Skip to content

Commit

Permalink
Only enable/disable PrivacyDialog zPIV elements if needed.
Browse files Browse the repository at this point in the history
Currently the zPIV buttons are constantly updated to enabled or disabled even if they are already in the correct state.
  • Loading branch information
presstab committed May 8, 2018
1 parent 766d519 commit 2b76f31
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/qt/privacydialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -791,16 +791,17 @@ void PrivacyDialog::updateAutomintStatus()
void PrivacyDialog::updateSPORK16Status()
{
// Update/enable labels, buttons and tooltips depending on the current SPORK_16 status
if(GetAdjustedTime() > GetSporkValue(SPORK_16_ZEROCOIN_MAINTENANCE_MODE)) {
bool fButtonsEnabled = ui->pushButtonMintzPIV->isEnabled();
bool fMaintenanceMode = GetAdjustedTime() > GetSporkValue(SPORK_16_ZEROCOIN_MAINTENANCE_MODE);
if (fMaintenanceMode && fButtonsEnabled) {
// Mint zPIV
ui->pushButtonMintzPIV->setEnabled(false);
ui->pushButtonMintzPIV->setToolTip(tr("zPIV is currently disabled due to maintenance."));

// Spend zPIV
ui->pushButtonSpendzPIV->setEnabled(false);
ui->pushButtonSpendzPIV->setToolTip(tr("zPIV is currently disabled due to maintenance."));
}
else {
} else if (!fMaintenanceMode && !fButtonsEnabled) {
// Mint zPIV
ui->pushButtonMintzPIV->setEnabled(true);
ui->pushButtonMintzPIV->setToolTip(tr("PrivacyDialog", "Enter an amount of PIV to convert to zPIV", 0));
Expand Down

0 comments on commit 2b76f31

Please sign in to comment.