mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-28 05:27:15 +03:00
parent
75d1ac8889
commit
3da9444688
2 changed files with 6 additions and 10 deletions
|
@ -41,8 +41,8 @@
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
#include <QMessageBox>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
|
@ -84,10 +84,9 @@ namespace
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SearchWidget::SearchWidget(IGUIApplication *app, MainWindow *mainWindow)
|
SearchWidget::SearchWidget(IGUIApplication *app, QWidget *parent)
|
||||||
: GUIApplicationComponent(app, mainWindow)
|
: GUIApplicationComponent(app, parent)
|
||||||
, m_ui {new Ui::SearchWidget()}
|
, m_ui {new Ui::SearchWidget()}
|
||||||
, m_mainWindow {mainWindow}
|
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
m_ui->tabWidget->tabBar()->installEventFilter(this);
|
m_ui->tabWidget->tabBar()->installEventFilter(this);
|
||||||
|
@ -175,6 +174,7 @@ bool SearchWidget::eventFilter(QObject *object, QEvent *event)
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return QWidget::eventFilter(object, event);
|
return QWidget::eventFilter(object, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -373,7 +373,7 @@ void SearchWidget::tabStatusChanged(QWidget *tab)
|
||||||
{
|
{
|
||||||
Q_ASSERT(m_activeSearchTab->status() != SearchJobWidget::Status::Ongoing);
|
Q_ASSERT(m_activeSearchTab->status() != SearchJobWidget::Status::Ongoing);
|
||||||
|
|
||||||
if (app()->desktopIntegration()->isNotificationsEnabled() && (m_mainWindow->currentTabWidget() != this))
|
if (app()->desktopIntegration()->isNotificationsEnabled() && (app()->mainWindow()->currentTabWidget() != this))
|
||||||
{
|
{
|
||||||
if (m_activeSearchTab->status() == SearchJobWidget::Status::Error)
|
if (m_activeSearchTab->status() == SearchJobWidget::Status::Error)
|
||||||
app()->desktopIntegration()->showNotification(tr("Search Engine"), tr("Search has failed"));
|
app()->desktopIntegration()->showNotification(tr("Search Engine"), tr("Search has failed"));
|
||||||
|
|
|
@ -30,7 +30,6 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QList>
|
|
||||||
#include <QPointer>
|
#include <QPointer>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
|
@ -38,9 +37,7 @@
|
||||||
|
|
||||||
class QEvent;
|
class QEvent;
|
||||||
class QObject;
|
class QObject;
|
||||||
class QTabWidget;
|
|
||||||
|
|
||||||
class MainWindow;
|
|
||||||
class SearchJobWidget;
|
class SearchJobWidget;
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
|
@ -54,7 +51,7 @@ class SearchWidget : public GUIApplicationComponent<QWidget>
|
||||||
Q_DISABLE_COPY_MOVE(SearchWidget)
|
Q_DISABLE_COPY_MOVE(SearchWidget)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit SearchWidget(IGUIApplication *app, MainWindow *mainWindow);
|
explicit SearchWidget(IGUIApplication *app, QWidget *parent);
|
||||||
~SearchWidget() override;
|
~SearchWidget() override;
|
||||||
|
|
||||||
void giveFocusToSearchInput();
|
void giveFocusToSearchInput();
|
||||||
|
@ -83,6 +80,5 @@ private:
|
||||||
Ui::SearchWidget *m_ui = nullptr;
|
Ui::SearchWidget *m_ui = nullptr;
|
||||||
QPointer<SearchJobWidget> m_currentSearchTab; // Selected tab
|
QPointer<SearchJobWidget> m_currentSearchTab; // Selected tab
|
||||||
QPointer<SearchJobWidget> m_activeSearchTab; // Tab with running search
|
QPointer<SearchJobWidget> m_activeSearchTab; // Tab with running search
|
||||||
MainWindow *m_mainWindow = nullptr;
|
|
||||||
bool m_isNewQueryString = false;
|
bool m_isNewQueryString = false;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue