// SPDX-License-Identifier: BSD-3-Clause // Copyright (C) 2020 KeePassXC Team // Copyright (C) 2011 Felix Geyer // Copyright (c) 2020-2021, The Monero Project. #ifndef WOWLET_SETTINGS_H #define WOWLET_SETTINGS_H #include #include #include class Config : public QObject { Q_OBJECT public: Q_DISABLE_COPY(Config) enum ConfigKey { warnOnExternalLink, checkForAppUpdates, warnOnStagenet, warnOnTestnet, warnOnAlpha, homeWidget, donateBeg, autoOpenWalletPath, skin, openVRSkin, preferredFiatCurrency, blockExplorer, walletDirectory, walletPath, xmrigPath, xmrigPool, nodes, websocketEnabled, nodeSource, useOnionNodes, showTabHome, showTabCoins, showTabCalc, showTabXMRig, geometry, windowState, firstRun, hideBalance, redditFrontend, showHistorySyncNotice }; ~Config() override; QVariant get(ConfigKey key); QString getFileName(); void set(ConfigKey key, const QVariant& value); void sync(); void resetToDefaults(); static Config* instance(); signals: void changed(ConfigKey key); private: Config(const QString& fileName, QObject* parent = nullptr); explicit Config(QObject* parent); void init(const QString& configFileName); static QPointer m_instance; QScopedPointer m_settings; QHash m_defaults; }; inline Config* config() { return Config::instance(); } #endif //WOWLET_SETTINGS_H