diff options
author | markt <markt> | 2007-12-13 05:48:00 (GMT) |
---|---|---|
committer | markt <markt> | 2007-12-13 05:48:00 (GMT) |
commit | 8b7464046cea5e521ac46811591b0fce0c45aca1 (patch) | |
tree | 09df752f426a249ae15375a626a98436c8727593 /src/MenuCreator.cc | |
parent | daca07edafc2e75eb9ee04d35fe80759308a8583 (diff) | |
download | fluxbox-8b7464046cea5e521ac46811591b0fce0c45aca1.zip fluxbox-8b7464046cea5e521ac46811591b0fce0c45aca1.tar.bz2 |
added FbTk::CommandRegistry, decentralized command parsing, and made them auto-register
Diffstat (limited to 'src/MenuCreator.cc')
-rw-r--r-- | src/MenuCreator.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/MenuCreator.cc b/src/MenuCreator.cc index 8cc483a..b98287b 100644 --- a/src/MenuCreator.cc +++ b/src/MenuCreator.cc | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #include "defaults.hh" | 27 | #include "defaults.hh" |
28 | #include "Screen.hh" | 28 | #include "Screen.hh" |
29 | #include "CommandParser.hh" | 29 | #include "FbTk/CommandRegistry.hh" |
30 | #include "fluxbox.hh" | 30 | #include "fluxbox.hh" |
31 | #include "Window.hh" | 31 | #include "Window.hh" |
32 | #include "WindowCmd.hh" | 32 | #include "WindowCmd.hh" |
@@ -247,7 +247,7 @@ static void translateMenuItem(Parser &parse, ParseItem &pitem, FbTk::StringConve | |||
247 | else | 247 | else |
248 | menu.insert(str_label, submenu); | 248 | menu.insert(str_label, submenu); |
249 | } else if (str_key == "exit") { // exit | 249 | } else if (str_key == "exit") { // exit |
250 | FbTk::RefCount<FbTk::Command> exit_cmd(CommandParser::instance().parseLine("exit")); | 250 | FbTk::RefCount<FbTk::Command> exit_cmd(FbTk::CommandRegistry::instance().parseLine("exit")); |
251 | if (str_label.empty()) | 251 | if (str_label.empty()) |
252 | menu.insert(_FB_XTEXT(Menu, Exit, "Exit", "Exit Command"), exit_cmd); | 252 | menu.insert(_FB_XTEXT(Menu, Exit, "Exit", "Exit Command"), exit_cmd); |
253 | else | 253 | else |
@@ -255,8 +255,8 @@ static void translateMenuItem(Parser &parse, ParseItem &pitem, FbTk::StringConve | |||
255 | } else if (str_key == "exec") { | 255 | } else if (str_key == "exec") { |
256 | // execute and hide menu | 256 | // execute and hide menu |
257 | using namespace FbTk; | 257 | using namespace FbTk; |
258 | RefCount<Command> exec_cmd(CommandParser::instance().parseLine("exec " + str_cmd)); | 258 | RefCount<Command> exec_cmd(FbTk::CommandRegistry::instance().parseLine("exec " + str_cmd)); |
259 | RefCount<Command> hide_menu(CommandParser::instance().parseLine("hidemenus")); | 259 | RefCount<Command> hide_menu(FbTk::CommandRegistry::instance().parseLine("hidemenus")); |
260 | MacroCommand *exec_and_hide = new FbTk::MacroCommand(); | 260 | MacroCommand *exec_and_hide = new FbTk::MacroCommand(); |
261 | exec_and_hide->add(hide_menu); | 261 | exec_and_hide->add(hide_menu); |
262 | exec_and_hide->add(exec_cmd); | 262 | exec_and_hide->add(exec_cmd); |
@@ -264,8 +264,8 @@ static void translateMenuItem(Parser &parse, ParseItem &pitem, FbTk::StringConve | |||
264 | menu.insert(str_label, exec_and_hide_cmd); | 264 | menu.insert(str_label, exec_and_hide_cmd); |
265 | } else if (str_key == "macrocmd") { | 265 | } else if (str_key == "macrocmd") { |
266 | using namespace FbTk; | 266 | using namespace FbTk; |
267 | RefCount<Command> macro_cmd(CommandParser::instance().parseLine("macrocmd " + str_cmd)); | 267 | RefCount<Command> macro_cmd(FbTk::CommandRegistry::instance().parseLine("macrocmd " + str_cmd)); |
268 | RefCount<Command> hide_menu(CommandParser::instance().parseLine("hidemenus")); | 268 | RefCount<Command> hide_menu(FbTk::CommandRegistry::instance().parseLine("hidemenus")); |
269 | MacroCommand *exec_and_hide = new FbTk::MacroCommand(); | 269 | MacroCommand *exec_and_hide = new FbTk::MacroCommand(); |
270 | exec_and_hide->add(hide_menu); | 270 | exec_and_hide->add(hide_menu); |
271 | exec_and_hide->add(macro_cmd); | 271 | exec_and_hide->add(macro_cmd); |
@@ -364,7 +364,7 @@ static void translateMenuItem(Parser &parse, ParseItem &pitem, FbTk::StringConve | |||
364 | else { // ok, if we didn't find any special menu item we try with command parser | 364 | else { // ok, if we didn't find any special menu item we try with command parser |
365 | // we need to attach command with arguments so command parser can parse it | 365 | // we need to attach command with arguments so command parser can parse it |
366 | string line = str_key + " " + str_cmd; | 366 | string line = str_key + " " + str_cmd; |
367 | FbTk::RefCount<FbTk::Command> command(CommandParser::instance().parseLine(line)); | 367 | FbTk::RefCount<FbTk::Command> command(FbTk::CommandRegistry::instance().parseLine(line)); |
368 | if (*command != 0) { | 368 | if (*command != 0) { |
369 | // special NLS default labels | 369 | // special NLS default labels |
370 | if (str_label.empty()) { | 370 | if (str_label.empty()) { |