aboutsummaryrefslogtreecommitdiff
path: root/src/FbCommands.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbCommands.cc')
-rw-r--r--src/FbCommands.cc16
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
340void ShowCustomMenuCmd::reload() { 341void 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
346REGISTER_COMMAND(rootmenu, FbCommands::ShowRootMenuCmd, void); 358REGISTER_COMMAND(rootmenu, FbCommands::ShowRootMenuCmd, void);