From 0dc39929a47b86443d14e22a0d9fcd77c1d4851e Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Fri, 18 Sep 2009 16:44:20 +0000 Subject: [PATCH] It appears that somewhere along the way, backing up originals when saving got conflated with autosaving, with the result that it became impossible to disable autosaving, as reported on the user list. This patch disentangles the two again. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31395 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiPrefs.cpp | 17 +++++++++++------ src/frontends/qt4/ui/PrefUi.ui | 19 +++++++++++++------ 2 files changed, 24 insertions(+), 12 deletions(-) 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 -- 2.39.2