Browse Source

Disable force reannounce when it is not possible

Closes #12080.
PR #16551.
adaptive-webui-19844
An0n 3 years ago committed by GitHub
parent
commit
aa189a7fc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 23
      src/gui/transferlistwidget.cpp

23
src/gui/transferlistwidget.cpp

@ -924,6 +924,7 @@ void TransferListWidget::displayListMenu() @@ -924,6 +924,7 @@ void TransferListWidget::displayListMenu()
TagSet tagsInAny;
TagSet tagsInAll;
bool hasInfohashV1 = false, hasInfohashV2 = false;
bool oneCanForceReannounce = false;
for (const QModelIndex &index : selectedIndexes)
{
@ -987,7 +988,8 @@ void TransferListWidget::displayListMenu() @@ -987,7 +988,8 @@ void TransferListWidget::displayListMenu()
else
needsStart = true;
if (torrent->isPaused())
const bool isPaused = torrent->isPaused();
if (isPaused)
needsStart = true;
else
needsPause = true;
@ -1010,10 +1012,16 @@ void TransferListWidget::displayListMenu() @@ -1010,10 +1012,16 @@ void TransferListWidget::displayListMenu()
first = false;
const bool rechecking = torrent->isChecking();
const bool queued = (BitTorrent::Session::instance()->isQueueingSystemEnabled() && torrent->isQueued());
if (!isPaused && !rechecking && !queued)
oneCanForceReannounce = true;
if (oneHasMetadata && oneNotSeed && !allSameSequentialDownloadMode
&& !allSamePrioFirstlast && !allSameSuperSeeding && !allSameCategory
&& needsStart && needsForce && needsPause && needsPreview && !allSameAutoTMM
&& hasInfohashV1 && hasInfohashV2)
&& hasInfohashV1 && hasInfohashV2 && oneCanForceReannounce)
{
break;
}
@ -1135,11 +1143,14 @@ void TransferListWidget::displayListMenu() @@ -1135,11 +1143,14 @@ void TransferListWidget::displayListMenu()
if (addedPreviewAction)
listMenu->addSeparator();
if (oneHasMetadata)
{
listMenu->addAction(actionForceRecheck);
listMenu->addAction(actionForceReannounce);
listMenu->addSeparator();
}
// We can not force reannounce torrents that are paused/errored/checking/missing files/queued.
// We may already have the tracker list from magnet url. So we can force reannounce torrents without metadata anyway.
listMenu->addAction(actionForceReannounce);
actionForceReannounce->setEnabled(oneCanForceReannounce);
if (!oneCanForceReannounce)
actionForceReannounce->setToolTip(tr("Can not force reannounce if torrent is Paused/Queued/Errored/Checking"));
listMenu->addSeparator();
listMenu->addAction(actionOpenDestinationFolder);
if (BitTorrent::Session::instance()->isQueueingSystemEnabled() && oneNotSeed)
{

Loading…
Cancel
Save