From: Bo Peng Date: Sat, 15 Mar 2008 22:41:54 +0000 (+0000) Subject: Add use_bundled_format rc entry to allow creation of new buffers in bundled format. X-Git-Tag: 1.6.10~5605 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=0f9a8fcad4104542ff1c94dd384e602b543f15f6;p=features.git Add use_bundled_format rc entry to allow creation of new buffers in bundled format. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23768 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 9914ae9429..3f14e3a7b0 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -351,7 +351,7 @@ BufferParams::BufferParams() listings_params = string(); pagestyle = "default"; compressed = false; - embedded = false; + embedded = lyxrc.use_bundled_format; for (int iter = 0; iter < 4; ++iter) { user_defined_bullet(iter) = ITEMIZE_DEFAULTS[iter]; temp_bullet(iter) = ITEMIZE_DEFAULTS[iter]; diff --git a/src/LyXRC.cpp b/src/LyXRC.cpp index f8327bd7ee..484edb4220 100644 --- a/src/LyXRC.cpp +++ b/src/LyXRC.cpp @@ -162,6 +162,7 @@ keyword_item lyxrcTags[] = { { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS }, { "\\ui_file", LyXRC::RC_UIFILE }, { "\\use_alt_language", LyXRC::RC_USE_ALT_LANG }, + { "\\use_bundled_format", LyXRC::RC_USE_BUNDLED_FORMAT }, { "\\use_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE }, { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS }, { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC }, @@ -298,6 +299,7 @@ void LyXRC::setDefaults() { #else open_buffers_in_tabs = true; #endif + use_bundled_format = false; // Fullscreen settings full_screen_limit = false; @@ -1306,6 +1308,10 @@ int LyXRC::read(Lexer & lexrc) if (lexrc.next()) open_buffers_in_tabs = lexrc.getBool(); break; + case RC_USE_BUNDLED_FORMAT: + if (lexrc.next()) + use_bundled_format = lexrc.getBool(); + break; case RC_LAST: break; // this is just a dummy } @@ -1893,6 +1899,15 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c } if (tag != RC_LAST) break; + case RC_USE_BUNDLED_FORMAT: + if (ignore_system_lyxrc || + use_bundled_format != system_lyxrc.use_bundled_format) { + os << "\\use_bundled_format " + << convert(use_bundled_format) + << '\n'; + } + if (tag != RC_LAST) + break; os << "\n#\n" << "# COLOR SECTION ###################################\n" diff --git a/src/LyXRC.h b/src/LyXRC.h index 40b3647880..68dcdfba60 100644 --- a/src/LyXRC.h +++ b/src/LyXRC.h @@ -151,6 +151,7 @@ public: RC_USER_NAME, RC_USETEMPDIR, RC_USE_ALT_LANG, + RC_USE_BUNDLED_FORMAT, RC_USE_CONVERTER_CACHE, RC_USE_ESC_CHARS, RC_USE_INP_ENC, @@ -439,6 +440,8 @@ public: bool completion_popup_after_complete; /// bool open_buffers_in_tabs; + /// + bool use_bundled_format; }; diff --git a/src/frontends/qt4/GuiPrefs.cpp b/src/frontends/qt4/GuiPrefs.cpp index 23eb5a44cc..47a9c5a2c4 100644 --- a/src/frontends/qt4/GuiPrefs.cpp +++ b/src/frontends/qt4/GuiPrefs.cpp @@ -1803,6 +1803,8 @@ PrefUserInterface::PrefUserInterface(GuiPreferences * form, QWidget * parent) this, SIGNAL(changed())); connect(tooltipCB, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + connect(useBundledCB, SIGNAL(toggled(bool)), + this, SIGNAL(changed())); lastfilesSB->setMaximum(maxlastfiles); } @@ -1818,6 +1820,7 @@ void PrefUserInterface::apply(LyXRC & rc) const rc.num_lastfiles = lastfilesSB->value(); rc.use_tooltip = tooltipCB->isChecked(); rc.open_buffers_in_tabs = openDocumentsInTabsCB->isChecked(); + rc.use_bundled_format = useBundledCB->isChecked(); } @@ -1836,6 +1839,7 @@ void PrefUserInterface::update(LyXRC const & rc) lastfilesSB->setValue(rc.num_lastfiles); tooltipCB->setChecked(rc.use_tooltip); openDocumentsInTabsCB->setChecked(rc.open_buffers_in_tabs); + useBundledCB->setChecked(rc.use_bundled_format); } diff --git a/src/frontends/qt4/ui/PrefUi.ui b/src/frontends/qt4/ui/PrefUi.ui index eacc496685..1c7f837e02 100644 --- a/src/frontends/qt4/ui/PrefUi.ui +++ b/src/frontends/qt4/ui/PrefUi.ui @@ -171,6 +171,13 @@ + + + + Use &bundled format for new documents + + + @@ -252,6 +259,7 @@ autoSaveSB lastfilesSB openDocumentsInTabsCB + useBundledCB qt_helpers.h