diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2013-11-12 14:54:43 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2013-11-13 09:22:00 +0100 |
commit | 146ba964e4b784171c29600e959a0fae3e2e0c03 (patch) | |
tree | c94ccf87d3a0386adc0e8b07ac35353995ad4e29 /src/qt/bitcoin.cpp | |
parent | e6b7e3dc79e91db7a9e20ec8fd593145f6c3ac41 (diff) | |
download | bitcoin-146ba964e4b784171c29600e959a0fae3e2e0c03.tar.xz |
qt: GUI support for -disablewallet mode
Diffstat (limited to 'src/qt/bitcoin.cpp')
-rw-r--r-- | src/qt/bitcoin.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 54f96f4426..57ce7da361 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -313,11 +313,16 @@ int main(int argc, char *argv[]) splash.finish(&window); ClientModel clientModel(&optionsModel); - WalletModel walletModel(pwalletMain, &optionsModel); + WalletModel *walletModel = 0; + if(pwalletMain) + walletModel = new WalletModel(pwalletMain, &optionsModel); window.setClientModel(&clientModel); - window.addWallet("~Default", &walletModel); - window.setCurrentWallet("~Default"); + if(walletModel) + { + window.addWallet("~Default", walletModel); + window.setCurrentWallet("~Default"); + } // If -min option passed, start window minimized. if(GetBoolArg("-min", false)) @@ -335,8 +340,11 @@ int main(int argc, char *argv[]) &window, SLOT(handlePaymentRequest(SendCoinsRecipient))); QObject::connect(&window, SIGNAL(receivedURI(QString)), paymentServer, SLOT(handleURIOrFile(QString))); - QObject::connect(&walletModel, SIGNAL(coinsSent(CWallet*,SendCoinsRecipient,QByteArray)), - paymentServer, SLOT(fetchPaymentACK(CWallet*,const SendCoinsRecipient&,QByteArray))); + if(walletModel) + { + QObject::connect(walletModel, SIGNAL(coinsSent(CWallet*,SendCoinsRecipient,QByteArray)), + paymentServer, SLOT(fetchPaymentACK(CWallet*,const SendCoinsRecipient&,QByteArray))); + } QObject::connect(paymentServer, SIGNAL(message(QString,QString,unsigned int)), guiref, SLOT(message(QString,QString,unsigned int))); QTimer::singleShot(100, paymentServer, SLOT(uiReady())); @@ -347,6 +355,7 @@ int main(int argc, char *argv[]) window.setClientModel(0); window.removeAllWallets(); guiref = 0; + delete walletModel; } // Shutdown the core and its threads, but don't exit Bitcoin-Qt here threadGroup.interrupt_all(); |