Skip to content

Commit e47e59a

Browse files
author
gsherman
committedJan 5, 2006
Added notifications to the new splash screen implementation. Currently
messages are displayed at the bottom/center of the splash image. git-svn-id: http://svn.osgeo.org/qgis/trunk@4477 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 657bd32 commit e47e59a

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed
 

‎src/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ int main(int argc, char *argv[])
431431

432432

433433

434-
QgisApp *qgis = new QgisApp; // "QgisApp" used to find canonical instance
434+
QgisApp *qgis = new QgisApp(mypSplash); // "QgisApp" used to find canonical instance
435435
qgis->setName( "QgisApp" );
436436

437437
/////////////////////////////////////////////////////////////////////
@@ -559,6 +559,7 @@ int main(int argc, char *argv[])
559559
qgis->show();
560560
a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
561561

562+
mypSplash->finish(qgis);
562563
delete mypSplash;
563564
return a.exec();
564565

‎src/qgisapp.cpp

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,13 +219,18 @@ static void setTitleBarText_( QWidget & qgisApp )
219219

220220

221221
// constructor starts here
222-
QgisApp::QgisApp(QWidget * parent, Qt::WFlags fl)
222+
QgisApp::QgisApp(QSplashScreen *splash, QWidget * parent, Qt::WFlags fl)
223223
: QMainWindow(parent,fl),
224-
mMapTool(QGis::NoTool)
224+
mMapTool(QGis::NoTool),
225+
mSplash(splash)
225226
{
226227

227228
setupUi(this);
229+
mSplash->showMessage("Reading settings", Qt::AlignHCenter | Qt::AlignBottom);
230+
qApp->processEvents();
228231
readSettings();
232+
mSplash->showMessage("Setting up the GUI", Qt::AlignHCenter | Qt::AlignBottom);
233+
qApp->processEvents();
229234
createActions();
230235
createMenus();
231236
createToolBars();
@@ -236,6 +241,9 @@ static void setTitleBarText_( QWidget & qgisApp )
236241
createCanvas();
237242
createOverview();
238243
createLegend();
244+
245+
mSplash->showMessage("Checking database", Qt::AlignHCenter | Qt::AlignBottom);
246+
qApp->processEvents();
239247
createDB();
240248

241249
// register all GDAL and OGR plug-ins
@@ -274,6 +282,8 @@ static void setTitleBarText_( QWidget & qgisApp )
274282
std::cout << "Plugins and providers are installed in " << plib.toLocal8Bit().data() << std::endl;
275283
#endif
276284
// load any plugins that were running in the last session
285+
mSplash->showMessage("Restoring loaded plugins", Qt::AlignHCenter | Qt::AlignBottom);
286+
qApp->processEvents();
277287
restoreSessionPlugins(plib);
278288

279289
/* Delete this I think - Tim - FIXME
@@ -292,6 +302,8 @@ static void setTitleBarText_( QWidget & qgisApp )
292302
// Map composer
293303
mComposer = new QgsComposer(this);
294304

305+
mSplash->showMessage("Initializing file filters", Qt::AlignHCenter | Qt::AlignBottom);
306+
qApp->processEvents();
295307
// now build vector file filter
296308
buildSupportedVectorFileFilter_( mVectorFileFilter );
297309

@@ -304,7 +316,12 @@ static void setTitleBarText_( QWidget & qgisApp )
304316
// Please make sure this is the last thing the ctor does so that we can ensure teh
305317
// widgets are all initialised before trying to restore their state.
306318
//
319+
mSplash->showMessage("Restoring window state", Qt::AlignHCenter | Qt::AlignBottom);
320+
qApp->processEvents();
307321
restoreWindowState();
322+
323+
mSplash->showMessage("QGIS Ready!", Qt::AlignHCenter | Qt::AlignBottom);
324+
qApp->processEvents();
308325
} // QgisApp ctor
309326

310327

‎src/qgisapp.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <QEvent>
2626
#include <QPixmap>
2727
#include <QLabel>
28+
#include <QSplashScreen>
2829
class QCanvas;
2930
class QRect;
3031
class QCanvasView;
@@ -73,7 +74,7 @@ class QgisApp : public QMainWindow, public Ui::QgisAppBase
7374
Q_OBJECT;
7475
public:
7576
//! Constructor
76-
QgisApp(QWidget * parent = 0, Qt::WFlags fl = Qt::WType_TopLevel);
77+
QgisApp(QSplashScreen *splash, QWidget * parent = 0, Qt::WFlags fl = Qt::WType_TopLevel);
7778
//! Destructor
7879
~QgisApp();
7980
/*
@@ -408,6 +409,7 @@ public slots:
408409
void pasteTransformations();
409410
//! check to see if file is dirty and if so, prompt the user th save it
410411
int saveDirty();
412+
//! Set the pointer to the splash screen so status messages can be
411413

412414

413415
/// QgisApp aren't copyable
@@ -549,6 +551,7 @@ public slots:
549551
QgisIface *mQgisInterface;
550552
QTcpSocket *mSocket;
551553
QString mVersionMessage;
554+
QSplashScreen *mSplash;
552555
friend class QgisIface;
553556
QgsProviderRegistry *mProviderRegistry;
554557
//! application directory

0 commit comments

Comments
 (0)
Please sign in to comment.