mirror of
https://github.com/transmission/transmission
synced 2024-12-28 10:38:45 +00:00
don't allow pex state to be changed when active
This commit is contained in:
parent
ced5ec5c98
commit
55111cd53d
3 changed files with 8 additions and 4 deletions
|
@ -566,21 +566,24 @@
|
||||||
enumerator = [fTorrents objectEnumerator];
|
enumerator = [fTorrents objectEnumerator];
|
||||||
torrent = [enumerator nextObject]; //first torrent
|
torrent = [enumerator nextObject]; //first torrent
|
||||||
|
|
||||||
BOOL pexEnabled = ![torrent privateTorrent];
|
BOOL pexEnabled = ![torrent privateTorrent] && [torrent isPaused];
|
||||||
int pexState = [torrent pex] ? NSOnState : NSOffState;
|
int pexState = [torrent pex] ? NSOnState : NSOffState;
|
||||||
|
|
||||||
while ((pexEnabled || pexState != NSMixedState)
|
while ((pexEnabled || pexState != NSMixedState)
|
||||||
&& (torrent = [enumerator nextObject]))
|
&& (torrent = [enumerator nextObject]))
|
||||||
{
|
{
|
||||||
if (pexEnabled)
|
if (pexEnabled)
|
||||||
pexEnabled = ![torrent privateTorrent];
|
pexEnabled = ![torrent privateTorrent] && [torrent isPaused];
|
||||||
|
|
||||||
if (pexState != NSMixedState && pexState != ([torrent pex] ? NSOnState : NSOffState))
|
if (pexState != NSMixedState && pexState != ([torrent pex] ? NSOnState : NSOffState))
|
||||||
pexState = NSMixedState;
|
pexState = NSMixedState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#warning change even when already active
|
||||||
[fPexCheck setEnabled: pexEnabled];
|
[fPexCheck setEnabled: pexEnabled];
|
||||||
[fPexCheck setState: pexState];
|
[fPexCheck setState: pexState];
|
||||||
|
[fPexCheck setToolTip: !pexEnabled ? NSLocalizedString(@"PEX can only be toggled on public torrents when paused.",
|
||||||
|
"Inspector -> pex check") : @""];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -603,6 +606,7 @@
|
||||||
|
|
||||||
[fPexCheck setEnabled: NO];
|
[fPexCheck setEnabled: NO];
|
||||||
[fPexCheck setState: NSOffState];
|
[fPexCheck setState: NSOffState];
|
||||||
|
[fPexCheck setToolTip: @""];
|
||||||
}
|
}
|
||||||
|
|
||||||
[self updateInfoStats];
|
[self updateInfoStats];
|
||||||
|
|
Loading…
Reference in a new issue