mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-26 19:26:59 +03:00
Disable force reannounce when it is not possible
Closes #12080. PR #16551.
This commit is contained in:
parent
ab64ee872b
commit
aa189a7fc6
1 changed files with 17 additions and 6 deletions
|
@ -924,6 +924,7 @@ void TransferListWidget::displayListMenu()
|
||||||
TagSet tagsInAny;
|
TagSet tagsInAny;
|
||||||
TagSet tagsInAll;
|
TagSet tagsInAll;
|
||||||
bool hasInfohashV1 = false, hasInfohashV2 = false;
|
bool hasInfohashV1 = false, hasInfohashV2 = false;
|
||||||
|
bool oneCanForceReannounce = false;
|
||||||
|
|
||||||
for (const QModelIndex &index : selectedIndexes)
|
for (const QModelIndex &index : selectedIndexes)
|
||||||
{
|
{
|
||||||
|
@ -987,7 +988,8 @@ void TransferListWidget::displayListMenu()
|
||||||
else
|
else
|
||||||
needsStart = true;
|
needsStart = true;
|
||||||
|
|
||||||
if (torrent->isPaused())
|
const bool isPaused = torrent->isPaused();
|
||||||
|
if (isPaused)
|
||||||
needsStart = true;
|
needsStart = true;
|
||||||
else
|
else
|
||||||
needsPause = true;
|
needsPause = true;
|
||||||
|
@ -1010,10 +1012,16 @@ void TransferListWidget::displayListMenu()
|
||||||
|
|
||||||
first = false;
|
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
|
if (oneHasMetadata && oneNotSeed && !allSameSequentialDownloadMode
|
||||||
&& !allSamePrioFirstlast && !allSameSuperSeeding && !allSameCategory
|
&& !allSamePrioFirstlast && !allSameSuperSeeding && !allSameCategory
|
||||||
&& needsStart && needsForce && needsPause && needsPreview && !allSameAutoTMM
|
&& needsStart && needsForce && needsPause && needsPreview && !allSameAutoTMM
|
||||||
&& hasInfohashV1 && hasInfohashV2)
|
&& hasInfohashV1 && hasInfohashV2 && oneCanForceReannounce)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1135,11 +1143,14 @@ void TransferListWidget::displayListMenu()
|
||||||
if (addedPreviewAction)
|
if (addedPreviewAction)
|
||||||
listMenu->addSeparator();
|
listMenu->addSeparator();
|
||||||
if (oneHasMetadata)
|
if (oneHasMetadata)
|
||||||
{
|
|
||||||
listMenu->addAction(actionForceRecheck);
|
listMenu->addAction(actionForceRecheck);
|
||||||
listMenu->addAction(actionForceReannounce);
|
// We can not force reannounce torrents that are paused/errored/checking/missing files/queued.
|
||||||
listMenu->addSeparator();
|
// 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);
|
listMenu->addAction(actionOpenDestinationFolder);
|
||||||
if (BitTorrent::Session::instance()->isQueueingSystemEnabled() && oneNotSeed)
|
if (BitTorrent::Session::instance()->isQueueingSystemEnabled() && oneNotSeed)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue