diff options
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 be52e47..f5907c9 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" |
@@ -326,9 +327,20 @@ void ShowCustomMenuCmd::execute() { | |||
326 | } | 327 | } |
327 | 328 | ||
328 | void ShowCustomMenuCmd::reload() { | 329 | void ShowCustomMenuCmd::reload() { |
330 | _FB_USES_NLS; | ||
331 | |||
329 | m_menu->removeAll(); | 332 | m_menu->removeAll(); |
330 | m_menu->setLabel(FbTk::BiDiString("")); | 333 | try { |
331 | MenuCreator::createFromFile(custom_menu_file, *m_menu.get(), m_menu->reloadHelper()); | 334 | MenuCreator::createFromFile(custom_menu_file, *m_menu, m_menu->reloadHelper()); |
335 | } | ||
336 | catch(std::runtime_error &e) { | ||
337 | fprintf(stderr, _FB_CONSOLETEXT(FbCommands, CantLoadMenu, | ||
338 | "Failed to load menu file '%s': %s", | ||
339 | "Error message when loading of custom menu fails. " | ||
340 | "One %s for filename, one for exception text.").c_str(), | ||
341 | custom_menu_file.c_str(), e.what()); | ||
342 | fputs("\n", stderr); | ||
343 | } | ||
332 | } | 344 | } |
333 | 345 | ||
334 | REGISTER_COMMAND(rootmenu, FbCommands::ShowRootMenuCmd, void); | 346 | REGISTER_COMMAND(rootmenu, FbCommands::ShowRootMenuCmd, void); |