diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2012-02-17 23:19:52 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2012-02-17 23:19:52 +0100 |
commit | 17690ea5a74005bd8c9e99702f75d690e70c7b2f (patch) | |
tree | 8e403fe9b39d67b5616d515bd9640daf522c6aa3 /src/qt | |
parent | 83d1d1a90603c6d063d176a3d5efdeb1074b0fe4 (diff) |
Do show/showNormal only when needed.
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/bitcoingui.cpp | 22 | ||||
-rw-r--r-- | src/qt/bitcoingui.h | 3 |
2 files changed, 18 insertions, 7 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index a3b4fd2a82..3d6d7d7344 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -205,17 +205,17 @@ void BitcoinGUI::createActions() #endif tabGroup->addAction(messageAction); - connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormal())); + connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage())); - connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormal())); + connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage())); - connect(addressBookAction, SIGNAL(triggered()), this, SLOT(showNormal())); + connect(addressBookAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(addressBookAction, SIGNAL(triggered()), this, SLOT(gotoAddressBookPage())); - connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(showNormal())); + connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage())); - connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(showNormal())); + connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage())); - connect(messageAction, SIGNAL(triggered()), this, SLOT(showNormal())); + connect(messageAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(messageAction, SIGNAL(triggered()), this, SLOT(gotoMessagePage())); quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this); @@ -245,7 +245,7 @@ void BitcoinGUI::createActions() connect(optionsAction, SIGNAL(triggered()), this, SLOT(optionsClicked())); connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked())); connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt())); - connect(openBitcoinAction, SIGNAL(triggered()), this, SLOT(showNormal())); + connect(openBitcoinAction, SIGNAL(triggered()), this, SLOT(showNormalIfMinimized())); connect(encryptWalletAction, SIGNAL(triggered(bool)), this, SLOT(encryptWallet(bool))); connect(changePassphraseAction, SIGNAL(triggered()), this, SLOT(changePassphrase())); } @@ -788,3 +788,11 @@ void BitcoinGUI::unlockWallet() dlg.exec(); } } + +void BitcoinGUI::showNormalIfMinimized() +{ + if(!isVisible()) // Show, if hidden + show(); + if(isMinimized()) // Unminimize, if minimized + showNormal(); +} diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h index 09ad89a894..f996e6ba25 100644 --- a/src/qt/bitcoingui.h +++ b/src/qt/bitcoingui.h @@ -162,6 +162,9 @@ private slots: void changePassphrase(); /** Ask for pass phrase to unlock wallet temporarily */ void unlockWallet(); + + /** Show window if hidden, unminimize when minimized */ + void showNormalIfMinimized(); }; #endif |