clean up, fix requestdialog.cpp
This commit is contained in:
@@ -425,15 +425,11 @@ void MainWindow::setupSettingsModal() {
|
|||||||
int currency_index = settings.comboBoxCurrency->findText(Settings::getInstance()->get_currency_name(), Qt::MatchExactly);
|
int currency_index = settings.comboBoxCurrency->findText(Settings::getInstance()->get_currency_name(), Qt::MatchExactly);
|
||||||
settings.comboBoxCurrency->setCurrentIndex(currency_index);
|
settings.comboBoxCurrency->setCurrentIndex(currency_index);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QObject::connect(settings.comboBoxCurrency, &QComboBox::currentTextChanged, [=] (QString currency_name) {
|
QObject::connect(settings.comboBoxCurrency, &QComboBox::currentTextChanged, [=] (QString currency_name) {
|
||||||
this->slot_change_currency(currency_name);
|
this->slot_change_currency(currency_name);
|
||||||
|
|
||||||
// Tell the user to restart
|
// Tell the user to restart
|
||||||
QMessageBox::information(this, tr("Currency Change"), tr("Please restart SilentDragonLite to have new currencies apply"), QMessageBox::Ok);
|
QMessageBox::information(this, tr("Currency Change"), tr("Please restart SilentDragonLite to have new currencies apply"), QMessageBox::Ok);
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Check for updates
|
// Check for updates
|
||||||
@@ -1309,19 +1305,10 @@ void MainWindow::slot_change_currency(const QString& currency_name)
|
|||||||
saved_currency_name = "USD";
|
saved_currency_name = "USD";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void MainWindow::slot_change_theme(const QString& theme_name)
|
void MainWindow::slot_change_theme(const QString& theme_name)
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
Settings::getInstance()->set_theme_name(theme_name);
|
Settings::getInstance()->set_theme_name(theme_name);
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,6 @@ public slots:
|
|||||||
void slot_change_theme(const QString& themeName);
|
void slot_change_theme(const QString& themeName);
|
||||||
void slot_change_currency(const QString& currencyName);
|
void slot_change_currency(const QString& currencyName);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void closeEvent(QCloseEvent* event);
|
void closeEvent(QCloseEvent* event);
|
||||||
|
|
||||||
|
|||||||
@@ -126,6 +126,22 @@ void RequestDialog::showRequesthush(MainWindow* main) {
|
|||||||
req.txtAmountUSD->setText(amount.toDecimalEURString());
|
req.txtAmountUSD->setText(amount.toDecimalEURString());
|
||||||
} else if (Settings::getInstance()->get_currency_name() == "BTC") {
|
} else if (Settings::getInstance()->get_currency_name() == "BTC") {
|
||||||
req.txtAmountUSD->setText(amount.toDecimalBTCString());
|
req.txtAmountUSD->setText(amount.toDecimalBTCString());
|
||||||
|
} else if (Settings::getInstance()->get_currency_name() == "CNY") {
|
||||||
|
req.txtAmountUSD->setText(amount.toDecimalCNYString());
|
||||||
|
} else if (Settings::getInstance()->get_currency_name() == "RUB") {
|
||||||
|
req.txtAmountUSD->setText(amount.toDecimalRUBString());
|
||||||
|
} else if (Settings::getInstance()->get_currency_name() == "CAD") {
|
||||||
|
req.txtAmountUSD->setText(amount.toDecimalCADString());
|
||||||
|
} else if (Settings::getInstance()->get_currency_name() == "SGD") {
|
||||||
|
req.txtAmountUSD->setText(amount.toDecimalSGDString());
|
||||||
|
} else if (Settings::getInstance()->get_currency_name() == "CHF") {
|
||||||
|
req.txtAmountUSD->setText(amount.toDecimalCHFString());
|
||||||
|
} else if (Settings::getInstance()->get_currency_name() == "INR") {
|
||||||
|
req.txtAmountUSD->setText(amount.toDecimalINRString());
|
||||||
|
} else if (Settings::getInstance()->get_currency_name() == "GBP") {
|
||||||
|
req.txtAmountUSD->setText(amount.toDecimalGBPString());
|
||||||
|
} else if (Settings::getInstance()->get_currency_name() == "AUD") {
|
||||||
|
req.txtAmountUSD->setText(amount.toDecimalBTCString());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
CAmount amount = CAmount::fromDecimalString(req.txtAmount->text());
|
CAmount amount = CAmount::fromDecimalString(req.txtAmount->text());
|
||||||
@@ -135,8 +151,23 @@ void RequestDialog::showRequesthush(MainWindow* main) {
|
|||||||
req.txtAmountUSD->setText(amount.toDecimalEURString());
|
req.txtAmountUSD->setText(amount.toDecimalEURString());
|
||||||
} else if (Settings::getInstance()->get_currency_name() == "BTC") {
|
} else if (Settings::getInstance()->get_currency_name() == "BTC") {
|
||||||
req.txtAmountUSD->setText(amount.toDecimalBTCString());
|
req.txtAmountUSD->setText(amount.toDecimalBTCString());
|
||||||
|
} else if (Settings::getInstance()->get_currency_name() == "CNY") {
|
||||||
|
req.txtAmountUSD->setText(amount.toDecimalCNYString());
|
||||||
|
} else if (Settings::getInstance()->get_currency_name() == "RUB") {
|
||||||
|
req.txtAmountUSD->setText(amount.toDecimalRUBString());
|
||||||
|
} else if (Settings::getInstance()->get_currency_name() == "CAD") {
|
||||||
|
req.txtAmountUSD->setText(amount.toDecimalCADString());
|
||||||
|
} else if (Settings::getInstance()->get_currency_name() == "SGD") {
|
||||||
|
req.txtAmountUSD->setText(amount.toDecimalSGDString());
|
||||||
|
} else if (Settings::getInstance()->get_currency_name() == "CHF") {
|
||||||
|
req.txtAmountUSD->setText(amount.toDecimalCHFString());
|
||||||
|
} else if (Settings::getInstance()->get_currency_name() == "INR") {
|
||||||
|
req.txtAmountUSD->setText(amount.toDecimalINRString());
|
||||||
|
} else if (Settings::getInstance()->get_currency_name() == "GBP") {
|
||||||
|
req.txtAmountUSD->setText(amount.toDecimalGBPString());
|
||||||
|
} else if (Settings::getInstance()->get_currency_name() == "AUD") {
|
||||||
|
req.txtAmountUSD->setText(amount.toDecimalBTCString());
|
||||||
}
|
}
|
||||||
|
|
||||||
req.txtMemo->setAcceptButton(req.buttonBox->button(QDialogButtonBox::Ok));
|
req.txtMemo->setAcceptButton(req.buttonBox->button(QDialogButtonBox::Ok));
|
||||||
req.txtMemo->setLenDisplayLabel(req.lblMemoLen);
|
req.txtMemo->setLenDisplayLabel(req.lblMemoLen);
|
||||||
req.txtMemo->setMaxLen(400);
|
req.txtMemo->setMaxLen(400);
|
||||||
|
|||||||
Reference in New Issue
Block a user