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 @@ @@ -1,7 +1,9 @@
* Unknown - Christophe Dumez <chris@qbittorrent.org> - v1.2.0
- FEATURE: DHT is always ON (no longer used as fallback)
- 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: RSS Tab is now hidden as a default
* Unknown - Christophe Dumez <chris@qbittorrent.org> - v1.1.0
- 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 @@ -147,8 +147,14 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
tabs->addTab(finishedTorrentTab, tr("Finished") + QString::fromUtf8(" (0/0)"));
tabs->setTabIcon(1, QIcon(QString::fromUtf8(":/Icons/skin/seeding.png")));
connect(finishedTorrentTab, SIGNAL(torrentDoubleClicked(QString, bool)), this, SLOT(torrentDoubleClicked(QString, bool)));
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
connect(downloadingTorrentTab, SIGNAL(torrentFinished(QString)), finishedTorrentTab, 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 @@ -160,15 +166,6 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
configureSession(true);
// Resume unfinished torrents
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
processParams(torrentCmdLine);
// Initialize Web UI
@ -241,6 +238,7 @@ GUI::~GUI() { @@ -241,6 +238,7 @@ GUI::~GUI() {
delete statusSep1;
delete statusSep2;
delete statusSep3;
if(rssWidget != 0)
delete rssWidget;
delete searchEngine;
delete refresher;
@ -274,6 +272,20 @@ GUI::~GUI() { @@ -274,6 +272,20 @@ GUI::~GUI() {
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() {
// Update ratio info
float ratio = 1.;
@ -1092,6 +1104,12 @@ void GUI::configureSession(bool deleteOptions) { @@ -1092,6 +1104,12 @@ void GUI::configureSession(bool deleteOptions) {
BTSession->disableIPFilter();
downloadingTorrentTab->setBottomTabEnabled(1, false);
}
// RSS
if(options->isRSSEnabled()) {
displayRSSTab(true);
} else {
displayRSSTab(false);
}
// Clean up
if(deleteOptions) {
delete options;

1
src/GUI.h

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

23
src/options.ui

@ -1562,7 +1562,7 @@ @@ -1562,7 +1562,7 @@
<iconset resource="icons.qrc" >
<normaloff>:/Icons/configure.png</normaloff>:/Icons/configure.png</iconset>
</attribute>
<layout class="QVBoxLayout" >
<layout class="QVBoxLayout" name="verticalLayout_7" >
<item>
<widget class="QGroupBox" name="filterBox" >
<property name="enabled" >
@ -1622,7 +1622,23 @@ @@ -1622,7 +1622,23 @@
<property name="title" >
<string>RSS</string>
</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>
<layout class="QHBoxLayout" >
<item>
@ -1737,6 +1753,9 @@ @@ -1737,6 +1753,9 @@
</layout>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer" >
<property name="orientation" >

29
src/options_imp.cpp

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

2
src/options_imp.h

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

Loading…
Cancel
Save