Browse Source

- Allow to download plugins from their url

adaptive-webui-19844
Christophe Dumez 17 years ago
parent
commit
b7ea2fb51a
  1. 3
      TODO
  2. 17
      src/engineSelectDlg.cpp
  3. 2
      src/engineSelectDlg.h
  4. 56
      src/pluginSource.h
  5. 52
      src/pluginSource.ui
  6. 4
      src/src.pro

3
TODO

@ -47,13 +47,11 @@ @@ -47,13 +47,11 @@
// in v1.0.0 (partial) - WIP
- Fix all (or almost all) opened bugs in bug tracker
- Improve systray tooltip (again)
- Keep documention up to date
- Windows port (Chris - Peerkoel)
* beta 7
- update doc for plugins (and add screenies)
- update doc for options
- Allow to install search plugins from an url
- Review torrent content selection
* check the one in ktorrent
- Translations update (IN PROGRESS)
@ -100,6 +98,7 @@ beta6->beta7 changelog: @@ -100,6 +98,7 @@ beta6->beta7 changelog:
- 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: 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: Updated man page / README / INSTALL
- BUGFIX: Paused torrents could be displayed as connected for a sec after checking

17
src/engineSelectDlg.cpp

@ -22,6 +22,7 @@ @@ -22,6 +22,7 @@
#include "engineSelectDlg.h"
#include "downloadThread.h"
#include "misc.h"
#include "pluginSource.h"
#include <QProcess>
#include <QHeaderView>
#include <QSettings>
@ -29,6 +30,7 @@ @@ -29,6 +30,7 @@
#include <QMessageBox>
#include <QFileDialog>
#include <QDropEvent>
#include <QInputDialog>
#ifdef HAVE_MAGICK
#include <Magick++.h>
@ -511,6 +513,21 @@ void engineSelectDlg::installPlugin(QString path, QString plugin_name) { @@ -511,6 +513,21 @@ void engineSelectDlg::installPlugin(QString path, QString plugin_name) {
}
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,
tr("Select search plugins"), QDir::homePath(),
#ifdef HAVE_ZZIP

2
src/engineSelectDlg.h

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

56
src/pluginSource.h

@ -0,0 +1,56 @@ @@ -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

@ -0,0 +1,52 @@ @@ -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>

4
src/src.pro

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

Loading…
Cancel
Save