mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-22 20:44:15 +00:00
Search engine can now be disabled
This commit is contained in:
parent
54131001b0
commit
39b32bf1cd
31
src/GUI.cpp
31
src/GUI.cpp
@ -155,10 +155,6 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
|
|||||||
connect(actionIncreasePriority, SIGNAL(triggered()), transferList, SLOT(increasePrioSelectedTorrents()));
|
connect(actionIncreasePriority, SIGNAL(triggered()), transferList, SLOT(increasePrioSelectedTorrents()));
|
||||||
connect(actionDecreasePriority, SIGNAL(triggered()), transferList, SLOT(decreasePrioSelectedTorrents()));
|
connect(actionDecreasePriority, SIGNAL(triggered()), transferList, SLOT(decreasePrioSelectedTorrents()));
|
||||||
|
|
||||||
// Search engine tab
|
|
||||||
searchEngine = new SearchEngine(this, BTSession);
|
|
||||||
tabs->addTab(searchEngine, QIcon(QString::fromUtf8(":/Icons/oxygen/edit-find.png")), tr("Search"));
|
|
||||||
|
|
||||||
// Configure BT session according to options
|
// Configure BT session according to options
|
||||||
loadPreferences(false);
|
loadPreferences(false);
|
||||||
// Resume unfinished torrents
|
// Resume unfinished torrents
|
||||||
@ -185,6 +181,9 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
|
|||||||
actionTop_tool_bar->setChecked(Preferences::isToolbarDisplayed());
|
actionTop_tool_bar->setChecked(Preferences::isToolbarDisplayed());
|
||||||
actionSpeed_in_title_bar->setChecked(Preferences::speedInTitleBar());
|
actionSpeed_in_title_bar->setChecked(Preferences::speedInTitleBar());
|
||||||
actionRSS_Reader->setChecked(Preferences::isRSSEnabled());
|
actionRSS_Reader->setChecked(Preferences::isRSSEnabled());
|
||||||
|
actionSearch_engine->setChecked(Preferences::isSearchEnabled());
|
||||||
|
if(actionSearch_engine->isChecked())
|
||||||
|
displaySearchTab(true);
|
||||||
if(actionRSS_Reader->isChecked())
|
if(actionRSS_Reader->isChecked())
|
||||||
displayRSSTab(true);
|
displayRSSTab(true);
|
||||||
|
|
||||||
@ -254,7 +253,8 @@ GUI::~GUI() {
|
|||||||
delete downloadFromURLDialog;
|
delete downloadFromURLDialog;
|
||||||
if(rssWidget)
|
if(rssWidget)
|
||||||
delete rssWidget;
|
delete rssWidget;
|
||||||
delete searchEngine;
|
if(searchEngine)
|
||||||
|
delete searchEngine;
|
||||||
delete transferListFilters;
|
delete transferListFilters;
|
||||||
delete properties;
|
delete properties;
|
||||||
delete hSplitter;
|
delete hSplitter;
|
||||||
@ -304,6 +304,20 @@ void GUI::displayRSSTab(bool enable) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GUI::displaySearchTab(bool enable) {
|
||||||
|
if(enable) {
|
||||||
|
// RSS tab
|
||||||
|
if(!searchEngine) {
|
||||||
|
searchEngine = new SearchEngine(this, BTSession);
|
||||||
|
tabs->insertTab(1, searchEngine, QIcon(QString::fromUtf8(":/Icons/oxygen/edit-find.png")), tr("Search"));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(searchEngine) {
|
||||||
|
delete searchEngine;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GUI::updateNbTorrents(unsigned int nb_downloading, unsigned int nb_seeding, unsigned int nb_active, unsigned int nb_inactive, unsigned int nb_paused) {
|
void GUI::updateNbTorrents(unsigned int nb_downloading, unsigned int nb_seeding, unsigned int nb_active, unsigned int nb_inactive, unsigned int nb_paused) {
|
||||||
Q_UNUSED(nb_downloading);
|
Q_UNUSED(nb_downloading);
|
||||||
Q_UNUSED(nb_seeding);
|
Q_UNUSED(nb_seeding);
|
||||||
@ -1008,9 +1022,15 @@ void GUI::on_actionSpeed_in_title_bar_triggered() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GUI::on_actionRSS_Reader_triggered() {
|
void GUI::on_actionRSS_Reader_triggered() {
|
||||||
|
Preferences::setRSSEnabled(actionRSS_Reader->isChecked());
|
||||||
displayRSSTab(actionRSS_Reader->isChecked());
|
displayRSSTab(actionRSS_Reader->isChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GUI::on_actionSearch_engine_triggered() {
|
||||||
|
Preferences::setSearchEnabled(actionSearch_engine->isChecked());
|
||||||
|
displaySearchTab(actionSearch_engine->isChecked());
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************
|
/*****************************************************
|
||||||
* *
|
* *
|
||||||
* HTTP Downloader *
|
* HTTP Downloader *
|
||||||
@ -1025,3 +1045,4 @@ void GUI::on_actionDownload_from_URL_triggered() {
|
|||||||
connect(downloadFromURLDialog, SIGNAL(urlsReadyToBeDownloaded(const QStringList&)), this, SLOT(downloadFromURLList(const QStringList&)));
|
connect(downloadFromURLDialog, SIGNAL(urlsReadyToBeDownloaded(const QStringList&)), this, SLOT(downloadFromURLList(const QStringList&)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,6 +128,7 @@ protected:
|
|||||||
void showEvent(QShowEvent *);
|
void showEvent(QShowEvent *);
|
||||||
bool event(QEvent * event);
|
bool event(QEvent * event);
|
||||||
void displayRSSTab(bool enable);
|
void displayRSSTab(bool enable);
|
||||||
|
void displaySearchTab(bool enable);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Bittorrent
|
// Bittorrent
|
||||||
@ -161,11 +162,12 @@ private:
|
|||||||
QSplitter *hSplitter;
|
QSplitter *hSplitter;
|
||||||
QSplitter *vSplitter;
|
QSplitter *vSplitter;
|
||||||
// Search
|
// Search
|
||||||
SearchEngine *searchEngine;
|
QPointer<SearchEngine> searchEngine;
|
||||||
// RSS
|
// RSS
|
||||||
QPointer<RSSImp> rssWidget;
|
QPointer<RSSImp> rssWidget;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void on_actionSearch_engine_triggered();
|
||||||
void on_actionRSS_Reader_triggered();
|
void on_actionRSS_Reader_triggered();
|
||||||
void on_actionSpeed_in_title_bar_triggered();
|
void on_actionSpeed_in_title_bar_triggered();
|
||||||
void on_actionTop_tool_bar_triggered();
|
void on_actionTop_tool_bar_triggered();
|
||||||
|
@ -733,12 +733,28 @@ public:
|
|||||||
return settings.value(QString::fromUtf8("Preferences/IPFilter/BannedIPs"), QStringList()).toStringList();
|
return settings.value(QString::fromUtf8("Preferences/IPFilter/BannedIPs"), QStringList()).toStringList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Search
|
||||||
|
static bool isSearchEnabled() {
|
||||||
|
QSettings settings("qBittorrent", "qBittorrent");
|
||||||
|
return settings.value(QString::fromUtf8("Preferences/Search/SearchEnabled"), true).toBool();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void setSearchEnabled(bool enabled) {
|
||||||
|
QSettings settings("qBittorrent", "qBittorrent");
|
||||||
|
settings.setValue(QString::fromUtf8("Preferences/Search/SearchEnabled"), enabled);
|
||||||
|
}
|
||||||
|
|
||||||
// RSS
|
// RSS
|
||||||
static bool isRSSEnabled() {
|
static bool isRSSEnabled() {
|
||||||
QSettings settings("qBittorrent", "qBittorrent");
|
QSettings settings("qBittorrent", "qBittorrent");
|
||||||
return settings.value(QString::fromUtf8("Preferences/RSS/RSSEnabled"), false).toBool();
|
return settings.value(QString::fromUtf8("Preferences/RSS/RSSEnabled"), false).toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void setRSSEnabled(bool enabled) {
|
||||||
|
QSettings settings("qBittorrent", "qBittorrent");
|
||||||
|
settings.setValue(QString::fromUtf8("Preferences/RSS/RSSEnabled"), enabled);
|
||||||
|
}
|
||||||
|
|
||||||
static unsigned int getRSSRefreshInterval() {
|
static unsigned int getRSSRefreshInterval() {
|
||||||
QSettings settings("qBittorrent", "qBittorrent");
|
QSettings settings("qBittorrent", "qBittorrent");
|
||||||
return settings.value(QString::fromUtf8("Preferences/RSS/RSSRefresh"), 5).toUInt();
|
return settings.value(QString::fromUtf8("Preferences/RSS/RSSRefresh"), 5).toUInt();
|
||||||
|
@ -79,6 +79,8 @@
|
|||||||
</property>
|
</property>
|
||||||
<addaction name="actionTop_tool_bar"/>
|
<addaction name="actionTop_tool_bar"/>
|
||||||
<addaction name="actionSpeed_in_title_bar"/>
|
<addaction name="actionSpeed_in_title_bar"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
|
<addaction name="actionSearch_engine"/>
|
||||||
<addaction name="actionRSS_Reader"/>
|
<addaction name="actionRSS_Reader"/>
|
||||||
</widget>
|
</widget>
|
||||||
<addaction name="menu_File"/>
|
<addaction name="menu_File"/>
|
||||||
@ -307,7 +309,15 @@
|
|||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>RSS Reader</string>
|
<string>RSS reader</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actionSearch_engine">
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Search engine</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user