From ec4efde40c9b1b65c28669a2bc99e140a55a51e7 Mon Sep 17 00:00:00 2001 From: Chris Moore Date: Fri, 24 Feb 2012 18:54:18 -0800 Subject: [PATCH] Add option "-splash" so we can disable the splash screen. Don't show splash screen when -min is specified on the command line. --- src/init.cpp | 1 + src/qt/bitcoin.cpp | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index b2c59ec4ec..3a8fcdf524 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -187,6 +187,7 @@ bool AppInit2(int argc, char* argv[]) " -gen \t\t " + _("Generate coins") + "\n" + " -gen=0 \t\t " + _("Don't generate coins") + "\n" + " -min \t\t " + _("Start minimized") + "\n" + + " -splash \t\t " + _("Show splash screen on startup (default: 1)") + "\n" + " -datadir= \t\t " + _("Specify data directory") + "\n" + " -timeout= \t " + _("Specify connection timeout (in milliseconds)") + "\n" + " -proxy= \t " + _("Connect through socks4 proxy") + "\n" + diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 354e87c983..03b89f06fc 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -183,9 +183,12 @@ int main(int argc, char *argv[]) app.setApplicationName(QApplication::translate("main", "Bitcoin-Qt")); QSplashScreen splash(QPixmap(":/images/splash"), 0); - splash.show(); - splash.setAutoFillBackground(true); - splashref = &splash; + if (GetBoolArg("-splash", true) && !GetBoolArg("-min")) + { + splash.show(); + splash.setAutoFillBackground(true); + splashref = &splash; + } app.processEvents(); @@ -199,7 +202,8 @@ int main(int argc, char *argv[]) // Put this in a block, so that BitcoinGUI is cleaned up properly before // calling Shutdown() in case of exceptions. BitcoinGUI window; - splash.finish(&window); + if (splashref) + splash.finish(&window); OptionsModel optionsModel(pwalletMain); ClientModel clientModel(&optionsModel); WalletModel walletModel(pwalletMain, &optionsModel);