From d2758ae9c4fc6a25c7aaf4afce7f9dd371094266 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 1 Nov 2012 16:17:55 +0100 Subject: Fix Splash Actually display splash screen and show what we're doing. --- shemov.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'shemov.cpp') diff --git a/shemov.cpp b/shemov.cpp index 2703a56..817c808 100644 --- a/shemov.cpp +++ b/shemov.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include @@ -62,11 +63,17 @@ SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, fla //application icon qApp->setWindowIcon(QIcon(":/shemov.png")); setAttribute(Qt::WA_DeleteOnClose); + QSplashScreen splash(QPixmap(":/shemov_splash.png")); + splash.show(); //init database as early as possible + splash.showMessage(tr("Initializing globals..."), Qt::AlignHCenter, Qt::yellow); + qApp->processEvents(); (void) SmGlobals::instance(); //FileSystemWidget + TabWidget + splash.showMessage(tr("Constructing Filemanager..."), Qt::AlignHCenter, Qt::yellow); + qApp->processEvents(); mFSWidget = new FilesystemWidget; setWindowTitle(mFSWidget->windowTitle()); mTab = new QTabWidget; @@ -74,6 +81,8 @@ SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, fla connect(this, SIGNAL(configChanged()), mFSWidget, SLOT(configChanged())); //ArchiveTreeView + splash.showMessage(tr("Creating Archive..."), Qt::AlignHCenter, Qt::yellow); + qApp->processEvents(); mATree = new ArchiveTreeView; mTab->addTab(mATree, "Archive"); connect(mATree->filesWidget(), SIGNAL(statusMessage(QString)), this, SLOT(statusbarMessage(QString))); @@ -84,6 +93,8 @@ SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, fla connect(this, SIGNAL(configChanged()), mATree, SLOT(readSettings())); //pictures + splash.showMessage(tr("Creating Picture Archive..."), Qt::AlignHCenter, Qt::yellow); + qApp->processEvents(); mPicWidget = new PicturesWidget; mTab->addTab(mPicWidget, tr("Pictures")); connect(mPicWidget, SIGNAL(needWindowTitleChange(QString)), this, SLOT(setWindowTitle(QString))); @@ -93,6 +104,8 @@ SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, fla PictureViewer2 *picViewer = SmGlobals::instance()->pictureViewer(); //newmoviewizard + dbanalyzer + splash.showMessage(tr("Creating misc. Dialogs..."), Qt::AlignHCenter, Qt::yellow); + qApp->processEvents(); mNewMovieWizard = new NewMovieWizard(this); connect(mNewMovieWizard, SIGNAL(seriesAdded(QString,int)), mATree->seriesWidget(), SLOT(seriesAdded(QString,int))); mDbAnalyzerDialog = new DbAnalyzerDialog(this); @@ -102,12 +115,16 @@ SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, fla QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addWidget(mTab); + splash.showMessage(tr("Creating Menus and Statusbar..."), Qt::AlignHCenter, Qt::yellow); + qApp->processEvents(); createStatusbar(); createActions(); createMenus(); createToolBar(); setFsFree(); + splash.showMessage(tr("Finishing..."), Qt::AlignHCenter, Qt::yellow); + qApp->processEvents(); connect(mFSWidget->fileView(), SIGNAL(selectedSize(qint64)), this, SLOT(setSize(qint64))); connect(mFSWidget->fileView(), SIGNAL(numSelected(int)), this, SLOT(updateSelectedCount(int))); connect(mFSWidget, SIGNAL(windowTitle(QString)), this, SLOT(setWindowTitle(QString))); @@ -126,6 +143,7 @@ SheMov::SheMov(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, fla centralWidget->setLayout(mainLayout); setCentralWidget(centralWidget); show(); + splash.finish(this); mATree->seriesWidget()->readSettings(); mATree->filesWidget()->filesTree()->readSettings(); mFSWidget->readSettings(); -- cgit v1.2.3-70-g09d2