]> git.mxchange.org Git - flightgear.git/commitdiff
Read menu titles indirectly from specified property names so we can support
authorcurt <curt>
Tue, 1 Oct 2002 18:38:34 +0000 (18:38 +0000)
committercurt <curt>
Tue, 1 Oct 2002 18:38:34 +0000 (18:38 +0000)
translations.

src/GUI/gui.cxx

index 8dd66e826e327976d5c987012f499f6ad2180649..0a1a071ce2ebe682ded1a5077477279625877316 100644 (file)
@@ -117,14 +117,17 @@ void initMenu()
              SGPropertyNode *sep = option[i]->getNode("seperator");
 
              int pos = option.size()-i-1;
-             if (sep)
+             if (sep) {
                 Menu[h].submenu[pos] = strdup("----------");
-
-             else if (call && strcmp(call->getStringValue(), ""))
-                 Menu[h].submenu[pos] = strdup(name->getStringValue());
-
-             else
+             } else if (call && strcmp(call->getStringValue(), "")) {
+                 cout << name->getStringValue() << endl;
+                 string text = fgGetString( name->getStringValue(),
+                                        "/strings/null" );
+                 Menu[h].submenu[pos]
+                     = strdup(text.c_str());
+             } else {
                  Menu[h].submenu[pos] = strdup("not specified");
+             }
 
              Menu[h].cb[pos] = NULL;
              for (unsigned int j=0; __fg_gui_fn[j].fn; j++)
@@ -137,8 +140,11 @@ void initMenu()
          }
 
          SGPropertyNode *name = submenu[h]->getNode("name");
+         cout << name->getStringValue() << endl;
+         string text = fgGetString( name->getStringValue(),
+                                    "/strings/null" );
 
-         Menu[h].name = strdup(name->getStringValue());
+         Menu[h].name = strdup(text.c_str());
          mainMenuBar->add_submenu(Menu[h].name, Menu[h].submenu, Menu[h].cb);
 
     }