Skip to content

Commit

Permalink
Added notifications to the new splash screen implementation. Currently
Browse files Browse the repository at this point in the history
messages are displayed at the bottom/center of the splash image.


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@4477 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
gsherman committed Jan 5, 2006
1 parent d5c8de5 commit 638ab43
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/main.cpp
Expand Up @@ -431,7 +431,7 @@ int main(int argc, char *argv[])



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

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

mypSplash->finish(qgis);
delete mypSplash;
return a.exec();

Expand Down
21 changes: 19 additions & 2 deletions src/qgisapp.cpp
Expand Up @@ -219,13 +219,18 @@ static void setTitleBarText_( QWidget & qgisApp )


// constructor starts here
QgisApp::QgisApp(QWidget * parent, Qt::WFlags fl)
QgisApp::QgisApp(QSplashScreen *splash, QWidget * parent, Qt::WFlags fl)
: QMainWindow(parent,fl),
mMapTool(QGis::NoTool)
mMapTool(QGis::NoTool),
mSplash(splash)
{

setupUi(this);
mSplash->showMessage("Reading settings", Qt::AlignHCenter | Qt::AlignBottom);
qApp->processEvents();
readSettings();
mSplash->showMessage("Setting up the GUI", Qt::AlignHCenter | Qt::AlignBottom);
qApp->processEvents();
createActions();
createMenus();
createToolBars();
Expand All @@ -236,6 +241,9 @@ static void setTitleBarText_( QWidget & qgisApp )
createCanvas();
createOverview();
createLegend();

mSplash->showMessage("Checking database", Qt::AlignHCenter | Qt::AlignBottom);
qApp->processEvents();
createDB();

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

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

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

Expand All @@ -304,7 +316,12 @@ static void setTitleBarText_( QWidget & qgisApp )
// Please make sure this is the last thing the ctor does so that we can ensure teh
// widgets are all initialised before trying to restore their state.
//
mSplash->showMessage("Restoring window state", Qt::AlignHCenter | Qt::AlignBottom);
qApp->processEvents();
restoreWindowState();

mSplash->showMessage("QGIS Ready!", Qt::AlignHCenter | Qt::AlignBottom);
qApp->processEvents();
} // QgisApp ctor


Expand Down
5 changes: 4 additions & 1 deletion src/qgisapp.h
Expand Up @@ -25,6 +25,7 @@
#include <QEvent>
#include <QPixmap>
#include <QLabel>
#include <QSplashScreen>
class QCanvas;
class QRect;
class QCanvasView;
Expand Down Expand Up @@ -73,7 +74,7 @@ class QgisApp : public QMainWindow, public Ui::QgisAppBase
Q_OBJECT;
public:
//! Constructor
QgisApp(QWidget * parent = 0, Qt::WFlags fl = Qt::WType_TopLevel);
QgisApp(QSplashScreen *splash, QWidget * parent = 0, Qt::WFlags fl = Qt::WType_TopLevel);
//! Destructor
~QgisApp();
/*
Expand Down Expand Up @@ -408,6 +409,7 @@ public slots:
void pasteTransformations();
//! check to see if file is dirty and if so, prompt the user th save it
int saveDirty();
//! Set the pointer to the splash screen so status messages can be


/// QgisApp aren't copyable
Expand Down Expand Up @@ -549,6 +551,7 @@ public slots:
QgisIface *mQgisInterface;
QTcpSocket *mSocket;
QString mVersionMessage;
QSplashScreen *mSplash;
friend class QgisIface;
QgsProviderRegistry *mProviderRegistry;
//! application directory
Expand Down

0 comments on commit 638ab43

Please sign in to comment.