mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-09-21 07:12:10 +00:00
Added splash for qt2 frontend, Edwin
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1776 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
017805b341
commit
50dd8f5894
@ -1,3 +1,10 @@
|
|||||||
|
2001-03-15 Edwin Leuven <leuven@fee.uva.nl>
|
||||||
|
|
||||||
|
* Added splash screen
|
||||||
|
* Makefile.am: updated
|
||||||
|
* FormSplash.[Ch]: added
|
||||||
|
* FormSplashImpl.[Ch]: added
|
||||||
|
|
||||||
2001-03-09 Edwin Leuven <leuven@fee.uva.nl>
|
2001-03-09 Edwin Leuven <leuven@fee.uva.nl>
|
||||||
|
|
||||||
* Makefile.am: updated
|
* Makefile.am: updated
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "FormPrint.h"
|
#include "FormPrint.h"
|
||||||
#include "FormRef.h"
|
#include "FormRef.h"
|
||||||
#include "FormSearch.h"
|
#include "FormSearch.h"
|
||||||
|
#include "FormSplash.h"
|
||||||
#include "FormTabular.h"
|
#include "FormTabular.h"
|
||||||
#include "FormTabularCreate.h"
|
#include "FormTabularCreate.h"
|
||||||
#include "FormToc.h"
|
#include "FormToc.h"
|
||||||
@ -43,6 +44,8 @@ Signal0<void> Dialogs::redrawGUI;
|
|||||||
|
|
||||||
Dialogs::Dialogs(LyXView * lv)
|
Dialogs::Dialogs(LyXView * lv)
|
||||||
{
|
{
|
||||||
|
splash_ = new FormSplash(lv, this);
|
||||||
|
|
||||||
dialogs_.push_back(new FormCharacter(lv, this));
|
dialogs_.push_back(new FormCharacter(lv, this));
|
||||||
dialogs_.push_back(new FormCitation(lv, this));
|
dialogs_.push_back(new FormCitation(lv, this));
|
||||||
dialogs_.push_back(new FormCopyright(lv, this));
|
dialogs_.push_back(new FormCopyright(lv, this));
|
||||||
@ -69,9 +72,17 @@ Dialogs::Dialogs(LyXView * lv)
|
|||||||
|
|
||||||
Dialogs::~Dialogs()
|
Dialogs::~Dialogs()
|
||||||
{
|
{
|
||||||
for (vector<DialogBase *>::iterator iter = dialogs_.begin();
|
for (vector<DialogBase *>::iterator iter = dialogs_.begin();
|
||||||
iter != dialogs_.end();
|
iter != dialogs_.end();
|
||||||
++iter) {
|
++iter) {
|
||||||
delete *iter;
|
delete *iter;
|
||||||
}
|
}
|
||||||
|
delete splash_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Dialogs::destroySplash()
|
||||||
|
{
|
||||||
|
delete splash_;
|
||||||
|
splash_ = 0;
|
||||||
}
|
}
|
||||||
|
48
src/frontends/qt2/FormSplash.C
Normal file
48
src/frontends/qt2/FormSplash.C
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
/**
|
||||||
|
* \file FormSplash.C
|
||||||
|
* Copyright 2001 the LyX Team
|
||||||
|
* Read the file COPYING
|
||||||
|
*
|
||||||
|
* \author Edwin Leuven
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
|
#include <qframe.h>
|
||||||
|
|
||||||
|
#include "FormSplashImpl.h"
|
||||||
|
#include "FormSplash.h"
|
||||||
|
#include "Dialogs.h"
|
||||||
|
#include "version.h"
|
||||||
|
#include "support/filetools.h"
|
||||||
|
#include "lyxrc.h"
|
||||||
|
|
||||||
|
FormSplash::FormSplash(LyXView *, Dialogs * d)
|
||||||
|
: dialog_(0), d_(d)
|
||||||
|
{
|
||||||
|
c_ = d->showSplash.connect(slot(this, &FormSplash::show));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
FormSplash::~FormSplash()
|
||||||
|
{
|
||||||
|
c_.disconnect();
|
||||||
|
delete dialog_;
|
||||||
|
}
|
||||||
|
|
||||||
|
void FormSplash::hide()
|
||||||
|
{
|
||||||
|
dialog_->hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
void FormSplash::show()
|
||||||
|
{
|
||||||
|
if (!lyxrc.show_banner)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!dialog_)
|
||||||
|
dialog_ = new FormSplashBase( 0, "LyX");
|
||||||
|
|
||||||
|
// show banner
|
||||||
|
dialog_->show();
|
||||||
|
}
|
42
src/frontends/qt2/FormSplash.h
Normal file
42
src/frontends/qt2/FormSplash.h
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
/**
|
||||||
|
* \file FormSplash.h
|
||||||
|
* Copyright 2001 the LyX Team
|
||||||
|
* Read the file COPYING
|
||||||
|
*
|
||||||
|
* \author Edwin Leuven
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef FORMSPLASH_H
|
||||||
|
#define FORMSPLASH_H
|
||||||
|
|
||||||
|
#include "DialogBase.h"
|
||||||
|
|
||||||
|
class Dialogs;
|
||||||
|
class LyXView;
|
||||||
|
class FormSplashBase;
|
||||||
|
|
||||||
|
/** The startup splash screen
|
||||||
|
*/
|
||||||
|
class FormSplash : public DialogBase {
|
||||||
|
|
||||||
|
public:
|
||||||
|
FormSplash(LyXView *, Dialogs *);
|
||||||
|
|
||||||
|
~FormSplash();
|
||||||
|
|
||||||
|
/// hide the dialog
|
||||||
|
void hide();
|
||||||
|
|
||||||
|
private:
|
||||||
|
/// show the dialog
|
||||||
|
void show();
|
||||||
|
|
||||||
|
/// Real GUI implementation.
|
||||||
|
FormSplashBase * dialog_;
|
||||||
|
/// our container
|
||||||
|
Dialogs * d_;
|
||||||
|
/// the show connection
|
||||||
|
Connection c_;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // FORMSPLASH_H
|
52
src/frontends/qt2/FormSplashImpl.C
Normal file
52
src/frontends/qt2/FormSplashImpl.C
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
/**
|
||||||
|
* \file FormSplashBase.C
|
||||||
|
* Copyright 2001 the LyX Team
|
||||||
|
* Read the file COPYING
|
||||||
|
*
|
||||||
|
* \author Edwin Leuven
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
|
#include <qapplication.h>
|
||||||
|
#include <qtimer.h>
|
||||||
|
#include <qframe.h>
|
||||||
|
#include <qpixmap.h>
|
||||||
|
|
||||||
|
#include "FormSplashImpl.h"
|
||||||
|
#include "version.h"
|
||||||
|
#include "support/filetools.h"
|
||||||
|
#include "lyxrc.h"
|
||||||
|
|
||||||
|
FormSplashBase::FormSplashBase( QWidget* parent, const char* name, WFlags fl, bool modal )
|
||||||
|
: QFrame( parent, name, fl, modal)
|
||||||
|
{
|
||||||
|
string banner_file = LibFileSearch("images", "banner", "xpm");
|
||||||
|
if (banner_file.empty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
QPixmap pm(tostr(banner_file).c_str());
|
||||||
|
int w = pm.width();
|
||||||
|
int h = pm.height();
|
||||||
|
|
||||||
|
setBackgroundPixmap(pm);
|
||||||
|
setLineWidth(0);
|
||||||
|
setGeometry(QApplication::desktop()->width ()/2-w/2,
|
||||||
|
QApplication::desktop()->height()/2-h/2,
|
||||||
|
w, h );
|
||||||
|
|
||||||
|
QTimer::singleShot( 5*1000, this, SLOT(hide()) );
|
||||||
|
}
|
||||||
|
|
||||||
|
FormSplashBase::~FormSplashBase()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void FormSplashBase::mousePressEvent( QMouseEvent * e)
|
||||||
|
{
|
||||||
|
hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
27
src/frontends/qt2/FormSplashImpl.h
Normal file
27
src/frontends/qt2/FormSplashImpl.h
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
/**
|
||||||
|
* \file FormSplashBase.C
|
||||||
|
* Copyright 2001 the LyX Team
|
||||||
|
* Read the file COPYING
|
||||||
|
*
|
||||||
|
* \author Edwin Leuven
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef FORMSPLASHBASE_H
|
||||||
|
#define FORMSPLASHBASE_H
|
||||||
|
|
||||||
|
class FormSplashBase : public QFrame
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
FormSplashBase(QWidget* parent, const char* name,
|
||||||
|
WFlags fl = QWidget::WStyle_NoBorder | QWidget::WStyle_Customize,
|
||||||
|
bool modal = false );
|
||||||
|
|
||||||
|
~FormSplashBase();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
virtual void mousePressEvent( QMouseEvent * );
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // FORMSPLASHBASE_H
|
@ -25,6 +25,7 @@ BUILTSOURCES = \
|
|||||||
moc_tabularcreatedlgimpl.C \
|
moc_tabularcreatedlgimpl.C \
|
||||||
moc_emptytable.C
|
moc_emptytable.C
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LYXDATADIRS = dlg
|
LYXDATADIRS = dlg
|
||||||
DISTCLEANFILES = $(BUILTSOURCES) *.orig *.rej *~ *.bak core
|
DISTCLEANFILES = $(BUILTSOURCES) *.orig *.rej *~ *.bak core
|
||||||
@ -108,6 +109,10 @@ libqt2_la_SOURCES = \
|
|||||||
searchdlg.h \
|
searchdlg.h \
|
||||||
searchdlgimpl.C \
|
searchdlgimpl.C \
|
||||||
searchdlgimpl.h \
|
searchdlgimpl.h \
|
||||||
|
FormSplash.C \
|
||||||
|
FormSplash.h \
|
||||||
|
FormSplashImpl.C \
|
||||||
|
FormSplashImpl.h \
|
||||||
FormTabularCreate.C \
|
FormTabularCreate.C \
|
||||||
FormTabularCreate.h \
|
FormTabularCreate.h \
|
||||||
tabularcreatedlg.C \
|
tabularcreatedlg.C \
|
||||||
|
Loading…
Reference in New Issue
Block a user