mirror of
https://github.com/wownero/wowlet.git
synced 2026-12-04 05:54:01 +01:00
Calc: configure crypto/fiat symbols
This commit is contained in:
@@ -68,6 +68,9 @@ static const QHash<Config::ConfigKey, ConfigDirective> configStrings = {
|
||||
{Config::redditFrontend, {QS("redditFrontend"), "old.reddit.com"}},
|
||||
{Config::localMoneroFrontend, {QS("localMoneroFrontend"), "https://localmonero.co"}},
|
||||
|
||||
{Config::fiatSymbols, {QS("fiatSymbols"), QStringList{"USD", "EUR", "GBP", "CAD", "AUD", "RUB"}}},
|
||||
{Config::cryptoSymbols, {QS("cryptoSymbols"), QStringList{"BTC", "ETH", "LTC", "XMR", "ZEC"}}},
|
||||
|
||||
// Tor
|
||||
{Config::torPrivacyLevel, {QS("torPrivacyLevel"), 1}},
|
||||
{Config::socks5Host, {QS("socks5Host"), "127.0.0.1"}},
|
||||
|
||||
@@ -20,6 +20,7 @@ public:
|
||||
|
||||
enum ConfigKey
|
||||
{
|
||||
// General
|
||||
firstRun,
|
||||
warnOnStagenet,
|
||||
warnOnTestnet,
|
||||
@@ -33,14 +34,17 @@ public:
|
||||
windowState,
|
||||
GUI_HistoryViewState,
|
||||
|
||||
// Wallets
|
||||
walletDirectory, // Directory where wallet files are stored
|
||||
autoOpenWalletPath,
|
||||
recentlyOpenedWallets,
|
||||
|
||||
// Nodes
|
||||
nodes,
|
||||
nodeSource,
|
||||
useOnionNodes,
|
||||
|
||||
// Tabs
|
||||
showTabHome,
|
||||
showTabCoins,
|
||||
showTabExchange,
|
||||
@@ -48,9 +52,11 @@ public:
|
||||
showTabXMRig,
|
||||
showSearchbar,
|
||||
|
||||
// Mining
|
||||
xmrigPath,
|
||||
xmrigPool,
|
||||
|
||||
// Settings
|
||||
preferredFiatCurrency,
|
||||
skin,
|
||||
amountPrecision,
|
||||
@@ -66,6 +72,10 @@ public:
|
||||
redditFrontend,
|
||||
localMoneroFrontend,
|
||||
|
||||
fiatSymbols,
|
||||
cryptoSymbols,
|
||||
|
||||
// Tor
|
||||
torPrivacyLevel,
|
||||
socks5Host,
|
||||
socks5Port,
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
#include "utils/prices.h"
|
||||
|
||||
Prices::Prices(QObject *parent) : QObject(parent) {
|
||||
this->rates = QMap<QString, double>();
|
||||
this->markets = QMap<QString, marketStruct>();
|
||||
Prices::Prices(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
void Prices::cryptoPricesReceived(const QJsonArray &data) {
|
||||
@@ -30,9 +30,8 @@ void Prices::cryptoPricesReceived(const QJsonArray &data) {
|
||||
|
||||
void Prices::fiatPricesReceived(const QJsonObject &data) {
|
||||
QJsonObject ratesData = data.value("rates").toObject();
|
||||
for (const auto ¤cy : ratesData) {
|
||||
QString currencyStr = currency.toString();
|
||||
this->rates.insert(currencyStr, ratesData.value(currencyStr).toDouble());
|
||||
for (const auto ¤cy : ratesData.keys()) {
|
||||
this->rates.insert(currency, ratesData.value(currency).toDouble());
|
||||
}
|
||||
emit fiatPricesUpdated();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user