From 29d45073c969e20a36ee01c1beabace331cb8245 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sat, 15 Feb 2014 10:38:06 +0100 Subject: qt: Add option to (not) spend unconfirmed change - Add a wallet tab to options dialog - Move fee setting to wallet tab - Add new setting to set -nospendzeroconfchange from UI --- src/qt/optionsmodel.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/qt/optionsmodel.cpp') 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(); -- cgit v1.2.3