]> git.lyx.org Git - lyx.git/blobdiff - src/LyXRC.cpp
Fix problem with python and change of PATH
[lyx.git] / src / LyXRC.cpp
index 6c7809c7e5811ea933e1021f9e059e3df8fdfe16..80b85141d25145e2a3eab443aae6030d480e19b1 100644 (file)
@@ -55,7 +55,9 @@ namespace os = support::os;
 
 namespace {
 
-static unsigned int const LYXRC_FILEFORMAT = 13; // vfr: System theme's icons
+// 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 = 15; // prannoy: statusbar on/off in full screen
 
 // when adding something to this array keep it sorted!
 LexerKeyword lyxrcTags[] = {
@@ -93,6 +95,7 @@ LexerKeyword lyxrcTags[] = {
        { "\\def_file", LyXRC::RC_DEFFILE },
        { "\\default_decimal_point", LyXRC::RC_DEFAULT_DECIMAL_POINT },
        { "\\default_length_unit", LyXRC::RC_DEFAULT_LENGTH_UNIT },
+       { "\\default_otf_view_format", LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT },
        { "\\default_view_format", LyXRC::RC_DEFAULT_VIEW_FORMAT },
        { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
        { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
@@ -109,6 +112,7 @@ LexerKeyword lyxrcTags[] = {
        { "\\fullscreen_limit", LyXRC::RC_FULL_SCREEN_LIMIT },
        { "\\fullscreen_menubar", LyXRC::RC_FULL_SCREEN_MENUBAR },
        { "\\fullscreen_scrollbar", LyXRC::RC_FULL_SCREEN_SCROLLBAR },
+       { "\\fullscreen_statusbar", LyXRC::RC_FULL_SCREEN_STATUSBAR },
        { "\\fullscreen_tabbar", LyXRC::RC_FULL_SCREEN_TABBAR },
        { "\\fullscreen_toolbars", LyXRC::RC_FULL_SCREEN_TOOLBARS },
        { "\\fullscreen_width", LyXRC::RC_FULL_SCREEN_WIDTH },
@@ -255,6 +259,7 @@ void LyXRC::setDefaults()
        document_path.erase();
        view_dvi_paper_option.erase();
        default_view_format = "pdf2";
+       default_otf_view_format = "pdf4";
        chktex_command = "chktex -n1 -n3 -n6 -n9 -n22 -n25 -n30 -n38";
        bibtex_command = "bibtex";
        fontenc = "default";
@@ -1162,6 +1167,10 @@ LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
                        break;
                }
 
+               case RC_DEFAULT_OTF_VIEW_FORMAT:
+                       lexrc >> default_otf_view_format;
+                       break;
+
                case RC_DEFAULT_VIEW_FORMAT:
                        lexrc >> default_view_format;
                        break;
@@ -1231,6 +1240,9 @@ LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format)
                case RC_FULL_SCREEN_SCROLLBAR:
                        lexrc >> full_screen_scrollbar;
                        break;
+               case RC_FULL_SCREEN_STATUSBAR:
+                       lexrc >> full_screen_statusbar;
+                       break;
                case RC_FULL_SCREEN_TABBAR:
                        lexrc >> full_screen_tabbar;
                        break;
@@ -1939,6 +1951,15 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                }
                if (tag != RC_LAST)
                        break;
+       case RC_FULL_SCREEN_STATUSBAR:
+               if (ignore_system_lyxrc ||
+                   full_screen_statusbar != system_lyxrc.full_screen_statusbar) {
+                       os << "\\fullscreen_statusbar "
+                          << convert<string>(full_screen_statusbar)
+                          << '\n';
+               }
+               if (tag != RC_LAST)
+                       break;
        case RC_FULL_SCREEN_TABBAR:
                if (ignore_system_lyxrc ||
                    full_screen_tabbar != system_lyxrc.full_screen_tabbar) {
@@ -2807,6 +2828,13 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
                if (tag != RC_LAST)
                        break;
        }
+       case RC_DEFAULT_OTF_VIEW_FORMAT:
+               if (ignore_system_lyxrc ||
+                   default_otf_view_format != system_lyxrc.default_otf_view_format) {
+                       os << "\\default_otf_view_format " << default_otf_view_format << '\n';
+               }
+               if (tag != RC_LAST)
+                       break;
        case RC_DEFAULT_VIEW_FORMAT:
                if (ignore_system_lyxrc ||
                    default_view_format != system_lyxrc.default_view_format) {
@@ -2929,6 +2957,7 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
        case LyXRC::RC_SCROLL_BELOW_DOCUMENT:
        case LyXRC::RC_DATE_INSERT_FORMAT:
        case LyXRC::RC_GUI_LANGUAGE:
+       case LyXRC::RC_DEFAULT_OTF_VIEW_FORMAT:
        case LyXRC::RC_DEFAULT_VIEW_FORMAT:
        case LyXRC::RC_DEFFILE:
        case LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN:
@@ -2977,6 +3006,8 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
        case LyXRC::RC_PATH_PREFIX:
                if (lyxrc_orig.path_prefix != lyxrc_new.path_prefix) {
                        prependEnvPath("PATH", lyxrc_new.path_prefix);
+                       // Resets python path
+                       support::os::python(true);
                }
        case LyXRC::RC_PREVIEW:
        case LyXRC::RC_PREVIEW_HASHED_LABELS:
@@ -3047,6 +3078,7 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
        case LyXRC::RC_FULL_SCREEN_LIMIT:
        case LyXRC::RC_FULL_SCREEN_SCROLLBAR:
        case LyXRC::RC_FULL_SCREEN_MENUBAR:
+       case LyXRC::RC_FULL_SCREEN_STATUSBAR:
        case LyXRC::RC_FULL_SCREEN_TABBAR:
        case LyXRC::RC_FULL_SCREEN_TOOLBARS:
        case LyXRC::RC_FULL_SCREEN_WIDTH:
@@ -3162,6 +3194,10 @@ string const LyXRC::getDescription(LyXRCTags tag)
                str = _("Command definition file. Can either specify an absolute path, or LyX will look in its global and local commands/ directories.");
                break;
 
+       case RC_DEFAULT_OTF_VIEW_FORMAT:
+               str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE] with non-TeX fonts.");
+               break;
+
        case RC_DEFAULT_VIEW_FORMAT:
                str = _("The default format used with LFUN_BUFFER_[VIEW|UPDATE].");
                break;