2007-08-31 16:06:31 +04:00
|
|
|
/*
|
|
|
|
* Bittorrent Client using Qt4 and libtorrent.
|
|
|
|
* Copyright (C) 2006 Christophe Dumez
|
|
|
|
*
|
|
|
|
* 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 21:00:55 +04: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 16:06:31 +04:00
|
|
|
* Contact : chris@qbittorrent.org
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ENGINE_SELECT_DLG_H
|
|
|
|
#define ENGINE_SELECT_DLG_H
|
|
|
|
|
2009-11-20 11:20:05 +03:00
|
|
|
#include "ui_engineselect.h"
|
2009-11-20 10:48:44 +03:00
|
|
|
#include "supportedengines.h"
|
2007-08-31 16:06:31 +04:00
|
|
|
|
|
|
|
class downloadThread;
|
2007-09-02 13:01:22 +04:00
|
|
|
class QDropEvent;
|
2007-08-31 16:06:31 +04:00
|
|
|
|
|
|
|
class engineSelectDlg : public QDialog, public Ui::engineSelect{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
private:
|
|
|
|
downloadThread *downloader;
|
2009-08-25 06:31:36 +04:00
|
|
|
SupportedEngines *supported_engines;
|
2007-08-31 16:06:31 +04:00
|
|
|
|
|
|
|
public:
|
2009-08-25 06:31:36 +04:00
|
|
|
engineSelectDlg(QWidget *parent, SupportedEngines *supported_engines);
|
2007-08-31 16:06:31 +04:00
|
|
|
~engineSelectDlg();
|
|
|
|
QList<QTreeWidgetItem*> findItemsWithUrl(QString url);
|
2007-09-04 02:05:40 +04:00
|
|
|
QTreeWidgetItem* findItemWithID(QString id);
|
2007-08-31 16:06:31 +04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
bool parseVersionsFile(QString versions_file, QString updateServer);
|
2007-09-01 14:23:39 +04:00
|
|
|
bool isUpdateNeeded(QString plugin_name, float new_version) const;
|
2007-08-31 16:06:31 +04:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void enginesChanged();
|
|
|
|
|
|
|
|
protected slots:
|
|
|
|
void on_closeButton_clicked();
|
2009-08-25 06:31:36 +04:00
|
|
|
void loadSupportedSearchEngines();
|
|
|
|
void addNewEngine(QString engine_name);
|
2007-08-31 16:06:31 +04:00
|
|
|
void toggleEngineState(QTreeWidgetItem*, int);
|
|
|
|
void setRowColor(int row, QString color);
|
|
|
|
void processDownloadedFile(QString url, QString filePath);
|
|
|
|
void handleDownloadFailure(QString url, QString reason);
|
|
|
|
void displayContextMenu(const QPoint& pos);
|
|
|
|
void enableSelection();
|
|
|
|
void disableSelection();
|
|
|
|
void on_actionUninstall_triggered();
|
|
|
|
void on_updateButton_clicked();
|
|
|
|
void on_installButton_clicked();
|
2007-09-02 13:01:22 +04:00
|
|
|
void dropEvent(QDropEvent *event);
|
|
|
|
void dragEnterEvent(QDragEnterEvent *event);
|
2007-09-04 02:05:40 +04:00
|
|
|
void installPlugin(QString plugin_path, QString plugin_name);
|
2007-09-11 23:31:21 +04:00
|
|
|
void askForLocalPlugin();
|
|
|
|
void askForPluginUrl();
|
2007-09-04 02:05:40 +04:00
|
|
|
#ifdef HAVE_ZZIP
|
|
|
|
void installZipPlugin(QString path);
|
|
|
|
#endif
|
2007-08-31 16:06:31 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|