diff options
author | Pavel Labath <pavelo@centrum.sk> | 2011-07-02 08:19:48 (GMT) |
---|---|---|
committer | Paul Tagliamonte <paultag@fluxbox.org> | 2012-04-07 02:11:29 (GMT) |
commit | 82883442e7a9faf234d0a26ebc373bc4026118a1 (patch) | |
tree | ac3f64bfa05bf9febe5addf89ea1cc99906afb21 /src/FbCommands.cc | |
parent | dee1ec29d0db48b8a721e8152a980f1379e332af (diff) | |
download | fluxbox_paul-82883442e7a9faf234d0a26ebc373bc4026118a1.zip fluxbox_paul-82883442e7a9faf234d0a26ebc373bc4026118a1.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 b0289b8..02a614a 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); |