mirror of
https://github.com/transmission/transmission
synced 2024-12-26 09:37:56 +00:00
Opening multiple torrents will once again respect the auto-start setting.
This commit is contained in:
parent
3581efe3da
commit
8cc1924999
2 changed files with 30 additions and 31 deletions
|
@ -1121,34 +1121,35 @@ static void sleepCallBack(void * controller, io_service_t y,
|
|||
{
|
||||
#warning expand upon
|
||||
if ([torrent progress] >= 1.0)
|
||||
{
|
||||
[torrent startTransfer];
|
||||
return;
|
||||
else
|
||||
{
|
||||
if (![torrent waitingToStart])
|
||||
return;
|
||||
|
||||
NSString * startSetting = [fDefaults stringForKey: @"StartSetting"];
|
||||
if ([startSetting isEqualToString: @"Wait"])
|
||||
{
|
||||
int desiredActive = [fDefaults integerForKey: @"WaitToStartNumber"];
|
||||
|
||||
Torrent * tempTorrent;
|
||||
NSEnumerator * enumerator = [fTorrents objectEnumerator];
|
||||
while ((tempTorrent = [enumerator nextObject]))
|
||||
if ([tempTorrent isActive] && ![tempTorrent isSeeding])
|
||||
{
|
||||
desiredActive--;
|
||||
if (desiredActive <= 0)
|
||||
return;
|
||||
}
|
||||
|
||||
[torrent startTransfer];
|
||||
}
|
||||
else if ([startSetting isEqualToString: @"Start"])
|
||||
[torrent startTransfer];
|
||||
else;
|
||||
}
|
||||
|
||||
if (![torrent waitingToStart])
|
||||
return;
|
||||
|
||||
NSString * startSetting = [fDefaults stringForKey: @"StartSetting"];
|
||||
if ([startSetting isEqualToString: @"Wait"])
|
||||
{
|
||||
int desiredActive = [fDefaults integerForKey: @"WaitToStartNumber"];
|
||||
|
||||
Torrent * tempTorrent;
|
||||
NSEnumerator * enumerator = [fTorrents objectEnumerator];
|
||||
while ((tempTorrent = [enumerator nextObject]))
|
||||
if ([tempTorrent isActive] && ![tempTorrent isSeeding])
|
||||
{
|
||||
desiredActive--;
|
||||
if (desiredActive <= 0)
|
||||
return;
|
||||
}
|
||||
|
||||
[torrent startTransfer];
|
||||
}
|
||||
else if ([startSetting isEqualToString: @"Start"])
|
||||
[torrent startTransfer];
|
||||
else;
|
||||
[torrent update];
|
||||
}
|
||||
|
||||
- (void) reloadInspector: (NSNotification *) notification
|
||||
|
|
|
@ -298,8 +298,7 @@
|
|||
}
|
||||
|
||||
int limit = [sender intValue];
|
||||
if (![[sender stringValue] isEqualToString: [NSString stringWithFormat: @"%d", limit]]
|
||||
|| limit < 0)
|
||||
if (![[sender stringValue] isEqualToString: [NSString stringWithFormat: @"%d", limit]] || limit < 0)
|
||||
{
|
||||
NSBeep();
|
||||
limit = [fDefaults integerForKey: key];
|
||||
|
@ -395,8 +394,7 @@
|
|||
NSString * key = sender == fSpeedLimitUploadField ? @"SpeedLimitUploadLimit" : @"SpeedLimitDownloadLimit";
|
||||
|
||||
int limit = [sender intValue];
|
||||
if (![[sender stringValue] isEqualToString: [NSString stringWithFormat: @"%d", limit]]
|
||||
|| limit < 0)
|
||||
if (![[sender stringValue] isEqualToString: [NSString stringWithFormat: @"%d", limit]] || limit < 0)
|
||||
{
|
||||
NSBeep();
|
||||
limit = [fDefaults integerForKey: key];
|
||||
|
@ -430,8 +428,8 @@
|
|||
[fDefaults setFloat: ratioLimit forKey: @"RatioLimit"];
|
||||
|
||||
NSDictionary * dict = [[NSDictionary alloc] initWithObjectsAndKeys:
|
||||
[NSNumber numberWithBool: [fRatioCheck state]], @"Enable",
|
||||
[NSNumber numberWithFloat: ratioLimit], @"Ratio", nil];
|
||||
[NSNumber numberWithBool: [fRatioCheck state]], @"Enable",
|
||||
[NSNumber numberWithFloat: ratioLimit], @"Ratio", nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName: @"RatioGlobalChange" object: dict];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue