aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authorJonas Schnelli <dev@jonasschnelli.ch>2015-11-30 09:13:57 +0100
committerJonas Schnelli <dev@jonasschnelli.ch>2015-11-30 09:14:42 +0100
commitfa93174a7c06f6bf74e597764398090f3d14c30c (patch)
tree7aea0ff694475b6f284d106cce755520e7acaad4 /src/qt
parentc28d3937b095f109bda1aaab7ce3db17c033b9a7 (diff)
parenta6cbc02b6b279dc0ed11e007ba84a6b09bdcd740 (diff)
Merge pull request #7127
a6cbc02 Bugfix: Default -uiplatform is not actually the platform this build was compiled on (Luke Dashjr)
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/bitcoin.cpp10
-rw-r--r--src/qt/bitcoingui.cpp10
-rw-r--r--src/qt/bitcoingui.h1
-rw-r--r--src/qt/utilitydialog.cpp2
4 files changed, 14 insertions, 9 deletions
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp
index 1fa5ef5f5d..6e6330d2a4 100644
--- a/src/qt/bitcoin.cpp
+++ b/src/qt/bitcoin.cpp
@@ -311,14 +311,8 @@ BitcoinApplication::BitcoinApplication(int &argc, char **argv):
// UI per-platform customization
// This must be done inside the BitcoinApplication constructor, or after it, because
// PlatformStyle::instantiate requires a QApplication
-#if defined(Q_OS_MAC)
- std::string platformName = "macosx";
-#elif defined(Q_OS_WIN)
- std::string platformName = "windows";
-#else
- std::string platformName = "other";
-#endif
- platformName = GetArg("-uiplatform", platformName);
+ std::string platformName;
+ platformName = GetArg("-uiplatform", BitcoinGUI::DEFAULT_UIPLATFORM);
platformStyle = PlatformStyle::instantiate(QString::fromStdString(platformName));
if (!platformStyle) // Fall back to "other" if specified name not found
platformStyle = PlatformStyle::instantiate("other");
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index 6f9f6e90d6..853a29e661 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -59,6 +59,16 @@
#include <QUrlQuery>
#endif
+const std::string BitcoinGUI::DEFAULT_UIPLATFORM =
+#if defined(Q_OS_MAC)
+ "macosx"
+#elif defined(Q_OS_WIN)
+ "windows"
+#else
+ "other"
+#endif
+ ;
+
const QString BitcoinGUI::DEFAULT_WALLET = "~Default";
BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *networkStyle, QWidget *parent) :
diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h
index 2b98dabc56..945adcd459 100644
--- a/src/qt/bitcoingui.h
+++ b/src/qt/bitcoingui.h
@@ -48,6 +48,7 @@ class BitcoinGUI : public QMainWindow
public:
static const QString DEFAULT_WALLET;
+ static const std::string DEFAULT_UIPLATFORM;
explicit BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *networkStyle, QWidget *parent = 0);
~BitcoinGUI();
diff --git a/src/qt/utilitydialog.cpp b/src/qt/utilitydialog.cpp
index da85ab2b30..f609289749 100644
--- a/src/qt/utilitydialog.cpp
+++ b/src/qt/utilitydialog.cpp
@@ -86,7 +86,7 @@ HelpMessageDialog::HelpMessageDialog(QWidget *parent, bool about) :
strUsage += HelpMessageOpt("-splash", strprintf(_("Show splash screen on startup (default: %u)"), DEFAULT_SPLASHSCREEN));
strUsage += HelpMessageOpt("-resetguisettings", _("Reset all settings changes made over the GUI"));
if (showDebug) {
- strUsage += HelpMessageOpt("-uiplatform", "Select platform to customize UI for (one of windows, macosx, other; default: platform compiled on)");
+ strUsage += HelpMessageOpt("-uiplatform", strprintf("Select platform to customize UI for (one of windows, macosx, other; default: %s)", BitcoinGUI::DEFAULT_UIPLATFORM));
}
QString coreOptions = QString::fromStdString(strUsage);
text = version + "\n" + header + "\n" + coreOptions;