Browse Source

Do show/showNormal only when needed.

0.8
Wladimir J. van der Laan 13 years ago
parent
commit
17690ea5a7
  1. 22
      src/qt/bitcoingui.cpp
  2. 3
      src/qt/bitcoingui.h

22
src/qt/bitcoingui.cpp

@ -205,17 +205,17 @@ void BitcoinGUI::createActions()
#endif #endif
tabGroup->addAction(messageAction); 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(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(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(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(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(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())); connect(messageAction, SIGNAL(triggered()), this, SLOT(gotoMessagePage()));
quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this); 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(optionsAction, SIGNAL(triggered()), this, SLOT(optionsClicked()));
connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked())); connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked()));
connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt())); 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(encryptWalletAction, SIGNAL(triggered(bool)), this, SLOT(encryptWallet(bool)));
connect(changePassphraseAction, SIGNAL(triggered()), this, SLOT(changePassphrase())); connect(changePassphraseAction, SIGNAL(triggered()), this, SLOT(changePassphrase()));
} }
@ -788,3 +788,11 @@ void BitcoinGUI::unlockWallet()
dlg.exec(); dlg.exec();
} }
} }
void BitcoinGUI::showNormalIfMinimized()
{
if(!isVisible()) // Show, if hidden
show();
if(isMinimized()) // Unminimize, if minimized
showNormal();
}

3
src/qt/bitcoingui.h

@ -162,6 +162,9 @@ private slots:
void changePassphrase(); void changePassphrase();
/** Ask for pass phrase to unlock wallet temporarily */ /** Ask for pass phrase to unlock wallet temporarily */
void unlockWallet(); void unlockWallet();
/** Show window if hidden, unminimize when minimized */
void showNormalIfMinimized();
}; };
#endif #endif

Loading…
Cancel
Save