]> git.lyx.org Git - features.git/commitdiff
Add use_bundled_format rc entry to allow creation of new buffers in bundled format.
authorBo Peng <bpeng@lyx.org>
Sat, 15 Mar 2008 22:41:54 +0000 (22:41 +0000)
committerBo Peng <bpeng@lyx.org>
Sat, 15 Mar 2008 22:41:54 +0000 (22:41 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23768 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferParams.cpp
src/LyXRC.cpp
src/LyXRC.h
src/frontends/qt4/GuiPrefs.cpp
src/frontends/qt4/ui/PrefUi.ui

index 9914ae94297ab00ad50c6e55605c72995090aa82..3f14e3a7b0f0c754c7453c3a32772da11523aff9 100644 (file)
@@ -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];
index f8327bd7ee7ecb9e49cfbf6956b5ac6b176e3bce..484edb42207211e7c2e9c3e6b430b428d21ed221 100644 (file)
@@ -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<string>(use_bundled_format)
+                          << '\n';
+               }
+               if (tag != RC_LAST)
+                       break;
 
                os << "\n#\n"
                   << "# COLOR SECTION ###################################\n"
index 40b3647880cb9cafc244c11e2aea3f7991af4590..68dcdfba607ec242424c0a15b53c690cb698455d 100644 (file)
@@ -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;
 };
 
 
index 23eb5a44cc9b6a63388a1fe62af48628cb6f5066..47a9c5a2c4a1be41d9de66563dfbe19e92378c04 100644 (file)
@@ -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);
 }
 
 
index eacc49668551412e421d9cb7ec915754e306982c..1c7f837e0223979822696dea6f804811b52e9597 100644 (file)
         </property>
        </widget>
       </item>
+      <item row="3" column="0" colspan="4" >
+       <widget class="QCheckBox" name="useBundledCB" >
+         <property name="text" >
+         <string>Use &amp;bundled format for new documents</string>
+         </property>
+       </widget>
+      </item>
      </layout>
     </widget>
    </item>
   <tabstop>autoSaveSB</tabstop>
   <tabstop>lastfilesSB</tabstop>
   <tabstop>openDocumentsInTabsCB</tabstop>
+  <tabstop>useBundledCB</tabstop>
  </tabstops>
  <includes>
   <include location="local" >qt_helpers.h</include>