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
This commit is contained in:
Bo Peng 2008-03-15 22:41:54 +00:00
parent 47c5be88e3
commit 0f9a8fcad4
5 changed files with 31 additions and 1 deletions

View File

@ -351,7 +351,7 @@ BufferParams::BufferParams()
listings_params = string(); listings_params = string();
pagestyle = "default"; pagestyle = "default";
compressed = false; compressed = false;
embedded = false; embedded = lyxrc.use_bundled_format;
for (int iter = 0; iter < 4; ++iter) { for (int iter = 0; iter < 4; ++iter) {
user_defined_bullet(iter) = ITEMIZE_DEFAULTS[iter]; user_defined_bullet(iter) = ITEMIZE_DEFAULTS[iter];
temp_bullet(iter) = ITEMIZE_DEFAULTS[iter]; temp_bullet(iter) = ITEMIZE_DEFAULTS[iter];

View File

@ -162,6 +162,7 @@ keyword_item lyxrcTags[] = {
{ "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS }, { "\\tex_expects_windows_paths", LyXRC::RC_TEX_EXPECTS_WINDOWS_PATHS },
{ "\\ui_file", LyXRC::RC_UIFILE }, { "\\ui_file", LyXRC::RC_UIFILE },
{ "\\use_alt_language", LyXRC::RC_USE_ALT_LANG }, { "\\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_converter_cache", LyXRC::RC_USE_CONVERTER_CACHE },
{ "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS }, { "\\use_escape_chars", LyXRC::RC_USE_ESC_CHARS },
{ "\\use_input_encoding", LyXRC::RC_USE_INP_ENC }, { "\\use_input_encoding", LyXRC::RC_USE_INP_ENC },
@ -298,6 +299,7 @@ void LyXRC::setDefaults() {
#else #else
open_buffers_in_tabs = true; open_buffers_in_tabs = true;
#endif #endif
use_bundled_format = false;
// Fullscreen settings // Fullscreen settings
full_screen_limit = false; full_screen_limit = false;
@ -1306,6 +1308,10 @@ int LyXRC::read(Lexer & lexrc)
if (lexrc.next()) if (lexrc.next())
open_buffers_in_tabs = lexrc.getBool(); open_buffers_in_tabs = lexrc.getBool();
break; break;
case RC_USE_BUNDLED_FORMAT:
if (lexrc.next())
use_bundled_format = lexrc.getBool();
break;
case RC_LAST: break; // this is just a dummy 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) if (tag != RC_LAST)
break; 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" os << "\n#\n"
<< "# COLOR SECTION ###################################\n" << "# COLOR SECTION ###################################\n"

View File

@ -151,6 +151,7 @@ public:
RC_USER_NAME, RC_USER_NAME,
RC_USETEMPDIR, RC_USETEMPDIR,
RC_USE_ALT_LANG, RC_USE_ALT_LANG,
RC_USE_BUNDLED_FORMAT,
RC_USE_CONVERTER_CACHE, RC_USE_CONVERTER_CACHE,
RC_USE_ESC_CHARS, RC_USE_ESC_CHARS,
RC_USE_INP_ENC, RC_USE_INP_ENC,
@ -439,6 +440,8 @@ public:
bool completion_popup_after_complete; bool completion_popup_after_complete;
/// ///
bool open_buffers_in_tabs; bool open_buffers_in_tabs;
///
bool use_bundled_format;
}; };

View File

@ -1803,6 +1803,8 @@ PrefUserInterface::PrefUserInterface(GuiPreferences * form, QWidget * parent)
this, SIGNAL(changed())); this, SIGNAL(changed()));
connect(tooltipCB, SIGNAL(toggled(bool)), connect(tooltipCB, SIGNAL(toggled(bool)),
this, SIGNAL(changed())); this, SIGNAL(changed()));
connect(useBundledCB, SIGNAL(toggled(bool)),
this, SIGNAL(changed()));
lastfilesSB->setMaximum(maxlastfiles); lastfilesSB->setMaximum(maxlastfiles);
} }
@ -1818,6 +1820,7 @@ void PrefUserInterface::apply(LyXRC & rc) const
rc.num_lastfiles = lastfilesSB->value(); rc.num_lastfiles = lastfilesSB->value();
rc.use_tooltip = tooltipCB->isChecked(); rc.use_tooltip = tooltipCB->isChecked();
rc.open_buffers_in_tabs = openDocumentsInTabsCB->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); lastfilesSB->setValue(rc.num_lastfiles);
tooltipCB->setChecked(rc.use_tooltip); tooltipCB->setChecked(rc.use_tooltip);
openDocumentsInTabsCB->setChecked(rc.open_buffers_in_tabs); openDocumentsInTabsCB->setChecked(rc.open_buffers_in_tabs);
useBundledCB->setChecked(rc.use_bundled_format);
} }

View File

@ -171,6 +171,13 @@
</property> </property>
</widget> </widget>
</item> </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> </layout>
</widget> </widget>
</item> </item>
@ -252,6 +259,7 @@
<tabstop>autoSaveSB</tabstop> <tabstop>autoSaveSB</tabstop>
<tabstop>lastfilesSB</tabstop> <tabstop>lastfilesSB</tabstop>
<tabstop>openDocumentsInTabsCB</tabstop> <tabstop>openDocumentsInTabsCB</tabstop>
<tabstop>useBundledCB</tabstop>
</tabstops> </tabstops>
<includes> <includes>
<include location="local" >qt_helpers.h</include> <include location="local" >qt_helpers.h</include>