From 6672307cdc88276fcb858a9ee8ee412d7518f02b Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Fri, 19 Jan 2007 14:35:32 +0000 Subject: [PATCH] * lyx_main.C (readUIFile): when reading an include file which name ends in .ui, try the .inc version too (support for user ui files) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_4_X@16763 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 5 +++++ src/lyx_main.C | 16 +++++++++++++--- src/lyx_main.h | 2 +- status.14x | 2 +- 4 files changed, 20 insertions(+), 5 deletions(-) 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).