GUI for --disable-wallet compiles and -disablewallet mode

There is not much in the GUI to be done without wallet,
though it's possible to change options, watch the sync process,
and use the debug console.

So embed the debug console in the main window.
This commit is contained in:
Wladimir J. van der Laan
2013-12-11 15:00:56 +01:00
parent ec41342e3d
commit b7f4b6d35d
8 changed files with 243 additions and 77 deletions

View File

@@ -14,8 +14,10 @@
#include "init.h"
#include "main.h"
#include "net.h"
#ifdef ENABLE_WALLET
#include "wallet.h"
#include "walletdb.h"
#endif
#include <QSettings>
#include <QStringList>
@@ -67,8 +69,10 @@ void OptionsModel::Init()
// by command-line and show this in the UI.
// Main
#ifdef ENABLE_WALLET
if (!settings.contains("nTransactionFee"))
settings.setValue("nTransactionFee", 0);
#endif
if (!settings.contains("nDatabaseCache"))
settings.setValue("nDatabaseCache", 25);
@@ -137,6 +141,7 @@ void OptionsModel::Upgrade()
settings.setValue("bImportFinished", true);
#ifdef ENABLE_WALLET
// Move settings from old wallet.dat (if any):
CWalletDB walletdb(strWalletFile);
@@ -181,6 +186,7 @@ void OptionsModel::Upgrade()
walletdb.EraseSetting("addrProxy");
}
}
#endif
Init();
}
@@ -227,6 +233,7 @@ QVariant OptionsModel::data(const QModelIndex & index, int role) const
case ProxySocksVersion:
return settings.value("nSocksVersion", 5);
#ifdef ENABLE_WALLET
case Fee:
// Attention: Init() is called before nTransactionFee is set in AppInit2()!
// To ensure we can change the fee on-the-fly update our QSetting when
@@ -236,6 +243,7 @@ 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");
#endif
case DisplayUnit:
return nDisplayUnit;
case DisplayAddresses:
@@ -318,13 +326,14 @@ bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, in
}
}
break;
#ifdef ENABLE_WALLET
case Fee: // core option - can be changed on-the-fly
// Todo: Add is valid check and warn via message, if not
nTransactionFee = value.toLongLong();
settings.setValue("nTransactionFee", (qint64)nTransactionFee);
emit transactionFeeChanged(nTransactionFee);
break;
#endif
case DisplayUnit:
nDisplayUnit = value.toInt();
settings.setValue("nDisplayUnit", nDisplayUnit);