From: Bo Peng Date: Tue, 25 Apr 2006 22:22:11 +0000 (+0000) Subject: Add lyxrc.use_lastfilepos and load_session to the preference dialog. Bo Peng (ben... X-Git-Tag: 1.6.10~13294 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=1d1df1a5f1fc9214890dd5fcc409bdd864676fd7;hp=13cd255a3053dcb62e0392b2d127aab70ab46e4c;p=lyx.git Add lyxrc.use_lastfilepos and load_session to the preference dialog. Bo Peng (ben.bob@gmail.com) * src/frontends/qt3/QPrefs.C, QPrefsDialog.C, ui/QPrefUIModule.ui: add two checkboxes * src/lyxrc.C: turn off load_session by default (since we now can turn it on) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13741 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt3/QPrefs.C b/src/frontends/qt3/QPrefs.C index 8ad8c2980e..e1fdc68bc5 100644 --- a/src/frontends/qt3/QPrefs.C +++ b/src/frontends/qt3/QPrefs.C @@ -178,6 +178,8 @@ void QPrefs::apply() rc.ui_file = internal_path(uimod->uiFileED->text()); rc.bind_file = internal_path(uimod->bindFileED->text()); + rc.use_lastfilepos = uimod->restoreCursorCB->isChecked(); + rc.load_session = uimod->loadSessionCB->isChecked(); rc.cursor_follows_scrollbar = uimod->cursorFollowsCB->isChecked(); rc.autosave = uimod->autoSaveSB->value() * 60; rc.make_backup = uimod->autoSaveCB->isChecked(); @@ -504,6 +506,8 @@ void QPrefs::update_contents() uimod->uiFileED->setText(external_path(rc.ui_file)); uimod->bindFileED->setText(external_path(rc.bind_file)); + uimod->restoreCursorCB->setChecked(rc.use_lastfilepos); + uimod->loadSessionCB->setChecked(rc.load_session); uimod->cursorFollowsCB->setChecked(rc.cursor_follows_scrollbar); // convert to minutes int mins(rc.autosave / 60); diff --git a/src/frontends/qt3/QPrefsDialog.C b/src/frontends/qt3/QPrefsDialog.C index fc4092de3d..5393eb8a5f 100644 --- a/src/frontends/qt3/QPrefsDialog.C +++ b/src/frontends/qt3/QPrefsDialog.C @@ -230,6 +230,8 @@ QPrefsDialog::QPrefsDialog(QPrefs * form) connect(languageModule->defaultLanguageCO, SIGNAL(activated(int)), this, SLOT(change_adaptor())); connect(uiModule->uiFileED, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor())); connect(uiModule->bindFileED, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor())); + connect(uiModule->restoreCursorCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor())); + connect(uiModule->loadSessionCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor())); connect(uiModule->cursorFollowsCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor())); connect(uiModule->autoSaveSB, SIGNAL(valueChanged(int)), this, SLOT(change_adaptor())); connect(uiModule->autoSaveCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor())); diff --git a/src/frontends/qt3/ui/QPrefUIModule.ui b/src/frontends/qt3/ui/QPrefUIModule.ui index 1fd387ab01..d7672f9513 100644 --- a/src/frontends/qt3/ui/QPrefUIModule.ui +++ b/src/frontends/qt3/ui/QPrefUIModule.ui @@ -1,15 +1,10 @@ - + QPrefUIModule -config.h -qt_helpers.h - - QWidget - - name + + QPrefUIModule - - geometry + 0 0 @@ -17,94 +12,131 @@ 441 - - sizePolicy + 1 1 + 0 + 0 - - caption + QPrefUIModule - - - margin + + + unnamed + + 11 - - spacing + 6 - - QLayoutWidget - - name + + + Layout2 + + + + unnamed + + + 0 + + + 6 + + + + bindFilePB + + + B&rowse... + + + + + uiFileLA + + + &User interface file: + + + uiFileED + + + + + bindFileLA + + + &Bind file: + + + bindFileED + + + + + uiFileED + + + + + uiFilePB + + + Bro&wse... + + + + + bindFileED + + + + + + Layout7 - - margin + + unnamed + + 0 - - spacing + 6 - - QLayoutWidget - - name + + Layout6 - - margin + + unnamed + + 0 - - spacing + 6 - - QGroupBox - - name + + documentsGB - - title + Documents - - QCheckBox - - name - autoSaveCB - - - geometry - - 11 - 17 - 275 - 17 - - - - text - B&ackup documents - - - - QLayoutWidget - - name + + Layout11 - - geometry + 60 40 @@ -113,86 +145,69 @@ - - margin + + unnamed + + 0 - - spacing + 6 - - name + Spacer6 - - orientation + Horizontal - - sizeType + Fixed - - sizeHint + 21 20 - - QLabel - - name + + autoSaveLA - - text + every - - buddy + autoSaveSB - - QSpinBox - - name + + autoSaveSB - - maxValue + 300 - - minValue + 1 - - QLabel - - name + + TextLabel1 - - text + minutes - - QLayoutWidget - - name + + Layout12 - - geometry + 11 69 @@ -201,60 +216,69 @@ - - margin + + unnamed + + 0 - - spacing + 6 - - QLabel - - name + + lastfilesLA - - text + &Maximum last files: - - buddy + lastfilesSB - - QSpinBox - - name + + lastfilesSB - - maxValue + 9 + + + autoSaveCB + + + + 11 + 17 + 275 + 17 + + + + B&ackup documents + + + Alt+A + + - - name + Spacer8 - - orientation + Horizontal - - sizeType + Expanding - - sizeHint + 20 20 @@ -263,122 +287,107 @@ - - QLayoutWidget - - name - Layout2 + + + layout6 - - - margin - 0 - - - spacing - 6 + + + unnamed - - QPushButton - - name - bindFilePB - - - text - B&rowse... + + + sessionGB - - - QLabel - - name - uiFileLA - - - text - &User interface file: - - - buddy - uiFileED - - - - QLabel - - name - bindFileLA - - - text - &Bind file: - - - buddy - bindFileED + + Session + + + unnamed + + + + layout7 + + + + unnamed + + + + restoreCursorCB + + + Restore cursor positions + + + true + + + Restore to cursor position when the file was last closed + + + + + loadSessionCB + + + Load opened files from last session + + + + + - - QLineEdit - - name - uiFileED + + + spacer4 - - - QPushButton - - name - uiFilePB + + Horizontal - - text - Bro&wse... + + Expanding - - - QLineEdit - - name - bindFileED + + + 81 + 31 + - - + + - - QCheckBox - - name + + cursorFollowsCB - - text + Cursor follows &scrollbar + + Alt+S + - - - name + + Spacer7 - - orientation + Vertical - - sizeType + Expanding - - sizeHint + 20 - 20 + 90 - + @@ -410,4 +419,9 @@ autoSaveSB lastfilesSB + + config.h + qt_helpers.h + + diff --git a/src/lyxrc.C b/src/lyxrc.C index e617f7d9ae..7cfb14f28d 100644 --- a/src/lyxrc.C +++ b/src/lyxrc.C @@ -254,7 +254,7 @@ void LyXRC::setDefaults() { num_lastfiles = maxlastfiles; check_lastfiles = true; use_lastfilepos = true; - load_session = true; + load_session = false; make_backup = true; backupdir_path.erase(); display_graphics = lyx::graphics::ColorDisplay;