diff options
author | Pavel Labath <pavelo@centrum.sk> | 2011-07-02 08:19:48 (GMT) |
---|---|---|
committer | Pavel Labath <pavelo@centrum.sk> | 2011-11-01 09:57:20 (GMT) |
commit | adf9f90af810c827fa4c849235515898733da8b6 (patch) | |
tree | 9249a2bbc26b5c9b07b78a2da53cfff81eda7904 /src/FbCommands.cc | |
parent | d5bef134ea20a2670d383492977b4d152e24464a (diff) | |
download | fluxbox_paul-adf9f90af810c827fa4c849235515898733da8b6.zip fluxbox_paul-adf9f90af810c827fa4c849235515898733da8b6.tar.bz2 |
CustomMenu command now shows lua menus
Diffstat (limited to 'src/FbCommands.cc')
-rw-r--r-- | src/FbCommands.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/FbCommands.cc b/src/FbCommands.cc index 63aa79d..e91484c 100644 --- a/src/FbCommands.cc +++ b/src/FbCommands.cc | |||
@@ -30,6 +30,7 @@ | |||
30 | #include "Keys.hh" | 30 | #include "Keys.hh" |
31 | #include "MenuCreator.hh" | 31 | #include "MenuCreator.hh" |
32 | 32 | ||
33 | #include "FbTk/I18n.hh" | ||
33 | #include "FbTk/Theme.hh" | 34 | #include "FbTk/Theme.hh" |
34 | #include "FbTk/Menu.hh" | 35 | #include "FbTk/Menu.hh" |
35 | #include "FbTk/CommandParser.hh" | 36 | #include "FbTk/CommandParser.hh" |
@@ -338,9 +339,20 @@ void ShowCustomMenuCmd::execute() { | |||
338 | } | 339 | } |
339 | 340 | ||
340 | void ShowCustomMenuCmd::reload() { | 341 | void ShowCustomMenuCmd::reload() { |
342 | _FB_USES_NLS; | ||
343 | |||
341 | m_menu->removeAll(); | 344 | m_menu->removeAll(); |
342 | m_menu->setLabel(FbTk::BiDiString("")); | 345 | try { |
343 | MenuCreator::createFromFile(custom_menu_file, *m_menu.get(), m_menu->reloadHelper()); | 346 | MenuCreator::createFromFile(custom_menu_file, *m_menu, m_menu->reloadHelper()); |
347 | } | ||
348 | catch(std::runtime_error &e) { | ||
349 | fprintf(stderr, _FB_CONSOLETEXT(FbCommands, CantLoadMenu, | ||
350 | "Failed to load menu file '%s': %s", | ||
351 | "Error message when loading of custom menu fails. " | ||
352 | "One %s for filename, one for exception text.").c_str(), | ||
353 | custom_menu_file.c_str(), e.what()); | ||
354 | fputs("\n", stderr); | ||
355 | } | ||
344 | } | 356 | } |
345 | 357 | ||
346 | REGISTER_COMMAND(rootmenu, FbCommands::ShowRootMenuCmd, void); | 358 | REGISTER_COMMAND(rootmenu, FbCommands::ShowRootMenuCmd, void); |