|
|
@ -75,7 +75,7 @@ const std::string BitcoinGUI::DEFAULT_UIPLATFORM = |
|
|
|
|
|
|
|
|
|
|
|
const QString BitcoinGUI::DEFAULT_WALLET = "~Default"; |
|
|
|
const QString BitcoinGUI::DEFAULT_WALLET = "~Default"; |
|
|
|
|
|
|
|
|
|
|
|
BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *networkStyle, QWidget *parent) : |
|
|
|
BitcoinGUI::BitcoinGUI(const PlatformStyle *_platformStyle, const NetworkStyle *networkStyle, QWidget *parent) : |
|
|
|
QMainWindow(parent), |
|
|
|
QMainWindow(parent), |
|
|
|
enableWallet(false), |
|
|
|
enableWallet(false), |
|
|
|
clientModel(0), |
|
|
|
clientModel(0), |
|
|
@ -117,7 +117,7 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *n |
|
|
|
helpMessageDialog(0), |
|
|
|
helpMessageDialog(0), |
|
|
|
prevBlocks(0), |
|
|
|
prevBlocks(0), |
|
|
|
spinnerFrame(0), |
|
|
|
spinnerFrame(0), |
|
|
|
platformStyle(platformStyle) |
|
|
|
platformStyle(_platformStyle) |
|
|
|
{ |
|
|
|
{ |
|
|
|
GUIUtil::restoreWindowGeometry("nWindow", QSize(850, 550), this); |
|
|
|
GUIUtil::restoreWindowGeometry("nWindow", QSize(850, 550), this); |
|
|
|
|
|
|
|
|
|
|
@ -146,13 +146,13 @@ BitcoinGUI::BitcoinGUI(const PlatformStyle *platformStyle, const NetworkStyle *n |
|
|
|
setUnifiedTitleAndToolBarOnMac(true); |
|
|
|
setUnifiedTitleAndToolBarOnMac(true); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
rpcConsole = new RPCConsole(platformStyle, 0); |
|
|
|
rpcConsole = new RPCConsole(_platformStyle, 0); |
|
|
|
helpMessageDialog = new HelpMessageDialog(this, false); |
|
|
|
helpMessageDialog = new HelpMessageDialog(this, false); |
|
|
|
#ifdef ENABLE_WALLET |
|
|
|
#ifdef ENABLE_WALLET |
|
|
|
if(enableWallet) |
|
|
|
if(enableWallet) |
|
|
|
{ |
|
|
|
{ |
|
|
|
/** Create wallet frame and make it the central widget */ |
|
|
|
/** Create wallet frame and make it the central widget */ |
|
|
|
walletFrame = new WalletFrame(platformStyle, this); |
|
|
|
walletFrame = new WalletFrame(_platformStyle, this); |
|
|
|
setCentralWidget(walletFrame); |
|
|
|
setCentralWidget(walletFrame); |
|
|
|
} else |
|
|
|
} else |
|
|
|
#endif // ENABLE_WALLET
|
|
|
|
#endif // ENABLE_WALLET
|
|
|
@ -449,38 +449,38 @@ void BitcoinGUI::createToolBars() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void BitcoinGUI::setClientModel(ClientModel *clientModel) |
|
|
|
void BitcoinGUI::setClientModel(ClientModel *_clientModel) |
|
|
|
{ |
|
|
|
{ |
|
|
|
this->clientModel = clientModel; |
|
|
|
this->clientModel = _clientModel; |
|
|
|
if(clientModel) |
|
|
|
if(_clientModel) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Create system tray menu (or setup the dock menu) that late to prevent users from calling actions,
|
|
|
|
// Create system tray menu (or setup the dock menu) that late to prevent users from calling actions,
|
|
|
|
// while the client has not yet fully loaded
|
|
|
|
// while the client has not yet fully loaded
|
|
|
|
createTrayIconMenu(); |
|
|
|
createTrayIconMenu(); |
|
|
|
|
|
|
|
|
|
|
|
// Keep up to date with client
|
|
|
|
// Keep up to date with client
|
|
|
|
setNumConnections(clientModel->getNumConnections()); |
|
|
|
setNumConnections(_clientModel->getNumConnections()); |
|
|
|
connect(clientModel, SIGNAL(numConnectionsChanged(int)), this, SLOT(setNumConnections(int))); |
|
|
|
connect(_clientModel, SIGNAL(numConnectionsChanged(int)), this, SLOT(setNumConnections(int))); |
|
|
|
|
|
|
|
|
|
|
|
setNumBlocks(clientModel->getNumBlocks(), clientModel->getLastBlockDate(), clientModel->getVerificationProgress(NULL), false); |
|
|
|
setNumBlocks(_clientModel->getNumBlocks(), _clientModel->getLastBlockDate(), _clientModel->getVerificationProgress(NULL), false); |
|
|
|
connect(clientModel, SIGNAL(numBlocksChanged(int,QDateTime,double,bool)), this, SLOT(setNumBlocks(int,QDateTime,double,bool))); |
|
|
|
connect(_clientModel, SIGNAL(numBlocksChanged(int,QDateTime,double,bool)), this, SLOT(setNumBlocks(int,QDateTime,double,bool))); |
|
|
|
|
|
|
|
|
|
|
|
// Receive and report messages from client model
|
|
|
|
// Receive and report messages from client model
|
|
|
|
connect(clientModel, SIGNAL(message(QString,QString,unsigned int)), this, SLOT(message(QString,QString,unsigned int))); |
|
|
|
connect(_clientModel, SIGNAL(message(QString,QString,unsigned int)), this, SLOT(message(QString,QString,unsigned int))); |
|
|
|
|
|
|
|
|
|
|
|
// Show progress dialog
|
|
|
|
// Show progress dialog
|
|
|
|
connect(clientModel, SIGNAL(showProgress(QString,int)), this, SLOT(showProgress(QString,int))); |
|
|
|
connect(_clientModel, SIGNAL(showProgress(QString,int)), this, SLOT(showProgress(QString,int))); |
|
|
|
|
|
|
|
|
|
|
|
rpcConsole->setClientModel(clientModel); |
|
|
|
rpcConsole->setClientModel(_clientModel); |
|
|
|
#ifdef ENABLE_WALLET |
|
|
|
#ifdef ENABLE_WALLET |
|
|
|
if(walletFrame) |
|
|
|
if(walletFrame) |
|
|
|
{ |
|
|
|
{ |
|
|
|
walletFrame->setClientModel(clientModel); |
|
|
|
walletFrame->setClientModel(_clientModel); |
|
|
|
} |
|
|
|
} |
|
|
|
#endif // ENABLE_WALLET
|
|
|
|
#endif // ENABLE_WALLET
|
|
|
|
unitDisplayControl->setOptionsModel(clientModel->getOptionsModel()); |
|
|
|
unitDisplayControl->setOptionsModel(_clientModel->getOptionsModel()); |
|
|
|
|
|
|
|
|
|
|
|
OptionsModel* optionsModel = clientModel->getOptionsModel(); |
|
|
|
OptionsModel* optionsModel = _clientModel->getOptionsModel(); |
|
|
|
if(optionsModel) |
|
|
|
if(optionsModel) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// be aware of the tray icon disable state change reported by the OptionsModel object.
|
|
|
|
// be aware of the tray icon disable state change reported by the OptionsModel object.
|
|
|
@ -1168,17 +1168,17 @@ void UnitDisplayStatusBarControl::createContextMenu() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** Lets the control know about the Options Model (and its signals) */ |
|
|
|
/** Lets the control know about the Options Model (and its signals) */ |
|
|
|
void UnitDisplayStatusBarControl::setOptionsModel(OptionsModel *optionsModel) |
|
|
|
void UnitDisplayStatusBarControl::setOptionsModel(OptionsModel *_optionsModel) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (optionsModel) |
|
|
|
if (_optionsModel) |
|
|
|
{ |
|
|
|
{ |
|
|
|
this->optionsModel = optionsModel; |
|
|
|
this->optionsModel = _optionsModel; |
|
|
|
|
|
|
|
|
|
|
|
// be aware of a display unit change reported by the OptionsModel object.
|
|
|
|
// be aware of a display unit change reported by the OptionsModel object.
|
|
|
|
connect(optionsModel,SIGNAL(displayUnitChanged(int)),this,SLOT(updateDisplayUnit(int))); |
|
|
|
connect(_optionsModel,SIGNAL(displayUnitChanged(int)),this,SLOT(updateDisplayUnit(int))); |
|
|
|
|
|
|
|
|
|
|
|
// initialize the display units label with the current value in the model.
|
|
|
|
// initialize the display units label with the current value in the model.
|
|
|
|
updateDisplayUnit(optionsModel->getDisplayUnit()); |
|
|
|
updateDisplayUnit(_optionsModel->getDisplayUnit()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|