mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-13 00:33:09 -07:00
Merge pull request #7396 from thalieht/updownratio
Properly pre-select the selected torrent's current ratio limiting options in UpDownRatioDlg
This commit is contained in:
commit
083bc71315
57 changed files with 389 additions and 439 deletions
|
@ -627,14 +627,18 @@ void TransferListWidget::setMaxRatioSelectedTorrents()
|
|||
const QList<BitTorrent::TorrentHandle *> torrents = getSelectedTorrents();
|
||||
if (torrents.isEmpty()) return;
|
||||
|
||||
bool useGlobalValue = true;
|
||||
qreal currentMaxRatio = BitTorrent::Session::instance()->globalMaxRatio();
|
||||
if (torrents.count() == 1)
|
||||
currentMaxRatio = torrents[0]->maxRatio(&useGlobalValue);
|
||||
currentMaxRatio = torrents[0]->maxRatio();
|
||||
|
||||
int currentMaxSeedingTime = BitTorrent::Session::instance()->globalMaxSeedingMinutes();
|
||||
if (torrents.count() == 1)
|
||||
currentMaxSeedingTime = torrents[0]->maxSeedingTime(&useGlobalValue);
|
||||
currentMaxSeedingTime = torrents[0]->maxSeedingTime();
|
||||
|
||||
bool useGlobalValue = true;
|
||||
if (torrents.count() == 1)
|
||||
useGlobalValue = (torrents[0]->ratioLimit() == BitTorrent::TorrentHandle::USE_GLOBAL_RATIO)
|
||||
&& (torrents[0]->seedingTimeLimit() == BitTorrent::TorrentHandle::USE_GLOBAL_SEEDING_TIME);
|
||||
|
||||
UpDownRatioDlg dlg(useGlobalValue, currentMaxRatio, BitTorrent::TorrentHandle::MAX_RATIO,
|
||||
currentMaxSeedingTime, BitTorrent::TorrentHandle::MAX_SEEDING_TIME, this);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue