]> git.lyx.org Git - lyx.git/blobdiff - src/lyxrc.C
A couple of minor bug fixes and cleanups
[lyx.git] / src / lyxrc.C
index 5e801533ff0eed2beca7ec175fdbc1503dcd24ff..331d0d39a86e8c12d4256bf8dafcda89166df46b 100644 (file)
@@ -43,6 +43,7 @@ extern boost::scoped_ptr<kb_keymap> toplevel_keymap;
 
 namespace {
 
+// when adding something to this array keep it sorted!
 keyword_item lyxrcTags[] = {
        { "\\accept_compound", LyXRC::RC_ACCEPT_COMPOUND },
        { "\\alternate_language", LyXRC::RC_ALT_LANG },
@@ -66,7 +67,6 @@ keyword_item lyxrcTags[] = {
        { "\\default_papersize", LyXRC::RC_DEFAULT_PAPERSIZE },
        { "\\dialogs_iconify_with_main", LyXRC::RC_DIALOGS_ICONIFY_WITH_MAIN },
        { "\\display_graphics", LyXRC::RC_DISPLAY_GRAPHICS },
-       { "\\display_shortcuts", LyXRC::RC_DISPLAY_SHORTCUTS },
        { "\\document_path", LyXRC::RC_DOCUMENTPATH },
        { "\\escape_chars", LyXRC::RC_ESC_CHARS },
        { "\\exit_confirmation", LyXRC::RC_EXIT_CONFIRMATION },
@@ -95,6 +95,7 @@ keyword_item lyxrcTags[] = {
        { "\\popup_bold_font", LyXRC::RC_POPUP_BOLD_FONT },
        { "\\popup_font_encoding", LyXRC::RC_POPUP_FONT_ENCODING },
        { "\\popup_normal_font", LyXRC::RC_POPUP_NORMAL_FONT },
+       { "\\preview", LyXRC::RC_PREVIEW },
        { "\\print_adapt_output", LyXRC::RC_PRINT_ADAPTOUTPUT },
        { "\\print_collcopies_flag", LyXRC::RC_PRINTCOLLCOPIESFLAG },
        { "\\print_command", LyXRC::RC_PRINT_COMMAND },
@@ -225,7 +226,6 @@ void LyXRC::setDefaults() {
        backupdir_path.erase();
        exit_confirmation = true;
        display_graphics = "color";
-       display_shortcuts = true;
        // Spellchecker settings:
 #ifdef USE_PSPELL
        use_pspell = true;
@@ -253,10 +253,10 @@ void LyXRC::setDefaults() {
 
        //
        date_insert_format = "%A, %e %B %Y";
-       show_banner = true;
        cursor_follows_scrollbar = false;
        dialogs_iconify_with_main = false;
        label_init_length = 3;
+       preview = false;
 
        /// These variables are not stored on disk (perhaps they
        // should be moved from the LyXRC class).
@@ -361,11 +361,6 @@ int LyXRC::read(string const & filename)
                                display_graphics = lexrc.getString();
                        break;
 
-               case RC_DISPLAY_SHORTCUTS:
-                       if (lexrc.next())
-                               display_shortcuts = lexrc.getBool();
-                       break;
-
                case RC_KBMAP:
                        if (lexrc.next())
                                use_kbmap = lexrc.getBool();
@@ -882,10 +877,6 @@ int LyXRC::read(string const & filename)
                        if (lexrc.next())
                                mark_foreign_language = lexrc.getBool();
                        break;
-               case RC_SHOW_BANNER:
-                       if (lexrc.next())
-                               show_banner = lexrc.getBool();
-                       break;
 
                case RC_NEW_ASK_FILENAME:
                        if (lexrc.next())
@@ -948,6 +939,16 @@ int LyXRC::read(string const & filename)
                                label_init_length = lexrc.getInteger();
                        break;
 
+               case RC_SHOW_BANNER:
+                       if (lexrc.next())
+                               show_banner = lexrc.getBool();
+                       break;
+
+               case RC_PREVIEW:
+                       if (lexrc.next())
+                               preview = lexrc.getBool();
+                       break;
+
                case RC_LAST: break; // this is just a dummy
                }
        }
@@ -1015,11 +1016,6 @@ void LyXRC::output(ostream & os) const
                   << "# MISC SECTION ######################################\n"
                   << "#\n\n";
 
-       case RC_SHOW_BANNER:
-               if (show_banner != system_lyxrc.show_banner) {
-                       os << "# Set to false to inhibit the startup banner.\n"
-                          << "\\show_banner " << tostr(show_banner) << "\n";
-               }
                // bind files are not done here.
        case RC_UIFILE:
                if (ui_file != system_lyxrc.ui_file) {
@@ -1059,13 +1055,6 @@ void LyXRC::output(ostream & os) const
                           << "\n";
                }
 
-       case RC_DISPLAY_SHORTCUTS:
-               if (display_shortcuts != system_lyxrc.display_shortcuts) {
-                       os << "# Display name of the last command executed,\n"
-                          << "# with a list of short-cuts in the minibuffer.\n"
-                          << "\\display_shortcuts " << tostr(display_shortcuts)
-                          << "\n";
-               }
        case RC_VIEWDVI_PAPEROPTION:
                if (view_dvi_paper_option
                    != system_lyxrc.view_dvi_paper_option) {
@@ -1134,6 +1123,16 @@ void LyXRC::output(ostream & os) const
                           << "\n";
                }
 
+       case RC_SHOW_BANNER:
+               if (show_banner != system_lyxrc.show_banner) {
+                       os << "\\show_banner " << tostr(show_banner) << "\n";
+               }
+
+       case RC_PREVIEW:
+               if (preview != system_lyxrc.preview) {
+                       os << "\\preview " << tostr(preview) << "\n";
+               }
+
                os << "\n#\n"
                   << "# SCREEN & FONTS SECTION ############################\n"
                   << "#\n\n";
@@ -1919,10 +1918,6 @@ string const LyXRC::getDescription(LyXRCTags tag)
                str = _("Select how LyX will display any graphics.");
                break;
 
-       case RC_DISPLAY_SHORTCUTS:
-               str = _("LyX continously displays names of last command executed, along with a list of defined short-cuts for it in the minibuffer. Set to false if LyX seems slow.");
-               break;
-
        case RC_MAKE_BACKUP:
                str = _("De-select if you don't want LyX to create backup files.");
                break;
@@ -2005,6 +2000,10 @@ string const LyXRC::getDescription(LyXRCTags tag)
                str = _("Maximum number of words in the initialization string for a new label");
                break;
 
+       case RC_PREVIEW:
+               str = _("Shows a typeset preview besides formulas");
+               break;
+
        default:
                break;
        }