diff options
author | João Barbosa <joao.paulo.barbosa@gmail.com> | 2018-02-01 16:48:56 +0000 |
---|---|---|
committer | João Barbosa <joao.paulo.barbosa@gmail.com> | 2018-02-01 19:40:20 +0000 |
commit | 6558f8acc363e1141f2864ee9be2bc7e980842a3 (patch) | |
tree | 8e1ed59bbc56e85bff2dcfd7ad117c0ff3942b5d /src/qt/sendcoinsdialog.cpp | |
parent | 895fbd768f0c89cea3f78acac58b233d4e3a145e (diff) |
[gui] Defer coin control instancing
Defer the GUI coin control instancing so that argument processing
is taken into account for the default coin control values.
Diffstat (limited to 'src/qt/sendcoinsdialog.cpp')
-rw-r--r-- | src/qt/sendcoinsdialog.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/qt/sendcoinsdialog.cpp b/src/qt/sendcoinsdialog.cpp index 9fd61db70e..1227e340ce 100644 --- a/src/qt/sendcoinsdialog.cpp +++ b/src/qt/sendcoinsdialog.cpp @@ -256,7 +256,7 @@ void SendCoinsDialog::on_sendButton_clicked() // Always use a CCoinControl instance, use the CoinControlDialog instance if CoinControl has been enabled CCoinControl ctrl; if (model->getOptionsModel()->getCoinControlFeatures()) - ctrl = *CoinControlDialog::coinControl; + ctrl = *CoinControlDialog::coinControl(); updateCoinControlState(ctrl); @@ -367,7 +367,7 @@ void SendCoinsDialog::on_sendButton_clicked() if (sendStatus.status == WalletModel::OK) { accept(); - CoinControlDialog::coinControl->UnSelectAll(); + CoinControlDialog::coinControl()->UnSelectAll(); coinControlUpdateLabels(); } fNewRecipientAllowed = true; @@ -604,7 +604,7 @@ void SendCoinsDialog::useAvailableBalance(SendCoinsEntry* entry) // Get CCoinControl instance if CoinControl is enabled or create a new one. CCoinControl coin_control; if (model->getOptionsModel()->getCoinControlFeatures()) { - coin_control = *CoinControlDialog::coinControl; + coin_control = *CoinControlDialog::coinControl(); } // Calculate available amount to send. @@ -754,7 +754,7 @@ void SendCoinsDialog::coinControlFeatureChanged(bool checked) ui->frameCoinControl->setVisible(checked); if (!checked && model) // coin control features disabled - CoinControlDialog::coinControl->SetNull(); + CoinControlDialog::coinControl()->SetNull(); coinControlUpdateLabels(); } @@ -773,7 +773,7 @@ void SendCoinsDialog::coinControlChangeChecked(int state) { if (state == Qt::Unchecked) { - CoinControlDialog::coinControl->destChange = CNoDestination(); + CoinControlDialog::coinControl()->destChange = CNoDestination(); ui->labelCoinControlChangeLabel->clear(); } else @@ -789,7 +789,7 @@ void SendCoinsDialog::coinControlChangeEdited(const QString& text) if (model && model->getAddressTableModel()) { // Default to no change address until verified - CoinControlDialog::coinControl->destChange = CNoDestination(); + CoinControlDialog::coinControl()->destChange = CNoDestination(); ui->labelCoinControlChangeLabel->setStyleSheet("QLabel{color:red;}"); const CTxDestination dest = DecodeDestination(text.toStdString()); @@ -812,7 +812,7 @@ void SendCoinsDialog::coinControlChangeEdited(const QString& text) QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Cancel); if(btnRetVal == QMessageBox::Yes) - CoinControlDialog::coinControl->destChange = dest; + CoinControlDialog::coinControl()->destChange = dest; else { ui->lineEditCoinControlChange->setText(""); @@ -831,7 +831,7 @@ void SendCoinsDialog::coinControlChangeEdited(const QString& text) else ui->labelCoinControlChangeLabel->setText(tr("(no label)")); - CoinControlDialog::coinControl->destChange = dest; + CoinControlDialog::coinControl()->destChange = dest; } } } @@ -843,7 +843,7 @@ void SendCoinsDialog::coinControlUpdateLabels() if (!model || !model->getOptionsModel()) return; - updateCoinControlState(*CoinControlDialog::coinControl); + updateCoinControlState(*CoinControlDialog::coinControl()); // set pay amounts CoinControlDialog::payAmounts.clear(); @@ -861,7 +861,7 @@ void SendCoinsDialog::coinControlUpdateLabels() } } - if (CoinControlDialog::coinControl->HasSelected()) + if (CoinControlDialog::coinControl()->HasSelected()) { // actual coin control calculation CoinControlDialog::updateLabels(model, this); |