mirror of
https://github.com/transmission/transmission
synced 2024-12-25 09:13:06 +00:00
disable option to pause torrents that are checking to avoid freezes
This commit is contained in:
parent
855f5b5b60
commit
fd586f4380
4 changed files with 21 additions and 15 deletions
|
@ -2398,7 +2398,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
|||
Torrent * torrent;
|
||||
NSEnumerator * enumerator = [fTorrents objectEnumerator];
|
||||
while ((torrent = [enumerator nextObject]))
|
||||
if ([torrent isActive] || [torrent waitingToStart])
|
||||
if (([torrent isActive] && ![torrent isChecking]) || [torrent waitingToStart])
|
||||
return YES;
|
||||
return NO;
|
||||
}
|
||||
|
@ -2421,7 +2421,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
|||
Torrent * torrent;
|
||||
while ((torrent = [enumerator nextObject]))
|
||||
{
|
||||
if ([torrent isActive] || [torrent waitingToStart])
|
||||
if (([torrent isActive] && ![torrent isChecking]) || [torrent waitingToStart])
|
||||
return YES;
|
||||
}
|
||||
return NO;
|
||||
|
@ -2551,7 +2551,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
|||
Torrent * torrent;
|
||||
NSEnumerator * enumerator = [fTorrents objectEnumerator];
|
||||
while ((torrent = [enumerator nextObject]))
|
||||
if ([torrent isActive] || [torrent waitingToStart])
|
||||
if (([torrent isActive] && ![torrent isChecking]) || [torrent waitingToStart])
|
||||
return YES;
|
||||
return NO;
|
||||
}
|
||||
|
@ -2604,7 +2604,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
|||
NSEnumerator * enumerator = [[fDisplayedTorrents objectsAtIndexes: [fTableView selectedRowIndexes]] objectEnumerator];
|
||||
Torrent * torrent;
|
||||
while ((torrent = [enumerator nextObject]))
|
||||
if ([torrent isActive] || [torrent waitingToStart])
|
||||
if (([torrent isActive] && ![torrent isChecking]) || [torrent waitingToStart])
|
||||
return YES;
|
||||
return NO;
|
||||
}
|
||||
|
|
|
@ -146,15 +146,16 @@
|
|||
|
||||
- (NSString *) stateString;
|
||||
|
||||
- (float) progress;
|
||||
- (int) eta;
|
||||
- (float) progress;
|
||||
- (int) eta;
|
||||
|
||||
- (BOOL) isActive;
|
||||
- (BOOL) isSeeding;
|
||||
- (BOOL) isPaused;
|
||||
- (BOOL) isError;
|
||||
- (NSString *) errorMessage;
|
||||
- (BOOL) justFinished;
|
||||
- (BOOL) isActive;
|
||||
- (BOOL) isSeeding;
|
||||
- (BOOL) isPaused;
|
||||
- (BOOL) isChecking;
|
||||
- (BOOL) isError;
|
||||
- (NSString *) errorMessage;
|
||||
- (BOOL) justFinished;
|
||||
|
||||
- (NSArray *) peers;
|
||||
|
||||
|
|
|
@ -511,7 +511,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
|
|||
fError = NO;
|
||||
fWaitToStart = NO;
|
||||
|
||||
if ([self isActive])
|
||||
if ([self isActive] && ![self isChecking])
|
||||
{
|
||||
tr_torrentStop(fHandle);
|
||||
[self update];
|
||||
|
@ -522,7 +522,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
|
|||
|
||||
- (void) stopTransferForQuit
|
||||
{
|
||||
if ([self isActive])
|
||||
if ([self isActive] && ![self isChecking])
|
||||
tr_torrentStop(fHandle);
|
||||
}
|
||||
|
||||
|
@ -954,6 +954,11 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
|
|||
return fStat->status == TR_STATUS_PAUSE;
|
||||
}
|
||||
|
||||
- (BOOL) isChecking
|
||||
{
|
||||
return fStat->status == TR_STATUS_CHECK;
|
||||
}
|
||||
|
||||
- (BOOL) isError
|
||||
{
|
||||
return fStat->error != 0;
|
||||
|
|
|
@ -249,7 +249,7 @@
|
|||
torrent = [fTorrents objectAtIndex: i];
|
||||
rect = [self pauseRectForRow: i];
|
||||
|
||||
if ([torrent isActive])
|
||||
if ([torrent isActive] && ![torrent isChecking])
|
||||
image = NSPointInRect(fClickPoint, rect) ? fPauseOnIcon : fPauseOffIcon;
|
||||
else if ([torrent isPaused])
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue