ends in .ui, try the .inc version too (support for user ui files)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16762
a592a061-630c-0410-9148-
cb99ea01b6c8
using support::addName;
using support::addPath;
using support::bformat;
using support::addName;
using support::addPath;
using support::bformat;
+using support::changeExtension;
using support::createDirectory;
using support::createLyXTmpDir;
using support::destroyDir;
using support::createDirectory;
using support::createLyXTmpDir;
using support::destroyDir;
// Read the ui file `name'
// Read the ui file `name'
-bool LyX::readUIFile(string const & name)
+bool LyX::readUIFile(string const & name, bool include)
{
enum Uitags {
ui_menuset = 1,
{
enum Uitags {
ui_menuset = 1,
lyxerr[Debug::INIT] << "About to read " << name << "..." << endl;
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;
}
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
uifiles.push_back(name);
lyxerr[Debug::INIT] << "Found " << name
case ui_include: {
lex.next(true);
string const file = lex.getString();
case ui_include: {
lex.next(true);
string const file = lex.getString();
+ if (!readUIFile(file, true))
/// read lyxrc/preferences
bool readRcFile(std::string const & name);
/// read the given ui (menu/toolbar) file
/// 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
/// read the given languages file
bool readLanguagesFile(std::string const & name);
/// read the given encodings file