diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/init.cpp | 4 | ||||
-rw-r--r-- | src/qt/bitcoingui.cpp | 7 | ||||
-rw-r--r-- | src/rpcdump.cpp | 2 | ||||
-rw-r--r-- | src/ui_interface.h | 2 |
4 files changed, 11 insertions, 4 deletions
diff --git a/src/init.cpp b/src/init.cpp index b5d784dc58..6b100ce148 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -164,13 +164,13 @@ void HandleSIGHUP(int) bool static InitError(const std::string &str) { - uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_ERROR); + uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_ERROR | CClientUIInterface::NOSHOWGUI); return false; } bool static InitWarning(const std::string &str) { - uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_WARNING); + uiInterface.ThreadSafeMessageBox(str, "", CClientUIInterface::MSG_WARNING | CClientUIInterface::NOSHOWGUI); return true; } diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 2d0f51a3fb..6be5a64015 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -684,8 +684,11 @@ void BitcoinGUI::message(const QString &title, const QString &message, unsigned if (!(buttons = (QMessageBox::StandardButton)(style & CClientUIInterface::BTN_MASK))) buttons = QMessageBox::Ok; - // Ensure we get users attention - showNormalIfMinimized(); + // 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(); QMessageBox mBox((QMessageBox::Icon)nMBoxIcon, strTitle, message, buttons, this); int r = mBox.exec(); if (ret != NULL) diff --git a/src/rpcdump.cpp b/src/rpcdump.cpp index 92f4c2c6dd..c801b284cb 100644 --- a/src/rpcdump.cpp +++ b/src/rpcdump.cpp @@ -86,6 +86,8 @@ Value importprivkey(const Array& params, bool fHelp) + HelpExampleRpc("importprivkey", "\"mykey\", \"testing\", false") ); + EnsureWalletIsUnlocked(); + string strSecret = params[0].get_str(); string strLabel = ""; if (params.size() > 1) diff --git a/src/ui_interface.h b/src/ui_interface.h index a14ed67814..677d097fa4 100644 --- a/src/ui_interface.h +++ b/src/ui_interface.h @@ -62,6 +62,8 @@ public: /** Force blocking, modal message box dialog (not just OS notification) */ MODAL = 0x10000000U, + /** Don't bring GUI to foreground. Use for messages during initialization */ + NOSHOWGUI = 0x20000000U, /** Predefined combinations for certain default usage cases */ MSG_INFORMATION = ICON_INFORMATION, |