mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-12 04:42:36 -03:00
Merge pull request #4524
49d5712
qt: Ignore showNormalIfMinimized in initialization or shutdown (Wladimir J. van der Laan)
This commit is contained in:
commit
d4bed1a6d3
3 changed files with 5 additions and 9 deletions
|
@ -179,13 +179,13 @@ void HandleSIGHUP(int)
|
||||||
|
|
||||||
bool static InitError(const std::string &str)
|
bool static InitError(const std::string &str)
|
||||||
{
|
{
|
||||||
uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_ERROR | CClientUIInterface::NOSHOWGUI);
|
uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_ERROR);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool static InitWarning(const std::string &str)
|
bool static InitWarning(const std::string &str)
|
||||||
{
|
{
|
||||||
uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_WARNING | CClientUIInterface::NOSHOWGUI);
|
uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_WARNING);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -783,11 +783,7 @@ void BitcoinGUI::message(const QString &title, const QString &message, unsigned
|
||||||
if (!(buttons = (QMessageBox::StandardButton)(style & CClientUIInterface::BTN_MASK)))
|
if (!(buttons = (QMessageBox::StandardButton)(style & CClientUIInterface::BTN_MASK)))
|
||||||
buttons = QMessageBox::Ok;
|
buttons = QMessageBox::Ok;
|
||||||
|
|
||||||
// Ensure we get users attention, but only if main window is visible
|
showNormalIfMinimized();
|
||||||
// as we don't want to pop up the main window for messages that happen before
|
|
||||||
// initialization is finished.
|
|
||||||
if(!(style & CClientUIInterface::NOSHOWGUI))
|
|
||||||
showNormalIfMinimized();
|
|
||||||
QMessageBox mBox((QMessageBox::Icon)nMBoxIcon, strTitle, message, buttons, this);
|
QMessageBox mBox((QMessageBox::Icon)nMBoxIcon, strTitle, message, buttons, this);
|
||||||
int r = mBox.exec();
|
int r = mBox.exec();
|
||||||
if (ret != NULL)
|
if (ret != NULL)
|
||||||
|
@ -924,6 +920,8 @@ void BitcoinGUI::setEncryptionStatus(int status)
|
||||||
|
|
||||||
void BitcoinGUI::showNormalIfMinimized(bool fToggleHidden)
|
void BitcoinGUI::showNormalIfMinimized(bool fToggleHidden)
|
||||||
{
|
{
|
||||||
|
if(!clientModel)
|
||||||
|
return;
|
||||||
// activateWindow() (sometimes) helps with keyboard focus on Windows
|
// activateWindow() (sometimes) helps with keyboard focus on Windows
|
||||||
if (isHidden())
|
if (isHidden())
|
||||||
{
|
{
|
||||||
|
|
|
@ -63,8 +63,6 @@ public:
|
||||||
|
|
||||||
/** Force blocking, modal message box dialog (not just OS notification) */
|
/** Force blocking, modal message box dialog (not just OS notification) */
|
||||||
MODAL = 0x10000000U,
|
MODAL = 0x10000000U,
|
||||||
/** Don't bring GUI to foreground. Use for messages during initialization */
|
|
||||||
NOSHOWGUI = 0x20000000U,
|
|
||||||
|
|
||||||
/** Predefined combinations for certain default usage cases */
|
/** Predefined combinations for certain default usage cases */
|
||||||
MSG_INFORMATION = ICON_INFORMATION,
|
MSG_INFORMATION = ICON_INFORMATION,
|
||||||
|
|
Loading…
Reference in a new issue