mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-26 03:11:59 +00:00
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:
parent
15f850609c
commit
1e4ccc2d22
@ -369,7 +369,7 @@ BufferParams::BufferParams()
|
|||||||
suppress_date = false;
|
suppress_date = false;
|
||||||
// white is equal to no background color
|
// white is equal to no background color
|
||||||
backgroundcolor = lyx::rgbFromHexName("#ffffff");
|
backgroundcolor = lyx::rgbFromHexName("#ffffff");
|
||||||
compressed = false;
|
compressed = lyxrc.save_compressed;
|
||||||
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];
|
||||||
|
@ -155,6 +155,7 @@ LexerKeyword lyxrcTags[] = {
|
|||||||
{ "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
|
{ "\\print_to_printer", LyXRC::RC_PRINTTOPRINTER },
|
||||||
{ "\\printer", LyXRC::RC_PRINTER },
|
{ "\\printer", LyXRC::RC_PRINTER },
|
||||||
{ "\\rtl", LyXRC::RC_RTL_SUPPORT },
|
{ "\\rtl", LyXRC::RC_RTL_SUPPORT },
|
||||||
|
{ "\\save_compressed", LyXRC::RC_SAVE_COMPRESSED },
|
||||||
{ "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
|
{ "\\screen_dpi", LyXRC::RC_SCREEN_DPI },
|
||||||
{ "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
|
{ "\\screen_font_roman", LyXRC::RC_SCREEN_FONT_ROMAN },
|
||||||
{ "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
|
{ "\\screen_font_roman_foundry", LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY },
|
||||||
@ -274,6 +275,7 @@ void LyXRC::setDefaults()
|
|||||||
use_lastfilepos = true;
|
use_lastfilepos = true;
|
||||||
load_session = false;
|
load_session = false;
|
||||||
make_backup = true;
|
make_backup = true;
|
||||||
|
save_compressed = false;
|
||||||
backupdir_path.erase();
|
backupdir_path.erase();
|
||||||
display_graphics = true;
|
display_graphics = true;
|
||||||
// Spellchecker settings:
|
// Spellchecker settings:
|
||||||
@ -921,6 +923,9 @@ int LyXRC::read(Lexer & lexrc)
|
|||||||
case RC_MAKE_BACKUP:
|
case RC_MAKE_BACKUP:
|
||||||
lexrc >> make_backup;
|
lexrc >> make_backup;
|
||||||
break;
|
break;
|
||||||
|
case RC_SAVE_COMPRESSED:
|
||||||
|
lexrc >> save_compressed;
|
||||||
|
break;
|
||||||
case RC_BACKUPDIR_PATH:
|
case RC_BACKUPDIR_PATH:
|
||||||
if (lexrc.next()) {
|
if (lexrc.next()) {
|
||||||
backupdir_path = os::internal_path(lexrc.getString());
|
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)
|
if (tag != RC_LAST)
|
||||||
break;
|
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:
|
case RC_BACKUPDIR_PATH:
|
||||||
if (ignore_system_lyxrc ||
|
if (ignore_system_lyxrc ||
|
||||||
backupdir_path != system_lyxrc.backupdir_path) {
|
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_ADAPTOUTPUT:
|
||||||
case LyXRC::RC_PRINT_COMMAND:
|
case LyXRC::RC_PRINT_COMMAND:
|
||||||
case LyXRC::RC_RTL_SUPPORT:
|
case LyXRC::RC_RTL_SUPPORT:
|
||||||
|
case LyXRC::RC_SAVE_COMPRESSED:
|
||||||
case LyXRC::RC_SCREEN_DPI:
|
case LyXRC::RC_SCREEN_DPI:
|
||||||
case LyXRC::RC_SCREEN_FONT_ROMAN:
|
case LyXRC::RC_SCREEN_FONT_ROMAN:
|
||||||
case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
|
case LyXRC::RC_SCREEN_FONT_ROMAN_FOUNDRY:
|
||||||
|
@ -140,6 +140,7 @@ public:
|
|||||||
RC_PRINT_ADAPTOUTPUT,
|
RC_PRINT_ADAPTOUTPUT,
|
||||||
RC_PRINT_COMMAND,
|
RC_PRINT_COMMAND,
|
||||||
RC_RTL_SUPPORT,
|
RC_RTL_SUPPORT,
|
||||||
|
RC_SAVE_COMPRESSED,
|
||||||
RC_SCREEN_DPI,
|
RC_SCREEN_DPI,
|
||||||
RC_SCREEN_FONT_ROMAN,
|
RC_SCREEN_FONT_ROMAN,
|
||||||
RC_SCREEN_FONT_ROMAN_FOUNDRY,
|
RC_SCREEN_FONT_ROMAN_FOUNDRY,
|
||||||
@ -302,6 +303,8 @@ public:
|
|||||||
bool use_lastfilepos;
|
bool use_lastfilepos;
|
||||||
/// load files from last session automatically
|
/// load files from last session automatically
|
||||||
bool load_session;
|
bool load_session;
|
||||||
|
/// do we save new documents as compressed by default
|
||||||
|
bool save_compressed;
|
||||||
/// shall a backup file be created
|
/// shall a backup file be created
|
||||||
bool make_backup;
|
bool make_backup;
|
||||||
/// A directory for storing backup files
|
/// A directory for storing backup files
|
||||||
|
@ -2248,6 +2248,8 @@ PrefUserInterface::PrefUserInterface(GuiPreferences * form)
|
|||||||
this, SIGNAL(changed()));
|
this, SIGNAL(changed()));
|
||||||
connect(backupCB, SIGNAL(clicked()),
|
connect(backupCB, SIGNAL(clicked()),
|
||||||
this, SIGNAL(changed()));
|
this, SIGNAL(changed()));
|
||||||
|
connect(saveCompressedCB, SIGNAL(clicked()),
|
||||||
|
this, SIGNAL(changed()));
|
||||||
connect(lastfilesSB, SIGNAL(valueChanged(int)),
|
connect(lastfilesSB, SIGNAL(valueChanged(int)),
|
||||||
this, SIGNAL(changed()));
|
this, SIGNAL(changed()));
|
||||||
connect(tooltipCB, SIGNAL(toggled(bool)),
|
connect(tooltipCB, SIGNAL(toggled(bool)),
|
||||||
@ -2262,8 +2264,9 @@ void PrefUserInterface::apply(LyXRC & rc) const
|
|||||||
rc.use_lastfilepos = restoreCursorCB->isChecked();
|
rc.use_lastfilepos = restoreCursorCB->isChecked();
|
||||||
rc.load_session = loadSessionCB->isChecked();
|
rc.load_session = loadSessionCB->isChecked();
|
||||||
rc.allow_geometry_session = allowGeometrySessionCB->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.make_backup = backupCB->isChecked();
|
||||||
|
rc.save_compressed = saveCompressedCB->isChecked();
|
||||||
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();
|
||||||
@ -2289,6 +2292,7 @@ void PrefUserInterface::update(LyXRC const & rc)
|
|||||||
autoSaveCB->setChecked(autosave);
|
autoSaveCB->setChecked(autosave);
|
||||||
autoSaveSB->setEnabled(autosave);
|
autoSaveSB->setEnabled(autosave);
|
||||||
backupCB->setChecked(rc.make_backup);
|
backupCB->setChecked(rc.make_backup);
|
||||||
|
saveCompressedCB->setChecked(rc.save_compressed);
|
||||||
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);
|
||||||
|
@ -91,7 +91,7 @@
|
|||||||
<property name="flat">
|
<property name="flat">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout_4">
|
||||||
<item row="0" column="0" colspan="2">
|
<item row="0" column="0" colspan="2">
|
||||||
<widget class="QCheckBox" name="allowGeometrySessionCB">
|
<widget class="QCheckBox" name="allowGeometrySessionCB">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
@ -196,6 +196,13 @@
|
|||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
|
<widget class="QCheckBox" name="saveCompressedCB">
|
||||||
|
<property name="text">
|
||||||
|
<string>&Save documents compressed by default</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="lastfilesLA">
|
<widget class="QLabel" name="lastfilesLA">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Maximum last files:</string>
|
<string>&Maximum last files:</string>
|
||||||
@ -205,14 +212,14 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="QSpinBox" name="lastfilesSB">
|
<widget class="QSpinBox" name="lastfilesSB">
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>9</number>
|
<number>9</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="2" colspan="2">
|
<item row="3" column="2" colspan="2">
|
||||||
<spacer>
|
<spacer>
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
@ -225,14 +232,14 @@
|
|||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0" colspan="2">
|
<item row="4" column="0" colspan="2">
|
||||||
<widget class="QCheckBox" name="openDocumentsInTabsCB">
|
<widget class="QCheckBox" name="openDocumentsInTabsCB">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Open documents in tabs</string>
|
<string>&Open documents in tabs</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0" colspan="2">
|
<item row="5" column="0" colspan="2">
|
||||||
<widget class="QCheckBox" name="singleCloseTabButtonCB">
|
<widget class="QCheckBox" name="singleCloseTabButtonCB">
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Whether to place close button on each tab or only one in the top left.</string>
|
<string>Whether to place close button on each tab or only one in the top left.</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user