1
0
Fork 0

Show a popup dialog for every SG_POPUP message in the queue

This commit is contained in:
Erik Hofman 2016-07-20 15:03:15 +02:00
parent e30c886068
commit 5ab2d82c89
3 changed files with 12 additions and 0 deletions

View file

@ -185,6 +185,7 @@ FGJSBsim::FGJSBsim( double dt )
case SG_INFO: case SG_INFO:
case SG_WARN: case SG_WARN:
case SG_ALERT: case SG_ALERT:
case SG_POPUP:
FGJSBBase::debug_lvl = 0x00; FGJSBBase::debug_lvl = 0x00;
break; break;
} }

View file

@ -178,6 +178,7 @@ getLoggingPriority ()
case SG_WARN: case SG_WARN:
return "warn"; return "warn";
case SG_ALERT: case SG_ALERT:
case SG_POPUP:
return "alert"; return "alert";
default: default:
SG_LOG(SG_GENERAL, SG_WARN, "Internal: Unknown logging priority number: " SG_LOG(SG_GENERAL, SG_WARN, "Internal: Unknown logging priority number: "

View file

@ -64,6 +64,7 @@ extern bool global_crashRptEnabled;
#include <Time/TimeManager.hxx> #include <Time/TimeManager.hxx>
#include <GUI/gui.h> #include <GUI/gui.h>
#include <GUI/MessageBox.hxx> #include <GUI/MessageBox.hxx>
#include <GUI/new_gui.hxx>
#include <Viewer/splash.hxx> #include <Viewer/splash.hxx>
#include <Viewer/renderer.hxx> #include <Viewer/renderer.hxx>
#include <Viewer/WindowSystemAdapter.hxx> #include <Viewer/WindowSystemAdapter.hxx>
@ -102,6 +103,15 @@ static TimeManager* timeMgr;
// for the next move and update the display? // for the next move and update the display?
static void fgMainLoop( void ) 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(); frame_signal->fireValueChanged();
// compute simulated time (allowing for pause, warp, etc) and // compute simulated time (allowing for pause, warp, etc) and