aboutsummaryrefslogtreecommitdiff
path: root/src/qt/networkstyle.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-10-09 11:04:49 +0200
committerjtimon <jtimon@blockstream.io>2014-10-10 11:00:59 +0200
commit6de50c3c9a89e72f3152a1df7775572d5c8ad0e7 (patch)
treecf708c7b5b7800b295aeb5bcdb3d742f79b6a31b /src/qt/networkstyle.h
parentdec58922d07241f0b502c96f8e5131abccbd5dc1 (diff)
qt: add network-specific style object
Mainly cleanups: Gets rid of isTestNet everywhere, by keeping track of network-specific theming in a central place. Also makes GUI no longer dependent on the network ID enumeration, which alleviates concerns about #4802.
Diffstat (limited to 'src/qt/networkstyle.h')
-rw-r--r--src/qt/networkstyle.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/qt/networkstyle.h b/src/qt/networkstyle.h
new file mode 100644
index 0000000000..99304d61a3
--- /dev/null
+++ b/src/qt/networkstyle.h
@@ -0,0 +1,33 @@
+// Copyright (c) 2014 The Bitcoin developers
+// Distributed under the MIT software license, see the accompanying
+// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+
+#ifndef H_NETWORKSTYLE
+#define H_NETWORKSTYLE
+
+#include <QIcon>
+#include <QPixmap>
+#include <QString>
+
+/* Coin network-specific GUI style information */
+class NetworkStyle
+{
+public:
+ /** Get style associated with provided BIP70 network id, or 0 if not known */
+ static const NetworkStyle *instantiate(const QString &networkId);
+
+ const QString &getAppName() const { return appName; }
+ const QIcon &getAppIcon() const { return appIcon; }
+ const QString &getTitleAddText() const { return titleAddText; }
+ const QPixmap &getSplashImage() const { return splashImage; }
+
+private:
+ NetworkStyle(const QString &appName, const QString &appIcon, const char *titleAddText, const QString &splashImage);
+
+ QString appName;
+ QIcon appIcon;
+ QString titleAddText;
+ QPixmap splashImage;
+};
+
+#endif // H_NETWORKSTYLE