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.
This commit is contained in:
committed by
jtimon
parent
dec58922d0
commit
6de50c3c9a
33
src/qt/networkstyle.h
Normal file
33
src/qt/networkstyle.h
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user