Browse Source

Merge pull request #3427

1ad2636 qt: Prevent non-functional GUI from popping up during Init (Wladimir J. van der Laan)
0.10
Wladimir J. van der Laan 11 years ago
parent
commit
362755d018
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 4
      src/init.cpp
  2. 5
      src/qt/bitcoingui.cpp
  3. 2
      src/ui_interface.h

4
src/init.cpp

@ -164,13 +164,13 @@ void HandleSIGHUP(int)
bool static InitError(const std::string &str) bool static InitError(const std::string &str)
{ {
uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_ERROR); uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_ERROR | CClientUIInterface::NOSHOWGUI);
return false; return false;
} }
bool static InitWarning(const std::string &str) bool static InitWarning(const std::string &str)
{ {
uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_WARNING); uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_WARNING | CClientUIInterface::NOSHOWGUI);
return true; return true;
} }

5
src/qt/bitcoingui.cpp

@ -684,7 +684,10 @@ 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 // Ensure we get users attention, but only if main window is visible
// as we don't want to pop up the main window for messages that happen before
// initialization is finished.
if(!(style & CClientUIInterface::NOSHOWGUI))
showNormalIfMinimized(); 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();

2
src/ui_interface.h

@ -62,6 +62,8 @@ 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…
Cancel
Save