Browse Source

Improved program options

adaptive-webui-19844
Christophe Dumez 14 years ago
parent
commit
335e7366fd
  1. 23
      src/options_imp.cpp
  2. 3
      src/options_imp.h
  3. 310
      src/ui/options.ui

23
src/options_imp.cpp

@ -176,11 +176,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
connect(checkProxyAuth_http, SIGNAL(toggled(bool)), this, SLOT(enableHTTPProxyAuth(bool))); connect(checkProxyAuth_http, SIGNAL(toggled(bool)), this, SLOT(enableHTTPProxyAuth(bool)));
connect(comboProxyType, SIGNAL(currentIndexChanged(int)),this, SLOT(enablePeerProxy(int))); connect(comboProxyType, SIGNAL(currentIndexChanged(int)),this, SLOT(enablePeerProxy(int)));
connect(checkProxyAuth, SIGNAL(toggled(bool)), this, SLOT(enablePeerProxyAuth(bool))); connect(checkProxyAuth, SIGNAL(toggled(bool)), this, SLOT(enablePeerProxyAuth(bool)));
// Misc tab
connect(checkIPFilter, SIGNAL(toggled(bool)), this, SLOT(enableFilter(bool)));
connect(checkEnableRSS, SIGNAL(toggled(bool)), this, SLOT(enableRSS(bool)));
// Web UI tab
connect(checkWebUi, SIGNAL(toggled(bool)), this, SLOT(enableWebUi(bool)));
// Apply button is activated when a value is changed // Apply button is activated when a value is changed
// General tab // General tab
@ -824,12 +819,10 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
// Misc preferences // Misc preferences
// * IP Filter // * IP Filter
checkIPFilter->setChecked(Preferences::isFilteringEnabled()); checkIPFilter->setChecked(Preferences::isFilteringEnabled());
enableFilter(checkIPFilter->isChecked());
textFilterPath->setText(Preferences::getFilter()); textFilterPath->setText(Preferences::getFilter());
// End IP Filter // End IP Filter
// * RSS // * RSS
checkEnableRSS->setChecked(Preferences::isRSSEnabled()); checkEnableRSS->setChecked(Preferences::isRSSEnabled());
enableRSS(checkEnableRSS->isChecked());
spinRSSRefresh->setValue(Preferences::getRSSRefreshInterval()); spinRSSRefresh->setValue(Preferences::getRSSRefreshInterval());
spinRSSMaxArticlesPerFeed->setValue(Preferences::getRSSMaxArticlesPerFeed()); spinRSSMaxArticlesPerFeed->setValue(Preferences::getRSSMaxArticlesPerFeed());
// End RSS preferences // End RSS preferences
@ -841,7 +834,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
// End Queueing system preferences // End Queueing system preferences
// Web UI // Web UI
checkWebUi->setChecked(Preferences::isWebUiEnabled()); checkWebUi->setChecked(Preferences::isWebUiEnabled());
enableWebUi(checkWebUi->isChecked());
spinWebUiPort->setValue(Preferences::getWebUiPort()); spinWebUiPort->setValue(Preferences::getWebUiPort());
textWebUiUsername->setText(Preferences::getWebUiUsername()); textWebUiUsername->setText(Preferences::getWebUiUsername());
textWebUiPassword->setText(Preferences::getWebUiPassword()); textWebUiPassword->setText(Preferences::getWebUiPassword());
@ -1132,16 +1124,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
} }
} }
void options_imp::enableFilter(bool checked){
lblFilterPath->setEnabled(checked);
textFilterPath->setEnabled(checked);
browseFilterButton->setEnabled(checked);
}
void options_imp::enableRSS(bool checked) {
groupRSSSettings->setEnabled(checked);
}
void options_imp::enableUploadLimit(bool checked){ void options_imp::enableUploadLimit(bool checked){
spinUploadLimit->setEnabled(checked); spinUploadLimit->setEnabled(checked);
} }
@ -1430,11 +1412,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
// Web UI // Web UI
void options_imp::enableWebUi(bool checkBoxValue){
groupWebUiServer->setEnabled(checkBoxValue);
groupWebUiAuth->setEnabled(checkBoxValue);
}
bool options_imp::isWebUiEnabled() const bool options_imp::isWebUiEnabled() const
{ {
return checkWebUi->isChecked(); return checkWebUi->isChecked();

3
src/options_imp.h

@ -139,8 +139,6 @@ protected slots:
void enableMaxUploadsLimitPerTorrent(bool checked); void enableMaxUploadsLimitPerTorrent(bool checked);
void enableShareRatio(bool checked); void enableShareRatio(bool checked);
void enableDeleteRatio(bool checked); void enableDeleteRatio(bool checked);
void enableFilter(bool checked);
void enableRSS(bool checked);
void enableSpoofingSettings(int index); void enableSpoofingSettings(int index);
void setStyle(QString style); void setStyle(QString style);
void on_buttonBox_accepted(); void on_buttonBox_accepted();
@ -155,7 +153,6 @@ protected slots:
void enableSystrayOptions(); void enableSystrayOptions();
void disableSystrayOptions(); void disableSystrayOptions();
void setSystrayOptionsState(bool checked); void setSystrayOptionsState(bool checked);
void enableWebUi(bool checkBoxValue);
void changePage(QListWidgetItem*, QListWidgetItem*); void changePage(QListWidgetItem*, QListWidgetItem*);
void loadWindowState(); void loadWindowState();
void saveWindowState() const; void saveWindowState() const;

310
src/ui/options.ui

@ -164,21 +164,6 @@
<normaloff>:/Icons/oxygen/proxy.png</normaloff>:/Icons/oxygen/proxy.png</iconset> <normaloff>:/Icons/oxygen/proxy.png</normaloff>:/Icons/oxygen/proxy.png</iconset>
</property> </property>
</item> </item>
<item>
<property name="text">
<string>IP Filter</string>
</property>
<property name="textAlignment">
<set>AlignHCenter|AlignVCenter|AlignCenter</set>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/Icons/oxygen/filter.png</normaloff>:/Icons/oxygen/filter.png</iconset>
</property>
<property name="flags">
<set>ItemIsSelectable|ItemIsEnabled</set>
</property>
</item>
<item> <item>
<property name="text"> <property name="text">
<string>Web UI</string> <string>Web UI</string>
@ -1094,6 +1079,9 @@ QGroupBox {
<string>Connections limit</string> <string>Connections limit</string>
</property> </property>
<layout class="QVBoxLayout" name="_8"> <layout class="QVBoxLayout" name="_8">
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<layout class="QHBoxLayout" name="_9"> <layout class="QHBoxLayout" name="_9">
<item> <item>
@ -1217,6 +1205,45 @@ QGroupBox {
</layout> </layout>
</widget> </widget>
</item> </item>
<item>
<widget class="QGroupBox" name="checkIPFilter">
<property name="title">
<string>IP Filtering</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout_14">
<item row="0" column="0">
<widget class="QLabel" name="lblFilterPath">
<property name="text">
<string>Filter path (.dat, .p2p, .p2b):</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="textFilterPath"/>
</item>
<item row="0" column="2">
<widget class="QToolButton" name="browseFilterButton">
<property name="minimumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/Icons/oxygen/browse.png</normaloff>:/Icons/oxygen/browse.png</iconset>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item> <item>
<spacer name="verticalSpacer_7"> <spacer name="verticalSpacer_7">
<property name="orientation"> <property name="orientation">
@ -2065,8 +2092,8 @@ QGroupBox {
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>475</width> <width>524</width>
<height>308</height> <height>406</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_16"> <layout class="QVBoxLayout" name="verticalLayout_16">
@ -2075,7 +2102,7 @@ QGroupBox {
<property name="title"> <property name="title">
<string>HTTP Communications (trackers, Web seeds, search engine)</string> <string>HTTP Communications (trackers, Web seeds, search engine)</string>
</property> </property>
<layout class="QVBoxLayout"> <layout class="QVBoxLayout" name="verticalLayout_27">
<item> <item>
<layout class="QHBoxLayout"> <layout class="QHBoxLayout">
<item> <item>
@ -2172,8 +2199,8 @@ QGroupBox {
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QHBoxLayout"> <layout class="QGridLayout" name="gridLayout_11">
<item> <item row="0" column="0">
<widget class="QCheckBox" name="checkProxyAuth_http"> <widget class="QCheckBox" name="checkProxyAuth_http">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
@ -2183,11 +2210,9 @@ QGroupBox {
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="0" column="1">
<layout class="QHBoxLayout"> <layout class="QGridLayout" name="gridLayout_10">
<item> <item row="0" column="0">
<layout class="QVBoxLayout">
<item>
<widget class="QLabel" name="lblProxyUsername_http"> <widget class="QLabel" name="lblProxyUsername_http">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
@ -2197,21 +2222,7 @@ QGroupBox {
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="0" column="1">
<widget class="QLabel" name="lblProxyPassword_http">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Password:</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout">
<item>
<widget class="QLineEdit" name="textProxyUsername_http"> <widget class="QLineEdit" name="textProxyUsername_http">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
@ -2227,7 +2238,17 @@ QGroupBox {
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="1" column="0">
<widget class="QLabel" name="lblProxyPassword_http">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Password:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="textProxyPassword_http"> <widget class="QLineEdit" name="textProxyPassword_http">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
@ -2245,7 +2266,7 @@ QGroupBox {
</item> </item>
</layout> </layout>
</item> </item>
<item> <item row="0" column="2">
<spacer> <spacer>
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
@ -2261,8 +2282,6 @@ QGroupBox {
</layout> </layout>
</item> </item>
</layout> </layout>
</item>
</layout>
</widget> </widget>
</item> </item>
<item> <item>
@ -2273,7 +2292,7 @@ QGroupBox {
<property name="title"> <property name="title">
<string>Peer Communications</string> <string>Peer Communications</string>
</property> </property>
<layout class="QVBoxLayout"> <layout class="QVBoxLayout" name="verticalLayout_29">
<item> <item>
<layout class="QHBoxLayout"> <layout class="QHBoxLayout">
<item> <item>
@ -2375,8 +2394,8 @@ QGroupBox {
</layout> </layout>
</item> </item>
<item> <item>
<layout class="QHBoxLayout"> <layout class="QGridLayout" name="gridLayout_13">
<item> <item row="0" column="0">
<widget class="QCheckBox" name="checkProxyAuth"> <widget class="QCheckBox" name="checkProxyAuth">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
@ -2386,11 +2405,9 @@ QGroupBox {
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="0" column="1">
<layout class="QHBoxLayout"> <layout class="QGridLayout" name="gridLayout_12">
<item> <item row="0" column="0">
<layout class="QVBoxLayout">
<item>
<widget class="QLabel" name="lblProxyUsername"> <widget class="QLabel" name="lblProxyUsername">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
@ -2400,21 +2417,7 @@ QGroupBox {
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="0" column="1">
<widget class="QLabel" name="lblProxyPassword">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Password:</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout">
<item>
<widget class="QLineEdit" name="textProxyUsername"> <widget class="QLineEdit" name="textProxyUsername">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
@ -2430,7 +2433,17 @@ QGroupBox {
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="1" column="0">
<widget class="QLabel" name="lblProxyPassword">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Password:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="textProxyPassword"> <widget class="QLineEdit" name="textProxyPassword">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
@ -2448,7 +2461,7 @@ QGroupBox {
</item> </item>
</layout> </layout>
</item> </item>
<item> <item row="0" column="2">
<spacer> <spacer>
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
@ -2464,8 +2477,6 @@ QGroupBox {
</layout> </layout>
</item> </item>
</layout> </layout>
</item>
</layout>
</widget> </widget>
</item> </item>
<item> <item>
@ -2487,103 +2498,6 @@ QGroupBox {
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="tabOptionPage6">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QScrollArea" name="scrollArea_6">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents_6">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>287</width>
<height>124</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_21">
<item>
<widget class="QGroupBox" name="filterBox">
<property name="enabled">
<bool>true</bool>
</property>
<property name="title">
<string>Filter Settings</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_22">
<item>
<widget class="QCheckBox" name="checkIPFilter">
<property name="text">
<string>Activate IP Filtering</string>
</property>
<property name="icon">
<iconset>
<normaloff>:/Icons/filter.png</normaloff>:/Icons/filter.png</iconset>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="mynonamelayout">
<item>
<widget class="QLabel" name="lblFilterPath">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Filter path (.dat, .p2p, .p2b):</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="textFilterPath">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="browseFilterButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>22</width>
<height>22</height>
</size>
</property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/Icons/oxygen/browse.png</normaloff>:/Icons/oxygen/browse.png</iconset>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="mynornamespacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>357</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tabOptionPage7"> <widget class="QWidget" name="tabOptionPage7">
<layout class="QVBoxLayout"> <layout class="QVBoxLayout">
<item> <item>
@ -2596,29 +2510,25 @@ QGroupBox {
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>213</width> <width>524</width>
<height>221</height> <height>406</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_23"> <layout class="QVBoxLayout" name="verticalLayout_23">
<item> <item>
<widget class="QCheckBox" name="checkWebUi"> <widget class="QGroupBox" name="checkWebUi">
<property name="enabled"> <property name="title">
<bool>true</bool> <string>Enable Web User Interface (Remote control)</string>
</property> </property>
<property name="text"> <property name="checkable">
<string>Enable Web User Interface</string> <bool>true</bool>
</property> </property>
<property name="checked"> <property name="checked">
<bool>false</bool> <bool>false</bool>
</property> </property>
</widget> <layout class="QVBoxLayout" name="verticalLayout_2">
</item>
<item> <item>
<widget class="QGroupBox" name="groupWebUiServer"> <widget class="QGroupBox" name="groupWebUiServer">
<property name="enabled">
<bool>false</bool>
</property>
<property name="title"> <property name="title">
<string>HTTP Server</string> <string>HTTP Server</string>
</property> </property>
@ -2661,9 +2571,6 @@ QGroupBox {
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupWebUiAuth"> <widget class="QGroupBox" name="groupWebUiAuth">
<property name="enabled">
<bool>false</bool>
</property>
<property name="title"> <property name="title">
<string>Authentication</string> <string>Authentication</string>
</property> </property>
@ -2732,6 +2639,9 @@ QGroupBox {
</layout> </layout>
</widget> </widget>
</item> </item>
</layout>
</widget>
</item>
<item> <item>
<spacer name="verticalSpacer_9"> <spacer name="verticalSpacer_9">
<property name="orientation"> <property name="orientation">
@ -2763,33 +2673,23 @@ QGroupBox {
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>445</width> <width>524</width>
<height>192</height> <height>406</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_24"> <layout class="QVBoxLayout" name="verticalLayout_24">
<item> <item>
<widget class="QGroupBox" name="groupRSS"> <widget class="QGroupBox" name="checkEnableRSS">
<property name="title"> <property name="title">
<string>RSS</string> <string>RSS</string>
</property> </property>
<layout class="QVBoxLayout" name="_12"> <property name="checkable">
<item> <bool>true</bool>
<widget class="QCheckBox" name="checkEnableRSS">
<property name="text">
<string>Enable RSS support</string>
</property> </property>
</widget> <property name="checked">
</item>
<item>
<widget class="QGroupBox" name="groupRSSSettings">
<property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="title"> <layout class="QVBoxLayout" name="_12">
<string>RSS settings</string>
</property>
<layout class="QVBoxLayout" name="_13">
<item> <item>
<layout class="QHBoxLayout" name="_14"> <layout class="QHBoxLayout" name="_14">
<item> <item>
@ -2901,9 +2801,6 @@ QGroupBox {
</item> </item>
</layout> </layout>
</item> </item>
</layout>
</widget>
</item>
<item> <item>
<spacer name="verticalSpacer_3"> <spacer name="verticalSpacer_3">
<property name="orientation"> <property name="orientation">
@ -2938,8 +2835,8 @@ QGroupBox {
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>62</width> <width>524</width>
<height>18</height> <height>406</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_36"/> <layout class="QVBoxLayout" name="verticalLayout_36"/>
@ -3002,9 +2899,6 @@ QGroupBox {
<tabstop>spinRatio</tabstop> <tabstop>spinRatio</tabstop>
<tabstop>checkRatioRemove</tabstop> <tabstop>checkRatioRemove</tabstop>
<tabstop>spinMaxRatio</tabstop> <tabstop>spinMaxRatio</tabstop>
<tabstop>checkIPFilter</tabstop>
<tabstop>textFilterPath</tabstop>
<tabstop>browseFilterButton</tabstop>
<tabstop>spinWebUiPort</tabstop> <tabstop>spinWebUiPort</tabstop>
<tabstop>textWebUiUsername</tabstop> <tabstop>textWebUiUsername</tabstop>
<tabstop>textWebUiPassword</tabstop> <tabstop>textWebUiPassword</tabstop>

Loading…
Cancel
Save