aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2012-02-20 08:56:41 -0800
committerWladimir J. van der Laan <laanwj@gmail.com>2012-02-20 08:56:41 -0800
commitf7b8f824de1f5d4671d2ba2ee4b823df00b4e0f6 (patch)
treeeb37fd644d899999c4a45205834ab9f3e548f017
parent7b88a617067e28ac1ab329257fc6d117453b1904 (diff)
parentbc5e6b9f21f1dd4703d286018b43fd0ea0f32186 (diff)
Merge pull request #857 from laanwj/2012_02_fixhelpwindow
On windows, show message box with help, as there is no stderr (fixes #702)
-rw-r--r--src/init.cpp5
-rw-r--r--src/qt/bitcoin.cpp16
2 files changed, 9 insertions, 12 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 2adfed2ebb..f09f044f16 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -249,7 +249,12 @@ bool AppInit2(int argc, char* argv[])
// Remove tabs
strUsage.erase(std::remove(strUsage.begin(), strUsage.end(), '\t'), strUsage.end());
+#if defined(QT_GUI) && defined(WIN32)
+ // On windows, show a message box, as there is no stderr
+ wxMessageBox(strUsage, "Usage");
+#else
fprintf(stderr, "%s", strUsage.c_str());
+#endif
return false;
}
diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp
index 20c185ed27..354e87c983 100644
--- a/src/qt/bitcoin.cpp
+++ b/src/qt/bitcoin.cpp
@@ -27,18 +27,10 @@ QSplashScreen *splashref;
int MyMessageBox(const std::string& message, const std::string& caption, int style, wxWindow* parent, int x, int y)
{
- // Message from main thread
- if(guiref)
- {
- guiref->error(QString::fromStdString(caption),
- QString::fromStdString(message));
- }
- else
- {
- QMessageBox::critical(0, QString::fromStdString(caption),
- QString::fromStdString(message),
- QMessageBox::Ok, QMessageBox::Ok);
- }
+ // Message from AppInit2(), always in main thread before main window is constructed
+ QMessageBox::critical(0, QString::fromStdString(caption),
+ QString::fromStdString(message),
+ QMessageBox::Ok, QMessageBox::Ok);
return 4;
}