From: Erik Hofman Date: Thu, 21 Jul 2016 06:56:05 +0000 (+0200) Subject: Move the PUI dialog code to James' new messagebox code and use that one instead for... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b32cfaf1d1cda6bcd691169d7817c9624b381890;p=flightgear.git Move the PUI dialog code to James' new messagebox code and use that one instead for SG_LOG_POPUP to get a native popup window if available and fall back to a PUI one if not --- diff --git a/src/GUI/MessageBox.cxx b/src/GUI/MessageBox.cxx index f4bdf6990..856e15a27 100644 --- a/src/GUI/MessageBox.cxx +++ b/src/GUI/MessageBox.cxx @@ -8,6 +8,7 @@ #include
#include +#include #include @@ -127,10 +128,16 @@ MessageBoxResult modalMessageBox(const std::string& caption, #elif defined(HAVE_QT) return QtMessageBox(caption, msg, moreText, false); #else - SG_LOG(SG_GENERAL, SG_ALERT, caption << ":" << msg); + std::string s = caption + ": "+ msg; if (!moreText.empty()) { - SG_LOG(SG_GENERAL, SG_ALERT, "(" << moreText << ")"); + s += "\n( " + moreText + ")"; } +// SG_LOG(SG_GENERAL, SG_ALERT, s); + + NewGUI* _gui = (NewGUI *)globals->get_subsystem("gui"); + SGPropertyNode_ptr dlg = _gui->getDialogProperties("popup"); + dlg->setStringValue("text/label", s ); + _gui->showDialog("popup"); return MSG_BOX_OK; #endif } diff --git a/src/Main/main.cxx b/src/Main/main.cxx index d7cec3d7b..d66d8adfe 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -64,7 +64,6 @@ extern bool global_crashRptEnabled; #include