From e887b3106f9eff8f9659f29e7be39df50d29cb1c Mon Sep 17 00:00:00 2001 From: Jesse Bryan Date: Tue, 2 Jan 2018 20:40:52 -0600 Subject: [PATCH] transferlist: added a force reannounce option. closes #6448. --- src/gui/transferlistwidget.cpp | 9 +++++++++ src/gui/transferlistwidget.h | 1 + 2 files changed, 10 insertions(+) diff --git a/src/gui/transferlistwidget.cpp b/src/gui/transferlistwidget.cpp index ba5a65460..2bc4c1448 100644 --- a/src/gui/transferlistwidget.cpp +++ b/src/gui/transferlistwidget.cpp @@ -683,6 +683,12 @@ void TransferListWidget::recheckSelectedTorrents() torrent->forceRecheck(); } +void TransferListWidget::reannounceSelectedTorrents() +{ + foreach (BitTorrent::TorrentHandle *const torrent, getSelectedTorrents()) + torrent->forceReannounce(); +} + // hide/show columns menu void TransferListWidget::displayDLHoSMenu(const QPoint&) { @@ -881,6 +887,8 @@ void TransferListWidget::displayListMenu(const QPoint&) connect(&actionSetTorrentPath, SIGNAL(triggered()), this, SLOT(setSelectedTorrentsLocation())); QAction actionForce_recheck(GuiIconProvider::instance()->getIcon("document-edit-verify"), tr("Force recheck"), 0); connect(&actionForce_recheck, SIGNAL(triggered()), this, SLOT(recheckSelectedTorrents())); + QAction actionForce_reannounce(GuiIconProvider::instance()->getIcon("document-edit-verify"), tr("Force reannounce"), 0); + connect(&actionForce_reannounce, SIGNAL(triggered()), this, SLOT(reannounceSelectedTorrents())); QAction actionCopy_magnet_link(GuiIconProvider::instance()->getIcon("kt-magnet"), tr("Copy magnet link"), 0); connect(&actionCopy_magnet_link, SIGNAL(triggered()), this, SLOT(copySelectedMagnetURIs())); QAction actionCopy_name(GuiIconProvider::instance()->getIcon("edit-copy"), tr("Copy name"), 0); @@ -1084,6 +1092,7 @@ void TransferListWidget::displayListMenu(const QPoint&) listMenu.addSeparator(); if (one_has_metadata) { listMenu.addAction(&actionForce_recheck); + listMenu.addAction(&actionForce_reannounce); listMenu.addSeparator(); } listMenu.addAction(&actionOpen_destination_folder); diff --git a/src/gui/transferlistwidget.h b/src/gui/transferlistwidget.h index 2ad24ab69..fc0a69d97 100644 --- a/src/gui/transferlistwidget.h +++ b/src/gui/transferlistwidget.h @@ -85,6 +85,7 @@ public slots: void copySelectedHashes() const; void openSelectedTorrentsFolder() const; void recheckSelectedTorrents(); + void reannounceSelectedTorrents(); void setDlLimitSelectedTorrents(); void setUpLimitSelectedTorrents(); void setMaxRatioSelectedTorrents();