diff --git a/src/bittorrent.cpp b/src/bittorrent.cpp index 729b7ca57..a272d1ffc 100644 --- a/src/bittorrent.cpp +++ b/src/bittorrent.cpp @@ -312,6 +312,18 @@ void bittorrent::resumeAllTorrents() { } } +void bittorrent::pauseTorrent(QString hash) { + QTorrentHandle h = getTorrentHandle(hash); + if(!h.is_paused()) + h.pause(); +} + +void bittorrent::resumeTorrent(QString hash) { + QTorrentHandle h = getTorrentHandle(hash); + if(h.is_paused()) + h.resume(); +} + void bittorrent::loadWebSeeds(QString hash) { QFile urlseeds_file(misc::qBittorrentPath()+"BT_backup"+QDir::separator()+hash+".urlseeds"); if(!urlseeds_file.open(QIODevice::ReadOnly | QIODevice::Text)) return; diff --git a/src/bittorrent.h b/src/bittorrent.h index b37aa54c1..6b638e573 100644 --- a/src/bittorrent.h +++ b/src/bittorrent.h @@ -106,8 +106,12 @@ class bittorrent : public QObject { void downloadFromUrl(QString url); void downloadFromURLList(const QStringList& url_list); void deleteTorrent(QString hash, bool permanent = false); + /* Needed by Web UI */ void pauseAllTorrents(); void resumeAllTorrents(); + void pauseTorrent(QString hash); + void resumeTorrent(QString hash); + /* End Web UI */ void saveDHTEntry(); void preAllocateAllFiles(bool b); void saveFastResumeData();