# HG changeset patch # User Chris Cannam # Date 1430913657 -3600 # Node ID 4a8f87c175f70da84fb3d7747617611d73b9fee3 # Parent 45bb2eaf7fe1cb939bf44eba955bd14827d7bc0c Fixes to scaling of splash screen diff -r 45bb2eaf7fe1 -r 4a8f87c175f7 .hgsubstate --- a/.hgsubstate Wed May 06 10:44:19 2015 +0100 +++ b/.hgsubstate Wed May 06 13:00:57 2015 +0100 @@ -1,6 +1,6 @@ d16f0fd6db6104d87882bc43788a3bb1b0f8c528 dataquay -886bc1927f683ff757adaa51b9398d086abbea96 icons/scalable +5327d8078a7bd9b834008da352d1edf9b257fba0 icons/scalable 55ece8862b6d3a54aad271a53f9c1615e5d3bcf8 sv-dependency-builds -dc1a360f2b694d73d4bc858b708db44249e2cddc svapp +c651a736ebc497cf4104fe2db6a8f97efc412de1 svapp 32ab6c48efaa23d24a67315bccdc27f3ba1a18d5 svcore 85b39667e9cf544206c3f68bd14692678770656c svgui diff -r 45bb2eaf7fe1 -r 4a8f87c175f7 main/main.cpp --- a/main/main.cpp Wed May 06 10:44:19 2015 +0100 +++ b/main/main.cpp Wed May 06 13:00:57 2015 +0100 @@ -14,6 +14,7 @@ */ #include "MainWindow.h" +#include "SVSplash.h" #include "system/System.h" #include "system/Init.h" @@ -36,13 +37,10 @@ #include #include #include -#include #include #include #include -#include "../version.h" - #include #include @@ -215,7 +213,7 @@ if (!success) manager.cancel(); } - void handleFilepathArgument(QString path, QSplashScreen *splash); + void handleFilepathArgument(QString path, SVSplash *splash); bool m_readyForFiles; QStringList m_filepathQueue; @@ -223,7 +221,6 @@ protected: MainWindow *m_mainWindow; bool event(QEvent *); - }; int @@ -274,22 +271,13 @@ QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); - QSplashScreen *splash = 0; + SVSplash *splash = 0; QSettings settings; settings.beginGroup("Preferences"); if (settings.value("show-splash", true).toBool()) { - QPixmap pixmap(":/icons/scalable/sv-splash@2x.png"); - QPainter painter; - painter.begin(&pixmap); - QString text = QString("v%1").arg(SV_VERSION); - painter.drawText - (pixmap.width() - painter.fontMetrics().width(text) - 10, - 10 + painter.fontMetrics().ascent(), - text); - painter.end(); - splash = new QSplashScreen(pixmap); + splash = new SVSplash(); splash->show(); QTimer::singleShot(5000, splash, SLOT(hide())); application.processEvents(); @@ -353,6 +341,8 @@ TransformUserConfigurator::setParentWidget(gui); if (splash) { QObject::connect(gui, SIGNAL(hideSplash()), splash, SLOT(hide())); + QObject::connect(gui, SIGNAL(hideSplash(QWidget *)), + splash, SLOT(finishSplash(QWidget *))); } QDesktopWidget *desktop = QApplication::desktop(); @@ -420,15 +410,6 @@ settings.endGroup(); #endif - if (splash) splash->finish(gui); - delete splash; - -/* - TipDialog tipDialog; - if (tipDialog.isOK()) { - tipDialog.exec(); - } -*/ int rv = application.exec(); gui->hide(); @@ -492,7 +473,7 @@ } /** Application-global handler for filepaths passed in, e.g. as command-line arguments or apple events */ -void SVApplication::handleFilepathArgument(QString path, QSplashScreen *splash){ +void SVApplication::handleFilepathArgument(QString path, SVSplash *splash){ static bool haveSession = false; static bool haveMainModel = false; static bool havePriorCommandLineModel = false; diff -r 45bb2eaf7fe1 -r 4a8f87c175f7 sv.pro --- a/sv.pro Wed May 06 10:44:19 2015 +0100 +++ b/sv.pro Wed May 06 13:00:57 2015 +0100 @@ -86,12 +86,14 @@ HEADERS += main/MainWindow.h \ main/NetworkPermissionTester.h \ main/Surveyer.h \ + main/SVSplash.h \ main/PreferencesDialog.h SOURCES += main/main.cpp \ main/OSCHandler.cpp \ main/MainWindow.cpp \ main/NetworkPermissionTester.cpp \ main/Surveyer.cpp \ + main/SVSplash.cpp \ main/PreferencesDialog.cpp # for mac integration