From f504a958ad6f669b3771a1986fcea9673c7e3e81 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Sun, 3 Jul 2011 14:49:20 +0200 Subject: Report unrecognized menu entries I put the error message into the menu, because noone reads stderr anyway. --- src/MenuCreator.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/MenuCreator.cc b/src/MenuCreator.cc index 6b612ef..8619b00 100644 --- a/src/MenuCreator.cc +++ b/src/MenuCreator.cc @@ -269,9 +269,12 @@ insertMenuItem(lua::state &l, FbTk::Menu &menu, FbTk::StringConvertor &parent_co reloader, program) ); } else if (str_key == "workspaces") { menu.insert(str_label, RefMenu(screen->workspaceMenu()) ); - } else { - // finally, try window-related commands - MenuCreator::createWindowMenuItem(str_key, str_label, menu); + // finally, try window-related commands + } else if(! MenuCreator::createWindowMenuItem(str_key, str_label, menu)) { + // everything failed, we give up + int size = menu.insert(_FB_XTEXT(Menu, UnknownType, "Unknown menu type: ", + "The text will be followed by the actual type") + str_key); + menu.setItemEnabled(size-1, false); } } -- cgit v0.11.2