mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 21:12:48 +01:00
Merge pull request #857 from laanwj/2012_02_fixhelpwindow
On windows, show message box with help, as there is no stderr (fixes #702)
This commit is contained in:
commit
f7b8f824de
@ -249,7 +249,12 @@ bool AppInit2(int argc, char* argv[])
|
|||||||
|
|
||||||
// Remove tabs
|
// Remove tabs
|
||||||
strUsage.erase(std::remove(strUsage.begin(), strUsage.end(), '\t'), strUsage.end());
|
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());
|
fprintf(stderr, "%s", strUsage.c_str());
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,18 +27,10 @@ QSplashScreen *splashref;
|
|||||||
|
|
||||||
int MyMessageBox(const std::string& message, const std::string& caption, int style, wxWindow* parent, int x, int y)
|
int MyMessageBox(const std::string& message, const std::string& caption, int style, wxWindow* parent, int x, int y)
|
||||||
{
|
{
|
||||||
// Message from main thread
|
// Message from AppInit2(), always in main thread before main window is constructed
|
||||||
if(guiref)
|
|
||||||
{
|
|
||||||
guiref->error(QString::fromStdString(caption),
|
|
||||||
QString::fromStdString(message));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
QMessageBox::critical(0, QString::fromStdString(caption),
|
QMessageBox::critical(0, QString::fromStdString(caption),
|
||||||
QString::fromStdString(message),
|
QString::fromStdString(message),
|
||||||
QMessageBox::Ok, QMessageBox::Ok);
|
QMessageBox::Ok, QMessageBox::Ok);
|
||||||
}
|
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user