mirror of
				https://git.wownero.com/wowlet/wowlet.git
				synced 2024-08-15 01:03:14 +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->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() {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -48,6 +48,8 @@ signals:
 | 
			
		|||
    void createTransaction(const QString &address, double amount, const QString &description, bool all);
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    void setupComboBox();
 | 
			
		||||
 | 
			
		||||
    Ui::SendWidget *ui;
 | 
			
		||||
    AppContext *m_ctx;
 | 
			
		||||
    double amount();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -105,48 +105,7 @@
 | 
			
		|||
        </widget>
 | 
			
		||||
       </item>
 | 
			
		||||
       <item>
 | 
			
		||||
        <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>
 | 
			
		||||
        <widget class="QComboBox" name="comboCurrencySelection"/>
 | 
			
		||||
       </item>
 | 
			
		||||
      </layout>
 | 
			
		||||
     </item>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue