Read menu titles indirectly from specified property names so we can support
translations.
This commit is contained in:
parent
4fb56176ce
commit
8722af0eb8
1 changed files with 13 additions and 7 deletions
|
@ -117,14 +117,17 @@ void initMenu()
|
||||||
SGPropertyNode *sep = option[i]->getNode("seperator");
|
SGPropertyNode *sep = option[i]->getNode("seperator");
|
||||||
|
|
||||||
int pos = option.size()-i-1;
|
int pos = option.size()-i-1;
|
||||||
if (sep)
|
if (sep) {
|
||||||
Menu[h].submenu[pos] = strdup("----------");
|
Menu[h].submenu[pos] = strdup("----------");
|
||||||
|
} else if (call && strcmp(call->getStringValue(), "")) {
|
||||||
else if (call && strcmp(call->getStringValue(), ""))
|
cout << name->getStringValue() << endl;
|
||||||
Menu[h].submenu[pos] = strdup(name->getStringValue());
|
string text = fgGetString( name->getStringValue(),
|
||||||
|
"/strings/null" );
|
||||||
else
|
Menu[h].submenu[pos]
|
||||||
|
= strdup(text.c_str());
|
||||||
|
} else {
|
||||||
Menu[h].submenu[pos] = strdup("not specified");
|
Menu[h].submenu[pos] = strdup("not specified");
|
||||||
|
}
|
||||||
|
|
||||||
Menu[h].cb[pos] = NULL;
|
Menu[h].cb[pos] = NULL;
|
||||||
for (unsigned int j=0; __fg_gui_fn[j].fn; j++)
|
for (unsigned int j=0; __fg_gui_fn[j].fn; j++)
|
||||||
|
@ -137,8 +140,11 @@ void initMenu()
|
||||||
}
|
}
|
||||||
|
|
||||||
SGPropertyNode *name = submenu[h]->getNode("name");
|
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);
|
mainMenuBar->add_submenu(Menu[h].name, Menu[h].submenu, Menu[h].cb);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue