mirror of
https://github.com/wownero/wowlet.git
synced 2026-10-21 09:08:41 +02:00
Send: Always include pref. currency in combobox
This commit is contained in:
@@ -29,6 +29,8 @@ SendWidget::SendWidget(QWidget *parent) :
|
||||
ui->label_conversionAmount->setText("");
|
||||
ui->label_conversionAmount->hide();
|
||||
ui->btn_openAlias->hide();
|
||||
|
||||
this->setupComboBox();
|
||||
}
|
||||
|
||||
void SendWidget::currencyComboChanged(int index) {
|
||||
@@ -185,8 +187,23 @@ void SendWidget::onEndTransaction() {
|
||||
ui->btnSend->setEnabled(true);
|
||||
}
|
||||
|
||||
void SendWidget::setupComboBox() {
|
||||
ui->comboCurrencySelection->clear();
|
||||
|
||||
QStringList defaultCurrencies = {"XMR", "USD", "EUR", "CNY", "JPY", "GBP"};
|
||||
QString preferredCurrency = config()->get(Config::preferredFiatCurrency).toString();
|
||||
|
||||
if (defaultCurrencies.contains(preferredCurrency)) {
|
||||
defaultCurrencies.removeOne(preferredCurrency);
|
||||
}
|
||||
|
||||
ui->comboCurrencySelection->insertItems(0, defaultCurrencies);
|
||||
ui->comboCurrencySelection->insertItem(1, preferredCurrency);
|
||||
}
|
||||
|
||||
void SendWidget::onPreferredFiatCurrencyChanged() {
|
||||
this->updateConversionLabel();
|
||||
this->setupComboBox();
|
||||
}
|
||||
|
||||
SendWidget::~SendWidget() {
|
||||
|
||||
Reference in New Issue
Block a user