]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/new_gui.cxx
Launcher: Maintain aircraft selection better
[flightgear.git] / src / GUI / new_gui.cxx
index d679c44c94e5037912c86afa7b12851f7a374cf3..bb8eb52dba624941d88c664b9c1f198935811ff4 100644 (file)
 #include "FGCocoaMenuBar.hxx"
 #endif
 
+#if defined(SG_WINDOWS)
+#include "FGWindowsMenuBar.hxx"
+#endif
+
 #include "FGPUIDialog.hxx"
 #include "FGFontCache.hxx"
 #include "FGColor.hxx"
@@ -84,6 +88,12 @@ NewGUI::init ()
 void
 NewGUI::shutdown()
 {
+    DialogDict::iterator it = _active_dialogs.begin();
+    for (; it != _active_dialogs.end(); ++it) {
+        delete it->second;
+    }
+    _active_dialogs.clear();
+    
     fgUntie("/sim/menubar/visibility");
     _menubar.reset();
     _dialog_props.clear();
@@ -109,6 +119,13 @@ NewGUI::createMenuBarImplementation()
     if (fgGetBool("/sim/menubar/native", true)) {
         _menubar.reset(new FGCocoaMenuBar);
     }
+#endif
+#if defined(SG_WINDOWS)
+       if (fgGetBool("/sim/menubar/native", true)) {
+       // Windows-native menubar disabled for the moment, fall-through
+       // to PUI version
+   //     _menubar.reset(new FGWindowsMenuBar);
+    }
 #endif
     if (!_menubar.get()) {
         _menubar.reset(new FGPUIMenuBar);
@@ -118,7 +135,7 @@ NewGUI::createMenuBarImplementation()
 void
 NewGUI::reset (bool reload)
 {
-    map<string,FGDialog *>::iterator iter;
+    DialogDict::iterator iter;
     string_list openDialogs;
     // close all open dialogs and remember them ...
     for (iter = _active_dialogs.begin(); iter != _active_dialogs.end(); ++iter)
@@ -398,7 +415,7 @@ NewGUI::setStyle (void)
 void
 NewGUI::setupFont (SGPropertyNode *node)
 {
-    _font = globals->get_fontcache()->get(node);
+    _font = FGFontCache::instance()->get(node);
     puSetDefaultFonts(*_font, *_font);
     return;
 }