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->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()));
@ -1127,6 +1129,8 @@ void QPrefsDialog::apply(LyXRC & rc) const
rc.ui_file = internal_path(uiModule->uiFileED->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.autosave = uiModule->autoSaveSB->value() * 60;
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->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);
// convert to minutes
int mins(rc.autosave / 60);

View File

@ -9,7 +9,7 @@
<x>0</x>
<y>0</y>
<width>416</width>
<height>441</height>
<height>513</height>
</rect>
</property>
<property name="sizePolicy" >
@ -23,6 +23,57 @@
<property name="windowTitle" >
<string/>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<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>
@ -31,72 +82,16 @@
<number>6</number>
</property>
<item>
<layout class="QGridLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="1" column="2" >
<widget class="QPushButton" name="bindFilePB" >
<widget class="QCheckBox" name="cursorFollowsCB" >
<property name="text" >
<string>B&amp;rowse...</string>
<string>Cursor follows &amp;scrollbar</string>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="uiFileLA" >
<property name="text" >
<string>&amp;User interface file:</string>
</property>
<property name="buddy" >
<cstring>uiFileED</cstring>
</property>
</layout>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="bindFileLA" >
<property name="text" >
<string>&amp;Bind file:</string>
</property>
<property name="buddy" >
<cstring>bindFileED</cstring>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLineEdit" name="uiFileED" />
</item>
<item row="0" column="2" >
<widget class="QPushButton" name="uiFilePB" >
<property name="text" >
<string>Bro&amp;wse...</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLineEdit" name="bindFileED" />
</item>
</layout>
</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>
@ -198,31 +193,7 @@
</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>
<item rowspan="2" row="1" column="1" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
@ -232,15 +203,13 @@
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>20</height>
<width>51</width>
<height>258</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<item row="4" column="0" colspan="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
@ -250,12 +219,62 @@
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>20</height>
<width>394</width>
<height>21</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0" colspan="2" >
<layout class="QGridLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="1" column="2" >
<widget class="QPushButton" name="bindFilePB" >
<property name="text" >
<string>B&amp;rowse...</string>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="uiFileLA" >
<property name="text" >
<string>&amp;User interface file:</string>
</property>
<property name="buddy" >
<cstring>uiFileED</cstring>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="bindFileLA" >
<property name="text" >
<string>&amp;Bind file:</string>
</property>
<property name="buddy" >
<cstring>bindFileED</cstring>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLineEdit" name="uiFileED" />
</item>
<item row="0" column="2" >
<widget class="QPushButton" name="uiFilePB" >
<property name="text" >
<string>Bro&amp;wse...</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLineEdit" name="bindFileED" />
</item>
</layout>
</item>
</layout>
</widget>
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>