Browse Source

- FEATURE: RSS can now be disabled from program preferences

- COSMETIC: RSS Tab is now hidden as a default
adaptive-webui-19844
Christophe Dumez 17 years ago
parent
commit
4c5f349f49
  1. 2
      Changelog
  2. 38
      src/GUI.cpp
  3. 1
      src/GUI.h
  4. 23
      src/options.ui
  5. 29
      src/options_imp.cpp
  6. 2
      src/options_imp.h

2
Changelog

@ -1,7 +1,9 @@
* Unknown - Christophe Dumez <chris@qbittorrent.org> - v1.2.0 * Unknown - Christophe Dumez <chris@qbittorrent.org> - v1.2.0
- FEATURE: DHT is always ON (no longer used as fallback) - FEATURE: DHT is always ON (no longer used as fallback)
- FEATURE: The number of DHT nodes is displayed - FEATURE: The number of DHT nodes is displayed
- FEATURE: RSS can now be disabled from program preferences
- COSMETIC: Transfer speed, ratio and DHT nodes are displayed in status bar - COSMETIC: Transfer speed, ratio and DHT nodes are displayed in status bar
- COSMETIC: RSS Tab is now hidden as a default
* Unknown - Christophe Dumez <chris@qbittorrent.org> - v1.1.0 * Unknown - Christophe Dumez <chris@qbittorrent.org> - v1.1.0
- FEATURE: Web interface to control qbittorrent (Ishan Arora) - FEATURE: Web interface to control qbittorrent (Ishan Arora)

38
src/GUI.cpp

