Hush full node GUI wallet
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
1.6 KiB

6 years ago
#ifndef SETTINGS_H
#define SETTINGS_H
#include "precompiled.h"
6 years ago
struct Config {
6 years ago
QString host;
QString port;
QString rpcuser;
QString rpcpassword;
};
6 years ago
class Settings
{
public:
static Settings* init();
static Settings* getInstance();
6 years ago
QString getUsernamePassword();
6 years ago
QString getHost();
QString getPort();
6 years ago
6 years ago
bool loadFromSettings();
bool loadFromFile();
6 years ago
void saveSettings(const QString& host, const QString& port, const QString& username, const QString& password);
bool isTestnet();
void setTestnet(bool isTestnet);
6 years ago
bool isSaplingAddress(QString addr);
bool isSproutAddress(QString addr);
bool isZAddress(QString addr);
6 years ago
bool isSyncing();
void setSyncing(bool syncing);
6 years ago
int getBlockNumber();
void setBlockNumber(int number);
6 years ago
bool getSaveZtxs();
void setSaveZtxs(bool save);
6 years ago
bool isSaplingActive();
6 years ago
const QString& getZcashdConfLocation() { return confLocation; }
6 years ago
void setZECPrice(double p) { zecPrice = p; }
double getZECPrice();
6 years ago
QString getUSDFormat (double bal);
QString getZECDisplayFormat (double bal);
QString getZECUSDDisplayFormat(double bal);
6 years ago
private:
// This class can only be accessed through Settings::getInstance()
Settings() = default;
6 years ago
~Settings();
static Settings* instance;
6 years ago
6 years ago
Config* currentConfig;
6 years ago
Config* defaults = nullptr;
Config* zcashconf = nullptr;
Config* uisettings = nullptr;
6 years ago
QString confLocation;
bool _isTestnet = false;
6 years ago
bool _isSyncing = false;
int _blockNumber = 0;
6 years ago
double zecPrice = 0.0;
6 years ago
};
#endif // SETTINGS_H