Preferences code clean up

This commit is contained in:
Christophe Dumez 2011-04-11 17:02:45 +00:00
parent 5579c7ff3d
commit a1272fff82
3 changed files with 74 additions and 93 deletions

View file

@ -985,9 +985,9 @@ QGroupBox {
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>-84</y>
<width>503</width> <width>503</width>
<height>426</height> <height>462</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_20"> <layout class="QVBoxLayout" name="verticalLayout_20">
@ -1300,18 +1300,21 @@ QGroupBox {
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QGridLayout" name="gridLayout_13"> <widget class="QGroupBox" name="checkProxyAuth">
<item row="0" column="0">
<widget class="QCheckBox" name="checkProxyAuth">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="text"> <property name="title">
<string>Authentication</string> <string>Authentication</string>
</property> </property>
</widget> <property name="checkable">
</item> <bool>true</bool>
<item row="0" column="1"> </property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout_24">
<item>
<layout class="QGridLayout" name="gridLayout_12"> <layout class="QGridLayout" name="gridLayout_12">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="lblProxyUsername"> <widget class="QLabel" name="lblProxyUsername">
@ -1367,20 +1370,8 @@ QGroupBox {
</item> </item>
</layout> </layout>
</item> </item>
<item row="0" column="2">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout> </layout>
</widget>
</item> </item>
</layout> </layout>
</widget> </widget>

View file

@ -113,7 +113,6 @@ options_imp::options_imp(QWidget *parent):
// Connect signals / slots // Connect signals / slots
// Proxy tab // Proxy tab
connect(comboProxyType, SIGNAL(currentIndexChanged(int)),this, SLOT(enableProxy(int))); connect(comboProxyType, SIGNAL(currentIndexChanged(int)),this, SLOT(enableProxy(int)));
connect(checkProxyAuth, SIGNAL(toggled(bool)), this, SLOT(enableProxyAuth(bool)));
// Apply button is activated when a value is changed // Apply button is activated when a value is changed
// General tab // General tab
@ -589,7 +588,6 @@ void options_imp::loadOptions(){
checkProxyAuth->setChecked(pref.isProxyAuthEnabled()); checkProxyAuth->setChecked(pref.isProxyAuthEnabled());
textProxyUsername->setText(pref.getProxyUsername()); textProxyUsername->setText(pref.getProxyUsername());
textProxyPassword->setText(pref.getProxyPassword()); textProxyPassword->setText(pref.getProxyPassword());
enableProxyAuth(checkProxyAuth->isChecked());
//} //}
// End Connection preferences // End Connection preferences
// Bittorrent preferences // Bittorrent preferences
@ -863,13 +861,6 @@ void options_imp::enableProxy(int index){
} }
} }
void options_imp::enableProxyAuth(bool checked){
lblProxyUsername->setEnabled(checked);
lblProxyPassword->setEnabled(checked);
textProxyUsername->setEnabled(checked);
textProxyPassword->setEnabled(checked);
}
bool options_imp::isSlashScreenDisabled() const { bool options_imp::isSlashScreenDisabled() const {
return !checkShowSplash->isChecked(); return !checkShowSplash->isChecked();
} }

View file

@ -56,7 +56,6 @@ public:
protected slots: protected slots:
void enableProxy(int comboIndex); void enableProxy(int comboIndex);
void enableProxyAuth(bool checked);
void on_buttonBox_accepted(); void on_buttonBox_accepted();
void closeEvent(QCloseEvent *e); void closeEvent(QCloseEvent *e);
void on_buttonBox_rejected(); void on_buttonBox_rejected();