another small layout tweak

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20358 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Edwin Leuven 2007-09-19 12:29:08 +00:00
parent cc9e364d83
commit a229ecb226
2 changed files with 123 additions and 174 deletions

View File

@ -465,14 +465,12 @@ GuiDocumentDialog::GuiDocumentDialog(LyXView & lv)
langModule = new UiWidget<Ui::LanguageUi>; langModule = new UiWidget<Ui::LanguageUi>;
connect(langModule->defaultencodingCB, SIGNAL(toggled(bool)),
langModule->encodingL, SLOT(setDisabled(bool)));
connect(langModule->defaultencodingCB, SIGNAL(toggled(bool)),
langModule->encodingCO, SLOT(setDisabled(bool)));
// language & quote // language & quote
connect(langModule->languageCO, SIGNAL(activated(int)), connect(langModule->languageCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor())); this, SLOT(change_adaptor()));
connect(langModule->defaultencodingCB, SIGNAL(clicked()), connect(langModule->defaultencodingRB, SIGNAL(clicked()),
this, SLOT(change_adaptor()));
connect(langModule->otherencodingRB, SIGNAL(clicked()),
this, SLOT(change_adaptor())); this, SLOT(change_adaptor()));
connect(langModule->encodingCO, SIGNAL(activated(int)), connect(langModule->encodingCO, SIGNAL(activated(int)),
this, SLOT(change_adaptor())); this, SLOT(change_adaptor()));
@ -971,7 +969,7 @@ void GuiDocumentDialog::apply(BufferParams & params)
biblioModule->bibtopicCB->isChecked(); biblioModule->bibtopicCB->isChecked();
// language & quotes // language & quotes
if (langModule->defaultencodingCB->isChecked()) { if (langModule->defaultencodingRB->isChecked()) {
params.inputenc = "auto"; params.inputenc = "auto";
} else { } else {
int i = langModule->encodingCO->currentIndex(); int i = langModule->encodingCO->currentIndex();
@ -1274,10 +1272,9 @@ void GuiDocumentDialog::updateParams(BufferParams const & params)
langModule->quoteStyleCO->setCurrentIndex( langModule->quoteStyleCO->setCurrentIndex(
params.quotes_language); params.quotes_language);
langModule->defaultencodingCB->setChecked(true); bool default_enc = true;
if (params.inputenc != "auto") { if (params.inputenc != "auto") {
langModule->defaultencodingCB->setChecked(false); default_enc = false;
if (params.inputenc == "default") { if (params.inputenc == "default") {
langModule->encodingCO->setCurrentIndex(0); langModule->encodingCO->setCurrentIndex(0);
} else { } else {
@ -1287,9 +1284,11 @@ void GuiDocumentDialog::updateParams(BufferParams const & params)
langModule->encodingCO->setCurrentIndex(i); langModule->encodingCO->setCurrentIndex(i);
else else
// unknown encoding. Set to default. // unknown encoding. Set to default.
langModule->defaultencodingCB->setChecked(true); default_enc = true;
} }
} }
langModule->defaultencodingRB->setChecked(default_enc);
langModule->otherencodingRB->setChecked(!default_enc);
// numbering // numbering
int const min_toclevel = controller().textClass().min_toclevel(); int const min_toclevel = controller().textClass().min_toclevel();

View File

@ -1,15 +1,12 @@
<ui version="4.0" > <ui version="4.0" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>LanguageUi</class> <class>LanguageUi</class>
<widget class="QWidget" name="LanguageUi" > <widget class="QWidget" name="LanguageUi" >
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>440</width> <width>392</width>
<height>451</height> <height>257</height>
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle" >
@ -17,67 +14,70 @@
</property> </property>
<layout class="QGridLayout" > <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 row="0" column="0" colspan="2" > <item row="2" column="0" colspan="3" >
<layout class="QHBoxLayout" > <widget class="QGroupBox" name="groupBox" >
<property name="margin" > <property name="title" >
<number>0</number> <string>Encoding</string>
</property> </property>
<property name="spacing" > <property name="flat" >
<number>6</number> <bool>true</bool>
</property>
<item>
<widget class="QLabel" name="languageL" >
<property name="text" >
<string>&amp;Language:</string>
</property>
<property name="buddy" >
<cstring>languageCO</cstring>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="languageCO" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="0" colspan="2" >
<widget class="QCheckBox" name="defaultencodingCB" >
<property name="text" >
<string>&amp;Use language's default encoding</string>
</property> </property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="0" column="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1" >
<widget class="QComboBox" name="encodingCO" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="duplicatesEnabled" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QRadioButton" name="otherencodingRB" >
<property name="text" >
<string>&amp;Other:</string>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2" >
<widget class="QRadioButton" name="defaultencodingRB" >
<property name="text" >
<string>Language &amp;Default</string>
</property>
<property name="checked" >
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget> </widget>
</item> </item>
<item row="4" column="1" > <item row="3" column="1" >
<spacer> <spacer>
<property name="orientation" > <property name="orientation" >
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
@ -87,13 +87,39 @@
</property> </property>
<property name="sizeHint" > <property name="sizeHint" >
<size> <size>
<width>20</width> <width>71</width>
<height>20</height> <height>171</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="3" column="1" > <item row="0" column="1" >
<widget class="QComboBox" name="languageCO" />
</item>
<item row="1" column="1" >
<widget class="QComboBox" name="quoteStyleCO" />
</item>
<item row="1" column="0" >
<widget class="QLabel" name="typeL" >
<property name="text" >
<string>&amp;Quote Style:</string>
</property>
<property name="buddy" >
<cstring>quoteStyleCO</cstring>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="languageL" >
<property name="text" >
<string>&amp;Language:</string>
</property>
<property name="buddy" >
<cstring>languageCO</cstring>
</property>
</widget>
</item>
<item row="0" column="2" >
<spacer> <spacer>
<property name="orientation" > <property name="orientation" >
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
@ -103,117 +129,41 @@
</property> </property>
<property name="sizeHint" > <property name="sizeHint" >
<size> <size>
<width>20</width> <width>121</width>
<height>20</height> <height>22</height>
</size>
</property>
</spacer>
</item>
<item rowspan="2" row="2" column="0" >
<layout class="QGridLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="0" column="0" >
<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="encodingL" >
<property name="text" >
<string>&amp;Encoding:</string>
</property>
<property name="buddy" >
<cstring>encodingCO</cstring>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="typeL" >
<property name="text" >
<string>&amp;Quote Style:</string>
</property>
<property name="buddy" >
<cstring>quoteStyleCO</cstring>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="1" >
<layout class="QGridLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="1" column="0" >
<widget class="QComboBox" name="quoteStyleCO" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QComboBox" name="encodingCO" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="duplicatesEnabled" >
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item row="2" column="1" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
</item> </item>
</layout> </layout>
</widget> </widget>
<pixmapfunction></pixmapfunction> <tabstops>
<tabstop>languageCO</tabstop>
<tabstop>quoteStyleCO</tabstop>
<tabstop>defaultencodingRB</tabstop>
<tabstop>otherencodingRB</tabstop>
<tabstop>encodingCO</tabstop>
</tabstops>
<includes> <includes>
<include location="local" >qt_helpers.h</include> <include location="local" >qt_helpers.h</include>
</includes> </includes>
<tabstops>
<tabstop>languageCO</tabstop>
<tabstop>defaultencodingCB</tabstop>
<tabstop>encodingCO</tabstop>
<tabstop>quoteStyleCO</tabstop>
</tabstops>
<resources/> <resources/>
<connections/> <connections>
<connection>
<sender>otherencodingRB</sender>
<signal>toggled(bool)</signal>
<receiver>encodingCO</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel" >
<x>34</x>
<y>149</y>
</hint>
<hint type="destinationlabel" >
<x>107</x>
<y>145</y>
</hint>
</hints>
</connection>
</connections>
</ui> </ui>