* QPrefConvertersUi.ui

- change GUI layout in accordance with latest "copiers" and "file format" changes.
  - add converter cache section.

* QPrefsDialog: implement converter cache enabling and maximum age.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17791 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-04-13 09:16:06 +00:00
parent 4502bc5f3d
commit 20c5d212ca
3 changed files with 296 additions and 203 deletions

View File

@ -876,16 +876,26 @@ PrefConverters::PrefConverters(QPrefs * form, QWidget * parent)
this, SIGNAL(changed()));
connect(converterModifyPB, SIGNAL(clicked()),
this, SIGNAL(changed()));
connect(maxAgeLE, SIGNAL(textChanged(const QString&)),
this, SIGNAL(changed()));
maxAgeLE->setValidator(new QDoubleValidator(maxAgeLE));
}
void PrefConverters::apply(LyXRC & /*rc*/) const
void PrefConverters::apply(LyXRC & rc) const
{
rc.use_converter_cache = cacheCB->isChecked();
rc.converter_cache_maxage = int(maxAgeLE->text().toDouble() * 86400.0);
}
void PrefConverters::update(LyXRC const & /*rc*/)
void PrefConverters::update(LyXRC const & rc)
{
cacheCB->setChecked(rc.use_converter_cache);
QString max_age;
max_age.setNum(double(rc.converter_cache_maxage) / 86400.0, 'g', 6);
maxAgeLE->setText(max_age);
updateGui();
}
@ -978,6 +988,9 @@ void PrefConverters::updateButtons()
converterModifyPB->setEnabled(valid && known && modified);
converterNewPB->setEnabled(valid && !known);
converterRemovePB->setEnabled(known);
maxAgeLE->setEnabled(cacheCB->isChecked());
maxAgeLA->setEnabled(cacheCB->isChecked());
}
@ -1011,6 +1024,14 @@ void PrefConverters::remove_converter()
}
void PrefConverters::on_cacheCB_stateChanged(int state)
{
maxAgeLE->setEnabled(state == Qt::Checked);
maxAgeLA->setEnabled(state == Qt::Checked);
changed();
}
PrefCopiers::PrefCopiers(QPrefs * form, QWidget * parent)
: PrefModule(docstring(), _("Copiers"), form, parent)
{

View File

@ -251,6 +251,7 @@ private Q_SLOTS:
void switch_converter();
void converter_changed();
void remove_converter();
void on_cacheCB_stateChanged(int state);
private:
void updateButtons();

View File

@ -1,219 +1,287 @@
<ui version="4.0" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>QPrefConvertersUi</class>
<widget class="QWidget" name="QPrefConvertersUi" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>297</width>
<height>307</height>
<width>423</width>
<height>394</height>
</rect>
</property>
<property name="windowTitle" >
<string/>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
<widget class="QGroupBox" name="cacheGB" >
<property name="geometry" >
<rect>
<x>0</x>
<y>330</y>
<width>421</width>
<height>61</height>
</rect>
</property>
<property name="spacing" >
<number>6</number>
<property name="title" >
<string>Converter File Cache</string>
</property>
<item rowspan="3" row="1" column="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>231</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1" >
<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::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>97</width>
<height>31</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="converterNewPB" >
<property name="text" >
<string>A&amp;dd</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="converterModifyPB" >
<property name="text" >
<string>&amp;Modify</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="1" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>121</width>
<height>112</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1" >
<layout class="QGridLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="0" column="0" >
<widget class="QLabel" name="converterFromLA" >
<property name="text" >
<string>&amp;From:</string>
</property>
<property name="buddy" >
<cstring>converterFromCO</cstring>
</property>
</widget>
</item>
<item row="3" column="1" >
<widget class="QLineEdit" name="converterFlagED" />
</item>
<item row="1" column="1" >
<widget class="QComboBox" name="converterToCO" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="3" column="0" >
<widget class="QLabel" name="converterFlagLA" >
<property name="text" >
<string>E&amp;xtra flag:</string>
</property>
<property name="buddy" >
<cstring>converterFlagED</cstring>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QLabel" name="converterLA" >
<property name="text" >
<string>C&amp;onverter:</string>
</property>
<property name="buddy" >
<cstring>converterED</cstring>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="converterToLA" >
<property name="text" >
<string>&amp;To:[[as in 'From format x to format y']]</string>
</property>
<property name="buddy" >
<cstring>converterToCO</cstring>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QComboBox" name="converterFromCO" />
</item>
<item row="2" column="1" >
<widget class="QLineEdit" name="converterED" />
</item>
</layout>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="formatsLA_2" >
<property name="text" >
<string>&amp;Converters</string>
</property>
<property name="buddy" >
<cstring>convertersLW</cstring>
</property>
</widget>
</item>
<item row="4" column="0" >
<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::Expanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="converterRemovePB" >
<property name="text" >
<string>&amp;Remove</string>
</property>
</widget>
</item>
</layout>
</item>
<item rowspan="3" row="1" column="0" >
<widget class="QListWidget" name="convertersLW" />
</item>
</layout>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="0" column="0" >
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QCheckBox" name="cacheCB" >
<property name="text" >
<string>&amp;Enabled</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="maxAgeLA" >
<property name="text" >
<string>&amp;Maximum Age (in days)</string>
</property>
<property name="buddy" >
<cstring>maxAgeLE</cstring>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="maxAgeLE" />
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QGroupBox" name="groupBox" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>421</width>
<height>331</height>
</rect>
</property>
<property name="title" >
<string>Converter &amp;Definitions</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="0" column="0" >
<widget class="QListWidget" name="convertersLW" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="1" >
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QPushButton" name="converterNewPB" >
<property name="text" >
<string>A&amp;dd</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="converterModifyPB" >
<property name="text" >
<string>&amp;Modify</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="converterRemovePB" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>1</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>&amp;Remove</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>75</width>
<height>16</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="0" colspan="2" >
<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="QLabel" name="converterFromLA" >
<property name="text" >
<string>&amp;From format:</string>
</property>
<property name="buddy" >
<cstring>converterFromCO</cstring>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="converterFromCO" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="converterFromLA_2" >
<property name="text" >
<string>&amp;To format:</string>
</property>
<property name="buddy" >
<cstring>converterFromCO</cstring>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="converterToCO" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item row="3" column="0" colspan="2" >
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="converterFlagLA" >
<property name="text" >
<string>E&amp;xtra flag:</string>
</property>
<property name="buddy" >
<cstring>converterFlagED</cstring>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="converterFlagED" />
</item>
</layout>
</item>
<item row="2" column="0" colspan="2" >
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QLabel" name="converterLA" >
<property name="text" >
<string>C&amp;onverter:</string>
</property>
<property name="buddy" >
<cstring>converterED</cstring>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="converterED" />
</item>
</layout>
</item>
</layout>
</widget>
</widget>
<pixmapfunction></pixmapfunction>
<includes>
<include location="local" >qt_helpers.h</include>
</includes>
<tabstops>
<tabstop>convertersLW</tabstop>
<tabstop>converterFromCO</tabstop>
@ -224,6 +292,9 @@
<tabstop>converterModifyPB</tabstop>
<tabstop>converterRemovePB</tabstop>
</tabstops>
<includes>
<include location="local" >qt_helpers.h</include>
</includes>
<resources/>
<connections/>
</ui>