mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 01:33:07 -07:00
- Made search engine use libnotify instead of qt notification when available. Note that a notification is displayed when a search request has finished and the search tab is not currently displayed (other tab is displayed or window is minimized/iconified)
This commit is contained in:
parent
507b9b149e
commit
17f712e3e0
3 changed files with 10 additions and 11 deletions
|
@ -33,7 +33,6 @@
|
|||
#include <QCompleter>
|
||||
#include <QSettings>
|
||||
#include <QMessageBox>
|
||||
#include <QSystemTrayIcon>
|
||||
#include <QTemporaryFile>
|
||||
#include <QSystemTrayIcon>
|
||||
#include <iostream>
|
||||
|
@ -49,11 +48,12 @@
|
|||
#include "downloadthread.h"
|
||||
#include "misc.h"
|
||||
#include "searchlistdelegate.h"
|
||||
#include "GUI.h"
|
||||
|
||||
#define SEARCHHISTORY_MAXSIZE 50
|
||||
|
||||
/*SEARCH ENGINE START*/
|
||||
SearchEngine::SearchEngine(Bittorrent *BTSession, QSystemTrayIcon *systrayIcon) : QWidget(), BTSession(BTSession), systrayIcon(systrayIcon) {
|
||||
SearchEngine::SearchEngine(GUI *parent, Bittorrent *BTSession) : QWidget(parent), BTSession(BTSession), parent(parent) {
|
||||
setupUi(this);
|
||||
// new qCompleter to the search pattern
|
||||
startSearchHistory();
|
||||
|
@ -428,8 +428,8 @@ void SearchEngine::updateNova() {
|
|||
void SearchEngine::searchFinished(int exitcode,QProcess::ExitStatus){
|
||||
QSettings settings("qBittorrent", "qBittorrent");
|
||||
bool useNotificationBalloons = settings.value("Preferences/General/NotificationBaloons", true).toBool();
|
||||
if(systrayIcon && useNotificationBalloons) {
|
||||
systrayIcon->showMessage(tr("Search Engine"), tr("Search has finished"), QSystemTrayIcon::Information, TIME_TRAY_BALLOON);
|
||||
if(useNotificationBalloons && parent->getCurrentTabIndex() != TAB_SEARCH) {
|
||||
parent->showNotificationBaloon(tr("Search Engine"), tr("Search has finished"));
|
||||
}
|
||||
if(exitcode){
|
||||
search_status->setText(tr("An error occured during search..."));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue