diff options
-rw-r--r-- | src/Screen.cc | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index d19a0b4..0165bfe 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -1387,11 +1387,16 @@ void BScreen::rereadMenu() { | |||
1387 | l.checkstack(1); | 1387 | l.checkstack(1); |
1388 | lua::stack_sentry s(l); | 1388 | lua::stack_sentry s(l); |
1389 | 1389 | ||
1390 | // XXX try/catch | ||
1391 | m_rootmenu->removeAll(); | 1390 | m_rootmenu->removeAll(); |
1392 | l.loadfile(FbTk::StringUtil::expandFilename(fb->getMenuFilename()).c_str()); | 1391 | try { |
1393 | l.call(0, 1); | 1392 | l.loadfile(FbTk::StringUtil::expandFilename(fb->getMenuFilename()).c_str()); |
1394 | MenuCreator::createMenu(*m_rootmenu, l, m_rootmenu->reloadHelper()); | 1393 | l.call(0, 1); |
1394 | MenuCreator::createMenu(*m_rootmenu, l, m_rootmenu->reloadHelper()); | ||
1395 | } | ||
1396 | catch(std::runtime_error &e) { | ||
1397 | cerr << _FB_CONSOLETEXT(Menu, RootLoad, "Loading root menu failed: ", | ||
1398 | "Actual error message follows this string") << e.what() << endl; | ||
1399 | } | ||
1395 | 1400 | ||
1396 | if (m_rootmenu->numberOfItems() == 0) { | 1401 | if (m_rootmenu->numberOfItems() == 0) { |
1397 | _FB_USES_NLS; | 1402 | _FB_USES_NLS; |
@@ -1421,12 +1426,16 @@ void BScreen::rereadWindowMenu() { | |||
1421 | l.checkstack(1); | 1426 | l.checkstack(1); |
1422 | lua::stack_sentry s(l); | 1427 | lua::stack_sentry s(l); |
1423 | 1428 | ||
1424 | |||
1425 | // XXX try/catch | ||
1426 | m_windowmenu->removeAll(); | 1429 | m_windowmenu->removeAll(); |
1427 | l.loadfile(FbTk::StringUtil::expandFilename(windowMenuFilename()).c_str()); | 1430 | try { |
1428 | l.call(0, 1); | 1431 | l.loadfile(FbTk::StringUtil::expandFilename(windowMenuFilename()).c_str()); |
1429 | MenuCreator::createMenu(*m_windowmenu, l, m_windowmenu->reloadHelper()); | 1432 | l.call(0, 1); |
1433 | MenuCreator::createMenu(*m_windowmenu, l, m_windowmenu->reloadHelper()); | ||
1434 | } | ||
1435 | catch(std::runtime_error &e) { | ||
1436 | cerr << _FB_CONSOLETEXT(Menu, RootLoad, "Loading window menu failed: ", | ||
1437 | "Actual error message follows this string") << e.what() << endl; | ||
1438 | } | ||
1430 | } | 1439 | } |
1431 | 1440 | ||
1432 | void BScreen::addConfigMenu(const FbTk::FbString &label, const FbTk::RefCount<FbTk::Menu> &menu) { | 1441 | void BScreen::addConfigMenu(const FbTk::FbString &label, const FbTk::RefCount<FbTk::Menu> &menu) { |