Browse Source

- Added "Copy magnet link" entry to right click menu now that we support magnet URIs

adaptive-webui-19844
Christophe Dumez 16 years ago
parent
commit
c8e8306e0a
  1. 4
      src/FinishedTorrents.cpp
  2. 24
      src/GUI.cpp
  3. 1
      src/GUI.h
  4. BIN
      src/Icons/magnet.png
  5. 6
      src/download.ui
  6. 3
      src/downloadingTorrents.cpp
  7. 169
      src/icons.qrc
  8. 40
      src/lang.qrc
  9. 16
      src/search.qrc
  10. 5
      src/seeding.ui

4
src/FinishedTorrents.cpp

@ -81,6 +81,8 @@ FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession) : par @@ -81,6 +81,8 @@ FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession) : par
actionDelete_Permanently->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/delete_perm.png")));
actionTorrent_Properties->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/properties.png")));
actionSet_upload_limit->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/seeding.png")));
actionCopy_magnet_link->setIcon(QIcon(QString::fromUtf8(":/Icons/magnet.png")));
connect(actionPause, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionPause_triggered()));
connect(actionStart, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionStart_triggered()));
connect(actionDelete, SIGNAL(triggered()), (GUI*)parent, SLOT(on_actionDelete_triggered()));
@ -90,6 +92,7 @@ FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession) : par @@ -90,6 +92,7 @@ FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession) : par
connect(actionBuy_it, SIGNAL(triggered()), (GUI*)parent, SLOT(goBuyPage()));
connect(actionTorrent_Properties, SIGNAL(triggered()), this, SLOT(propertiesSelection()));
connect(actionForce_recheck, SIGNAL(triggered()), this, SLOT(forceRecheck()));
connect(actionCopy_magnet_link, SIGNAL(triggered()), (GUI*)parent, SLOT(copyMagnetURI()));
connect(actionHOSColName, SIGNAL(triggered()), this, SLOT(hideOrShowColumnName()));
connect(actionHOSColSize, SIGNAL(triggered()), this, SLOT(hideOrShowColumnSize()));
@ -446,6 +449,7 @@ void FinishedTorrents::displayFinishedListMenu(const QPoint&){ @@ -446,6 +449,7 @@ void FinishedTorrents::displayFinishedListMenu(const QPoint&){
myFinishedListMenu.addAction(actionOpen_destination_folder);
myFinishedListMenu.addAction(actionTorrent_Properties);
myFinishedListMenu.addSeparator();
myFinishedListMenu.addAction(actionCopy_magnet_link);
myFinishedListMenu.addAction(actionBuy_it);
// Call menu

24
src/GUI.cpp

@ -34,6 +34,7 @@ @@ -34,6 +34,7 @@
#include <QDesktopServices>
#include <QStatusBar>
#include <QFrame>
#include <QClipboard>
#ifdef QT_4_4
#include <QLocalServer>
#include <QLocalSocket>
@ -598,6 +599,28 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis @@ -598,6 +599,28 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
}
}
void GUI::copyMagnetURI() const {
QStringList hashes;
switch(tabs->currentIndex()){
case 0:
hashes = downloadingTorrentTab->getSelectedTorrents();
break;
case 1:
hashes = finishedTorrentTab->getSelectedTorrents();
break;
default:
return;
}
QStringList magnet_uris;
foreach(QString hash, hashes) {
QTorrentHandle h = BTSession->getTorrentHandle(hash);
if(h.is_valid()) {
magnet_uris << misc::toQString(make_magnet_uri(h.get_torrent_info()));
}
}
qApp->clipboard()->setText(magnet_uris.join("\n"));
}
void GUI::goBuyPage() const {
QStringList hashes;
switch(tabs->currentIndex()){
@ -1351,6 +1374,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis @@ -1351,6 +1374,7 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
} else {
hashes = finishedTorrentTab->getSelectedTorrents();
}
qDebug("nb hashes: %d", hashes.size());
foreach(const QString &hash, hashes) {
QTorrentHandle h = BTSession->getTorrentHandle(hash);
if(!h.is_paused()){

1
src/GUI.h

@ -192,6 +192,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{ @@ -192,6 +192,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{
void setTabText(int index, QString text) const;
void openDestinationFolder() const;
void goBuyPage() const;
void copyMagnetURI() const;
void updateRatio();
protected:

BIN
src/Icons/magnet.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

6
src/download.ui

@ -1,3 +1,4 @@ @@ -1,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>downloading</class>
<widget class="QWidget" name="downloading">
@ -179,6 +180,11 @@ @@ -179,6 +180,11 @@
<string>Force recheck</string>
</property>
</action>
<action name="actionCopy_magnet_link">
<property name="text">
<string>Copy magnet link</string>
</property>
</action>
</widget>
<resources>
<include location="icons.qrc"/>

3
src/downloadingTorrents.cpp

@ -53,6 +53,7 @@ DownloadingTorrents::DownloadingTorrents(QObject *parent, bittorrent *BTSession) @@ -53,6 +53,7 @@ DownloadingTorrents::DownloadingTorrents(QObject *parent, bittorrent *BTSession)
actionSet_download_limit->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/downloading.png")));
actionDelete_Permanently->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/delete_perm.png")));
actionTorrent_Properties->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/properties.png")));
actionCopy_magnet_link->setIcon(QIcon(QString::fromUtf8(":/Icons/magnet.png")));
// tabBottom->setTabIcon(0, QIcon(QString::fromUtf8(":/Icons/oxygen/log.png")));
// tabBottom->setTabIcon(1, QIcon(QString::fromUtf8(":/Icons/oxygen/filter.png")));
@ -106,6 +107,7 @@ DownloadingTorrents::DownloadingTorrents(QObject *parent, bittorrent *BTSession) @@ -106,6 +107,7 @@ DownloadingTorrents::DownloadingTorrents(QObject *parent, bittorrent *BTSession)
connect(actionTorrent_Properties, SIGNAL(triggered()), this, SLOT(propertiesSelection()));
connect(actionForce_recheck, SIGNAL(triggered()), this, SLOT(forceRecheck()));
connect(actionBuy_it, SIGNAL(triggered()), (GUI*)parent, SLOT(goBuyPage()));
connect(actionCopy_magnet_link, SIGNAL(triggered()), (GUI*)parent, SLOT(copyMagnetURI()));
connect(actionHOSColName, SIGNAL(triggered()), this, SLOT(hideOrShowColumnName()));
connect(actionHOSColSize, SIGNAL(triggered()), this, SLOT(hideOrShowColumnSize()));
@ -298,6 +300,7 @@ void DownloadingTorrents::displayDLListMenu(const QPoint&) { @@ -298,6 +300,7 @@ void DownloadingTorrents::displayDLListMenu(const QPoint&) {
myDLLlistMenu.addAction(actionDecreasePriority);
}
myDLLlistMenu.addSeparator();
myDLLlistMenu.addAction(actionCopy_magnet_link);
myDLLlistMenu.addAction(actionBuy_it);
// Call menu
myDLLlistMenu.exec(QCursor::pos());

169
src/icons.qrc

@ -1,106 +1,107 @@ @@ -1,106 +1,107 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>Icons/add_file.png</file>
<file>Icons/add_folder.png</file>
<file>Icons/downarrow.png</file>
<file>Icons/gnome-shutdown.png</file>
<file>Icons/loading.png</file>
<file>Icons/locale.png</file>
<file>Icons/rss32.png</file>
<file>Icons/money.png</file>
<file>Icons/refresh.png</file>
<file>Icons/rss16.png</file>
<file>Icons/rss32.png</file>
<file>Icons/sphere.png</file>
<file>Icons/sphere2.png</file>
<file>Icons/uparrow.png</file>
<file>Icons/downarrow.png</file>
<file>Icons/url.png</file>
<file>Icons/flags/brazil.png</file>
<file>Icons/flags/bulgaria.png</file>
<file>Icons/flags/china.png</file>
<file>Icons/add_folder.png</file>
<file>Icons/locale.png</file>
<file>Icons/loading.png</file>
<file>Icons/add_file.png</file>
<file>Icons/magnet.png</file>
<file>Icons/sphere.png</file>
<file>Icons/uparrow.png</file>
<file>Icons/rss16.png</file>
<file>Icons/skin/play.png</file>
<file>Icons/skin/qbittorrent22.png</file>
<file>Icons/skin/new.png</file>
<file>Icons/skin/preview.png</file>
<file>Icons/skin/add.png</file>
<file>Icons/skin/stalled.png</file>
<file>Icons/skin/delete.png</file>
<file>Icons/skin/url.png</file>
<file>Icons/skin/connected.png</file>
<file>Icons/skin/mascot.png</file>
<file>Icons/skin/seeding.png</file>
<file>Icons/skin/increase.png</file>
<file>Icons/skin/qbittorrent32.png</file>
<file>Icons/skin/paused.png</file>
<file>Icons/skin/qb_question.png</file>
<file>Icons/skin/open.png</file>
<file>Icons/skin/remove.png</file>
<file>Icons/skin/qbittorrent16.png</file>
<file>Icons/skin/downloading.png</file>
<file>Icons/skin/search.png</file>
<file>Icons/skin/pause_all.png</file>
<file>Icons/skin/play_all.png</file>
<file>Icons/skin/pause.png</file>
<file>Icons/skin/firewalled.png</file>
<file>Icons/skin/properties.png</file>
<file>Icons/skin/info.png</file>
<file>Icons/skin/tabs.gif</file>
<file>Icons/skin/delete_perm.png</file>
<file>Icons/skin/queued.png</file>
<file>Icons/skin/settings.png</file>
<file>Icons/skin/exit.png</file>
<file>Icons/skin/delete_all.png</file>
<file>Icons/skin/splash.png</file>
<file>Icons/skin/decrease.png</file>
<file>Icons/flags/czech.png</file>
<file>Icons/flags/denmark.png</file>
<file>Icons/flags/china.png</file>
<file>Icons/flags/norway.png</file>
<file>Icons/flags/finland.png</file>
<file>Icons/flags/france.png</file>
<file>Icons/flags/germany.png</file>
<file>Icons/flags/greece.png</file>
<file>Icons/flags/hungary.png</file>
<file>Icons/flags/italy.png</file>
<file>Icons/flags/japan.png</file>
<file>Icons/flags/netherlands.png</file>
<file>Icons/flags/norway.png</file>
<file>Icons/flags/poland.png</file>
<file>Icons/flags/portugal.png</file>
<file>Icons/flags/taiwan.png</file>
<file>Icons/flags/sweden.png</file>
<file>Icons/flags/spain_catalunya.png</file>
<file>Icons/flags/romania.png</file>
<file>Icons/flags/denmark.png</file>
<file>Icons/flags/hungary.png</file>
<file>Icons/flags/ukraine.png</file>
<file>Icons/flags/turkey.png</file>
<file>Icons/flags/greece.png</file>
<file>Icons/flags/spain.png</file>
<file>Icons/flags/portugal.png</file>
<file>Icons/flags/russia.png</file>
<file>Icons/flags/united_kingdom.png</file>
<file>Icons/flags/poland.png</file>
<file>Icons/flags/germany.png</file>
<file>Icons/flags/bulgaria.png</file>
<file>Icons/flags/brazil.png</file>
<file>Icons/flags/france.png</file>
<file>Icons/flags/slovakia.png</file>
<file>Icons/flags/italy.png</file>
<file>Icons/flags/south_korea.png</file>
<file>Icons/flags/spain.png</file>
<file>Icons/flags/spain_catalunya.png</file>
<file>Icons/flags/sweden.png</file>
<file>Icons/flags/taiwan.png</file>
<file>Icons/flags/turkey.png</file>
<file>Icons/flags/ukraine.png</file>
<file>Icons/flags/united_kingdom.png</file>
<file>Icons/oxygen/browse.png</file>
<file>Icons/oxygen/bt_settings.png</file>
<file>Icons/oxygen/bug.png</file>
<file>Icons/oxygen/button_cancel.png</file>
<file>Icons/flags/japan.png</file>
<file>Icons/oxygen/file.png</file>
<file>Icons/oxygen/time.png</file>
<file>Icons/oxygen/edit-paste.png</file>
<file>Icons/oxygen/proxy.png</file>
<file>Icons/oxygen/log.png</file>
<file>Icons/oxygen/unavailable.png</file>
<file>Icons/oxygen/button_ok.png</file>
<file>Icons/oxygen/configure.png</file>
<file>Icons/oxygen/connection.png</file>
<file>Icons/oxygen/download.png</file>
<file>Icons/oxygen/button_cancel.png</file>
<file>Icons/oxygen/edit-clear.png</file>
<file>Icons/oxygen/edit-copy.png</file>
<file>Icons/oxygen/edit-cut.png</file>
<file>Icons/oxygen/edit-paste.png</file>
<file>Icons/oxygen/edit_clear.png</file>
<file>Icons/oxygen/encrypted.png</file>
<file>Icons/oxygen/file.png</file>
<file>Icons/oxygen/filter.png</file>
<file>Icons/oxygen/folder.png</file>
<file>Icons/oxygen/encrypted.png</file>
<file>Icons/oxygen/edit_clear.png</file>
<file>Icons/oxygen/download.png</file>
<file>Icons/oxygen/gear.png</file>
<file>Icons/oxygen/log.png</file>
<file>Icons/oxygen/proxy.png</file>
<file>Icons/oxygen/subscribe.png</file>
<file>Icons/oxygen/subscribe16.png</file>
<file>Icons/oxygen/time.png</file>
<file>Icons/oxygen/unavailable.png</file>
<file>Icons/oxygen/unsubscribe.png</file>
<file>Icons/oxygen/browse.png</file>
<file>Icons/oxygen/unsubscribe16.png</file>
<file>Icons/oxygen/subscribe.png</file>
<file>Icons/oxygen/edit-copy.png</file>
<file>Icons/oxygen/bt_settings.png</file>
<file>Icons/oxygen/webui.png</file>
<file>Icons/skin/add.png</file>
<file>Icons/skin/connected.png</file>
<file>Icons/skin/decrease.png</file>
<file>Icons/skin/delete.png</file>
<file>Icons/skin/delete_all.png</file>
<file>Icons/skin/delete_perm.png</file>
<file>Icons/skin/downloading.png</file>
<file>Icons/skin/exit.png</file>
<file>Icons/skin/firewalled.png</file>
<file>Icons/skin/increase.png</file>
<file>Icons/skin/info.png</file>
<file>Icons/skin/mascot.png</file>
<file>Icons/skin/new.png</file>
<file>Icons/skin/open.png</file>
<file>Icons/skin/pause.png</file>
<file>Icons/skin/pause_all.png</file>
<file>Icons/skin/paused.png</file>
<file>Icons/skin/play.png</file>
<file>Icons/skin/play_all.png</file>
<file>Icons/skin/preview.png</file>
<file>Icons/skin/properties.png</file>
<file>Icons/skin/qb_question.png</file>
<file>Icons/skin/qbittorrent16.png</file>
<file>Icons/skin/qbittorrent22.png</file>
<file>Icons/skin/qbittorrent32.png</file>
<file>Icons/skin/queued.png</file>
<file>Icons/skin/remove.png</file>
<file>Icons/skin/search.png</file>
<file>Icons/skin/seeding.png</file>
<file>Icons/skin/settings.png</file>
<file>Icons/skin/splash.png</file>
<file>Icons/skin/stalled.png</file>
<file>Icons/skin/tabs.gif</file>
<file>Icons/skin/url.png</file>
<file>Icons/oxygen/connection.png</file>
<file>Icons/oxygen/bug.png</file>
<file>Icons/oxygen/folder.png</file>
<file>Icons/oxygen/configure.png</file>
<file>Icons/oxygen/edit-cut.png</file>
<file>Icons/oxygen/unsubscribe.png</file>
<file>Icons/oxygen/subscribe16.png</file>
</qresource>
</RCC>

40
src/lang.qrc

@ -1,31 +1,31 @@ @@ -1,31 +1,31 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>lang/qbittorrent_bg.qm</file>
<file>lang/qbittorrent_ca.qm</file>
<file>lang/qbittorrent_cs.qm</file>
<file>lang/qbittorrent_da.qm</file>
<file>lang/qbittorrent_de.qm</file>
<file>lang/qbittorrent_el.qm</file>
<file>lang/qbittorrent_en.qm</file>
<file>lang/qbittorrent_es.qm</file>
<file>lang/qbittorrent_fi.qm</file>
<file>lang/qbittorrent_fr.qm</file>
<file>lang/qbittorrent_hu.qm</file>
<file>lang/qbittorrent_sk.qm</file>
<file>lang/qbittorrent_zh_TW.qm</file>
<file>lang/qbittorrent_pt.qm</file>
<file>lang/qbittorrent_sv.qm</file>
<file>lang/qbittorrent_pl.qm</file>
<file>lang/qbittorrent_it.qm</file>
<file>lang/qbittorrent_ja.qm</file>
<file>lang/qbittorrent_ko.qm</file>
<file>lang/qbittorrent_nb.qm</file>
<file>lang/qbittorrent_nl.qm</file>
<file>lang/qbittorrent_pl.qm</file>
<file>lang/qbittorrent_pt.qm</file>
<file>lang/qbittorrent_pt_BR.qm</file>
<file>lang/qbittorrent_en.qm</file>
<file>lang/qbittorrent_ro.qm</file>
<file>lang/qbittorrent_bg.qm</file>
<file>lang/qbittorrent_ru.qm</file>
<file>lang/qbittorrent_sk.qm</file>
<file>lang/qbittorrent_sv.qm</file>
<file>lang/qbittorrent_tr.qm</file>
<file>lang/qbittorrent_nl.qm</file>
<file>lang/qbittorrent_nb.qm</file>
<file>lang/qbittorrent_fi.qm</file>
<file>lang/qbittorrent_uk.qm</file>
<file>lang/qbittorrent_cs.qm</file>
<file>lang/qbittorrent_pt_BR.qm</file>
<file>lang/qbittorrent_el.qm</file>
<file>lang/qbittorrent_ca.qm</file>
<file>lang/qbittorrent_hu.qm</file>
<file>lang/qbittorrent_da.qm</file>
<file>lang/qbittorrent_de.qm</file>
<file>lang/qbittorrent_zh.qm</file>
<file>lang/qbittorrent_zh_TW.qm</file>
<file>lang/qbittorrent_ja.qm</file>
<file>lang/qbittorrent_tr.qm</file>
<file>lang/qbittorrent_fr.qm</file>
</qresource>
</RCC>

16
src/search.qrc

@ -1,18 +1,18 @@ @@ -1,18 +1,18 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>search_engine/novaprinter.py</file>
<file>search_engine/nova2dl.py</file>
<file>search_engine/helpers.py</file>
<file>search_engine/nova2.py</file>
<file>search_engine/nova2dl.py</file>
<file>search_engine/novaprinter.py</file>
<file>search_engine/engines/isohunt.py</file>
<file>search_engine/engines/isohunt.png</file>
<file>search_engine/engines/piratebay.py</file>
<file>search_engine/engines/torrentreactor.py</file>
<file>search_engine/engines/piratebay.png</file>
<file>search_engine/engines/btjunkie.png</file>
<file>search_engine/engines/btjunkie.py</file>
<file>search_engine/engines/isohunt.png</file>
<file>search_engine/engines/isohunt.py</file>
<file>search_engine/engines/torrentreactor.png</file>
<file>search_engine/engines/mininova.png</file>
<file>search_engine/engines/mininova.py</file>
<file>search_engine/engines/piratebay.png</file>
<file>search_engine/engines/piratebay.py</file>
<file>search_engine/engines/torrentreactor.png</file>
<file>search_engine/engines/torrentreactor.py</file>
</qresource>
</RCC>

5
src/seeding.ui

@ -146,6 +146,11 @@ @@ -146,6 +146,11 @@
<string>Seeds / Leechers</string>
</property>
</action>
<action name="actionCopy_magnet_link">
<property name="text">
<string>Copy magnet link</string>
</property>
</action>
</widget>
<resources>
<include location="icons.qrc"/>

Loading…
Cancel
Save