mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-17 08:06:59 +01:00
qt: GUI support for -disablewallet mode
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user