using lyx::support::compare_ascii_no_case;
using lyx::support::getVectorFromString;
-using lyx::support::LibFileSearch;
+using lyx::support::libFileSearch;
using lyx::support::subst;
using std::endl;
FuncRequest const & func, string const & tooltip)
{
tb.items.push_back(make_pair(func, tooltip));
+ tb.items.back().first.origin = FuncRequest::UI;
}
string fullname;
- if (f.action == LFUN_INSERT_MATH) {
- if (!f.argument.empty())
- fullname = find_xpm(f.argument.substr(1));
- } else if (f.action == LFUN_MATH_DELIM) {
- fullname = find_xpm(f.argument);
- } else {
+ switch (f.action) {
+ case LFUN_MATH_INSERT:
+ if (!f.argument().empty())
+ fullname = find_xpm(lyx::to_utf8(f.argument()).substr(1));
+ break;
+ case LFUN_MATH_DELIM:
+ case LFUN_MATH_BIGDELIM:
+ fullname = find_xpm(lyx::to_utf8(f.argument()));
+ break;
+ default:
string const name = lyxaction.getActionName(f.action);
string xpm_name(name);
- if (!f.argument.empty())
- xpm_name = subst(name + ' ' + f.argument, ' ', '_');
+ if (!f.argument().empty())
+ xpm_name = subst(name + ' ' + lyx::to_utf8(f.argument()), ' ', '_');
- fullname = LibFileSearch("images", xpm_name, "xpm");
+ fullname = libFileSearch("images", xpm_name, "xpm");
if (fullname.empty()) {
// try without the argument
- fullname = LibFileSearch("images", name, "xpm");
+ fullname = libFileSearch("images", name, "xpm");
}
}
lyxerr[Debug::GUI] << "Cannot find icon for command \""
<< lyxaction.getActionName(f.action)
- << '(' << f.argument << ")\"" << endl;
- return LibFileSearch("images", "unknown", "xpm");
+ << '(' << lyx::to_utf8(f.argument()) << ")\"" << endl;
+ return libFileSearch("images", "unknown", "xpm");
}