aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrathnor <rathnor>2004-09-16 14:08:46 (GMT)
committerrathnor <rathnor>2004-09-16 14:08:46 (GMT)
commit48e9c810d769efd733eecd8c3b0ea04b5fb6008e (patch)
tree00534d6cc343cf4e1036f8c9ec0693166943aeb0
parent2c66db2ba0c9061d96e5057c919d4576f84a091c (diff)
downloadfluxbox-48e9c810d769efd733eecd8c3b0ea04b5fb6008e.zip
fluxbox-48e9c810d769efd733eecd8c3b0ea04b5fb6008e.tar.bz2
fix menu creator not using args for some commands
-rw-r--r--ChangeLog3
-rw-r--r--src/MenuCreator.cc34
2 files changed, 17 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index a508ff6..150eea6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
1(Format: Year/Month/Day) 1(Format: Year/Month/Day)
2Changes for 0.9.11 2Changes for 0.9.11
3*04/09/16:
4 * Fix restart command not reading its args (Simon)
5 MenuCreator.cc
3*04/09/12: 6*04/09/12:
4 * Preliminary support for Composite extension (Simon) 7 * Preliminary support for Composite extension (Simon)
5 - Relies on external compositing manager using _NET_WM_WINDOW_OPACITY 8 - Relies on external compositing manager using _NET_WM_WINDOW_OPACITY
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);