- Allow to download plugins from their url

This commit is contained in:
Christophe Dumez 2007-09-11 19:31:21 +00:00
parent 4c880fea09
commit b7ea2fb51a
6 changed files with 130 additions and 4 deletions

3
TODO
View file

@ -47,13 +47,11 @@
// in v1.0.0 (partial) - WIP // in v1.0.0 (partial) - WIP
- Fix all (or almost all) opened bugs in bug tracker - Fix all (or almost all) opened bugs in bug tracker
- Improve systray tooltip (again)
- Keep documention up to date - Keep documention up to date
- Windows port (Chris - Peerkoel) - Windows port (Chris - Peerkoel)
* beta 7 * beta 7
- update doc for plugins (and add screenies) - update doc for plugins (and add screenies)
- update doc for options - update doc for options
- Allow to install search plugins from an url
- Review torrent content selection - Review torrent content selection
* check the one in ktorrent * check the one in ktorrent
- Translations update (IN PROGRESS) - Translations update (IN PROGRESS)
@ -100,6 +98,7 @@ beta6->beta7 changelog:
- FEATURE: Display RSS article date and author if available - FEATURE: Display RSS article date and author if available
- FEATURE: Articles in a RSS feed are now ordered by date (newer at the top) - FEATURE: Articles in a RSS feed are now ordered by date (newer at the top)
- FEATURE: Read articles in a feed are not resetted when the feed is refreshed anymore - FEATURE: Read articles in a feed are not resetted when the feed is refreshed anymore
- FEATURE: Allow to install plugins from their url
- BUGFIX: In torrent content, it is now easier to filter all torrents using right click menu - BUGFIX: In torrent content, it is now easier to filter all torrents using right click menu
- BUGFIX: Updated man page / README / INSTALL - BUGFIX: Updated man page / README / INSTALL
- BUGFIX: Paused torrents could be displayed as connected for a sec after checking - BUGFIX: Paused torrents could be displayed as connected for a sec after checking

View file

@ -22,6 +22,7 @@
#include "engineSelectDlg.h" #include "engineSelectDlg.h"
#include "downloadThread.h" #include "downloadThread.h"
#include "misc.h" #include "misc.h"
#include "pluginSource.h"
#include <QProcess> #include <QProcess>
#include <QHeaderView> #include <QHeaderView>
#include <QSettings> #include <QSettings>
@ -29,6 +30,7 @@
#include <QMessageBox> #include <QMessageBox>
#include <QFileDialog> #include <QFileDialog>
#include <QDropEvent> #include <QDropEvent>
#include <QInputDialog>
#ifdef HAVE_MAGICK #ifdef HAVE_MAGICK
#include <Magick++.h> #include <Magick++.h>
@ -511,6 +513,21 @@ void engineSelectDlg::installPlugin(QString path, QString plugin_name) {
} }
void engineSelectDlg::on_installButton_clicked() { void engineSelectDlg::on_installButton_clicked() {
pluginSourceDlg *dlg = new pluginSourceDlg(this);
connect(dlg, SIGNAL(askForLocalFile()), this, SLOT(askForLocalPlugin()));
connect(dlg, SIGNAL(askForUrl()), this, SLOT(askForPluginUrl()));
}
void engineSelectDlg::askForPluginUrl() {
bool ok;
QString url = QInputDialog::getText(this, tr("New search engine plugin URL"),
tr("URL:"), QLineEdit::Normal,
"http://", &ok);
if (ok && !url.isEmpty())
downloader->downloadUrl(url);
}
void engineSelectDlg::askForLocalPlugin() {
QStringList pathsList = QFileDialog::getOpenFileNames(0, QStringList pathsList = QFileDialog::getOpenFileNames(0,
tr("Select search plugins"), QDir::homePath(), tr("Select search plugins"), QDir::homePath(),
#ifdef HAVE_ZZIP #ifdef HAVE_ZZIP

View file

@ -66,6 +66,8 @@ class engineSelectDlg : public QDialog, public Ui::engineSelect{
void dropEvent(QDropEvent *event); void dropEvent(QDropEvent *event);
void dragEnterEvent(QDragEnterEvent *event); void dragEnterEvent(QDragEnterEvent *event);
void installPlugin(QString plugin_path, QString plugin_name); void installPlugin(QString plugin_path, QString plugin_name);
void askForLocalPlugin();
void askForPluginUrl();
#ifdef HAVE_ZZIP #ifdef HAVE_ZZIP
void installZipPlugin(QString path); void installZipPlugin(QString path);
#endif #endif

56
src/pluginSource.h Normal file
View file

@ -0,0 +1,56 @@
/*
* 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.
*
* Contact : chris@qbittorrent.org
*/
#ifndef PLUGIN_SOURCE_H
#define PLUGIN_SOURCE_H
#include <QDialog>
#include "ui_pluginSource.h"
class pluginSourceDlg: public QDialog, private Ui::pluginSourceDlg {
Q_OBJECT
signals:
void askForUrl();
void askForLocalFile();
protected slots:
void on_localButton_clicked() {
emit askForLocalFile();
close();
}
void on_urlButton_clicked() {
emit askForUrl();
close();
}
public:
pluginSourceDlg(QWidget* parent): QDialog(parent){
setupUi(this);
setAttribute(Qt::WA_DeleteOnClose);
show();
}
~pluginSourceDlg(){}
};
#endif

52
src/pluginSource.ui Normal file
View file

@ -0,0 +1,52 @@
<ui version="4.0" >
<class>pluginSourceDlg</class>
<widget class="QDialog" name="pluginSourceDlg" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>207</width>
<height>76</height>
</rect>
</property>
<property name="windowTitle" >
<string>Plugin source</string>
</property>
<layout class="QVBoxLayout" >
<item>
<widget class="QLabel" name="source_lbl" >
<property name="font" >
<font>
<weight>75</weight>
<bold>true</bold>
<underline>true</underline>
</font>
</property>
<property name="text" >
<string>Search plugin source:</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QPushButton" name="localButton" >
<property name="text" >
<string>Local file</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="urlButton" >
<property name="text" >
<string>Web link</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View file

@ -136,12 +136,12 @@ HEADERS += GUI.h misc.h options_imp.h about_imp.h \
rss.h rss_imp.h FinishedTorrents.h \ rss.h rss_imp.h FinishedTorrents.h \
allocationDlg.h FinishedListDelegate.h \ allocationDlg.h FinishedListDelegate.h \
qtorrenthandle.h downloadingTorrents.h \ qtorrenthandle.h downloadingTorrents.h \
engineSelectDlg.h engineSelectDlg.h pluginSource.h
FORMS += MainWindow.ui options.ui about.ui \ FORMS += MainWindow.ui options.ui about.ui \
properties.ui createtorrent.ui preview.ui \ properties.ui createtorrent.ui preview.ui \
login.ui downloadFromURL.ui addTorrentDialog.ui \ login.ui downloadFromURL.ui addTorrentDialog.ui \
search.ui rss.ui seeding.ui bandwidth_limit.ui \ search.ui rss.ui seeding.ui bandwidth_limit.ui \
download.ui engineSelect.ui download.ui engineSelect.ui pluginSource.ui
SOURCES += GUI.cpp \ SOURCES += GUI.cpp \
main.cpp \ main.cpp \
options_imp.cpp \ options_imp.cpp \