Add lyxrc.use_lastfilepos and load_session to the qt4 preference dialog.

* src/frontends/qt4/QPrefsDialog.C, connect checkboxes to lyxrc
	* src/frontends/qt4/ui/QPrefUi.ui, add two checkboxes.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13766 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Bo Peng 2006-04-27 18:19:14 +00:00
parent a19e4ae888
commit 7cff3d5d5e
2 changed files with 205 additions and 180 deletions

View File

@ -394,6 +394,8 @@ QPrefsDialog::QPrefsDialog(QPrefs * form)
connect(uiModule->bindFilePB, SIGNAL(clicked()), this, SLOT(select_bind())); connect(uiModule->bindFilePB, SIGNAL(clicked()), this, SLOT(select_bind()));
connect(uiModule->uiFileED, SIGNAL(textChanged(const QString&)), 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->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->cursorFollowsCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
connect(uiModule->autoSaveSB, SIGNAL(valueChanged(int)), this, SLOT(change_adaptor())); connect(uiModule->autoSaveSB, SIGNAL(valueChanged(int)), this, SLOT(change_adaptor()));
connect(uiModule->autoSaveCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor())); connect(uiModule->autoSaveCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor()));
@ -1127,6 +1129,8 @@ void QPrefsDialog::apply(LyXRC & rc) const
rc.ui_file = internal_path(uiModule->uiFileED->text()); rc.ui_file = internal_path(uiModule->uiFileED->text());
rc.bind_file = internal_path(uiModule->bindFileED->text()); rc.bind_file = internal_path(uiModule->bindFileED->text());
rc.use_lastfilepos = uiModule->restoreCursorCB->isChecked();
rc.load_session = uiModule->loadSessionCB->isChecked();
rc.cursor_follows_scrollbar = uiModule->cursorFollowsCB->isChecked(); rc.cursor_follows_scrollbar = uiModule->cursorFollowsCB->isChecked();
rc.autosave = uiModule->autoSaveSB->value() * 60; rc.autosave = uiModule->autoSaveSB->value() * 60;
rc.make_backup = uiModule->autoSaveCB->isChecked(); rc.make_backup = uiModule->autoSaveCB->isChecked();
@ -1421,6 +1425,8 @@ void QPrefsDialog::update(LyXRC const & rc)
uiModule->uiFileED->setText(external_path(rc.ui_file)); uiModule->uiFileED->setText(external_path(rc.ui_file));
uiModule->bindFileED->setText(external_path(rc.bind_file)); uiModule->bindFileED->setText(external_path(rc.bind_file));
uiModule->restoreCursorCB->setChecked(rc.use_lastfilepos);
uiModule->loadSessionCB->setChecked(rc.load_session);
uiModule->cursorFollowsCB->setChecked(rc.cursor_follows_scrollbar); uiModule->cursorFollowsCB->setChecked(rc.cursor_follows_scrollbar);
// convert to minutes // convert to minutes
int mins(rc.autosave / 60); int mins(rc.autosave / 60);

View File

@ -9,7 +9,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>416</width> <width>416</width>
<height>441</height> <height>513</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy" > <property name="sizePolicy" >
@ -23,14 +23,209 @@
<property name="windowTitle" > <property name="windowTitle" >
<string/> <string/>
</property> </property>
<layout class="QVBoxLayout" > <layout class="QGridLayout" >
<property name="margin" > <property name="margin" >
<number>11</number> <number>9</number>
</property> </property>
<property name="spacing" > <property name="spacing" >
<number>6</number> <number>6</number>
</property> </property>
<item> <item row="2" column="0" >
<widget class="QGroupBox" name="sessionGB" >
<property name="title" >
<string>Session</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="0" column="0" >
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QCheckBox" name="restoreCursorCB" >
<property name="text" >
<string>Restore cursor positions</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="loadSessionCB" >
<property name="text" >
<string>Load opened files from last session</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="3" column="0" >
<widget class="QGroupBox" name="scrollGB" >
<property name="title" >
<string>Scrolling</string>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>11</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QCheckBox" name="cursorFollowsCB" >
<property name="text" >
<string>Cursor follows &amp;scrollbar</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="1" column="0" >
<widget class="QGroupBox" name="documentsGB" >
<property name="title" >
<string>Documents</string>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>11</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QCheckBox" name="autoSaveCB" >
<property name="text" >
<string>B&amp;ackup documents </string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>21</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="autoSaveLA" >
<property name="text" >
<string> every</string>
</property>
<property name="buddy" >
<cstring>autoSaveSB</cstring>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="autoSaveSB" >
<property name="maximum" >
<number>300</number>
</property>
<property name="minimum" >
<number>1</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="TextLabel1" >
<property name="text" >
<string>minutes</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="lastfilesLA" >
<property name="text" >
<string>&amp;Maximum last files:</string>
</property>
<property name="buddy" >
<cstring>lastfilesSB</cstring>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="lastfilesSB" >
<property name="maximum" >
<number>9</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item rowspan="2" row="1" column="1" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>51</width>
<height>258</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="0" colspan="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>394</width>
<height>21</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0" colspan="2" >
<layout class="QGridLayout" > <layout class="QGridLayout" >
<property name="margin" > <property name="margin" >
<number>0</number> <number>0</number>
@ -80,182 +275,6 @@
</item> </item>
</layout> </layout>
</item> </item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QGroupBox" name="documentsGB" >
<property name="title" >
<string>Documents</string>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>11</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QCheckBox" name="autoSaveCB" >
<property name="text" >
<string>B&amp;ackup documents </string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>21</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="autoSaveLA" >
<property name="text" >
<string> every</string>
</property>
<property name="buddy" >
<cstring>autoSaveSB</cstring>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="autoSaveSB" >
<property name="maximum" >
<number>300</number>
</property>
<property name="minimum" >
<number>1</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="TextLabel1" >
<property name="text" >
<string>minutes</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="lastfilesLA" >
<property name="text" >
<string>&amp;Maximum last files:</string>
</property>
<property name="buddy" >
<cstring>lastfilesSB</cstring>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="lastfilesSB" >
<property name="maximum" >
<number>9</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="scrollGB" >
<property name="title" >
<string>Scrolling</string>
</property>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>11</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QCheckBox" name="cursorFollowsCB" >
<property name="text" >
<string>Cursor follows &amp;scrollbar</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget> </widget>
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction> <pixmapfunction>qPixmapFromMimeSource</pixmapfunction>