]> git.mxchange.org Git - flightgear.git/commitdiff
Show a popup dialog for every SG_POPUP message in the queue
authorErik Hofman <erik@ehofman.com>
Wed, 20 Jul 2016 13:03:15 +0000 (15:03 +0200)
committerRoland Haeder <roland@mxchange.org>
Thu, 22 Sep 2016 21:27:48 +0000 (23:27 +0200)
src/FDM/JSBSim/JSBSim.cxx
src/Main/fg_props.cxx
src/Main/main.cxx

index 89b96e48cf1a9c5ef0df4142502f2c0ddd862309..4e33296d182f5e34d204614e9cc54a6562d5f4c8 100644 (file)
@@ -185,6 +185,7 @@ FGJSBsim::FGJSBsim( double dt )
         case SG_INFO:
         case SG_WARN:
         case SG_ALERT:
+        case SG_POPUP:
             FGJSBBase::debug_lvl = 0x00;
             break;
         }
index 975a8a48cfe5dc4fa7923bdd1e2d795d45b955bc..e4bff808cdd79310df2b53f0d60f3ec56d894384 100644 (file)
@@ -178,6 +178,7 @@ getLoggingPriority ()
   case SG_WARN:
     return "warn";
   case SG_ALERT:
+  case SG_POPUP:
     return "alert";
   default:
     SG_LOG(SG_GENERAL, SG_WARN, "Internal: Unknown logging priority number: "
index 4e77b941cbd4d083097efc0354af474bbd4fbade..d7cec3d7bc175fcc4f048abb4c7708a3da7d501a 100644 (file)
@@ -64,6 +64,7 @@ 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>
@@ -102,6 +103,15 @@ static TimeManager* timeMgr;
 // for the next move and update the display?
 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");
+    }
+
     frame_signal->fireValueChanged();
 
     // compute simulated time (allowing for pause, warp, etc) and