2007-08-31 12:06:31 +00:00
|
|
|
/*
|
2015-08-27 11:25:14 +00:00
|
|
|
* Bittorrent Client using Qt and libtorrent.
|
|
|
|
* Copyright (C) 2015 Vladimir Golovnev <glassez@yandex.ru>
|
|
|
|
* Copyright (C) 2006 Christophe Dumez <chris@qbittorrent.org>
|
2007-08-31 12:06:31 +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-08-31 12:06:31 +00:00
|
|
|
*/
|
|
|
|
|
2018-06-14 09:54:23 +00:00
|
|
|
#ifndef PLUGINSELECTDIALOG_H
|
|
|
|
#define PLUGINSELECTDIALOG_H
|
2007-08-31 12:06:31 +00:00
|
|
|
|
2017-04-11 12:35:10 +00:00
|
|
|
#include <QDialog>
|
2007-08-31 12:06:31 +00:00
|
|
|
|
2018-01-29 14:05:29 +00:00
|
|
|
#include "base/search/searchpluginmanager.h"
|
2017-05-02 12:31:34 +00:00
|
|
|
|
2007-09-02 09:01:22 +00:00
|
|
|
class QDropEvent;
|
2017-06-13 22:23:08 +00:00
|
|
|
class QStringList;
|
2017-04-11 12:35:10 +00:00
|
|
|
class QTreeWidgetItem;
|
|
|
|
|
2019-03-01 07:38:16 +00:00
|
|
|
namespace Net
|
|
|
|
{
|
|
|
|
struct DownloadResult;
|
|
|
|
}
|
|
|
|
|
2017-04-11 12:35:10 +00:00
|
|
|
namespace Ui
|
|
|
|
{
|
2018-06-14 09:54:23 +00:00
|
|
|
class PluginSelectDialog;
|
2017-04-11 12:35:10 +00:00
|
|
|
}
|
|
|
|
|
2018-06-14 09:54:23 +00:00
|
|
|
class PluginSelectDialog : public QDialog
|
2015-08-26 17:05:57 +00:00
|
|
|
{
|
2015-09-24 07:33:02 +00:00
|
|
|
Q_OBJECT
|
2019-03-01 07:38:16 +00:00
|
|
|
Q_DISABLE_COPY(PluginSelectDialog)
|
2007-08-31 12:06:31 +00:00
|
|
|
|
2015-09-24 07:33:02 +00:00
|
|
|
public:
|
2018-06-14 09:54:23 +00:00
|
|
|
explicit PluginSelectDialog(SearchPluginManager *pluginManager, QWidget *parent = nullptr);
|
2019-03-01 07:38:16 +00:00
|
|
|
~PluginSelectDialog() override;
|
2015-09-24 07:33:02 +00:00
|
|
|
|
2019-08-02 04:55:06 +00:00
|
|
|
QVector<QTreeWidgetItem*> findItemsWithUrl(const QString &url);
|
2019-02-12 00:45:30 +00:00
|
|
|
QTreeWidgetItem *findItemWithID(const QString &id);
|
2007-08-31 12:06:31 +00:00
|
|
|
|
2015-09-24 07:33:02 +00:00
|
|
|
protected:
|
2018-06-14 11:46:50 +00:00
|
|
|
void dropEvent(QDropEvent *event) override;
|
|
|
|
void dragEnterEvent(QDragEnterEvent *event) override;
|
2015-08-27 11:25:14 +00:00
|
|
|
|
2015-09-24 07:33:02 +00:00
|
|
|
private slots:
|
|
|
|
void on_actionUninstall_triggered();
|
|
|
|
void on_updateButton_clicked();
|
|
|
|
void on_installButton_clicked();
|
2007-08-31 12:06:31 +00:00
|
|
|
void on_closeButton_clicked();
|
2015-08-27 11:25:14 +00:00
|
|
|
void togglePluginState(QTreeWidgetItem*, int);
|
2019-02-12 00:45:30 +00:00
|
|
|
void setRowColor(int row, const QString &color);
|
2019-06-03 07:10:19 +00:00
|
|
|
void displayContextMenu(const QPoint &);
|
2010-12-12 19:37:59 +00:00
|
|
|
void enableSelection(bool enable);
|
2007-09-11 19:31:21 +00:00
|
|
|
void askForLocalPlugin();
|
|
|
|
void askForPluginUrl();
|
2019-03-01 07:38:16 +00:00
|
|
|
void iconDownloadFinished(const Net::DownloadResult &result);
|
2015-08-27 11:25:14 +00:00
|
|
|
|
2017-05-02 12:31:34 +00:00
|
|
|
void checkForUpdatesFinished(const QHash<QString, PluginVersion> &updateInfo);
|
2015-08-27 11:25:14 +00:00
|
|
|
void checkForUpdatesFailed(const QString &reason);
|
|
|
|
void pluginInstalled(const QString &name);
|
|
|
|
void pluginInstallationFailed(const QString &name, const QString &reason);
|
|
|
|
void pluginUpdated(const QString &name);
|
|
|
|
void pluginUpdateFailed(const QString &name, const QString &reason);
|
|
|
|
|
2015-09-24 07:33:02 +00:00
|
|
|
private:
|
2015-08-27 11:25:14 +00:00
|
|
|
void loadSupportedSearchPlugins();
|
2019-02-12 00:45:30 +00:00
|
|
|
void addNewPlugin(const QString &pluginName);
|
2015-08-27 11:25:14 +00:00
|
|
|
void startAsyncOp();
|
|
|
|
void finishAsyncOp();
|
2017-06-13 22:23:08 +00:00
|
|
|
void finishPluginUpdate();
|
2015-09-24 07:33:02 +00:00
|
|
|
|
2018-06-14 09:54:23 +00:00
|
|
|
Ui::PluginSelectDialog *m_ui;
|
2018-01-29 14:05:29 +00:00
|
|
|
SearchPluginManager *m_pluginManager;
|
2017-06-13 22:23:08 +00:00
|
|
|
QStringList m_updatedPlugins;
|
2015-09-24 07:33:02 +00:00
|
|
|
int m_asyncOps;
|
2017-06-13 22:23:08 +00:00
|
|
|
int m_pendingUpdates;
|
2007-08-31 12:06:31 +00:00
|
|
|
};
|
|
|
|
|
2018-06-14 09:54:23 +00:00
|
|
|
#endif // PLUGINSELECTDIALOG_H
|