mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-17 13:07:54 +02:00
GUI: SendCoinsEntry: Propagate asset types available to amount field
This commit is contained in:
parent
a163be0ae1
commit
2ebae1ab89
2 changed files with 12 additions and 1 deletions
|
|
@ -81,8 +81,10 @@ void SendCoinsEntry::setModel(WalletModel *_model)
|
||||||
{
|
{
|
||||||
this->model = _model;
|
this->model = _model;
|
||||||
|
|
||||||
if (_model && _model->getOptionsModel())
|
if (_model && _model->getOptionsModel()) {
|
||||||
connect(_model->getOptionsModel(), &OptionsModel::displayUnitChanged, this, &SendCoinsEntry::updateDisplayUnit);
|
connect(_model->getOptionsModel(), &OptionsModel::displayUnitChanged, this, &SendCoinsEntry::updateDisplayUnit);
|
||||||
|
connect(_model, SIGNAL(assetTypesChanged()), this, SLOT(updateAssetTypes()));
|
||||||
|
}
|
||||||
|
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
|
|
@ -107,6 +109,7 @@ void SendCoinsEntry::clear()
|
||||||
ui->payAmount_s->clear();
|
ui->payAmount_s->clear();
|
||||||
|
|
||||||
// update the display unit, to not use the default ("BTC")
|
// update the display unit, to not use the default ("BTC")
|
||||||
|
updateAssetTypes();
|
||||||
updateDisplayUnit();
|
updateDisplayUnit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -251,6 +254,13 @@ void SendCoinsEntry::setFocus()
|
||||||
ui->payTo->setFocus();
|
ui->payTo->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SendCoinsEntry::updateAssetTypes()
|
||||||
|
{
|
||||||
|
if (model) {
|
||||||
|
ui->payAmount->setAllowedAssets(model->getAssetTypes());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void SendCoinsEntry::updateDisplayUnit()
|
void SendCoinsEntry::updateDisplayUnit()
|
||||||
{
|
{
|
||||||
if(model && model->getOptionsModel())
|
if(model && model->getOptionsModel())
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,7 @@ private Q_SLOTS:
|
||||||
void on_addressBookButton_clicked();
|
void on_addressBookButton_clicked();
|
||||||
void on_pasteButton_clicked();
|
void on_pasteButton_clicked();
|
||||||
void updateDisplayUnit();
|
void updateDisplayUnit();
|
||||||
|
void updateAssetTypes();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SendCoinsRecipient recipient;
|
SendCoinsRecipient recipient;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue