Skip to content

Commit

Permalink
Merge #891: Expose -privatesendmultisession to GUI options
Browse files Browse the repository at this point in the history
d1ece08 Expose `-privatesendmultisession` to GUI options
  • Loading branch information
UdjinM6 authored and schinzelh committed Jun 21, 2016
1 parent 078d5d9 commit 214c383
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/qt/forms/optionsdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,16 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="privateSendMultiSession">
<property name="toolTip">
<string>Whether to use experimental PrivateSend mode with multiple mixing sessions per block.&lt;br/&gt;Note: You must use this feature carefully.&lt;br/&gt;Make sure you always have recent wallet (auto)backup in a safe place!</string>
</property>
<property name="text">
<string>Enable PrivateSend &amp;multi-session</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="spendZeroConfChange">
<property name="toolTip">
Expand Down
1 change: 1 addition & 0 deletions src/qt/optionsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ void OptionsDialog::setMapper()
mapper->addMapping(ui->coinControlFeatures, OptionsModel::CoinControlFeatures);
mapper->addMapping(ui->privateSendRounds, OptionsModel::PrivateSendRounds);
mapper->addMapping(ui->anonymizeDash, OptionsModel::AnonymizeDashAmount);
mapper->addMapping(ui->privateSendMultiSession, OptionsModel::PrivateSendMultiSession);

/* Network */
mapper->addMapping(ui->mapPortUpnp, OptionsModel::MapPortUPnP);
Expand Down
15 changes: 15 additions & 0 deletions src/qt/optionsmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ void OptionsModel::Init(bool resetSettings)
if (!SoftSetArg("-anonymizedashamount", settings.value("nAnonymizeDashAmount").toString().toStdString()))
addOverriddenOption("-anonymizedashamount");
nAnonymizeDashAmount = settings.value("nAnonymizeDashAmount").toInt();

if (!settings.contains("fPrivateSendMultiSession"))
settings.setValue("fPrivateSendMultiSession", fPrivateSendMultiSession);
if (!SoftSetBoolArg("-privatesendmultisession", settings.value("fPrivateSendMultiSession").toBool()))
addOverriddenOption("-privatesendmultisession");
fPrivateSendMultiSession = settings.value("fPrivateSendMultiSession").toBool();
#endif

// Network
Expand Down Expand Up @@ -251,6 +257,8 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
return settings.value("nAnonymizeDashAmount");
case ShowMasternodesTab:
return settings.value("fShowMasternodesTab");
case PrivateSendMultiSession:
return settings.value("fPrivateSendMultiSession");
#endif
case DisplayUnit:
return nDisplayUnit;
Expand Down Expand Up @@ -400,6 +408,13 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
setRestartRequired(true);
}
break;
case PrivateSendMultiSession:
if (settings.value("fPrivateSendMultiSession") != value)
{
fPrivateSendMultiSession = value.toBool();
settings.setValue("fPrivateSendMultiSession", fPrivateSendMultiSession);
}
break;
#endif
case DisplayUnit:
setDisplayUnit(value);
Expand Down
1 change: 1 addition & 0 deletions src/qt/optionsmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class OptionsModel : public QAbstractListModel
PrivateSendRounds, // int
AnonymizeDashAmount, // int
ShowMasternodesTab, // bool
PrivateSendMultiSession,// bool
Listen, // bool
OptionIDRowCount,
};
Expand Down

0 comments on commit 214c383

Please sign in to comment.