From 335e7366fd2b1b334a383caa8c9f4a03436305fe Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Mon, 21 Jun 2010 21:27:59 +0000 Subject: [PATCH] Improved program options --- src/options_imp.cpp | 23 -- src/options_imp.h | 3 - src/ui/options.ui | 922 ++++++++++++++++++++------------------------ 3 files changed, 408 insertions(+), 540 deletions(-) diff --git a/src/options_imp.cpp b/src/options_imp.cpp index c5a3bd21b..bbddac2fa 100644 --- a/src/options_imp.cpp +++ b/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(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){ // 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){ // 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){ } } - 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){ // Web UI - void options_imp::enableWebUi(bool checkBoxValue){ - groupWebUiServer->setEnabled(checkBoxValue); - groupWebUiAuth->setEnabled(checkBoxValue); - } - bool options_imp::isWebUiEnabled() const { return checkWebUi->isChecked(); diff --git a/src/options_imp.h b/src/options_imp.h index 034d91ccf..4301e0d85 100644 --- a/src/options_imp.h +++ b/src/options_imp.h @@ -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: void enableSystrayOptions(); void disableSystrayOptions(); void setSystrayOptionsState(bool checked); - void enableWebUi(bool checkBoxValue); void changePage(QListWidgetItem*, QListWidgetItem*); void loadWindowState(); void saveWindowState() const; diff --git a/src/ui/options.ui b/src/ui/options.ui index 1e40bb0f1..0d37bd6e3 100644 --- a/src/ui/options.ui +++ b/src/ui/options.ui @@ -164,21 +164,6 @@ :/Icons/oxygen/proxy.png:/Icons/oxygen/proxy.png - - - IP Filter - - - AlignHCenter|AlignVCenter|AlignCenter - - - - :/Icons/oxygen/filter.png:/Icons/oxygen/filter.png - - - ItemIsSelectable|ItemIsEnabled - - Web UI @@ -1094,6 +1079,9 @@ QGroupBox { Connections limit + + 0 + @@ -1217,6 +1205,45 @@ QGroupBox { + + + + IP Filtering + + + true + + + false + + + + + + Filter path (.dat, .p2p, .p2b): + + + + + + + + + + + 22 + 22 + + + + + :/Icons/oxygen/browse.png:/Icons/oxygen/browse.png + + + + + + @@ -2065,8 +2092,8 @@ QGroupBox { 0 0 - 475 - 308 + 524 + 406 @@ -2075,7 +2102,7 @@ QGroupBox { HTTP Communications (trackers, Web seeds, search engine) - + @@ -2172,8 +2199,8 @@ QGroupBox { - - + + false @@ -2183,83 +2210,75 @@ QGroupBox { - - - - - - - - false - - - Username: - - - - - - - false - - - Password: - - - - + + + + + + false + + + Username: + + - - - - - - false - - - - - - 1000 - - - QLineEdit::Normal - - - - - - - false - - - - - - 1000 - - - QLineEdit::Password - - - - + + + + false + + + + + + 1000 + + + QLineEdit::Normal + + - - - - Qt::Horizontal + + + + false - - - 40 - 20 - + + Password: - + + + + + + false + + + + + + 1000 + + + QLineEdit::Password + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + @@ -2273,7 +2292,7 @@ QGroupBox { Peer Communications - + @@ -2375,8 +2394,8 @@ QGroupBox { - - + + false @@ -2386,83 +2405,75 @@ QGroupBox { - - - - - - - - false - - - Username: - - - - - - - false - - - Password: - - - - + + + + + + false + + + Username: + + - - - - - - false - - - - - - 1000 - - - QLineEdit::Normal - - - - - - - false - - - - - - 1000 - - - QLineEdit::Password - - - - + + + + false + + + + + + 1000 + + + QLineEdit::Normal + + - - - - Qt::Horizontal + + + + false - - - 40 - 20 - + + Password: - + + + + + + false + + + + + + 1000 + + + QLineEdit::Password + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + @@ -2487,93 +2498,159 @@ QGroupBox { - - + + - + true - + 0 0 - 287 - 124 + 524 + 406 - + - - + + + Enable Web User Interface (Remote control) + + true - - Filter Settings + + false - + - - - Activate IP Filtering - - - - :/Icons/filter.png:/Icons/filter.png + + + HTTP Server + + + + + Port: + + + + + + + 1 + + + 65535 + + + 8080 + + + + + + + Qt::Horizontal + + + + 21 + 29 + + + + + - - - - - false - - - Filter path (.dat, .p2p, .p2b): - - - - - - - false - - - - - - - false - - - - 22 - 22 - - - - - :/Icons/oxygen/browse.png:/Icons/oxygen/browse.png - - - - + + + Authentication + + + + + + + + Username: + + + + + + + Password: + + + + + + + + + + + + + + 1000 + + + QLineEdit::Normal + + + + + + + + + + 1000 + + + QLineEdit::Password + + + + + + + + + Qt::Horizontal + + + + 198 + 57 + + + + + + - + Qt::Vertical 20 - 357 + 40 @@ -2584,326 +2661,146 @@ QGroupBox { - - + + - + true - + 0 0 - 213 - 221 + 524 + 406 - + - - - true + + + RSS - - Enable Web User Interface + + true false - - - - - - false - - - HTTP Server - - - - - - Port: - - - - - - - 1 - - - 65535 - - - 8080 - - - - - - - Qt::Horizontal - - - - 21 - 29 - - - - - - - - - - - false - - - Authentication - - + - + - - - Username: + + + + 48 + 48 + - - - - - - Password: + + + 48 + 48 + - - - - - - - - - - 1000 + + :/Icons/rss32.png - - QLineEdit::Normal + + true - - - - - - 1000 - - - QLineEdit::Password - - + + + + + + + RSS feeds refresh interval: + + + + + + + 1 + + + 999999 + + + 5 + + + + + + + minutes + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Maximum number of articles per feed: + + + + + + + 9999 + + + 100 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + - - - - Qt::Horizontal - - - - 198 - 57 - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - - - - true - - - - - 0 - 0 - 445 - 192 - - - - - - - RSS - - - - - - Enable RSS support - - - - - - - false - - - RSS settings - - - - - - - - - 48 - 48 - - - - - 48 - 48 - - - - - - - :/Icons/rss32.png - - - true - - - - - - - - - - - RSS feeds refresh interval: - - - - - - - 1 - - - 999999 - - - 5 - - - - - - - minutes - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - Maximum number of articles per feed: - - - - - - - 9999 - - - 100 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - @@ -2938,8 +2835,8 @@ QGroupBox { 0 0 - 62 - 18 + 524 + 406 @@ -3002,9 +2899,6 @@ QGroupBox { spinRatio checkRatioRemove spinMaxRatio - checkIPFilter - textFilterPath - browseFilterButton spinWebUiPort textWebUiUsername textWebUiPassword