diff --git a/src/ChangeLog b/src/ChangeLog index 21859dd22a..ffd4f5a07e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2007-01-19 Jean-Marc Lasgouttes + + * lyx_main.C (readUIFile): when reading an include file which name + ends in .ui, try the .inc version too (support for user ui files) + 2007-01-17 Martin Vermeer * text.C (breakParagraph): when tracking changes, do not remove diff --git a/src/lyx_main.C b/src/lyx_main.C index 2e3a2b0f53..2644dc5a5c 100644 --- a/src/lyx_main.C +++ b/src/lyx_main.C @@ -62,6 +62,7 @@ using lyx::support::AddName; using lyx::support::AddPath; using lyx::support::bformat; +using lyx::support::ChangeExtension; using lyx::support::createDirectory; using lyx::support::createLyXTmpDir; using lyx::support::FileSearch; @@ -714,7 +715,7 @@ void LyX::readRcFile(string const & name) // Read the ui file `name' -void LyX::readUIFile(string const & name) +void LyX::readUIFile(string const & name, bool include) { enum Uitags { ui_menuset = 1, @@ -746,7 +747,16 @@ void LyX::readUIFile(string const & name) lyxerr[Debug::INIT] << "About to read " << name << "..." << endl; - string const ui_path = LibFileSearch("ui", name, "ui"); + + string 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; @@ -772,7 +782,7 @@ void LyX::readUIFile(string const & name) case ui_include: { lex.next(true); string const file = lex.getString(); - readUIFile(file); + readUIFile(file, true); break; } case ui_menuset: diff --git a/src/lyx_main.h b/src/lyx_main.h index 6466da745d..b8f853c2da 100644 --- a/src/lyx_main.h +++ b/src/lyx_main.h @@ -85,7 +85,7 @@ private: /// read lyxrc/preferences void readRcFile(std::string const & name); /// read the given ui (menu/toolbar) file - void readUIFile(std::string const & name); + void readUIFile(std::string const & name, bool include = false); /// read the given languages file void readLanguagesFile(std::string const & name); /// read the given encodings file diff --git a/status.14x b/status.14x index 894985ebb8..ba8aa4171f 100644 --- a/status.14x +++ b/status.14x @@ -86,7 +86,7 @@ What's new - Revert fix from 1.4.3 for better display of script insets with a nucleus with more than one element (like {a'}^{2}), since it was buggy and it is - very difficult to do it right. + very difficult to do it right (bug 2921) - Re-enable Address paragraph style in AMS article classes (bug 2890).