Skip to content

Commit

Permalink
GUI: SendCoinsEntry: Propagate asset types available to amount field
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-jr authored and instagibbs committed Apr 9, 2019
1 parent a163be0 commit 2ebae1a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/qt/sendcoinsentry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,10 @@ void SendCoinsEntry::setModel(WalletModel *_model)
{
this->model = _model;

if (_model && _model->getOptionsModel())
if (_model && _model->getOptionsModel()) {
connect(_model->getOptionsModel(), &OptionsModel::displayUnitChanged, this, &SendCoinsEntry::updateDisplayUnit);
connect(_model, SIGNAL(assetTypesChanged()), this, SLOT(updateAssetTypes()));
}

clear();
}
Expand All @@ -107,6 +109,7 @@ void SendCoinsEntry::clear()
ui->payAmount_s->clear();

// update the display unit, to not use the default ("BTC")
updateAssetTypes();
updateDisplayUnit();
}

Expand Down Expand Up @@ -251,6 +254,13 @@ void SendCoinsEntry::setFocus()
ui->payTo->setFocus();
}

void SendCoinsEntry::updateAssetTypes()
{
if (model) {
ui->payAmount->setAllowedAssets(model->getAssetTypes());
}
}

void SendCoinsEntry::updateDisplayUnit()
{
if(model && model->getOptionsModel())
Expand Down
1 change: 1 addition & 0 deletions src/qt/sendcoinsentry.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ private Q_SLOTS:
void on_addressBookButton_clicked();
void on_pasteButton_clicked();
void updateDisplayUnit();
void updateAssetTypes();

private:
SendCoinsRecipient recipient;
Expand Down

0 comments on commit 2ebae1a

Please sign in to comment.