2015-04-29 17:03:08 +00:00
|
|
|
// Copyright (c) 2011-2015 The Cryptonote developers
|
|
|
|
// Distributed under the MIT/X11 software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QDir>
|
|
|
|
#include <QJsonObject>
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
namespace WalletGui {
|
|
|
|
|
|
|
|
class CommandLineParser;
|
|
|
|
|
|
|
|
class Settings : public QObject {
|
|
|
|
Q_OBJECT
|
|
|
|
Q_DISABLE_COPY(Settings)
|
|
|
|
|
|
|
|
public:
|
|
|
|
static Settings& instance();
|
|
|
|
|
|
|
|
void setCommandLineParser(CommandLineParser* _cmd_line_parser);
|
|
|
|
void load();
|
|
|
|
|
2015-09-18 12:37:30 +00:00
|
|
|
bool hasAllowLocalIpOption() const;
|
|
|
|
bool hasHideMyPortOption() const;
|
|
|
|
bool isTestnet() const;
|
2015-04-29 17:03:08 +00:00
|
|
|
QDir getDataDir() const;
|
2015-09-18 12:37:30 +00:00
|
|
|
QString getP2pBindIp() const;
|
|
|
|
quint16 getLocalRpcPort() const;
|
|
|
|
quint16 getP2pBindPort() const;
|
|
|
|
quint16 getP2pExternalPort() const;
|
|
|
|
QStringList getExclusiveNodes() const;
|
|
|
|
QStringList getPeers() const;
|
|
|
|
QStringList getPriorityNodes() const;
|
|
|
|
QStringList getSeedNodes() const;
|
|
|
|
|
2015-04-29 17:03:08 +00:00
|
|
|
QString getWalletFile() const;
|
|
|
|
QString getAddressBookFile() const;
|
|
|
|
bool isEncrypted() const;
|
|
|
|
QString getVersion() const;
|
|
|
|
bool isStartOnLoginEnabled() const;
|
|
|
|
#ifdef Q_OS_WIN
|
|
|
|
bool isMinimizeToTrayEnabled() const;
|
|
|
|
bool isCloseToTrayEnabled() const;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void setWalletFile(const QString& _file);
|
|
|
|
void setEncrypted(bool _encrypted);
|
|
|
|
void setCurrentTheme(const QString& _theme);
|
|
|
|
void setStartOnLoginEnabled(bool _enable);
|
|
|
|
#ifdef Q_OS_WIN
|
|
|
|
void setMinimizeToTrayEnabled(bool _enable);
|
|
|
|
void setCloseToTrayEnabled(bool _enable);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
private:
|
|
|
|
QJsonObject m_settings;
|
|
|
|
QString m_addressBookFile;
|
|
|
|
CommandLineParser* m_cmdLineParser;
|
|
|
|
|
|
|
|
Settings();
|
|
|
|
~Settings();
|
|
|
|
|
|
|
|
void saveSettings() const;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|