]> git.mxchange.org Git - flightgear.git/commitdiff
Move the PUI dialog code to James' new messagebox code and use that one instead for...
authorErik Hofman <erik@ehofman.com>
Thu, 21 Jul 2016 06:56:05 +0000 (08:56 +0200)
committerRoland Haeder <roland@mxchange.org>
Thu, 22 Sep 2016 21:27:48 +0000 (23:27 +0200)
src/GUI/MessageBox.cxx
src/Main/main.cxx

index f4bdf69903bcea508816a80d1ee37fedd789ec3d..856e15a2755a90630a77ffb1cc87bb2e9bffd737 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <Main/globals.hxx>
 #include <Viewer/renderer.hxx>
+#include <GUI/new_gui.hxx>
 
 #include <osgViewer/Viewer>
 
@@ -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
 }
index d7cec3d7bc175fcc4f048abb4c7708a3da7d501a..d66d8adfe82dd71f08ff24720ce818d5e7e802e6 100644 (file)
@@ -64,7 +64,6 @@ extern bool global_crashRptEnabled;
 #include <Time/TimeManager.hxx>
 #include <GUI/gui.h>
 #include <GUI/MessageBox.hxx>
-#include <GUI/new_gui.hxx>
 #include <Viewer/splash.hxx>
 #include <Viewer/renderer.hxx>
 #include <Viewer/WindowSystemAdapter.hxx>
@@ -105,11 +104,8 @@ static void fgMainLoop( void )
 {
 
     if (sglog().has_popup()) {
-        NewGUI* _gui = (NewGUI *)globals->get_subsystem("gui");
-        SGPropertyNode_ptr dlg = _gui->getDialogProperties("popup");
         std::string s = sglog().get_popup();
-        dlg->setStringValue("text/label", s );
-        _gui->showDialog("popup");
+        flightgear::modalMessageBox("Alert", s, "");
     }
 
     frame_signal->fireValueChanged();