From dc58cbc1616c204b696df9b8bb6aa9602915a92e 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 467f643..ea45487 100644 --- a/src/MenuCreator.cc +++ b/src/MenuCreator.cc @@ -268,9 +268,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