Skip to content

Commit

Permalink
[BUG] CustomFeeDialog: proper reset on clearAll
Browse files Browse the repository at this point in the history
Github-Pull: #1574
Rebased-From: a10c0f7
  • Loading branch information
random-zebra authored and Fuzzbawls committed May 5, 2020
1 parent f849742 commit a0a9fe7
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/qt/pivx/sendcustomfeedialog.cpp
Expand Up @@ -70,6 +70,9 @@ void SendCustomFeeDialog::showEvent(QShowEvent *event)
if (walletModel && walletModel->hasWalletCustomFee()) {
ui->checkBoxCustom->setChecked(true);
onCustomChecked();
} else {
ui->checkBoxRecommended->setChecked(true);
onRecommendedChecked();
}
}

Expand All @@ -80,10 +83,12 @@ void SendCustomFeeDialog::onCustomChecked()
ui->comboBoxRecommended->setEnabled(!isChecked);
ui->checkBoxRecommended->setChecked(!isChecked);

if (walletModel && ui->lineEditCustomFee->text().isEmpty()) {
if (isChecked && walletModel) {
CAmount nFee;
walletModel->getWalletCustomFee(nFee);
ui->lineEditCustomFee->setText(BitcoinUnits::format(walletModel->getOptionsModel()->getDisplayUnit(), nFee));
} else {
ui->lineEditCustomFee->clear();
}
}

Expand All @@ -93,6 +98,9 @@ void SendCustomFeeDialog::onRecommendedChecked()
ui->lineEditCustomFee->setEnabled(!isChecked);
ui->comboBoxRecommended->setEnabled(isChecked);
ui->checkBoxCustom->setChecked(!isChecked);
if (isChecked) {
ui->lineEditCustomFee->clear();
}
}

// Fast = 1.
Expand Down Expand Up @@ -123,8 +131,7 @@ void SendCustomFeeDialog::accept()

void SendCustomFeeDialog::clear()
{
onRecommendedChecked();
updateFee();
ui->comboBoxRecommended->setCurrentIndex(0);
}

CFeeRate SendCustomFeeDialog::getFeeRate()
Expand Down

0 comments on commit a0a9fe7

Please sign in to comment.