|
|
@ -279,7 +279,8 @@ void MainWindow::setupSettingsModal() { |
|
|
|
std::string currency_name; |
|
|
|
try { |
|
|
|
currency_name = Settings::getInstance()->get_currency_name(); |
|
|
|
} catch (...) { |
|
|
|
} catch (const std::exception& e) { |
|
|
|
qDebug() << QString("Currency name exception! : ") << e.what(); |
|
|
|
currency_name = "USD"; |
|
|
|
} |
|
|
|
|
|
|
@ -305,12 +306,13 @@ void MainWindow::setupSettingsModal() { |
|
|
|
QMessageBox::information(this, tr("Theme Change"), tr("This change can take a few seconds."), QMessageBox::Ok); |
|
|
|
}); |
|
|
|
|
|
|
|
// Get Currency Data
|
|
|
|
// Set local currency
|
|
|
|
QString ticker = QString::fromStdString( Settings::getInstance()->get_currency_name() ); |
|
|
|
int currency_index = settings.comboBoxCurrency->findText(ticker, Qt::MatchExactly); |
|
|
|
settings.comboBoxCurrency->setCurrentIndex(currency_index); |
|
|
|
QObject::connect(settings.comboBoxCurrency, SIGNAL(currentIndexChanged(QString)), this, SLOT(slot_change_currency(QString))); |
|
|
|
QObject::connect(settings.comboBoxCurrency, &QComboBox::currentTextChanged, [=] (QString ticker) { |
|
|
|
this->slot_change_currency(currency_name); |
|
|
|
this->slot_change_currency(ticker.toStdString()); |
|
|
|
rpc->refresh(true); |
|
|
|
QMessageBox::information(this, tr("Currency Change"), tr("This change can take a few seconds."), QMessageBox::Ok); |
|
|
|
}); |
|
|
@ -392,6 +394,7 @@ void MainWindow::setupSettingsModal() { |
|
|
|
} |
|
|
|
|
|
|
|
if (settingsDialog.exec() == QDialog::Accepted) { |
|
|
|
qDebug() << "Setting dialog box accepted"; |
|
|
|
// Custom fees
|
|
|
|
bool customFees = settings.chkCustomFees->isChecked(); |
|
|
|
Settings::getInstance()->setAllowCustomFees(customFees); |
|
|
@ -610,7 +613,7 @@ bool MainWindow::eventFilter(QObject *object, QEvent *event) { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Pay the Zcash URI by showing a confirmation window. If the URI parameter is empty, the UI
|
|
|
|
// Pay the Hush URI by showing a confirmation window. If the URI parameter is empty, the UI
|
|
|
|
// will prompt for one. If the myAddr is empty, then the default from address is used to send
|
|
|
|
// the transaction.
|
|
|
|
void MainWindow::payZcashURI(QString uri, QString myAddr) { |
|
|
@ -1338,6 +1341,7 @@ void MainWindow::updateLabels() { |
|
|
|
|
|
|
|
void MainWindow::slot_change_currency(const std::string& currency_name) |
|
|
|
{ |
|
|
|
qDebug() << "slot_change_currency"; //<< ": " << currency_name;
|
|
|
|
Settings::getInstance()->set_currency_name(currency_name); |
|
|
|
|
|
|
|
// Include currency
|
|
|
|