aboutsummaryrefslogtreecommitdiff
path: root/src/qt/bitcoin.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2012-02-16 21:09:41 -0500
committerPieter Wuille <pieter.wuille@gmail.com>2012-02-26 23:38:28 +0100
commit3f8cb2c565b24635d2967c9900cf5f2aa8b1d632 (patch)
treec29faa335bf501b123001ea80cf33e81c987ce11 /src/qt/bitcoin.cpp
parent972060ce0e9746c979ce0ddeeb997121414c1d58 (diff)
downloadbitcoin-3f8cb2c565b24635d2967c9900cf5f2aa8b1d632.tar.xz
Reworked QT settings
Diffstat (limited to 'src/qt/bitcoin.cpp')
-rw-r--r--src/qt/bitcoin.cpp27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp
index 03b89f06fc..5e79f6ec98 100644
--- a/src/qt/bitcoin.cpp
+++ b/src/qt/bitcoin.cpp
@@ -152,8 +152,28 @@ int main(int argc, char *argv[])
Q_INIT_RESOURCE(bitcoin);
QApplication app(argc, argv);
+ // Command-line options take precedence:
ParseParameters(argc, argv);
+ // ... then bitcoin.conf:
+ if (!ReadConfigFile(mapArgs, mapMultiArgs))
+ {
+ fprintf(stderr, "Error: Specified directory does not exist\n");
+ return 1;
+ }
+
+ // Application identification (must be set before OptionsModel is initialized,
+ // as it is used to locate QSettings)
+ app.setOrganizationName("Bitcoin");
+ app.setOrganizationDomain("bitcoin.org");
+ if(GetBoolArg("-testnet")) // Separate UI settings for testnet
+ app.setApplicationName("Bitcoin-Qt-testnet");
+ else
+ app.setApplicationName("Bitcoin-Qt");
+
+ // ... then GUI settings:
+ OptionsModel optionsModel;
+
// Get desired locale ("en_US") from command line or system locale
QString lang_territory = QString::fromStdString(GetArg("-lang", QLocale::system().name().toStdString()));
// Load language files for configured locale:
@@ -180,8 +200,6 @@ int main(int argc, char *argv[])
if (!translator.isEmpty())
app.installTranslator(&translator);
- app.setApplicationName(QApplication::translate("main", "Bitcoin-Qt"));
-
QSplashScreen splash(QPixmap(":/images/splash"), 0);
if (GetBoolArg("-splash", true) && !GetBoolArg("-min"))
{
@@ -201,10 +219,13 @@ 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.
+
+ optionsModel.Upgrade(); // Must be done after AppInit2
+
BitcoinGUI window;
if (splashref)
splash.finish(&window);
- OptionsModel optionsModel(pwalletMain);
+
ClientModel clientModel(&optionsModel);
WalletModel walletModel(pwalletMain, &optionsModel);