mirror of
https://github.com/feather-wallet/feather.git
synced 2025-01-09 04:19:57 +00:00
Send: Always include pref. currency in combobox
This commit is contained in:
parent
9d781d1b57
commit
1d001322cc
3 changed files with 20 additions and 42 deletions
|
@ -29,6 +29,8 @@ SendWidget::SendWidget(QWidget *parent) :
|
||||||
ui->label_conversionAmount->setText("");
|
ui->label_conversionAmount->setText("");
|
||||||
ui->label_conversionAmount->hide();
|
ui->label_conversionAmount->hide();
|
||||||
ui->btn_openAlias->hide();
|
ui->btn_openAlias->hide();
|
||||||
|
|
||||||
|
this->setupComboBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SendWidget::currencyComboChanged(int index) {
|
void SendWidget::currencyComboChanged(int index) {
|
||||||
|
@ -185,8 +187,23 @@ void SendWidget::onEndTransaction() {
|
||||||
ui->btnSend->setEnabled(true);
|
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() {
|
void SendWidget::onPreferredFiatCurrencyChanged() {
|
||||||
this->updateConversionLabel();
|
this->updateConversionLabel();
|
||||||
|
this->setupComboBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
SendWidget::~SendWidget() {
|
SendWidget::~SendWidget() {
|
||||||
|
|
|
@ -48,6 +48,8 @@ signals:
|
||||||
void createTransaction(const QString &address, double amount, const QString &description, bool all);
|
void createTransaction(const QString &address, double amount, const QString &description, bool all);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void setupComboBox();
|
||||||
|
|
||||||
Ui::SendWidget *ui;
|
Ui::SendWidget *ui;
|
||||||
AppContext *m_ctx;
|
AppContext *m_ctx;
|
||||||
double amount();
|
double amount();
|
||||||
|
|
|
@ -105,48 +105,7 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QComboBox" name="comboCurrencySelection">
|
<widget class="QComboBox" name="comboCurrencySelection"/>
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>XMR</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>EUR</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>USD</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>GBP</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>AUD</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>JPY</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>NZD</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>RMB</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
|
Loading…
Reference in a new issue