InsetInfo: tidy up error messages, fix an obvious bug in menus.cpp that breaks "info-insert menu name"

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24327 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Bo Peng 2008-04-18 16:26:24 +00:00
parent 491f30920e
commit b56a40d7eb
2 changed files with 4 additions and 3 deletions

View File

@ -202,7 +202,7 @@ public:
/// set the description of the submenu
void submenuname(QString const & name) { submenuname_ = name; }
///
bool hasSubmenu() const { return submenu_.isEmpty(); }
bool hasSubmenu() const { return !submenu_.isEmpty(); }
///
MenuDefinition const & submenu() const { return submenu_.at(0); }
MenuDefinition & submenu() { return submenu_[0]; }

View File

@ -208,12 +208,13 @@ void InsetInfo::updateInfo()
vector<docstring> names;
FuncRequest func = lyxaction.lookupFunc(name_);
if (func.action == LFUN_UNKNOWN_ACTION) {
setText(_("No menu entry for "), bp.getFont(), false);
setText(bformat(_("Unknown action %1$s"), from_utf8(name_)), bp.getFont(), false);
break;
}
// iterate through the menubackend to find it
if (!theApp()->searchMenu(func, names)) {
setText(_("No menu entry for "), bp.getFont(), false);
setText(bformat(_("No menu entry for action %1$s"), from_utf8(name_)),
bp.getFont(), false);
break;
}
// if find, return its path.