Fix bug #6617: Allowing "compressed documents" be the default.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33870 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2010-03-26 14:02:56 +00:00
parent 15f850609c
commit 1e4ccc2d22
5 changed files with 34 additions and 7 deletions

View File

@ -369,7 +369,7 @@ BufferParams::BufferParams()
suppress_date = false;
// white is equal to no background color
backgroundcolor = lyx::rgbFromHexName("#ffffff");
compressed = false;
compressed = lyxrc.save_compressed;
for (int iter = 0; iter < 4; ++iter) {
user_defined_bullet(iter) = ITEMIZE_DEFAULTS[iter];
temp_bullet(iter) = ITEMIZE_DEFAULTS[iter];

View File

@ -155,6 +155,7 @@ LexerKeyword lyxrcTags[] = {
{ "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
{ "\\printer", LyXRC::RC_PRINTER },
{ "\\rtl", LyXRC::RC_RTL_SUPPORT },
{ "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
{ "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
{ "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
{ "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
@ -274,6 +275,7 @@ void LyXRC::setDefaults()
use_lastfilepos = true;
load_session = false;
make_backup = true;
save_compressed = false;
backupdir_path.erase();
display_graphics = true;
// Spellchecker settings:
@ -921,6 +923,9 @@ int LyXRC::read(Lexer & lexrc)
case RC_MAKE_BACKUP:
lexrc >> make_backup;
break;
case RC_SAVE_COMPRESSED:
lexrc >> save_compressed;
break;
case RC_BACKUPDIR_PATH:
if (lexrc.next()) {
backupdir_path = os::internal_path(lexrc.getString());
@ -2218,6 +2223,13 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c
}
if (tag != RC_LAST)
break;
case RC_SAVE_COMPRESSED:
if (ignore_system_lyxrc ||
save_compressed != system_lyxrc.save_compressed) {
os << "\\save_compressed " << convert<string>(save_compressed) << '\n';
}
if (tag != RC_LAST)
break;
case RC_BACKUPDIR_PATH:
if (ignore_system_lyxrc ||
backupdir_path != system_lyxrc.backupdir_path) {
@ -2736,6 +2748,7 @@ void actOnUpdatedPrefs(LyXRC const & lyxrc_orig, LyXRC const & lyxrc_new)
case LyXRC::RC_PRINT_ADAPTOUTPUT:
case LyXRC::RC_PRINT_COMMAND:
case LyXRC::RC_RTL_SUPPORT:
case LyXRC::RC_SAVE_COMPRESSED:
case LyXRC::RC_SCREEN_DPI:
case LyXRC::RC_SCREEN_FONT_ROMAN:
case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:

View File

@ -140,6 +140,7 @@ public:
RC_PRINT_ADAPTOUTPUT,
RC_PRINT_COMMAND,
RC_RTL_SUPPORT,
RC_SAVE_COMPRESSED,
RC_SCREEN_DPI,
RC_SCREEN_FONT_ROMAN,
RC_SCREEN_FONT_ROMAN_FOUNDRY,
@ -302,6 +303,8 @@ public:
bool use_lastfilepos;
/// load files from last session automatically
bool load_session;
/// do we save new documents as compressed by default
bool save_compressed;
/// shall a backup file be created
bool make_backup;
/// A directory for storing backup files

View File

@ -2248,6 +2248,8 @@ PrefUserInterface::PrefUserInterface(GuiPreferences * form)
this, SIGNAL(changed()));
connect(backupCB, SIGNAL(clicked()),
this, SIGNAL(changed()));
connect(saveCompressedCB, SIGNAL(clicked()),
this, SIGNAL(changed()));
connect(lastfilesSB, SIGNAL(valueChanged(int)),
this, SIGNAL(changed()));
connect(tooltipCB, SIGNAL(toggled(bool)),
@ -2262,8 +2264,9 @@ void PrefUserInterface::apply(LyXRC & rc) const
rc.use_lastfilepos = restoreCursorCB->isChecked();
rc.load_session = loadSessionCB->isChecked();
rc.allow_geometry_session = allowGeometrySessionCB->isChecked();
rc.autosave = autoSaveCB->isChecked()? autoSaveSB->value() * 60 : 0;
rc.autosave = autoSaveCB->isChecked() ? autoSaveSB->value() * 60 : 0;
rc.make_backup = backupCB->isChecked();
rc.save_compressed = saveCompressedCB->isChecked();
rc.num_lastfiles = lastfilesSB->value();
rc.use_tooltip = tooltipCB->isChecked();
rc.open_buffers_in_tabs = openDocumentsInTabsCB->isChecked();
@ -2289,6 +2292,7 @@ void PrefUserInterface::update(LyXRC const & rc)
autoSaveCB->setChecked(autosave);
autoSaveSB->setEnabled(autosave);
backupCB->setChecked(rc.make_backup);
saveCompressedCB->setChecked(rc.save_compressed);
lastfilesSB->setValue(rc.num_lastfiles);
tooltipCB->setChecked(rc.use_tooltip);
openDocumentsInTabsCB->setChecked(rc.open_buffers_in_tabs);

View File

@ -91,7 +91,7 @@
<property name="flat">
<bool>true</bool>
</property>
<layout class="QGridLayout" name="gridLayout">
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="allowGeometrySessionCB">
<property name="enabled">
@ -196,6 +196,13 @@
</spacer>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="saveCompressedCB">
<property name="text">
<string>&amp;Save documents compressed by default</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="lastfilesLA">
<property name="text">
<string>&amp;Maximum last files:</string>
@ -205,14 +212,14 @@
</property>
</widget>
</item>
<item row="2" column="1">
<item row="3" column="1">
<widget class="QSpinBox" name="lastfilesSB">
<property name="maximum">
<number>9</number>
</property>
</widget>
</item>
<item row="2" column="2" colspan="2">
<item row="3" column="2" colspan="2">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -225,14 +232,14 @@
</property>
</spacer>
</item>
<item row="3" column="0" colspan="2">
<item row="4" column="0" colspan="2">
<widget class="QCheckBox" name="openDocumentsInTabsCB">
<property name="text">
<string>&amp;Open documents in tabs</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="2">
<item row="5" column="0" colspan="2">
<widget class="QCheckBox" name="singleCloseTabButtonCB">
<property name="toolTip">
<string>Whether to place close button on each tab or only one in the top left.</string>