diff --git a/src/frontends/qt4/GuiPrefs.cpp b/src/frontends/qt4/GuiPrefs.cpp index 5c66378962..241c70b20d 100644 --- a/src/frontends/qt4/GuiPrefs.cpp +++ b/src/frontends/qt4/GuiPrefs.cpp @@ -2152,6 +2152,8 @@ PrefUserInterface::PrefUserInterface(GuiPreferences * form) this, SIGNAL(changed())); connect(autoSaveCB, SIGNAL(clicked()), this, SIGNAL(changed())); + connect(backupCB, SIGNAL(clicked()), + this, SIGNAL(changed())); connect(lastfilesSB, SIGNAL(valueChanged(int)), this, SIGNAL(changed())); connect(tooltipCB, SIGNAL(toggled(bool)), @@ -2166,8 +2168,8 @@ void PrefUserInterface::apply(LyXRC & rc) const rc.use_lastfilepos = restoreCursorCB->isChecked(); rc.load_session = loadSessionCB->isChecked(); rc.allow_geometry_session = allowGeometrySessionCB->isChecked(); - rc.autosave = autoSaveSB->value() * 60; - rc.make_backup = autoSaveCB->isChecked(); + rc.autosave = autoSaveCB->isChecked()? autoSaveSB->value() * 60 : 0; + rc.make_backup = backupCB->isChecked(); rc.num_lastfiles = lastfilesSB->value(); rc.use_tooltip = tooltipCB->isChecked(); rc.open_buffers_in_tabs = openDocumentsInTabsCB->isChecked(); @@ -2181,11 +2183,14 @@ void PrefUserInterface::update(LyXRC const & rc) loadSessionCB->setChecked(rc.load_session); allowGeometrySessionCB->setChecked(rc.allow_geometry_session); // convert to minutes - int mins(rc.autosave / 60); - if (rc.autosave && !mins) - mins = 1; + bool autosave = rc.autosave > 0; + int mins = rc.autosave / 60; + if (!mins) + mins = 5; autoSaveSB->setValue(mins); - autoSaveCB->setChecked(rc.make_backup); + autoSaveCB->setChecked(autosave); + autoSaveSB->setEnabled(autosave); + backupCB->setChecked(rc.make_backup); lastfilesSB->setValue(rc.num_lastfiles); tooltipCB->setChecked(rc.use_tooltip); openDocumentsInTabsCB->setChecked(rc.open_buffers_in_tabs); diff --git a/src/frontends/qt4/ui/PrefUi.ui b/src/frontends/qt4/ui/PrefUi.ui index 6f338c6749..8ac971a546 100644 --- a/src/frontends/qt4/ui/PrefUi.ui +++ b/src/frontends/qt4/ui/PrefUi.ui @@ -94,7 +94,7 @@ 6 - + 6 @@ -134,7 +134,14 @@ - + + + + Backup original documents when saving + + + + Qt::Horizontal @@ -147,14 +154,14 @@ - + minutes - + 1 @@ -164,14 +171,14 @@ - + &Backup documents, every - + &Open documents in tabs