]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/new_gui.cxx
Melchior: Make line wrapping in textboxes configurable, and enable it by default
[flightgear.git] / src / GUI / new_gui.cxx
index 65bdd9add93196f0879de33b6a5cae9baae0917f..fce518055bbf85648093610d04729d5d3a5479e6 100644 (file)
@@ -185,8 +185,9 @@ NewGUI::newDialog (SGPropertyNode* props)
         SG_LOG(SG_GENERAL, SG_ALERT, "New dialog has no <name> property");
         return;
     }
-    string name = props->getStringValue("name");
-    _dialog_props[name] = props;
+    string name = cname;
+    if(!_active_dialogs[name])
+        _dialog_props[name] = props;
 }
 
 void
@@ -218,13 +219,18 @@ NewGUI::readDir (const char * path)
                 delete props;
                 continue;
             }
-            if (!props->hasValue("name")) {
+            SGPropertyNode *nameprop = props->getNode("name");
+            if (!nameprop) {
                 SG_LOG(SG_INPUT, SG_WARN, "dialog " << subpath
                    << " has no name; skipping.");
                 delete props;
                 continue;
             }
-            newDialog(props);
+            string name = nameprop->getStringValue();
+            if (_dialog_props[name])
+                delete (SGPropertyNode *)_dialog_props[name];
+
+            _dialog_props[name] = props;
         }
     }
     ulCloseDir(dir);