Handle torrent "paused" state at application level

This commit is contained in:
Vladimir Golovnev (Glassez) 2020-04-19 16:12:50 +03:00
parent b249216db6
commit 85bd0feee0
No known key found for this signature in database
GPG key ID: 52A2C7DEE2DFA6F7
10 changed files with 157 additions and 146 deletions

View file

@ -357,7 +357,7 @@ void TransferListWidget::startSelectedTorrents()
void TransferListWidget::forceStartSelectedTorrents()
{
for (BitTorrent::TorrentHandle *const torrent : asConst(getSelectedTorrents()))
torrent->resume(true);
torrent->resume(BitTorrent::TorrentOperatingMode::Forced);
}
void TransferListWidget::startVisibleTorrents()
@ -965,14 +965,24 @@ void TransferListWidget::displayListMenu(const QPoint &)
allSameSuperSeeding = false;
}
}
if (!torrent->isForced())
needsForce = true;
else
needsStart = true;
if (torrent->isPaused())
needsStart = true;
else
needsPause = true;
if (torrent->isErrored() || torrent->hasMissingFiles()) {
// If torrent is in "errored" or "missing files" state
// it cannot keep further processing until you restart it.
needsStart = true;
needsForce = true;
}
if (torrent->hasMetadata())
needsPreview = true;