Browse Source

Don't show wallet options in the preferences menu when running with -disablewallet

0.10
sinetek 10 years ago committed by Wladimir J. van der Laan
parent
commit
d52f072605
  1. 6
      src/qt/bitcoingui.cpp
  2. 1
      src/qt/bitcoingui.h
  3. 7
      src/qt/optionsdialog.cpp
  4. 2
      src/qt/optionsdialog.h

6
src/qt/bitcoingui.cpp

@ -103,9 +103,9 @@ BitcoinGUI::BitcoinGUI(const NetworkStyle *networkStyle, QWidget *parent) : @@ -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() @@ -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();
}

1
src/qt/bitcoingui.h

@ -64,6 +64,7 @@ public: @@ -64,6 +64,7 @@ public:
bool setCurrentWallet(const QString& name);
void removeAllWallets();
#endif // ENABLE_WALLET
bool enableWallet;
protected:
void changeEvent(QEvent *e);

7
src/qt/optionsdialog.cpp

@ -30,7 +30,7 @@ @@ -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) : @@ -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(""));

2
src/qt/optionsdialog.h

@ -24,7 +24,7 @@ class OptionsDialog : public QDialog @@ -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);

Loading…
Cancel
Save