aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-11-10 20:51:37 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2014-11-10 20:51:38 +0100
commit83f5daf2fe6e2f42c81576097f4084d2788b454b (patch)
tree289b96eafff753b964d23ada8576a6e603598305
parentaf3ec17f6794eeebb23f9089ae00edb030e5d619 (diff)
parentd52f07260582f7b1ffef05953bcc821bcee8af61 (diff)
Merge pull request #5245
d52f072 Don't show wallet options in the preferences menu when running with -disablewallet (sinetek)
-rw-r--r--src/qt/bitcoingui.cpp6
-rw-r--r--src/qt/bitcoingui.h1
-rw-r--r--src/qt/optionsdialog.cpp7
-rw-r--r--src/qt/optionsdialog.h2
4 files changed, 11 insertions, 5 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index 77cfdceef0..450b83a8c6 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -103,9 +103,9 @@ BitcoinGUI::BitcoinGUI(const NetworkStyle *networkStyle, QWidget *parent) :
QString windowTitle = tr("Bitcoin Core") + " - ";
#ifdef ENABLE_WALLET
/* if compiled with wallet support, -disablewallet can still disable the wallet */
- bool enableWallet = !GetBoolArg("-disablewallet", false);
+ enableWallet = !GetBoolArg("-disablewallet", false);
#else
- bool enableWallet = false;
+ enableWallet = false;
#endif // ENABLE_WALLET
if(enableWallet)
{
@@ -554,7 +554,7 @@ void BitcoinGUI::optionsClicked()
if(!clientModel || !clientModel->getOptionsModel())
return;
- OptionsDialog dlg(this);
+ OptionsDialog dlg(this, enableWallet);
dlg.setModel(clientModel->getOptionsModel());
dlg.exec();
}
diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h
index 35b36811c4..662ef9d9e8 100644
--- a/src/qt/bitcoingui.h
+++ b/src/qt/bitcoingui.h
@@ -64,6 +64,7 @@ public:
bool setCurrentWallet(const QString& name);
void removeAllWallets();
#endif // ENABLE_WALLET
+ bool enableWallet;
protected:
void changeEvent(QEvent *e);
diff --git a/src/qt/optionsdialog.cpp b/src/qt/optionsdialog.cpp
index 67be174d55..f5a0759c92 100644
--- a/src/qt/optionsdialog.cpp
+++ b/src/qt/optionsdialog.cpp
@@ -30,7 +30,7 @@
#include <QMessageBox>
#include <QTimer>
-OptionsDialog::OptionsDialog(QWidget *parent) :
+OptionsDialog::OptionsDialog(QWidget *parent, bool enableWallet) :
QDialog(parent),
ui(new Ui::OptionsDialog),
model(0),
@@ -66,6 +66,11 @@ OptionsDialog::OptionsDialog(QWidget *parent) :
ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->tabWindow));
#endif
+ /* remove Wallet tab in case of -disablewallet */
+ if (!enableWallet) {
+ ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->tabWallet));
+ }
+
/* Display elements init */
QDir translations(":translations");
ui->lang->addItem(QString("(") + tr("default") + QString(")"), QVariant(""));
diff --git a/src/qt/optionsdialog.h b/src/qt/optionsdialog.h
index 108609610d..794a39590c 100644
--- a/src/qt/optionsdialog.h
+++ b/src/qt/optionsdialog.h
@@ -24,7 +24,7 @@ class OptionsDialog : public QDialog
Q_OBJECT
public:
- explicit OptionsDialog(QWidget *parent);
+ explicit OptionsDialog(QWidget *parent, bool enableWallet);
~OptionsDialog();
void setModel(OptionsModel *model);