]> git.lyx.org Git - lyx.git/blobdiff - src/LyXRC.cpp
Remove undisclosed imports (from xxx import *)
[lyx.git] / src / LyXRC.cpp
index fa50d4a51d8aa2832ac8781bc93b5c85e6b947dd..edd9a58240d12440a98883e7a5d05ef78cedf656 100644 (file)
@@ -25,7 +25,6 @@
 #include "Format.h"
 #include "FuncCode.h"
 #include "FuncRequest.h"
-#include "Lexer.h"
 #include "LyX.h"
 #include "Mover.h"
 #include "SpellChecker.h"
@@ -36,6 +35,7 @@
 #include "support/environment.h"
 #include "support/FileName.h"
 #include "support/filetools.h"
+#include "support/Lexer.h"
 #include "support/lstrings.h"
 #include "support/os.h"
 #include "support/Package.h"
@@ -60,7 +60,7 @@ namespace {
 
 // The format should also be updated in configure.py, and conversion code
 // should be added to prefs2prefs_prefs.py.
-static unsigned int const LYXRC_FILEFORMAT = 37; // chillenb: screen_width and screen_limit
+static unsigned int const LYXRC_FILEFORMAT = 38; // chillenb: screen_width and screen_limit
 // when adding something to this array keep it sorted!
 LexerKeyword lyxrcTags[] = {
        { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
@@ -197,6 +197,7 @@ LexerKeyword lyxrcTags[] = {
        { "\\texinputs_prefix", LyXRC::RC_TEXINPUTS_PREFIX },
        { "\\thesaurusdir_path", LyXRC::RC_THESAURUSDIRPATH },
        { "\\ui_file", LyXRC::RC_UIFILE },
+       { "\\ui_style", LyXRC::RC_UI_STYLE },
        { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
        { "\\use_converter_needauth", LyXRC::RC_USE_CONVERTER_NEEDAUTH },
        { "\\use_converter_needauth_forbidden", LyXRC::RC_USE_CONVERTER_NEEDAUTH_FORBIDDEN },
@@ -603,6 +604,10 @@ LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
                        lexrc >> icon_set;
                        break;
 
+               case RC_UI_STYLE:
+                       lexrc >> ui_style;
+                       break;
+
                case RC_USE_SYSTEM_THEME_ICONS:
                        lexrc >> use_system_theme_icons;
                        break;
@@ -1142,8 +1147,9 @@ LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
                                        draw_strategy = DS_PARTIAL;
                                else if (tmp == "backingstore")
                                        draw_strategy = DS_BACKINGSTORE;
+                               else if (tmp == "full")
+                                       draw_strategy = DS_FULL;
                                else {
-                                       draw_strategy = DS_PARTIAL;
                                        LYXERR0("Unrecognized draw strategy " << tmp <<'"');
                                }
                        }
@@ -1624,6 +1630,15 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                if (tag != RC_LAST)
                        break;
                // fall through
+       case RC_UI_STYLE:
+               if (ignore_system_lyxrc ||
+                       ui_style != system_lyxrc.ui_style) {
+                       os << "\\ui_style \"" << ui_style
+                               << "\"\n";
+               }
+               if (tag != RC_LAST)
+                       break;
+               // fall through
        case RC_USE_SYSTEM_THEME_ICONS:
                if (ignore_system_lyxrc ||
                          use_system_theme_icons != system_lyxrc.use_system_theme_icons) {
@@ -2041,6 +2056,9 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                        draw_strategy != system_lyxrc.draw_strategy) {
                        string status;
                        switch (draw_strategy) {
+                       case DS_FULL:
+                               status = "full";
+                               break;
                        case DS_PARTIAL:
                                status = "partial";
                                break;
@@ -2950,6 +2968,7 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
        case LyXRC::RC_GROUP_LAYOUTS:
        case LyXRC::RC_HUNSPELLDIR_PATH:
        case LyXRC::RC_ICON_SET:
+       case LyXRC::RC_UI_STYLE:
        case LyXRC::RC_INDEX_ALTERNATIVES:
        case LyXRC::RC_INDEX_COMMAND:
        case LyXRC::RC_JBIBTEX_COMMAND: