namespace lyx {
-using support::compare_no_case;
using support::compare_ascii_no_case;
using support::contains;
using support::makeDisplayPath;
using support::token;
-using support::uppercase;
using boost::bind;
}
-docstring const MenuItem::binding() const
+docstring const MenuItem::binding(bool forgui) const
{
if (kind_ != Command)
return docstring();
kb_keymap::Bindings bindings = theTopLevelKeymap().findbindings(func_);
if (bindings.size()) {
- return from_utf8(bindings.begin()->print());
+ return bindings.begin()->print(forgui);
} else {
- lyxerr[Debug::KBMAP]
+ LYXERR(Debug::KBMAP)
<< "No binding for "
<< lyxaction.getActionName(func_.action)
<< '(' << to_utf8(func_.argument()) << ')' << endl;
<< "\" does not contain shortcut `"
<< to_utf8(shortcut) << "'." << endl;
for (const_iterator it2 = begin(); it2 != it1 ; ++it2) {
- if (!compare_no_case(it2->shortcut(), shortcut)) {
+ if (!compare_ascii_no_case(it2->shortcut(), shortcut)) {
lyxerr << "Menu warning: menu entries "
<< '"' << to_utf8(it1->fulllabel())
<< "\" and \"" << to_utf8(it2->fulllabel())
}
-void MenuBackend::specialMenu(docstring const &name)
+void MenuBackend::specialMenu(Menu const & menu)
{
- if (hasMenu(name))
- specialmenu_ = &getMenu(name);
+ specialmenu_ = menu;
}
int ii = 1;
for (; lfit != lf.end() && ii < 10; ++lfit, ++ii) {
+ string const file = lfit->absFilename();
docstring const label = convert<docstring>(ii) + ". "
- + makeDisplayPath((*lfit), 30)
+ + makeDisplayPath(file, 30)
+ char_type('|') + convert<docstring>(ii);
- tomenu.add(MenuItem(MenuItem::Command, label, FuncRequest(LFUN_FILE_OPEN, (*lfit))));
+ tomenu.add(MenuItem(MenuItem::Command, label, FuncRequest(LFUN_FILE_OPEN, file)));
}
}
for (size_t i = 1; i <= bm.size(); ++i) {
if (bm.isValid(i)) {
docstring const label = convert<docstring>(i) + ". "
- + makeDisplayPath(bm.bookmark(i).filename, 20)
+ + makeDisplayPath(bm.bookmark(i).filename.absFilename(), 20)
+ char_type('|') + convert<docstring>(i);
tomenu.add(MenuItem(MenuItem::Command, label, FuncRequest(LFUN_BOOKMARK_GOTO,
convert<docstring>(i))));
switch (kind) {
case MenuItem::ImportFormats:
+ // FIXME: This is a hack, we should rather solve
+ // FIXME: bug 2488 instead.
if ((*fit)->name() == "text")
- label = _("Plain Text as Lines");
+ label = _("Plain Text");
else if ((*fit)->name() == "textparagraph")
- label = _("Plain Text as Paragraphs");
+ label = _("Plain Text, Join Lines");
label += "...";
break;
case MenuItem::ViewFormats:
docstring const label = from_utf8(cit->name);
tomenu.addWithStatusCheck(MenuItem(MenuItem::Command, label,
FuncRequest(LFUN_CHARSTYLE_INSERT,
- cit->name)));
+ label)));
}
}
break;
case MenuItem::Command:
- if (!specialmenu_
- || !specialmenu_->hasFunc(cit->func()))
+ if (!specialmenu_.hasFunc(cit->func()))
tomenu.addWithStatusCheck(*cit);
}
}