Browse Source

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

Conflicts:
	src/qt/optionsmodel.cpp
	src/qt/optionsmodel.h

Conflicts:
	src/qt/forms/optionsdialog.ui
	src/qt/optionsmodel.h

Rebased-from: 391cf691d5eee2934ed0e2e2b59bd99987c394a5 0.8.x
0.8
Wladimir J. van der Laan 11 years ago committed by Warren Togami
parent
commit
9b8b8075df
  1. 107
      src/qt/forms/optionsdialog.ui
  2. 5
      src/qt/optionsdialog.cpp
  3. 9
      src/qt/optionsmodel.cpp
  4. 1
      src/qt/optionsmodel.h

107
src/qt/forms/optionsdialog.ui

@ -30,6 +30,66 @@ @@ -30,6 +30,66 @@
<string>&amp;Main</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_Main">
<item>
<widget class="QCheckBox" name="bitcoinAtStartup">
<property name="toolTip">
<string>Automatically start Litecoin after logging in to the system.</string>
</property>
<property name="text">
<string>&amp;Start Litecoin on system login</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_Main">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2_Main">
<item>
<spacer name="horizontalSpacer_2_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>
<item>
<widget class="QPushButton" name="resetButton">
<property name="toolTip">
<string>Reset all client options to default.</string>
</property>
<property name="text">
<string>&amp;Reset Options</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</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">
@ -77,17 +137,24 @@ @@ -77,17 +137,24 @@
</layout>
</item>
<item>
<widget class="QCheckBox" name="bitcoinAtStartup">
<property name="toolTip">
<string>Automatically start Litecoin after logging in to the system.</string>
<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>&amp;Start Litecoin on system login</string>
<string>Spend unconfirmed change (experts only)</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_Main">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
@ -99,36 +166,6 @@ @@ -99,36 +166,6 @@
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2_Main">
<item>
<spacer name="horizontalSpacer_2_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>
<item>
<widget class="QPushButton" name="resetButton">
<property name="toolTip">
<string>Reset all client options to default.</string>
</property>
<property name="text">
<string>&amp;Reset Options</string>
</property>
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabNetwork">

5
src/qt/optionsdialog.cpp

@ -129,9 +129,12 @@ void OptionsDialog::setModel(OptionsModel *model) @@ -129,9 +129,12 @@ void OptionsDialog::setModel(OptionsModel *model)
void OptionsDialog::setMapper()
{
/* Main */
mapper->addMapping(ui->transactionFee, OptionsModel::Fee);
mapper->addMapping(ui->bitcoinAtStartup, OptionsModel::StartAtStartup);
/* Wallet */
mapper->addMapping(ui->transactionFee, OptionsModel::Fee);
mapper->addMapping(ui->spendZeroConfChange, OptionsModel::SpendZeroConfChange);
/* Network */
mapper->addMapping(ui->mapPortUpnp, OptionsModel::MapPortUPnP);

9
src/qt/optionsmodel.cpp

@ -51,6 +51,7 @@ void OptionsModel::Init() @@ -51,6 +51,7 @@ void OptionsModel::Init()
fMinimizeToTray = settings.value("fMinimizeToTray", false).toBool();
fMinimizeOnClose = settings.value("fMinimizeOnClose", false).toBool();
nTransactionFee = settings.value("nTransactionFee").toLongLong();
bSpendZeroConfChange = settings.value("bSpendZeroConfChange").toBool();
language = settings.value("language", "").toString();
fCoinControlFeatures = settings.value("fCoinControlFeatures", false).toBool();
@ -195,6 +196,8 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const @@ -195,6 +196,8 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
}
case Fee:
return QVariant(nTransactionFee);
case SpendZeroConfChange:
return bSpendZeroConfChange;
case DisplayUnit:
return QVariant(nDisplayUnit);
case DisplayAddresses:
@ -273,6 +276,12 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in @@ -273,6 +276,12 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
settings.setValue("nTransactionFee", nTransactionFee);
emit transactionFeeChanged(nTransactionFee);
break;
case SpendZeroConfChange:
if (settings.value("bSpendZeroConfChange") != value) {
bSpendZeroConfChange = value.toBool();
settings.setValue("bSpendZeroConfChange", value);
}
break;
case DisplayUnit:
nDisplayUnit = value.toInt();
settings.setValue("nDisplayUnit", nDisplayUnit);

1
src/qt/optionsmodel.h

@ -34,6 +34,7 @@ public: @@ -34,6 +34,7 @@ public:
DisplayAddresses, // bool
Language, // QString
CoinControlFeatures, // bool
SpendZeroConfChange, // bool
OptionIDRowCount,
};

Loading…
Cancel
Save