aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/optionsdialog.cpp6
-rw-r--r--src/qt/optionsmodel.cpp9
-rw-r--r--src/qt/optionsmodel.h3
3 files changed, 17 insertions, 1 deletions
diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp
index 8233e42c25..59c44ac5f9 100644
--- a/src/qt/optionsdialog.cpp
+++ b/src/qt/optionsdialog.cpp
@@ -38,6 +38,7 @@ private:
QCheckBox *minimize_on_close;
#endif
QCheckBox *connect_socks4;
+ QCheckBox *detach_database;
QLineEdit *proxy_ip;
QLineEdit *proxy_port;
BitcoinAmountField *fee_edit;
@@ -229,6 +230,10 @@ MainOptionsPage::MainOptionsPage(QWidget *parent):
layout->addLayout(fee_hbox);
+ detach_database = new QCheckBox(tr("Detach databases at shutdown"));
+ detach_database->setToolTip(tr("Detach block and address databases at shutdown. This means they can be moved to another data directory, but it slows down shutdown. The wallet is always detached."));
+ layout->addWidget(detach_database);
+
layout->addStretch(1); // Extra space at bottom
setLayout(layout);
@@ -256,6 +261,7 @@ void MainOptionsPage::setMapper(MonitoredDataMapper *mapper)
mapper->addMapping(proxy_ip, OptionsModel::ProxyIP);
mapper->addMapping(proxy_port, OptionsModel::ProxyPort);
mapper->addMapping(fee_edit, OptionsModel::Fee);
+ mapper->addMapping(detach_database, OptionsModel::DetachDatabases);
}
DisplayOptionsPage::DisplayOptionsPage(QWidget *parent):
diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp
index 2210c4dd76..5bba308cf2 100644
--- a/src/qt/optionsmodel.cpp
+++ b/src/qt/optionsmodel.cpp
@@ -28,6 +28,8 @@ void OptionsModel::Init()
SoftSetBoolArg("-upnp", settings.value("fUseUPnP").toBool());
if (settings.contains("addrProxy") && settings.value("fUseProxy").toBool())
SoftSetArg("-proxy", settings.value("addrProxy").toString().toStdString());
+ if (settings.contains("detachDB"))
+ SoftSetBoolArg("-detachdb", settings.value("detachDB").toBool());
}
bool OptionsModel::Upgrade()
@@ -121,6 +123,8 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
return QVariant(nDisplayUnit);
case DisplayAddresses:
return QVariant(bDisplayAddresses);
+ case DetachDatabases:
+ return QVariant(fDetachDB);
default:
return QVariant();
}
@@ -204,6 +208,11 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
settings.setValue("bDisplayAddresses", bDisplayAddresses);
}
break;
+ case DetachDatabases: {
+ fDetachDB = value.toBool();
+ settings.setValue("detachDB", fDetachDB);
+ }
+ break;
default:
break;
}
diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h
index 0be70f8935..da4e86f104 100644
--- a/src/qt/optionsmodel.h
+++ b/src/qt/optionsmodel.h
@@ -26,7 +26,8 @@ public:
Fee, // qint64
DisplayUnit, // BitcoinUnits::Unit
DisplayAddresses, // bool
- OptionIDRowCount
+ DetachDatabases, // bool
+ OptionIDRowCount,
};
void Init();