Reset: GUI can be shutdown.
This commit is contained in:
parent
e62a4f502a
commit
02a5261797
2 changed files with 22 additions and 11 deletions
|
@ -52,18 +52,10 @@ using std::string;
|
||||||
NewGUI::NewGUI () :
|
NewGUI::NewGUI () :
|
||||||
_active_dialog(0)
|
_active_dialog(0)
|
||||||
{
|
{
|
||||||
#if defined(SG_MAC)
|
|
||||||
if (fgGetBool("/sim/menubar/native", true)) {
|
|
||||||
_menubar.reset(new FGCocoaMenuBar);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
_menubar.reset(new FGPUIMenuBar);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NewGUI::~NewGUI ()
|
NewGUI::~NewGUI ()
|
||||||
{
|
{
|
||||||
_dialog_props.clear();
|
|
||||||
for (_itt_t it = _colors.begin(); it != _colors.end(); ++it)
|
for (_itt_t it = _colors.begin(); it != _colors.end(); ++it)
|
||||||
delete it->second;
|
delete it->second;
|
||||||
}
|
}
|
||||||
|
@ -71,6 +63,18 @@ NewGUI::~NewGUI ()
|
||||||
void
|
void
|
||||||
NewGUI::init ()
|
NewGUI::init ()
|
||||||
{
|
{
|
||||||
|
#if defined(SG_MAC)
|
||||||
|
if (fgGetBool("/sim/menubar/native", true)) {
|
||||||
|
_menubar.reset(new FGCocoaMenuBar);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (!_menubar.get()) {
|
||||||
|
_menubar.reset(new FGPUIMenuBar);
|
||||||
|
}
|
||||||
|
|
||||||
|
fgTie("/sim/menubar/visibility", this,
|
||||||
|
&NewGUI::getMenuBarVisible, &NewGUI::setMenuBarVisible);
|
||||||
|
|
||||||
setStyle();
|
setStyle();
|
||||||
SGPath p(globals->get_fg_root(), "gui/dialogs");
|
SGPath p(globals->get_fg_root(), "gui/dialogs");
|
||||||
readDir(p);
|
readDir(p);
|
||||||
|
@ -82,6 +86,14 @@ NewGUI::init ()
|
||||||
_menubar->init();
|
_menubar->init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
NewGUI::shutdown()
|
||||||
|
{
|
||||||
|
fgUntie("/sim/menubar/visibility");
|
||||||
|
_menubar.reset();
|
||||||
|
_dialog_props.clear();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
NewGUI::reinit ()
|
NewGUI::reinit ()
|
||||||
{
|
{
|
||||||
|
@ -132,14 +144,11 @@ NewGUI::reset (bool reload)
|
||||||
void
|
void
|
||||||
NewGUI::bind ()
|
NewGUI::bind ()
|
||||||
{
|
{
|
||||||
fgTie("/sim/menubar/visibility", this,
|
|
||||||
&NewGUI::getMenuBarVisible, &NewGUI::setMenuBarVisible);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
NewGUI::unbind ()
|
NewGUI::unbind ()
|
||||||
{
|
{
|
||||||
fgUntie("/sim/menubar/visibility");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -46,6 +46,8 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual void init ();
|
virtual void init ();
|
||||||
|
|
||||||
|
virtual void shutdown ();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reinitialize the GUI subsystem. Reloads all XML dialogs.
|
* Reinitialize the GUI subsystem. Reloads all XML dialogs.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue