aboutsummaryrefslogtreecommitdiff
path: root/src/qt/bitcoin.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2012-02-27 11:30:05 -0500
committerGavin Andresen <gavinandresen@gmail.com>2012-02-27 11:30:05 -0500
commit90d78142c077a553a988f4f39c75b071a026b87d (patch)
treeb8c8fa45b720a7c3b553fdc23626ebf849896e5f /src/qt/bitcoin.cpp
parentfbbd42a535813b2d7e30dba44c5c36b70833fe55 (diff)
parent42c8b56f62af171ee1e14963df301358970b1525 (diff)
Merge branch 'nooptionsinwallet+fixproxysetting' of https://github.com/sipa/bitcoin
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);