@ -147,8 +147,14 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
tabs->addTab(finishedTorrentTab, tr("Finished") + QString::fromUtf8(" (0/0)")); tabs->addTab(finishedTorrentTab, tr("Finished") + QString::fromUtf8(" (0/0)"));
tabs->setTabIcon(1, QIcon(QString::fromUtf8(":/Icons/skin/seeding.png"))); tabs->setTabIcon(1, QIcon(QString::fromUtf8(":/Icons/skin/seeding.png")));
connect(finishedTorrentTab, SIGNAL(torrentDoubleClicked(QString, bool)), this, SLOT(torrentDoubleClicked(QString, bool))); connect(finishedTorrentTab, SIGNAL(torrentDoubleClicked(QString, bool)), this, SLOT(torrentDoubleClicked(QString, bool)));
connect(finishedTorrentTab, SIGNAL(finishedTorrentsNumberChanged(unsigned int)), this, SLOT(updateFinishedTorrentNumber(unsigned int))); connect(finishedTorrentTab, SIGNAL(finishedTorrentsNumberChanged(unsigned int)), this, SLOT(updateFinishedTorrentNumber(unsigned int)));
// Search engine tab
searchEngine = new SearchEngine(BTSession, myTrayIcon, systrayIntegration);
tabs->addTab(searchEngine, tr("Search"));
tabs->setTabIcon(2, QIcon(QString::fromUtf8(":/Icons/skin/search.png")));
readSettings();
// RSS Tab
rssWidget = 0;
// Smooth torrent switching between tabs Downloading <--> Finished // Smooth torrent switching between tabs Downloading <--> Finished
connect(downloadingTorrentTab, SIGNAL(torrentFinished(QString)), finishedTorrentTab, SLOT(addTorrent(QString))); connect(downloadingTorrentTab, SIGNAL(torrentFinished(QString)), finishedTorrentTab, SLOT(addTorrent(QString)));
connect(finishedTorrentTab, SIGNAL(torrentMovedFromFinishedList(QString)), downloadingTorrentTab, SLOT(addTorrent(QString))); connect(finishedTorrentTab, SIGNAL(torrentMovedFromFinishedList(QString)), downloadingTorrentTab, SLOT(addTorrent(QString)));
@ -160,15 +166,6 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
configureSession(true); configureSession(true);
// Resume unfinished torrents // Resume unfinished torrents
BTSession->resumeUnfinishedTorrents(); BTSession->resumeUnfinishedTorrents();
// Search engine tab
searchEngine = new SearchEngine(BTSession, myTrayIcon, systrayIntegration);
tabs->addTab(searchEngine, tr("Search"));
tabs->setTabIcon(2, QIcon(QString::fromUtf8(":/Icons/skin/search.png")));
// RSS tab
rssWidget = new RSSImp();
tabs->addTab(rssWidget, tr("RSS"));
tabs->setTabIcon(3, QIcon(QString::fromUtf8(":/Icons/rss32.png")));
readSettings();
// Add torrent given on command line // Add torrent given on command line
processParams(torrentCmdLine); processParams(torrentCmdLine);
// Initialize Web UI // Initialize Web UI
@ -241,6 +238,7 @@ GUI::~GUI() {
delete statusSep1; delete statusSep1;
delete statusSep2; delete statusSep2;
delete statusSep3; delete statusSep3;
if(rssWidget != 0)
delete rssWidget; delete rssWidget;
delete searchEngine; delete searchEngine;
delete refresher; delete refresher;
@ -274,6 +272,20 @@ GUI::~GUI() {
qDebug("5"); qDebug("5");
} }
void GUI::displayRSSTab(bool enable) {
if(enable) {
// RSS tab
rssWidget = new RSSImp();
tabs->addTab(rssWidget, tr("RSS"));
tabs->setTabIcon(3, QIcon(QString::fromUtf8(":/Icons/rss32.png")));
} else {
if(rssWidget != 0) {
delete rssWidget;
rssWidget = 0;
}
}
}
void GUI::updateRatio() { void GUI::updateRatio() {
// Update ratio info // Update ratio info
float ratio = 1.; float ratio = 1.;
@ -1092,6 +1104,12 @@ void GUI::configureSession(bool deleteOptions) {
BTSession->disableIPFilter(); BTSession->disableIPFilter();
downloadingTorrentTab->setBottomTabEnabled(1, false); downloadingTorrentTab->setBottomTabEnabled(1, false);
} }
// RSS
if(options->isRSSEnabled()) {
displayRSSTab(true);
} else {
displayRSSTab(false);
}
// Clean up // Clean up
if(deleteOptions) { if(deleteOptions) {
delete options; delete options;

1
src/GUI.h

@ -179,6 +179,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{
protected: protected:
void closeEvent(QCloseEvent *); void closeEvent(QCloseEvent *);
void hideEvent(QHideEvent *); void hideEvent(QHideEvent *);
void displayRSSTab(bool enable);
public: public:
// Construct / Destruct // Construct / Destruct

23
src/options.ui

@ -1562,7 +1562,7 @@
<iconset resource="icons.qrc" > <iconset resource="icons.qrc" >
<normaloff>:/Icons/configure.png</normaloff>:/Icons/configure.png</iconset> <normaloff>:/Icons/configure.png</normaloff>:/Icons/configure.png</iconset>
</attribute> </attribute>
<layout class="QVBoxLayout" > <layout class="QVBoxLayout" name="verticalLayout_7" >
<item> <item>
<widget class="QGroupBox" name="filterBox" > <widget class="QGroupBox" name="filterBox" >
<property name="enabled" > <property name="enabled" >
@ -1622,7 +1622,23 @@
<property name="title" > <property name="title" >
<string>RSS</string> <string>RSS</string>
</property> </property>
<layout class="QVBoxLayout" > <layout class="QVBoxLayout" name="verticalLayout_6" >
<item>
<widget class="QCheckBox" name="checkEnableRSS" >
<property name="text" >
<string>Enable RSS support</string>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupRSSSettings" >
<property name="enabled" >
<bool>false</bool>
</property>
<property name="title" >
<string>RSS settings</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5" >
<item> <item>
<layout class="QHBoxLayout" > <layout class="QHBoxLayout" >
<item> <item>
@ -1737,6 +1753,9 @@
</layout> </layout>
</widget> </widget>
</item> </item>
</layout>
</widget>
</item>
<item> <item>
<spacer name="verticalSpacer" > <spacer name="verticalSpacer" >
<property name="orientation" > <property name="orientation" >

29
src/options_imp.cpp

@ -140,8 +140,9 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
connect(checkMaxUploadsPerTorrent, SIGNAL(stateChanged(int)), this, SLOT(enableMaxUploadsLimitPerTorrent(int))); connect(checkMaxUploadsPerTorrent, SIGNAL(stateChanged(int)), this, SLOT(enableMaxUploadsLimitPerTorrent(int)));
connect(checkRatioLimit, SIGNAL(stateChanged(int)), this, SLOT(enableShareRatio(int))); connect(checkRatioLimit, SIGNAL(stateChanged(int)), this, SLOT(enableShareRatio(int)));
connect(checkRatioRemove, SIGNAL(stateChanged(int)), this, SLOT(enableDeleteRatio(int))); connect(checkRatioRemove, SIGNAL(stateChanged(int)), this, SLOT(enableDeleteRatio(int)));
// IP Filter tab // Misc tab
connect(checkIPFilter, SIGNAL(stateChanged(int)), this, SLOT(enableFilter(int))); connect(checkIPFilter, SIGNAL(stateChanged(int)), this, SLOT(enableFilter(int)));
connect(checkEnableRSS, SIGNAL(stateChanged(int)), this, SLOT(enableRSS(int)));
// Web UI tab // Web UI tab
connect(checkWebUi, SIGNAL(toggled(bool)), this, SLOT(enableWebUi(bool))); connect(checkWebUi, SIGNAL(toggled(bool)), this, SLOT(enableWebUi(bool)));
@ -205,6 +206,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
connect(textFilterPath, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); connect(textFilterPath, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton()));
connect(spinRSSRefresh, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); connect(spinRSSRefresh, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton()));
connect(spinRSSMaxArticlesPerFeed, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); connect(spinRSSMaxArticlesPerFeed, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton()));
connect(checkEnableRSS, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
// Web UI tab // Web UI tab
connect(checkWebUi, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); connect(checkWebUi, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(spinWebUiPort, SIGNAL(valueChanged(int)), this, SLOT(enableApplyButton())); connect(spinWebUiPort, SIGNAL(valueChanged(int)), this, SLOT(enableApplyButton()));
@ -338,8 +340,9 @@ void options_imp::saveOptions(){
} }
// End IPFilter preferences // End IPFilter preferences
settings.endGroup(); settings.endGroup();
// * RSS // RSS
settings.beginGroup("RSS"); settings.beginGroup("RSS");
settings.setValue(QString::fromUtf8("RSSEnabled"), isRSSEnabled());
settings.setValue(QString::fromUtf8("RSSRefresh"), spinRSSRefresh->value()); settings.setValue(QString::fromUtf8("RSSRefresh"), spinRSSRefresh->value());
settings.setValue(QString::fromUtf8("RSSMaxArticlesPerFeed"), spinRSSMaxArticlesPerFeed->value()); settings.setValue(QString::fromUtf8("RSSMaxArticlesPerFeed"), spinRSSMaxArticlesPerFeed->value());
// End RSS preferences // End RSS preferences
@ -607,6 +610,12 @@ void options_imp::loadOptions(){
settings.endGroup(); settings.endGroup();
// * RSS // * RSS
settings.beginGroup("RSS"); settings.beginGroup("RSS");
checkEnableRSS->setChecked(settings.value(QString::fromUtf8("RSSEnabled"), false).toBool());
if(isRSSEnabled()) {
enableRSS(2); // Enable
} else {
enableRSS(0); // Disable
}
spinRSSRefresh->setValue(settings.value(QString::fromUtf8("RSSRefresh"), 5).toInt()); spinRSSRefresh->setValue(settings.value(QString::fromUtf8("RSSRefresh"), 5).toInt());
spinRSSMaxArticlesPerFeed->setValue(settings.value(QString::fromUtf8("RSSMaxArticlesPerFeed"), 50).toInt()); spinRSSMaxArticlesPerFeed->setValue(settings.value(QString::fromUtf8("RSSMaxArticlesPerFeed"), 50).toInt());
// End RSS preferences // End RSS preferences
@ -658,6 +667,10 @@ bool options_imp::isDHTEnabled() const{
return checkDHT->isChecked(); return checkDHT->isChecked();
} }
bool options_imp::isRSSEnabled() const{
return checkEnableRSS->isChecked();
}
bool options_imp::isPeXEnabled() const{ bool options_imp::isPeXEnabled() const{
return checkPeX->isChecked(); return checkPeX->isChecked();
} }
@ -850,7 +863,7 @@ void options_imp::enableMaxUploadsLimitPerTorrent(int checkBoxValue){
} }
void options_imp::enableFilter(int checkBoxValue){ void options_imp::enableFilter(int checkBoxValue){
if(checkBoxValue!=2){ if(checkBoxValue != 2){
//Disable //Disable
lblFilterPath->setEnabled(false); lblFilterPath->setEnabled(false);
textFilterPath->setEnabled(false); textFilterPath->setEnabled(false);
@ -863,6 +876,16 @@ void options_imp::enableFilter(int checkBoxValue){
} }
} }
void options_imp::enableRSS(int checkBoxValue) {
if(checkBoxValue != 2){
//Disable
groupRSSSettings->setEnabled(false);
}else{
//enable
groupRSSSettings->setEnabled(true);
}
}
void options_imp::enableUploadLimit(int checkBoxValue){ void options_imp::enableUploadLimit(int checkBoxValue){
if(checkBoxValue != 2){ if(checkBoxValue != 2){
//Disable //Disable

2
src/options_imp.h

@ -99,6 +99,7 @@ class options_imp : public QDialog, private Ui::Dialog {
bool isDHTEnabled() const; bool isDHTEnabled() const;
bool isPeXEnabled() const; bool isPeXEnabled() const;
bool isLSDEnabled() const; bool isLSDEnabled() const;
bool isRSSEnabled() const;
bool shouldSpoofAzureus() const; bool shouldSpoofAzureus() const;
int getEncryptionSetting() const; int getEncryptionSetting() const;
float getDesiredRatio() const; float getDesiredRatio() const;
@ -123,6 +124,7 @@ class options_imp : public QDialog, private Ui::Dialog {
void enableShareRatio(int checkBoxValue); void enableShareRatio(int checkBoxValue);
void enableDeleteRatio(int checkBoxValue); void enableDeleteRatio(int checkBoxValue);
void enableFilter(int checkBoxValue); void enableFilter(int checkBoxValue);
void enableRSS(int checkBoxValue);
void setStyle(int style); void setStyle(int style);
void on_buttonBox_accepted(); void on_buttonBox_accepted();
void closeEvent(QCloseEvent *e); void closeEvent(QCloseEvent *e);

Loading…
Cancel
Save