aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-02-16 09:28:31 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2014-02-16 09:29:12 +0100
commit25d816110ba28c5014b23c9a363c472fc28a3891 (patch)
treec1e1e6f84e269b78e857c0f67ae76ca6f6b0b88f
parent085c62149ad19cecf235829e49df07884a279e1e (diff)
parent29d45073c969e20a36ee01c1beabace331cb8245 (diff)
Merge pull request #3676
29d4507 qt: Add option to (not) spend unconfirmed change (Wladimir J. van der Laan)
-rw-r--r--src/qt/forms/optionsdialog.ui129
-rw-r--r--src/qt/optionsdialog.cpp5
-rw-r--r--src/qt/optionsmodel.cpp13
-rw-r--r--src/qt/optionsmodel.h1
4 files changed, 101 insertions, 47 deletions
diff --git a/src/qt/forms/optionsdialog.ui b/src/qt/forms/optionsdialog.ui
index e0d99aac39..b4a9f1f580 100644
--- a/src/qt/forms/optionsdialog.ui
+++ b/src/qt/forms/optionsdialog.ui
@@ -28,52 +28,6 @@
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_Main">
<item>
- <widget class="QLabel" name="transactionFeeInfoLabel">
- <property name="text">
- <string>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</string>
- </property>
- <property name="textFormat">
- <enum>Qt::PlainText</enum>
- </property>
- <property name="wordWrap">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout_1_Main">
- <item>
- <widget class="QLabel" name="transactionFeeLabel">
- <property name="text">
- <string>Pay transaction &amp;fee</string>
- </property>
- <property name="textFormat">
- <enum>Qt::PlainText</enum>
- </property>
- <property name="buddy">
- <cstring>transactionFee</cstring>
- </property>
- </widget>
- </item>
- <item>
- <widget class="BitcoinAmountField" name="transactionFee"/>
- </item>
- <item>
- <spacer name="horizontalSpacer_1_Main">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
- </item>
- <item>
<widget class="QCheckBox" name="bitcoinAtStartup">
<property name="toolTip">
<string>Automatically start Bitcoin after logging in to the system.</string>
@@ -194,6 +148,89 @@
</item>
</layout>
</widget>
+ <widget class="QWidget" name="tabWallet">
+ <attribute name="title">
+ <string>W&amp;allet</string>
+ </attribute>
+ <layout class="QVBoxLayout" name="verticalLayout_Network">
+ <item>
+ <widget class="QLabel" name="transactionFeeInfoLabel">
+ <property name="text">
+ <string>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.</string>
+ </property>
+ <property name="textFormat">
+ <enum>Qt::PlainText</enum>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_1_Main">
+ <item>
+ <widget class="QLabel" name="transactionFeeLabel">
+ <property name="text">
+ <string>Pay transaction &amp;fee</string>
+ </property>
+ <property name="textFormat">
+ <enum>Qt::PlainText</enum>
+ </property>
+ <property name="buddy">
+ <cstring>transactionFee</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="BitcoinAmountField" name="transactionFee"/>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_1_Main">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>If you disable the spending of unconfirmed change, the change from a transaction cannot be used until that transaction has at least one confirmation. This also affects how your balance is computed.</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="spendZeroConfChange">
+ <property name="text">
+ <string>Spend unconfirmed change (experts only)</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
<widget class="QWidget" name="tabNetwork">
<attribute name="title">
<string>&amp;Network</string>
diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp
index f61bb3ed2c..317e1db7d3 100644
--- a/src/qt/optionsdialog.cpp
+++ b/src/qt/optionsdialog.cpp
@@ -148,11 +148,14 @@ void OptionsDialog::setModel(OptionsModel *model)
void OptionsDialog::setMapper()
{
/* Main */
- mapper->addMapping(ui->transactionFee, OptionsModel::Fee);
mapper->addMapping(ui->bitcoinAtStartup, OptionsModel::StartAtStartup);
mapper->addMapping(ui->threadsScriptVerif, OptionsModel::ThreadsScriptVerif);
mapper->addMapping(ui->databaseCache, OptionsModel::DatabaseCache);
+ /* Wallet */
+ mapper->addMapping(ui->transactionFee, OptionsModel::Fee);
+ mapper->addMapping(ui->spendZeroConfChange, OptionsModel::SpendZeroConfChange);
+
/* Network */
mapper->addMapping(ui->mapPortUpnp, OptionsModel::MapPortUPnP);
diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp
index a2a2732b1c..f8354ef557 100644
--- a/src/qt/optionsmodel.cpp
+++ b/src/qt/optionsmodel.cpp
@@ -76,6 +76,11 @@ void OptionsModel::Init()
nTransactionFee = settings.value("nTransactionFee").toLongLong(); // if -paytxfee is set, this will be overridden later in init.cpp
if (mapArgs.count("-paytxfee"))
strOverriddenByCommandLine += "-paytxfee ";
+
+ if (!settings.contains("bSpendZeroConfChange"))
+ settings.setValue("bSpendZeroConfChange", true);
+ if (!SoftSetBoolArg("-spendzeroconfchange", settings.value("bSpendZeroConfChange").toBool()))
+ strOverriddenByCommandLine += "-spendzeroconfchange ";
#endif
if (!settings.contains("nDatabaseCache"))
@@ -184,6 +189,8 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
// Todo: Consider to revert back to use just nTransactionFee here, if we don't want
// -paytxfee to update our QSettings!
return settings.value("nTransactionFee");
+ case SpendZeroConfChange:
+ return settings.value("bSpendZeroConfChange");
#endif
case DisplayUnit:
return nDisplayUnit;
@@ -274,6 +281,12 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
settings.setValue("nTransactionFee", (qint64)nTransactionFee);
emit transactionFeeChanged(nTransactionFee);
break;
+ case SpendZeroConfChange:
+ if (settings.value("bSpendZeroConfChange") != value) {
+ settings.setValue("bSpendZeroConfChange", value);
+ setRestartRequired(true);
+ }
+ break;
#endif
case DisplayUnit:
nDisplayUnit = value.toInt();
diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h
index e5c1e3e8b9..a3487ddd2e 100644
--- a/src/qt/optionsmodel.h
+++ b/src/qt/optionsmodel.h
@@ -40,6 +40,7 @@ public:
CoinControlFeatures, // bool
ThreadsScriptVerif, // int
DatabaseCache, // int
+ SpendZeroConfChange, // bool
OptionIDRowCount,
};