Add full support of USD,EUR,BTC
This commit is contained in:
@@ -37,9 +37,21 @@ QString CAmount::toDecimalUSDString() const {
|
||||
double dblAmount = static_cast<double>(this->amount) / COIN;
|
||||
double price = Settings::getInstance()->getZECPrice();
|
||||
|
||||
return "$" + QLocale(QLocale::English).toString(dblAmount*price, 'f', 2);
|
||||
return "$ " + QLocale(QLocale::English).toString(dblAmount*price, 'f', 2);
|
||||
}
|
||||
|
||||
QString CAmount::toDecimalEURString() const {
|
||||
double dblAmount = static_cast<double>(this->amount) / COIN;
|
||||
double price = Settings::getInstance()->getEURPrice();
|
||||
|
||||
return QLocale(QLocale::German).toString(dblAmount*price, 'f', 2) + " €";
|
||||
}
|
||||
QString CAmount::toDecimalBTCString() const {
|
||||
double dblAmount = static_cast<double>(this->amount) / COIN;
|
||||
double price = Settings::getInstance()->getBTCPrice();
|
||||
|
||||
return "BTC " + QLocale(QLocale::English).toString(dblAmount*price, 'f', 9);
|
||||
}
|
||||
QString CAmount::toDecimalhushString() const {
|
||||
return this->toDecimalString() % " " % Settings::getTokenName();
|
||||
}
|
||||
@@ -52,6 +64,23 @@ QString CAmount::toDecimalhushUSDString() const {
|
||||
return this->toDecimalhushString();
|
||||
}
|
||||
|
||||
|
||||
QString CAmount::toDecimalhushEURString() const {
|
||||
auto eurString = this->toDecimalEURString();
|
||||
if (!eurString.isEmpty())
|
||||
return this->toDecimalhushString() % " (" % eurString % ")";
|
||||
else
|
||||
return this->toDecimalhushString();
|
||||
}
|
||||
|
||||
QString CAmount::toDecimalhushBTCString() const {
|
||||
auto btcString = this->toDecimalBTCString();
|
||||
if (!btcString.isEmpty())
|
||||
return this->toDecimalhushString() % " (" % btcString % ")";
|
||||
else
|
||||
return this->toDecimalhushString();
|
||||
}
|
||||
|
||||
CAmount CAmount::fromDecimalString(QString decimalString) {
|
||||
auto amtParts = decimalString.split(".");
|
||||
qint64 r = amtParts[0].toULongLong() * COIN;
|
||||
|
||||
@@ -27,8 +27,12 @@ public:
|
||||
double toDecimalDouble() const;
|
||||
QString toDecimalString() const;
|
||||
QString toDecimalUSDString() const;
|
||||
QString toDecimalEURString() const;
|
||||
QString toDecimalBTCString() const;
|
||||
QString toDecimalhushString() const;
|
||||
QString toDecimalhushUSDString() const;
|
||||
QString toDecimalhushEURString() const;
|
||||
QString toDecimalhushBTCString() const;
|
||||
qint64 toqint64() const { return amount; };
|
||||
|
||||
CAmount operator+ (const CAmount& other) const {
|
||||
|
||||
@@ -28,10 +28,11 @@ Controller::Controller(MainWindow* main) {
|
||||
// Set up timer to refresh Price
|
||||
priceTimer = new QTimer(main);
|
||||
QObject::connect(priceTimer, &QTimer::timeout, [=]() {
|
||||
if (Settings::getInstance()->getAllowFetchPrices())
|
||||
refreshZECPrice();
|
||||
if (Settings::getInstance()->getAllowFetchPrices())
|
||||
refreshZECPrice();
|
||||
|
||||
});
|
||||
priceTimer->start(Settings::priceRefreshSpeed); // Every hour
|
||||
priceTimer->start(Settings::priceRefreshSpeed); // Every 5 Min
|
||||
|
||||
// Set up a timer to refresh the UI every few seconds
|
||||
timer = new QTimer(main);
|
||||
@@ -167,18 +168,18 @@ void Controller::getInfoThenRefresh(bool force) {
|
||||
// use currency ComboBox as input
|
||||
|
||||
if (Settings::getInstance()->get_currency_name() == "USD") {
|
||||
main->statusLabel->setText(" HUSH/USD=$" + QString::number( (double) Settings::getInstance()->getZECPrice() ));
|
||||
main->statusLabel->setText(" HUSH/USD=$ " + QString::number( (double) Settings::getInstance()->getZECPrice() ));
|
||||
} else if (Settings::getInstance()->get_currency_name() == "EUR") {
|
||||
main->statusLabel->setText(" HUSH/EUR=€" + QString::number( (double) Settings::getInstance()->getEURPrice() ));
|
||||
main->statusLabel->setText(" HUSH/EUR=€ " + QString::number( (double) Settings::getInstance()->getEURPrice() ));
|
||||
} else if (Settings::getInstance()->get_currency_name() == "BTC") {
|
||||
main->statusLabel->setText(" HUSH/BTC=BTC" + QString::number( (double) Settings::getInstance()->getBTCPrice() ));
|
||||
main->statusLabel->setText(" HUSH/BTC=BTC " + QString::number((double) Settings::getInstance()->getBTCPrice() ));
|
||||
} else {
|
||||
main->statusLabel->setText(" Fehler=KACKE" + QString::number( (double) Settings::getInstance()->getEURPrice() ));
|
||||
main->statusLabel->setText(" error Input" + QString::number( (double) Settings::getInstance()->getEURPrice() ));
|
||||
}
|
||||
main->statusLabel->setToolTip(tooltip);
|
||||
main->statusIcon->setPixmap(i.pixmap(16, 16));
|
||||
main->statusIcon->setToolTip(tooltip);
|
||||
|
||||
|
||||
//int version = reply["version"].get<json::string_t>();
|
||||
int version = 1;
|
||||
Settings::getInstance()->sethushdVersion(version);
|
||||
@@ -302,14 +303,35 @@ void Controller::updateUIBalances() {
|
||||
ui->balTransparent->setText(balT.toDecimalhushString());
|
||||
ui->balTotal ->setText(balTotal.toDecimalhushString());
|
||||
|
||||
if (Settings::getInstance()->get_currency_name() == "USD") {
|
||||
ui->balSheilded ->setToolTip(balZ.toDecimalUSDString());
|
||||
ui->balVerified ->setToolTip(balVerified.toDecimalUSDString());
|
||||
ui->balTransparent->setToolTip(balT.toDecimalUSDString());
|
||||
ui->balTotal ->setToolTip(balTotal.toDecimalUSDString());
|
||||
|
||||
} else if (Settings::getInstance()->get_currency_name() == "EUR") {
|
||||
ui->balSheilded ->setToolTip(balZ.toDecimalEURString());
|
||||
ui->balVerified ->setToolTip(balVerified.toDecimalEURString());
|
||||
ui->balTransparent->setToolTip(balT.toDecimalEURString());
|
||||
ui->balTotal ->setToolTip(balTotal.toDecimalEURString());
|
||||
|
||||
} else if (Settings::getInstance()->get_currency_name() == "BTC") {
|
||||
ui->balSheilded ->setToolTip(balZ.toDecimalBTCString());
|
||||
ui->balVerified ->setToolTip(balVerified.toDecimalBTCString());
|
||||
ui->balTransparent->setToolTip(balT.toDecimalBTCString());
|
||||
ui->balTotal ->setToolTip(balTotal.toDecimalBTCString());
|
||||
}
|
||||
// Send tab
|
||||
ui->txtAvailablehush->setText(balAvailable.toDecimalhushString());
|
||||
ui->txtAvailableUSD->setText(balAvailable.toDecimalUSDString());
|
||||
|
||||
if (Settings::getInstance()->get_currency_name() == "USD") {
|
||||
ui->txtAvailableUSD->setText(balAvailable.toDecimalUSDString());
|
||||
} else if (Settings::getInstance()->get_currency_name() == "EUR") {
|
||||
ui->txtAvailableUSD->setText(balAvailable.toDecimalEURString());
|
||||
} else if (Settings::getInstance()->get_currency_name() == "BTC") {
|
||||
ui->txtAvailableUSD->setText(balAvailable.toDecimalBTCString());
|
||||
} else
|
||||
ui->txtAvailableUSD->setText(balAvailable.toDecimalBTCString());
|
||||
}
|
||||
|
||||
void Controller::refreshBalances() {
|
||||
@@ -647,6 +669,8 @@ void Controller::refreshZECPrice() {
|
||||
qDebug() << reply->errorString();
|
||||
}
|
||||
Settings::getInstance()->setZECPrice(0);
|
||||
Settings::getInstance()->setEURPrice(0);
|
||||
Settings::getInstance()->setBTCPrice(0);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -656,6 +680,8 @@ void Controller::refreshZECPrice() {
|
||||
auto parsed = json::parse(all, nullptr, false);
|
||||
if (parsed.is_discarded()) {
|
||||
Settings::getInstance()->setZECPrice(0);
|
||||
Settings::getInstance()->setEURPrice(0);
|
||||
Settings::getInstance()->setBTCPrice(0);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,8 @@ public:
|
||||
|
||||
void checkForUpdate(bool silent = true);
|
||||
void refreshZECPrice();
|
||||
void refreshEURPrice();
|
||||
void refreshBTCPrice();
|
||||
|
||||
void executeStandardUITransaction(Tx tx);
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>Allow connections to the internet to check for updates, get hush/USD prices etc...</string>
|
||||
<string>Allow connections to the internet to check for updates, get hush prices etc...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -429,6 +429,7 @@ void MainWindow::setupSettingsModal() {
|
||||
|
||||
QObject::connect(settings.comboBoxCurrency, &QComboBox::currentTextChanged, [=] (QString currency_name) {
|
||||
this->slot_change_currency(currency_name);
|
||||
|
||||
// Tell the user that it will take some seconds
|
||||
QMessageBox::information(this, tr("Currency Change"), tr("This change will take some seconds"), QMessageBox::Ok);
|
||||
|
||||
@@ -1124,7 +1125,14 @@ void MainWindow::setupReceiveTab() {
|
||||
}
|
||||
|
||||
ui->rcvLabel->setText(label);
|
||||
if (Settings::getInstance()->get_currency_name() == "USD") {
|
||||
ui->rcvBal->setText(rpc->getModel()->getAllBalances().value(addr).toDecimalhushUSDString());
|
||||
} else if (Settings::getInstance()->get_currency_name() == "EUR") {
|
||||
ui->rcvBal->setText(rpc->getModel()->getAllBalances().value(addr).toDecimalhushEURString());
|
||||
} else if (Settings::getInstance()->get_currency_name() == "BTC") {
|
||||
ui->rcvBal->setText(rpc->getModel()->getAllBalances().value(addr).toDecimalhushBTCString());
|
||||
}
|
||||
|
||||
ui->txtReceive->setPlainText(addr);
|
||||
ui->qrcodeDisplay->setQrcodeString(addr);
|
||||
if (rpc->getModel()->getUsedAddresses().value(addr, false)) {
|
||||
|
||||
@@ -83,7 +83,13 @@ QJsonObject RecurringPaymentInfo::toJson() {
|
||||
|
||||
QString RecurringPaymentInfo::getAmountPretty() const {
|
||||
CAmount amount = CAmount::fromDouble(amt);
|
||||
if (Settings::getInstance()->get_currency_name() == "USD") {
|
||||
return currency == "USD" ? amount.toDecimalUSDString() : amount.toDecimalhushString();
|
||||
} else if (Settings::getInstance()->get_currency_name() == "EUR") {
|
||||
return currency == "EUR" ? amount.toDecimalEURString() : amount.toDecimalhushString();
|
||||
} else if (Settings::getInstance()->get_currency_name() == "BTC") {
|
||||
return currency == "BTC" ? amount.toDecimalBTCString() : amount.toDecimalhushString();
|
||||
}
|
||||
}
|
||||
|
||||
QString RecurringPaymentInfo::getScheduleDescription() const {
|
||||
@@ -136,8 +142,14 @@ RecurringPaymentInfo* Recurring::getNewRecurringFromTx(QWidget* parent, MainWind
|
||||
if (tx.toAddrs.length() > 0) {
|
||||
ui.lblTo->setText(tx.toAddrs[0].addr);
|
||||
|
||||
// Default is USD
|
||||
// Change it with currency in Settings
|
||||
if (Settings::getInstance()->get_currency_name() == "USD") {
|
||||
ui.lblAmt->setText(tx.toAddrs[0].amount.toDecimalUSDString());
|
||||
} else if (Settings::getInstance()->get_currency_name() == "EUR") {
|
||||
ui.lblAmt->setText(tx.toAddrs[0].amount.toDecimalEURString());
|
||||
} else if (Settings::getInstance()->get_currency_name() == "BTC") {
|
||||
ui.lblAmt->setText(tx.toAddrs[0].amount.toDecimalBTCString());
|
||||
}
|
||||
|
||||
ui.txtMemo->setPlainText(tx.toAddrs[0].memo);
|
||||
ui.txtMemo->setEnabled(false);
|
||||
@@ -147,10 +159,16 @@ RecurringPaymentInfo* Recurring::getNewRecurringFromTx(QWidget* parent, MainWind
|
||||
QObject::connect(ui.cmbCurrency, &QComboBox::currentTextChanged, [&](QString c) {
|
||||
if (tx.toAddrs.length() < 1)
|
||||
return;
|
||||
|
||||
if (c == "USD") {
|
||||
ui.lblAmt->setText(tx.toAddrs[0].amount.toDecimalUSDString());
|
||||
|
||||
} else if (c == "EUR") {
|
||||
ui.lblAmt->setText(tx.toAddrs[0].amount.toDecimalEURString());
|
||||
} else if
|
||||
(c == "BTC") {
|
||||
ui.lblAmt->setText(tx.toAddrs[0].amount.toDecimalBTCString());
|
||||
}
|
||||
|
||||
else {
|
||||
ui.lblAmt->setText(tx.toAddrs[0].amount.toDecimalString());
|
||||
}
|
||||
@@ -472,6 +490,8 @@ void Recurring::executeRecurringPayment(MainWindow* main, RecurringPaymentInfo r
|
||||
PaymentStatus::ERROR);
|
||||
}
|
||||
return;
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Translate it into hush
|
||||
|
||||
@@ -74,7 +74,13 @@ void RequestDialog::showPaymentConfirmation(MainWindow* main, QString paymentURI
|
||||
req.txtMemo->setPlainText(payInfo.memo);
|
||||
req.txtAmount->setText(payInfo.amt);
|
||||
CAmount amount = CAmount::fromDecimalString(req.txtAmount->text());
|
||||
if (Settings::getInstance()->get_currency_name() == "USD") {
|
||||
req.txtAmountUSD->setText(amount.toDecimalUSDString());
|
||||
} else if (Settings::getInstance()->get_currency_name() == "EUR") {
|
||||
req.txtAmountUSD->setText(amount.toDecimalEURString());
|
||||
} else if (Settings::getInstance()->get_currency_name() == "BTC") {
|
||||
req.txtAmountUSD->setText(amount.toDecimalBTCString());
|
||||
}
|
||||
|
||||
req.buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Pay"));
|
||||
|
||||
@@ -114,10 +120,22 @@ void RequestDialog::showRequesthush(MainWindow* main) {
|
||||
req.txtAmount->setValidator(main->getAmountValidator());
|
||||
QObject::connect(req.txtAmount, &QLineEdit::textChanged, [=] (auto text) {
|
||||
CAmount amount = CAmount::fromDecimalString(text);
|
||||
req.txtAmountUSD->setText(amount.toDecimalUSDString());
|
||||
if (Settings::getInstance()->get_currency_name() == "USD") {
|
||||
req.txtAmountUSD->setText(amount.toDecimalUSDString());
|
||||
} else if (Settings::getInstance()->get_currency_name() == "EUR") {
|
||||
req.txtAmountUSD->setText(amount.toDecimalEURString());
|
||||
} else if (Settings::getInstance()->get_currency_name() == "BTC") {
|
||||
req.txtAmountUSD->setText(amount.toDecimalBTCString());
|
||||
}
|
||||
});
|
||||
CAmount amount = CAmount::fromDecimalString(req.txtAmount->text());
|
||||
if (Settings::getInstance()->get_currency_name() == "USD") {
|
||||
req.txtAmountUSD->setText(amount.toDecimalUSDString());
|
||||
} else if (Settings::getInstance()->get_currency_name() == "EUR") {
|
||||
req.txtAmountUSD->setText(amount.toDecimalEURString());
|
||||
} else if (Settings::getInstance()->get_currency_name() == "BTC") {
|
||||
req.txtAmountUSD->setText(amount.toDecimalBTCString());
|
||||
}
|
||||
|
||||
req.txtMemo->setAcceptButton(req.buttonBox->button(QDialogButtonBox::Ok));
|
||||
req.txtMemo->setLenDisplayLabel(req.lblMemoLen);
|
||||
|
||||
@@ -58,7 +58,14 @@ void MainWindow::setupSendTab() {
|
||||
ui->minerFeeAmt->setReadOnly(true);
|
||||
QObject::connect(ui->minerFeeAmt, &QLineEdit::textChanged, [=](auto txt) {
|
||||
CAmount fee = CAmount::fromDecimalString(txt);
|
||||
|
||||
if (Settings::getInstance()->get_currency_name() == "USD") {
|
||||
ui->lblMinerFeeUSD->setText(fee.toDecimalUSDString());
|
||||
} else if (Settings::getInstance()->get_currency_name() == "EUR") {
|
||||
ui->lblMinerFeeUSD->setText(fee.toDecimalEURString());
|
||||
} else if (Settings::getInstance()->get_currency_name() == "BTC") {
|
||||
ui->lblMinerFeeUSD->setText(fee.toDecimalBTCString());
|
||||
}
|
||||
});
|
||||
ui->minerFeeAmt->setText(Settings::getMinerFee().toDecimalString());
|
||||
|
||||
@@ -66,9 +73,18 @@ void MainWindow::setupSendTab() {
|
||||
QObject::connect(ui->tabWidget, &QTabWidget::currentChanged, [=] (int pos) {
|
||||
if (pos == 1) {
|
||||
QString txt = ui->minerFeeAmt->text();
|
||||
if (Settings::getInstance()->get_currency_name() == "USD") {
|
||||
QString feeUSD = CAmount::fromDecimalString(txt).toDecimalUSDString();
|
||||
ui->lblMinerFeeUSD->setText(feeUSD);
|
||||
}
|
||||
ui->lblMinerFeeUSD->setText(feeUSD);
|
||||
} else if (Settings::getInstance()->get_currency_name() == "EUR") {
|
||||
QString feeUSD = CAmount::fromDecimalString(txt).toDecimalEURString();
|
||||
ui->lblMinerFeeUSD->setText(feeUSD);
|
||||
} else if (Settings::getInstance()->get_currency_name() == "BTC") {
|
||||
QString feeUSD = CAmount::fromDecimalString(txt).toDecimalEURString();
|
||||
ui->lblMinerFeeUSD->setText(feeUSD);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//Fees validator
|
||||
@@ -275,7 +291,14 @@ void MainWindow::addressChanged(int itemNumber, const QString& text) {
|
||||
void MainWindow::amountChanged(int item, const QString& text) {
|
||||
auto usd = ui->sendToWidgets->findChild<QLabel*>(QString("AmtUSD") % QString::number(item));
|
||||
CAmount amt = CAmount::fromDecimalString(text);
|
||||
|
||||
if (Settings::getInstance()->get_currency_name() == "USD") {
|
||||
usd->setText(amt.toDecimalUSDString());
|
||||
} else if (Settings::getInstance()->get_currency_name() == "EUR") {
|
||||
usd->setText(amt.toDecimalEURString());
|
||||
} else if (Settings::getInstance()->get_currency_name() == "BTC") {
|
||||
usd->setText(amt.toDecimalBTCString());
|
||||
}
|
||||
|
||||
// If there is a recurring payment, update the info there as well
|
||||
if (sendTxRecurringInfo != nullptr) {
|
||||
@@ -535,12 +558,29 @@ bool MainWindow::confirmTx(Tx tx, RecurringPaymentInfo* rpi) {
|
||||
totalSpending = totalSpending + toAddr.amount;
|
||||
|
||||
// Amount (USD)
|
||||
if (Settings::getInstance()->get_currency_name() == "USD") {
|
||||
auto AmtUSD = new QLabel(confirm.sendToAddrs);
|
||||
AmtUSD->setObjectName(QString("AmtUSD") % QString::number(i + 1));
|
||||
AmtUSD->setText(toAddr.amount.toDecimalUSDString());
|
||||
AmtUSD->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);
|
||||
confirm.gridLayout->addWidget(AmtUSD, row, 2, 1, 1);
|
||||
confirm.gridLayout->addWidget(AmtUSD, row, 2, 1, 1);
|
||||
|
||||
// Amount (EUR)
|
||||
} else if (Settings::getInstance()->get_currency_name() == "EUR") {
|
||||
auto AmtUSD = new QLabel(confirm.sendToAddrs);
|
||||
AmtUSD->setObjectName(QString("AmtUSD") % QString::number(i + 1));
|
||||
AmtUSD->setText(toAddr.amount.toDecimalEURString());
|
||||
AmtUSD->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);
|
||||
confirm.gridLayout->addWidget(AmtUSD, row, 2, 1, 1);
|
||||
|
||||
// Amount (EUR)
|
||||
} else if (Settings::getInstance()->get_currency_name() == "BTC") {
|
||||
auto AmtUSD = new QLabel(confirm.sendToAddrs);
|
||||
AmtUSD->setObjectName(QString("AmtUSD") % QString::number(i + 1));
|
||||
AmtUSD->setText(toAddr.amount.toDecimalBTCString());
|
||||
AmtUSD->setAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter);
|
||||
confirm.gridLayout->addWidget(AmtUSD, row, 2, 1, 1);
|
||||
}
|
||||
// Memo
|
||||
if (Settings::isZAddress(toAddr.addr) && !toAddr.memo.isEmpty()) {
|
||||
row++;
|
||||
@@ -588,7 +628,13 @@ bool MainWindow::confirmTx(Tx tx, RecurringPaymentInfo* rpi) {
|
||||
minerFeeUSD->setObjectName(QStringLiteral("minerFeeUSD"));
|
||||
minerFeeUSD->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
|
||||
confirm.gridLayout->addWidget(minerFeeUSD, row, 2, 1, 1);
|
||||
if (Settings::getInstance()->get_currency_name() == "USD") {
|
||||
minerFeeUSD->setText(tx.fee.toDecimalUSDString());
|
||||
} else if (Settings::getInstance()->get_currency_name() == "EUR") {
|
||||
minerFeeUSD->setText(tx.fee.toDecimalEURString());
|
||||
} else if (Settings::getInstance()->get_currency_name() == "BTC") {
|
||||
minerFeeUSD->setText(tx.fee.toDecimalBTCString());
|
||||
}
|
||||
}
|
||||
|
||||
// Recurring payment info, show only if there is exactly one destination address
|
||||
|
||||
@@ -107,9 +107,9 @@ public:
|
||||
|
||||
static const QString labelRegExp;
|
||||
|
||||
static const int updateSpeed = 20 * 1000; // 10 sec
|
||||
static const int quickUpdateSpeed = 5 * 1000; // 3 sec
|
||||
static const int priceRefreshSpeed = 60 * 60 * 1000; // 15 mins
|
||||
static const int updateSpeed = 20 * 1000; // 20 sec
|
||||
static const int quickUpdateSpeed = 5 * 1000; // 5 sec
|
||||
static const int priceRefreshSpeed = 5 * 60 * 1000; // 5 mins
|
||||
|
||||
private:
|
||||
// This class can only be accessed through Settings::getInstance()
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Fetch hush / USD prices</string>
|
||||
<string>Fetch hush prices</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox" name="chkCheckUpdates">
|
||||
|
||||
@@ -155,7 +155,14 @@ QVariant TxTableModel::data(const QModelIndex &index, int role) const {
|
||||
for (int i=0; i < dat.items.length(); i++) {
|
||||
total = total + dat.items[i].amount;
|
||||
}
|
||||
if (Settings::getInstance()->get_currency_name() == "USD") {
|
||||
return total.toDecimalUSDString();
|
||||
} else if (Settings::getInstance()->get_currency_name() == "EUR") {
|
||||
return total.toDecimalEURString();
|
||||
} else if (Settings::getInstance()->get_currency_name() == "BTC") {
|
||||
return total.toDecimalBTCString();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user