diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-08-26 17:38:11 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2014-08-26 17:39:16 +0200 |
commit | b9bd6282c5d1d8c72c8731df202b3e4f7d60f340 (patch) | |
tree | 671dc202d38f299fc5316a94c1fcb6de6172278b /src/qt/bitcoingui.cpp | |
parent | 3da58b216b5726461b45685aa99cab9deb78c6fd (diff) | |
parent | b197bf3270490068319d87e4b977b08f754a1307 (diff) |
Merge pull request #4649
b197bf3 [Qt] disable tray interactions when client model set to 0 (Philip Kaufmann)
314fbd9 [Qt] use BitcoinGUI::DEFAULT_WALLET constant in bitcoin.cpp (Philip Kaufmann)
8ca6a16 [Qt] ensure all class attributes are init to 0 (Philip Kaufmann)
Diffstat (limited to 'src/qt/bitcoingui.cpp')
-rw-r--r-- | src/qt/bitcoingui.cpp | 43 |
1 files changed, 36 insertions, 7 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index d0a5ff13c3..68d42ce64b 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -62,10 +62,35 @@ BitcoinGUI::BitcoinGUI(bool fIsTestnet, QWidget *parent) : QMainWindow(parent), clientModel(0), walletFrame(0), + unitDisplayControl(0), + labelEncryptionIcon(0), + labelConnectionsIcon(0), + labelBlocksIcon(0), + progressBarLabel(0), + progressBar(0), + progressDialog(0), + appMenuBar(0), + overviewAction(0), + historyAction(0), + quitAction(0), + sendCoinsAction(0), + usedSendingAddressesAction(0), + usedReceivingAddressesAction(0), + signMessageAction(0), + verifyMessageAction(0), + aboutAction(0), + receiveCoinsAction(0), + optionsAction(0), + toggleHideAction(0), encryptWalletAction(0), + backupWalletAction(0), changePassphraseAction(0), aboutQtAction(0), + openRPCConsoleAction(0), + openAction(0), + showHelpMessageAction(0), trayIcon(0), + trayIconMenu(0), notificator(0), rpcConsole(0), prevBlocks(0), @@ -426,8 +451,12 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel) walletFrame->setClientModel(clientModel); } #endif - - this->unitDisplayControl->setOptionsModel(clientModel->getOptionsModel()); + unitDisplayControl->setOptionsModel(clientModel->getOptionsModel()); + } else { + // Disable possibility to show main window via action + toggleHideAction->setEnabled(false); + // Disable context menu on tray icon + trayIconMenu->clear(); } } @@ -496,7 +525,6 @@ void BitcoinGUI::createTrayIcon(bool fIsTestnet) void BitcoinGUI::createTrayIconMenu() { - QMenu *trayIconMenu; #ifndef Q_OS_MAC // return if trayIcon is unset (only on non-Mac OSes) if (!trayIcon) @@ -537,7 +565,7 @@ void BitcoinGUI::trayIconActivated(QSystemTrayIcon::ActivationReason reason) if(reason == QSystemTrayIcon::Trigger) { // Click on system tray icon triggers show/hide of the main window - toggleHideAction->trigger(); + toggleHidden(); } } #endif @@ -923,6 +951,7 @@ void BitcoinGUI::showNormalIfMinimized(bool fToggleHidden) { if(!clientModel) return; + // activateWindow() (sometimes) helps with keyboard focus on Windows if (isHidden()) { @@ -1007,9 +1036,10 @@ void BitcoinGUI::unsubscribeFromCoreSignals() uiInterface.ThreadSafeMessageBox.disconnect(boost::bind(ThreadSafeMessageBox, this, _1, _2, _3)); } -UnitDisplayStatusBarControl::UnitDisplayStatusBarControl():QLabel() +UnitDisplayStatusBarControl::UnitDisplayStatusBarControl() : + optionsModel(0), + menu(0) { - optionsModel = 0; createContextMenu(); setToolTip(tr("Unit to show amounts in. Click to select another unit.")); } @@ -1069,4 +1099,3 @@ void UnitDisplayStatusBarControl::onMenuSelection(QAction* action) optionsModel->setDisplayUnit(action->data()); } } - |