Browse Source

Improved program options

adaptive-webui-19844
Christophe Dumez 15 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){ @@ -176,11 +176,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
connect(checkProxyAuth_http, SIGNAL(toggled(bool)), this, SLOT(enableHTTPProxyAuth(bool)));
connect(comboProxyType, SIGNAL(currentIndexChanged(int)),this, SLOT(enablePeerProxy(int)));
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
// General tab
@ -824,12 +819,10 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){ @@ -824,12 +819,10 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
// Misc preferences
// * IP Filter
checkIPFilter->setChecked(Preferences::isFilteringEnabled());
enableFilter(checkIPFilter->isChecked());
textFilterPath->setText(Preferences::getFilter());
// End IP Filter
// * RSS
checkEnableRSS->setChecked(Preferences::isRSSEnabled());
enableRSS(checkEnableRSS->isChecked());
spinRSSRefresh->setValue(Preferences::getRSSRefreshInterval());
spinRSSMaxArticlesPerFeed->setValue(Preferences::getRSSMaxArticlesPerFeed());
// End RSS preferences
@ -841,7 +834,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){ @@ -841,7 +834,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
// End Queueing system preferences
// Web UI
checkWebUi->setChecked(Preferences::isWebUiEnabled());
enableWebUi(checkWebUi->isChecked());
spinWebUiPort->setValue(Preferences::getWebUiPort());
textWebUiUsername->setText(Preferences::getWebUiUsername());
textWebUiPassword->setText(Preferences::getWebUiPassword());
@ -1132,16 +1124,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){ @@ -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){
spinUploadLimit->setEnabled(checked);
}
@ -1430,11 +1412,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){ @@ -1430,11 +1412,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
// Web UI
void options_imp::enableWebUi(bool checkBoxValue){
groupWebUiServer->setEnabled(checkBoxValue);
groupWebUiAuth->setEnabled(checkBoxValue);
}
bool options_imp::isWebUiEnabled() const
{
return checkWebUi->isChecked();

3
src/options_imp.h

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

310
src/ui/options.ui

@ -164,21 +164,6 @@ @@ -164,21 +164,6 @@
<normaloff>:/Icons/oxygen/proxy.png</normaloff>:/Icons/oxygen/proxy.png</iconset>
</property>
</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>
<property name="text">
<string>Web UI</string>
@ -1094,6 +1079,9 @@ QGroupBox { @@ -1094,6 +1079,9 @@ QGroupBox {
<string>Connections limit</string>
</property>
<layout class="QVBoxLayout" name="_8">
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="_9">
<item>
@ -1217,6 +1205,45 @@ QGroupBox { @@ -1217,6 +1205,45 @@ QGroupBox {
</layout>
</widget>
</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>
<spacer name="verticalSpacer_7">
<property name="orientation">
@ -2065,8 +2092,8 @@ QGroupBox { @@ -2065,8 +2092,8 @@ QGroupBox {
<rect>
<x>0</x>
<y>0</y>
<width>475</width>
<height>308</height>
<width>524</width>
<height>406</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_16">
@ -2075,7 +2102,7 @@ QGroupBox { @@ -2075,7 +2102,7 @@ QGroupBox {
<property name="title">
<string>HTTP Communications (trackers, Web seeds, search engine)</string>
</property>
<layout class="QVBoxLayout">
<layout class="QVBoxLayout" name="verticalLayout_27">
<item>
<layout class="QHBoxLayout">
<item>
@ -2172,8 +2199,8 @@ QGroupBox { @@ -2172,8 +2199,8 @@ QGroupBox {
</layout>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<layout class="QGridLayout" name="gridLayout_11">
<item row="0" column="0">
<widget class="QCheckBox" name="checkProxyAuth_http">
<property name="enabled">
<bool>false</bool>
@ -2183,11 +2210,9 @@ QGroupBox { @@ -2183,11 +2210,9 @@ QGroupBox {
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<layout class="QVBoxLayout">
<item>
<item row="0" column="1">
<layout class="QGridLayout" name="gridLayout_10">
<item row="0" column="0">
<widget class="QLabel" name="lblProxyUsername_http">
<property name="enabled">
<bool>false</bool>
@ -2197,21 +2222,7 @@ QGroupBox { @@ -2197,21 +2222,7 @@ QGroupBox {
</property>
</widget>
</item>
<item>
<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>
<item row="0" column="1">
<widget class="QLineEdit" name="textProxyUsername_http">
<property name="enabled">
<bool>false</bool>
@ -2227,7 +2238,17 @@ QGroupBox { @@ -2227,7 +2238,17 @@ QGroupBox {
</property>
</widget>
</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">
<property name="enabled">
<bool>false</bool>
@ -2245,7 +2266,7 @@ QGroupBox { @@ -2245,7 +2266,7 @@ QGroupBox {
</item>
</layout>
</item>
<item>
<item row="0" column="2">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -2261,8 +2282,6 @@ QGroupBox { @@ -2261,8 +2282,6 @@ QGroupBox {
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
@ -2273,7 +2292,7 @@ QGroupBox { @@ -2273,7 +2292,7 @@ QGroupBox {
<property name="title">
<string>Peer Communications</string>
</property>
<layout class="QVBoxLayout">
<layout class="QVBoxLayout" name="verticalLayout_29">
<item>
<layout class="QHBoxLayout">
<item>
@ -2375,8 +2394,8 @@ QGroupBox { @@ -2375,8 +2394,8 @@ QGroupBox {
</layout>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<layout class="QGridLayout" name="gridLayout_13">
<item row="0" column="0">
<widget class="QCheckBox" name="checkProxyAuth">
<property name="enabled">
<bool>false</bool>
@ -2386,11 +2405,9 @@ QGroupBox { @@ -2386,11 +2405,9 @@ QGroupBox {
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<layout class="QVBoxLayout">
<item>
<item row="0" column="1">
<layout class="QGridLayout" name="gridLayout_12">
<item row="0" column="0">
<widget class="QLabel" name="lblProxyUsername">
<property name="enabled">
<bool>false</bool>
@ -2400,21 +2417,7 @@ QGroupBox { @@ -2400,21 +2417,7 @@ QGroupBox {
</property>
</widget>
</item>
<item>
<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>
<item row="0" column="1">
<widget class="QLineEdit" name="textProxyUsername">
<property name="enabled">
<bool>false</bool>
@ -2430,7 +2433,17 @@ QGroupBox { @@ -2430,7 +2433,17 @@ QGroupBox {
</property>
</widget>
</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">
<property name="enabled">
<bool>false</bool>
@ -2448,7 +2461,7 @@ QGroupBox { @@ -2448,7 +2461,7 @@ QGroupBox {
</item>
</layout>
</item>
<item>
<item row="0" column="2">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
@ -2464,8 +2477,6 @@ QGroupBox { @@ -2464,8 +2477,6 @@ QGroupBox {
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
@ -2487,103 +2498,6 @@ QGroupBox { @@ -2487,103 +2498,6 @@ QGroupBox {
</item>
</layout>
</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">
<layout class="QVBoxLayout">
<item>
@ -2596,29 +2510,25 @@ QGroupBox { @@ -2596,29 +2510,25 @@ QGroupBox {
<rect>
<x>0</x>
<y>0</y>
<width>213</width>
<height>221</height>
<width>524</width>
<height>406</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_23">
<item>
<widget class="QCheckBox" name="checkWebUi">
<property name="enabled">
<bool>true</bool>
<widget class="QGroupBox" name="checkWebUi">
<property name="title">
<string>Enable Web User Interface (Remote control)</string>
</property>
<property name="text">
<string>Enable Web User Interface</string>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QGroupBox" name="groupWebUiServer">
<property name="enabled">
<bool>false</bool>
</property>
<property name="title">
<string>HTTP Server</string>
</property>
@ -2661,9 +2571,6 @@ QGroupBox { @@ -2661,9 +2571,6 @@ QGroupBox {
</item>
<item>
<widget class="QGroupBox" name="groupWebUiAuth">
<property name="enabled">
<bool>false</bool>
</property>
<property name="title">
<string>Authentication</string>
</property>
@ -2732,6 +2639,9 @@ QGroupBox { @@ -2732,6 +2639,9 @@ QGroupBox {
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_9">
<property name="orientation">
@ -2763,33 +2673,23 @@ QGroupBox { @@ -2763,33 +2673,23 @@ QGroupBox {
<rect>
<x>0</x>
<y>0</y>
<width>445</width>
<height>192</height>
<width>524</width>
<height>406</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_24">
<item>
<widget class="QGroupBox" name="groupRSS">
<widget class="QGroupBox" name="checkEnableRSS">
<property name="title">
<string>RSS</string>
</property>
<layout class="QVBoxLayout" name="_12">
<item>
<widget class="QCheckBox" name="checkEnableRSS">
<property name="text">
<string>Enable RSS support</string>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupRSSSettings">
<property name="enabled">
<property name="checked">
<bool>false</bool>
</property>
<property name="title">
<string>RSS settings</string>
</property>
<layout class="QVBoxLayout" name="_13">
<layout class="QVBoxLayout" name="_12">
<item>
<layout class="QHBoxLayout" name="_14">
<item>
@ -2901,9 +2801,6 @@ QGroupBox { @@ -2901,9 +2801,6 @@ QGroupBox {
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
@ -2938,8 +2835,8 @@ QGroupBox { @@ -2938,8 +2835,8 @@ QGroupBox {
<rect>
<x>0</x>
<y>0</y>
<width>62</width>
<height>18</height>
<width>524</width>
<height>406</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_36"/>
@ -3002,9 +2899,6 @@ QGroupBox { @@ -3002,9 +2899,6 @@ QGroupBox {
<tabstop>spinRatio</tabstop>
<tabstop>checkRatioRemove</tabstop>
<tabstop>spinMaxRatio</tabstop>
<tabstop>checkIPFilter</tabstop>
<tabstop>textFilterPath</tabstop>
<tabstop>browseFilterButton</tabstop>
<tabstop>spinWebUiPort</tabstop>
<tabstop>textWebUiUsername</tabstop>
<tabstop>textWebUiPassword</tabstop>

Loading…
Cancel
Save