all repos — fluxbox @ 48e9c810d769efd733eecd8c3b0ea04b5fb6008e

custom fork of the fluxbox windowmanager

fix menu creator not using args for some commands
rathnor rathnor
commit

48e9c810d769efd733eecd8c3b0ea04b5fb6008e

parent

2c66db2ba0c9061d96e5057c919d4576f84a091c

2 files changed, 17 insertions(+), 20 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,5 +1,8 @@

(Format: Year/Month/Day) Changes for 0.9.11 +*04/09/16: + * Fix restart command not reading its args (Simon) + MenuCreator.cc *04/09/12: * Preliminary support for Composite extension (Simon) - Relies on external compositing manager using _NET_WM_WINDOW_OPACITY
M src/MenuCreator.ccsrc/MenuCreator.cc

@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: MenuCreator.cc,v 1.15 2004/09/12 00:31:11 fluxgen Exp $ +// $Id: MenuCreator.cc,v 1.16 2004/09/16 14:08:46 rathnor Exp $ #include "MenuCreator.hh"

@@ -278,24 +278,7 @@ if (screen != 0)

screen->saveMenu(*submenu); } // end of submenu - else if (str_key == "restart") { - FbTk::RefCount<FbTk::Command> restart_fb(CommandParser::instance(). - parseLine("restart")); - if (str_label.empty()) - menu.insert(_FBTEXT(Menu, Restart, "Restart", "Restart Command"), restart_fb); - else - menu.insert(str_label.c_str(), restart_fb); - } // end of restart - else if (str_key == "reconfig") { // reconf - FbTk::RefCount<FbTk::Command> - reconfig_fb_cmd(CommandParser::instance(). - parseLine("reconfigure")); - if (str_label.empty()) - menu.insert(_FBTEXT(Menu, Reconfigure, "Reload Config", "Reload all the configs"), reconfig_fb_cmd); - else - menu.insert(str_label.c_str(), reconfig_fb_cmd); - - } else if (str_key == "stylesdir" || str_key == "stylesmenu") { + else if (str_key == "stylesdir" || str_key == "stylesmenu") { createStyleMenu(menu, str_label, str_key == "stylesmenu" ? str_cmd : str_label); } // end of stylesdir

@@ -321,8 +304,19 @@ else { // ok, if we didn't find any special menu item we try with command parser

// we need to attach command with arguments so command parser can parse it string line = str_key + " " + str_cmd; FbTk::RefCount<FbTk::Command> command(CommandParser::instance().parseLine(line)); - if (*command != 0) + if (*command != 0) { + // special NLS default labels + if (str_label.empty()) { + if (str_key == "reconfig" || str_key == "reconfigure") { + menu.insert(_FBTEXT(Menu, Reconfigure, "Reload Config", "Reload all the configs"), command); + return; + } else if (str_key == "restart") { + menu.insert(_FBTEXT(Menu, Restart, "Restart", "Restart Command"), command); + return; + } + } menu.insert(str_label.c_str(), command); + } } if (menu.numberOfItems() != 0) { FbTk::MenuItem *item = menu.find(menu.numberOfItems() - 1);