Merge #919: Add option to hide warning about low keys
b4647b5 Add option to hide warning about low keys before creating autobackup (but still warn if backup fails)
This commit is contained in:
parent
8f9544c46e
commit
66fb11c964
@ -173,6 +173,16 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="lowKeysWarning">
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Show warning dialog when PrivateSend detects that wallet has very low number of keys left.</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Warn if PrivateSend is running out of keys</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="privateSendMultiSession">
|
<widget class="QCheckBox" name="privateSendMultiSession">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
|
@ -201,6 +201,7 @@ void OptionsDialog::setMapper()
|
|||||||
mapper->addMapping(ui->coinControlFeatures, OptionsModel::CoinControlFeatures);
|
mapper->addMapping(ui->coinControlFeatures, OptionsModel::CoinControlFeatures);
|
||||||
mapper->addMapping(ui->privateSendRounds, OptionsModel::PrivateSendRounds);
|
mapper->addMapping(ui->privateSendRounds, OptionsModel::PrivateSendRounds);
|
||||||
mapper->addMapping(ui->privateSendAmount, OptionsModel::PrivateSendAmount);
|
mapper->addMapping(ui->privateSendAmount, OptionsModel::PrivateSendAmount);
|
||||||
|
mapper->addMapping(ui->lowKeysWarning, OptionsModel::LowKeysWarning);
|
||||||
mapper->addMapping(ui->privateSendMultiSession, OptionsModel::PrivateSendMultiSession);
|
mapper->addMapping(ui->privateSendMultiSession, OptionsModel::PrivateSendMultiSession);
|
||||||
|
|
||||||
/* Network */
|
/* Network */
|
||||||
|
@ -88,6 +88,9 @@ void OptionsModel::Init(bool resetSettings)
|
|||||||
settings.setValue("fShowAdvancedPSUI", false);
|
settings.setValue("fShowAdvancedPSUI", false);
|
||||||
fShowAdvancedPSUI = settings.value("fShowAdvancedPSUI", false).toBool();
|
fShowAdvancedPSUI = settings.value("fShowAdvancedPSUI", false).toBool();
|
||||||
|
|
||||||
|
if (!settings.contains("fLowKeysWarning"))
|
||||||
|
settings.setValue("fLowKeysWarning", true);
|
||||||
|
|
||||||
// These are shared with the core or have a command-line parameter
|
// These are shared with the core or have a command-line parameter
|
||||||
// and we want command-line parameters to overwrite the GUI settings.
|
// and we want command-line parameters to overwrite the GUI settings.
|
||||||
//
|
//
|
||||||
@ -251,6 +254,8 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
|
|||||||
return settings.value("bSpendZeroConfChange");
|
return settings.value("bSpendZeroConfChange");
|
||||||
case ShowAdvancedPSUI:
|
case ShowAdvancedPSUI:
|
||||||
return fShowAdvancedPSUI;
|
return fShowAdvancedPSUI;
|
||||||
|
case LowKeysWarning:
|
||||||
|
return settings.value("fLowKeysWarning");
|
||||||
case PrivateSendRounds:
|
case PrivateSendRounds:
|
||||||
return settings.value("nPrivateSendRounds");
|
return settings.value("nPrivateSendRounds");
|
||||||
case PrivateSendAmount:
|
case PrivateSendAmount:
|
||||||
@ -386,6 +391,9 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
|
|||||||
settings.setValue("fShowAdvancedPSUI", fShowAdvancedPSUI);
|
settings.setValue("fShowAdvancedPSUI", fShowAdvancedPSUI);
|
||||||
Q_EMIT advancedPSUIChanged(fShowAdvancedPSUI);
|
Q_EMIT advancedPSUIChanged(fShowAdvancedPSUI);
|
||||||
break;
|
break;
|
||||||
|
case LowKeysWarning:
|
||||||
|
settings.setValue("fLowKeysWarning", value);
|
||||||
|
break;
|
||||||
case PrivateSendRounds:
|
case PrivateSendRounds:
|
||||||
if (settings.value("nPrivateSendRounds") != value)
|
if (settings.value("nPrivateSendRounds") != value)
|
||||||
{
|
{
|
||||||
|
@ -47,6 +47,7 @@ public:
|
|||||||
DatabaseCache, // int
|
DatabaseCache, // int
|
||||||
SpendZeroConfChange, // bool
|
SpendZeroConfChange, // bool
|
||||||
ShowAdvancedPSUI, // bool
|
ShowAdvancedPSUI, // bool
|
||||||
|
LowKeysWarning, // bool
|
||||||
PrivateSendRounds, // int
|
PrivateSendRounds, // int
|
||||||
PrivateSendAmount, // int
|
PrivateSendAmount, // int
|
||||||
ShowMasternodesTab, // bool
|
ShowMasternodesTab, // bool
|
||||||
|
@ -463,13 +463,18 @@ void OverviewPage::privateSendStatus()
|
|||||||
|
|
||||||
// Warn user that wallet is running out of keys
|
// Warn user that wallet is running out of keys
|
||||||
if (nWalletBackups > 0 && pwalletMain->nKeysLeftSinceAutoBackup < PS_KEYS_THRESHOLD_WARNING) {
|
if (nWalletBackups > 0 && pwalletMain->nKeysLeftSinceAutoBackup < PS_KEYS_THRESHOLD_WARNING) {
|
||||||
QString strWarn = tr("Very low number of keys left since last automatic backup!") + "<br><br>" +
|
QSettings settings;
|
||||||
tr("We are about to create a new automatic backup for you, however "
|
if(settings.value("fLowKeysWarning").toBool()) {
|
||||||
"<span style='color:red;'> you should always make sure you have backups "
|
QString strWarn = tr("Very low number of keys left since last automatic backup!") + "<br><br>" +
|
||||||
"saved in some safe place</span>!");
|
tr("We are about to create a new automatic backup for you, however "
|
||||||
ui->labelPrivateSendEnabled->setToolTip(strWarn);
|
"<span style='color:red;'> you should always make sure you have backups "
|
||||||
LogPrintf("OverviewPage::privateSendStatus - Very low number of keys left since last automatic backup, warning user and trying to create new backup...\n");
|
"saved in some safe place</span>!") + "<br><br>" +
|
||||||
QMessageBox::warning(this, tr("PrivateSend"), strWarn, QMessageBox::Ok, QMessageBox::Ok);
|
tr("Note: You turn this message off in options.");
|
||||||
|
ui->labelPrivateSendEnabled->setToolTip(strWarn);
|
||||||
|
LogPrintf("OverviewPage::privateSendStatus -- Very low number of keys left since last automatic backup, warning user and trying to create new backup...\n");
|
||||||
|
QMessageBox::warning(this, tr("PrivateSend"), strWarn, QMessageBox::Ok, QMessageBox::Ok);
|
||||||
|
} else
|
||||||
|
LogPrintf("OverviewPage::privateSendStatus -- Very low number of keys left since last automatic backup, skipping warning and trying to create new backup...\n");
|
||||||
|
|
||||||
std::string warningString;
|
std::string warningString;
|
||||||
std::string errorString;
|
std::string errorString;
|
||||||
|
Loading…
Reference in New Issue
Block a user