[Qt] improve minimum absolute fee option
- Only display the minimum absolute fee control if CoinControl is enabled
This commit is contained in:
parent
31b508a18b
commit
ff723da6f6
1 changed files with 22 additions and 5 deletions
|
@ -585,7 +585,7 @@ void SendCoinsDialog::updateFeeSectionControls()
|
||||||
ui->checkBoxMinimumFee ->setEnabled(ui->radioCustomFee->isChecked());
|
ui->checkBoxMinimumFee ->setEnabled(ui->radioCustomFee->isChecked());
|
||||||
ui->labelMinFeeWarning ->setEnabled(ui->radioCustomFee->isChecked());
|
ui->labelMinFeeWarning ->setEnabled(ui->radioCustomFee->isChecked());
|
||||||
ui->radioCustomPerKilobyte ->setEnabled(ui->radioCustomFee->isChecked() && !ui->checkBoxMinimumFee->isChecked());
|
ui->radioCustomPerKilobyte ->setEnabled(ui->radioCustomFee->isChecked() && !ui->checkBoxMinimumFee->isChecked());
|
||||||
ui->radioCustomAtLeast ->setEnabled(ui->radioCustomFee->isChecked() && !ui->checkBoxMinimumFee->isChecked());
|
ui->radioCustomAtLeast ->setEnabled(ui->radioCustomFee->isChecked() && !ui->checkBoxMinimumFee->isChecked() && CoinControlDialog::coinControl->HasSelected());
|
||||||
ui->customFee ->setEnabled(ui->radioCustomFee->isChecked() && !ui->checkBoxMinimumFee->isChecked());
|
ui->customFee ->setEnabled(ui->radioCustomFee->isChecked() && !ui->checkBoxMinimumFee->isChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -600,7 +600,10 @@ void SendCoinsDialog::updateGlobalFeeVariables()
|
||||||
{
|
{
|
||||||
nTxConfirmTarget = defaultConfirmTarget;
|
nTxConfirmTarget = defaultConfirmTarget;
|
||||||
payTxFee = CFeeRate(ui->customFee->value());
|
payTxFee = CFeeRate(ui->customFee->value());
|
||||||
fPayAtLeastCustomFee = ui->radioCustomAtLeast->isChecked();
|
|
||||||
|
// if user has selected to set a minimum absolute fee, pass the value to coincontrol
|
||||||
|
// set nMinimumTotalFee to 0 in case of user has selected that the fee is per KB
|
||||||
|
CoinControlDialog::coinControl->nMinimumTotalFee = ui->radioCustomAtLeast->isChecked() ? ui->customFee->value() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
fSendFreeTransactions = ui->checkBoxFreeTx->isChecked();
|
fSendFreeTransactions = ui->checkBoxFreeTx->isChecked();
|
||||||
|
@ -707,7 +710,6 @@ void SendCoinsDialog::coinControlFeatureChanged(bool checked)
|
||||||
if (!checked && model) // coin control features disabled
|
if (!checked && model) // coin control features disabled
|
||||||
CoinControlDialog::coinControl->SetNull();
|
CoinControlDialog::coinControl->SetNull();
|
||||||
|
|
||||||
if (checked)
|
|
||||||
coinControlUpdateLabels();
|
coinControlUpdateLabels();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -782,9 +784,24 @@ void SendCoinsDialog::coinControlChangeEdited(const QString& text)
|
||||||
// Coin Control: update labels
|
// Coin Control: update labels
|
||||||
void SendCoinsDialog::coinControlUpdateLabels()
|
void SendCoinsDialog::coinControlUpdateLabels()
|
||||||
{
|
{
|
||||||
if (!model || !model->getOptionsModel() || !model->getOptionsModel()->getCoinControlFeatures())
|
if (!model || !model->getOptionsModel())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (model->getOptionsModel()->getCoinControlFeatures())
|
||||||
|
{
|
||||||
|
// enable minium absolute fee UI controls
|
||||||
|
ui->radioCustomAtLeast->setVisible(true);
|
||||||
|
|
||||||
|
// only enable the feature if inputs are selected
|
||||||
|
ui->radioCustomAtLeast->setEnabled(CoinControlDialog::coinControl->HasSelected());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// in case coin control is disabled (=default), hide minimum absolute fee UI controls
|
||||||
|
ui->radioCustomAtLeast->setVisible(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// set pay amounts
|
// set pay amounts
|
||||||
CoinControlDialog::payAmounts.clear();
|
CoinControlDialog::payAmounts.clear();
|
||||||
CoinControlDialog::fSubtractFeeFromAmount = false;
|
CoinControlDialog::fSubtractFeeFromAmount = false;
|
||||||
|
|
Loading…
Reference in a new issue