aboutsummaryrefslogtreecommitdiff
path: root/src/MenuCreator.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/MenuCreator.cc')
-rw-r--r--src/MenuCreator.cc34
1 files changed, 14 insertions, 20 deletions
diff --git a/src/MenuCreator.cc b/src/MenuCreator.cc
index 12bec82..4a72fae 100644
--- a/src/MenuCreator.cc
+++ b/src/MenuCreator.cc
@@ -20,7 +20,7 @@
20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21// DEALINGS IN THE SOFTWARE. 21// DEALINGS IN THE SOFTWARE.
22 22
23// $Id: MenuCreator.cc,v 1.15 2004/09/12 00:31:11 fluxgen Exp $ 23// $Id: MenuCreator.cc,v 1.16 2004/09/16 14:08:46 rathnor Exp $
24 24
25#include "MenuCreator.hh" 25#include "MenuCreator.hh"
26 26
@@ -278,24 +278,7 @@ static void translateMenuItem(Parser &parse, ParseItem &pitem) {
278 screen->saveMenu(*submenu); 278 screen->saveMenu(*submenu);
279 279
280 } // end of submenu 280 } // end of submenu
281 else if (str_key == "restart") { 281 else if (str_key == "stylesdir" || str_key == "stylesmenu") {
282 FbTk::RefCount<FbTk::Command> restart_fb(CommandParser::instance().
283 parseLine("restart"));
284 if (str_label.empty())
285 menu.insert(_FBTEXT(Menu, Restart, "Restart", "Restart Command"), restart_fb);
286 else
287 menu.insert(str_label.c_str(), restart_fb);
288 } // end of restart
289 else if (str_key == "reconfig") { // reconf
290 FbTk::RefCount<FbTk::Command>
291 reconfig_fb_cmd(CommandParser::instance().
292 parseLine("reconfigure"));
293 if (str_label.empty())
294 menu.insert(_FBTEXT(Menu, Reconfigure, "Reload Config", "Reload all the configs"), reconfig_fb_cmd);
295 else
296 menu.insert(str_label.c_str(), reconfig_fb_cmd);
297
298 } else if (str_key == "stylesdir" || str_key == "stylesmenu") {
299 createStyleMenu(menu, str_label, 282 createStyleMenu(menu, str_label,
300 str_key == "stylesmenu" ? str_cmd : str_label); 283 str_key == "stylesmenu" ? str_cmd : str_label);
301 } // end of stylesdir 284 } // end of stylesdir
@@ -321,8 +304,19 @@ static void translateMenuItem(Parser &parse, ParseItem &pitem) {
321 // we need to attach command with arguments so command parser can parse it 304 // we need to attach command with arguments so command parser can parse it
322 string line = str_key + " " + str_cmd; 305 string line = str_key + " " + str_cmd;
323 FbTk::RefCount<FbTk::Command> command(CommandParser::instance().parseLine(line)); 306 FbTk::RefCount<FbTk::Command> command(CommandParser::instance().parseLine(line));
324 if (*command != 0) 307 if (*command != 0) {
308 // special NLS default labels
309 if (str_label.empty()) {
310 if (str_key == "reconfig" || str_key == "reconfigure") {
311 menu.insert(_FBTEXT(Menu, Reconfigure, "Reload Config", "Reload all the configs"), command);
312 return;
313 } else if (str_key == "restart") {
314 menu.insert(_FBTEXT(Menu, Restart, "Restart", "Restart Command"), command);
315 return;
316 }
317 }
325 menu.insert(str_label.c_str(), command); 318 menu.insert(str_label.c_str(), command);
319 }
326 } 320 }
327 if (menu.numberOfItems() != 0) { 321 if (menu.numberOfItems() != 0) {
328 FbTk::MenuItem *item = menu.find(menu.numberOfItems() - 1); 322 FbTk::MenuItem *item = menu.find(menu.numberOfItems() - 1);