2007-03-27 18:49:29 +00:00
|
|
|
/*
|
2015-08-27 14:25:14 +03:00
|
|
|
* Bittorrent Client using Qt and libtorrent.
|
2020-10-17 00:21:10 -04:00
|
|
|
* Copyright (C) 2020, Will Da Silva <will@willdasilva.xyz>
|
2018-01-29 17:05:29 +03:00
|
|
|
* Copyright (C) 2015, 2018 Vladimir Golovnev <glassez@yandex.ru>
|
2015-08-27 14:25:14 +03:00
|
|
|
* Copyright (C) 2006 Christophe Dumez <chris@qbittorrent.org>
|
2007-03-27 18:49:29 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
2009-04-05 17:00:55 +00:00
|
|
|
* In addition, as a special exception, the copyright holders give permission to
|
|
|
|
* link this program with the OpenSSL project's "OpenSSL" library (or with
|
|
|
|
* modified versions of it that use the same license as the "OpenSSL" library),
|
|
|
|
* and distribute the linked executables. You must obey the GNU General Public
|
|
|
|
* License in all respects for all of the code used other than "OpenSSL". If you
|
|
|
|
* modify file(s), you may extend this exception to your version of the file(s),
|
|
|
|
* but you are not obligated to do so. If you do not wish to do so, delete this
|
|
|
|
* exception statement from your version.
|
2007-03-27 18:49:29 +00:00
|
|
|
*/
|
|
|
|
|
2018-01-29 17:05:29 +03:00
|
|
|
#pragma once
|
2007-03-27 18:49:29 +00:00
|
|
|
|
2008-06-25 19:04:42 +00:00
|
|
|
#include <QList>
|
2009-07-12 06:42:38 +00:00
|
|
|
#include <QPointer>
|
2017-04-11 14:35:10 +02:00
|
|
|
#include <QWidget>
|
2015-09-24 10:33:02 +03:00
|
|
|
|
2020-10-17 00:21:10 -04:00
|
|
|
class QEvent;
|
|
|
|
class QObject;
|
2017-04-11 14:35:10 +02:00
|
|
|
class QTabWidget;
|
2007-03-27 18:49:29 +00:00
|
|
|
|
2010-11-13 21:15:52 +00:00
|
|
|
class MainWindow;
|
2018-06-14 12:54:23 +03:00
|
|
|
class SearchJobWidget;
|
2007-03-27 18:49:29 +00:00
|
|
|
|
2017-04-11 14:35:10 +02:00
|
|
|
namespace Ui
|
|
|
|
{
|
|
|
|
class SearchWidget;
|
|
|
|
}
|
|
|
|
|
2018-01-29 17:05:29 +03:00
|
|
|
class SearchWidget : public QWidget
|
2015-09-24 10:33:02 +03:00
|
|
|
{
|
2015-04-11 14:26:25 +03:00
|
|
|
Q_OBJECT
|
2015-08-26 20:05:57 +03:00
|
|
|
Q_DISABLE_COPY(SearchWidget)
|
2009-11-25 22:03:05 +00:00
|
|
|
|
2009-08-25 02:31:36 +00:00
|
|
|
public:
|
2015-09-24 10:33:02 +03:00
|
|
|
explicit SearchWidget(MainWindow *mainWindow);
|
2018-01-29 17:05:29 +03:00
|
|
|
~SearchWidget() override;
|
2009-08-25 02:31:36 +00:00
|
|
|
|
2015-04-11 14:26:25 +03:00
|
|
|
void giveFocusToSearchInput();
|
2009-08-25 02:31:36 +00:00
|
|
|
|
2015-08-27 14:25:14 +03:00
|
|
|
private slots:
|
2015-09-24 10:33:02 +03:00
|
|
|
void on_searchButton_clicked();
|
|
|
|
void on_pluginsButton_clicked();
|
|
|
|
|
2018-01-29 17:05:29 +03:00
|
|
|
private:
|
2020-10-17 00:21:10 -04:00
|
|
|
bool eventFilter(QObject *object, QEvent *event) override;
|
2018-01-29 17:05:29 +03:00
|
|
|
void tabChanged(int index);
|
2015-04-11 14:26:25 +03:00
|
|
|
void closeTab(int index);
|
2018-01-29 17:05:29 +03:00
|
|
|
void tabStatusChanged(QWidget *tab);
|
2016-02-29 14:46:39 +08:00
|
|
|
void selectMultipleBox(int index);
|
2018-07-05 11:16:14 +03:00
|
|
|
void toggleFocusBetweenLineEdits();
|
2015-09-24 10:33:02 +03:00
|
|
|
|
2015-04-11 14:26:25 +03:00
|
|
|
void fillCatCombobox();
|
2015-08-27 14:25:14 +03:00
|
|
|
void fillPluginComboBox();
|
2017-06-02 01:30:21 +03:00
|
|
|
void selectActivePage();
|
2019-02-12 02:45:30 +02:00
|
|
|
void searchTextEdited(const QString &);
|
2010-12-26 09:51:37 +00:00
|
|
|
|
2015-09-24 10:33:02 +03:00
|
|
|
QString selectedCategory() const;
|
|
|
|
QString selectedPlugin() const;
|
2015-08-27 14:25:14 +03:00
|
|
|
|
2017-04-11 14:35:10 +02:00
|
|
|
Ui::SearchWidget *m_ui;
|
2018-06-14 12:54:23 +03:00
|
|
|
QPointer<SearchJobWidget> m_currentSearchTab; // Selected tab
|
|
|
|
QPointer<SearchJobWidget> m_activeSearchTab; // Tab with running search
|
|
|
|
QList<SearchJobWidget *> m_allTabs; // To store all tabs
|
2015-09-24 10:33:02 +03:00
|
|
|
MainWindow *m_mainWindow;
|
|
|
|
bool m_isNewQueryString;
|
2007-03-27 18:49:29 +00:00
|
|
|
};
|