using support::addName;
using support::addPath;
using support::bformat;
+using support::changeExtension;
using support::createDirectory;
using support::createLyXTmpDir;
using support::destroyDir;
// Read the ui file `name'
-bool LyX::readUIFile(string const & name)
+bool LyX::readUIFile(string const & name, bool include)
{
enum Uitags {
ui_menuset = 1,
lyxerr[Debug::INIT] << "About to read " << name << "..." << endl;
- FileName const ui_path = libFileSearch("ui", name, "ui");
-
+
+ FileName ui_path;
+ if (include) {
+ ui_path = libFileSearch("ui", name, "inc");
+ if (ui_path.empty())
+ ui_path = libFileSearch("ui",
+ changeExtension(name, "inc"));
+ }
+ else
+ ui_path = libFileSearch("ui", name, "ui");
+
if (ui_path.empty()) {
lyxerr[Debug::INIT] << "Could not find " << name << endl;
showFileError(name);
return false;
}
+
uifiles.push_back(name);
lyxerr[Debug::INIT] << "Found " << name
case ui_include: {
lex.next(true);
string const file = lex.getString();
- if (!readUIFile(file))
+ if (!readUIFile(file, true))
return false;
break;
}
/// read lyxrc/preferences
bool readRcFile(std::string const & name);
/// read the given ui (menu/toolbar) file
- bool readUIFile(std::string const & name);
+ bool readUIFile(std::string const & name, bool include = false);
/// read the given languages file
bool readLanguagesFile(std::string const & name);
/// read the given encodings file