mirror of
https://github.com/transmission/transmission
synced 2024-12-26 09:37:56 +00:00
a little better menu item validation
This commit is contained in:
parent
f23d2aa950
commit
73565b2bc4
1 changed files with 4 additions and 13 deletions
|
@ -2361,7 +2361,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
||||||
Torrent * torrent;
|
Torrent * torrent;
|
||||||
NSEnumerator * enumerator = [fTorrents objectEnumerator];
|
NSEnumerator * enumerator = [fTorrents objectEnumerator];
|
||||||
while ((torrent = [enumerator nextObject]))
|
while ((torrent = [enumerator nextObject]))
|
||||||
if (![torrent isActive] && [torrent waitingToStart])
|
if ([torrent isPaused] && [torrent waitingToStart])
|
||||||
return YES;
|
return YES;
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
@ -2375,10 +2375,8 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
||||||
NSEnumerator * enumerator = [[fDisplayedTorrents objectsAtIndexes: [fTableView selectedRowIndexes]] objectEnumerator];
|
NSEnumerator * enumerator = [[fDisplayedTorrents objectsAtIndexes: [fTableView selectedRowIndexes]] objectEnumerator];
|
||||||
Torrent * torrent;
|
Torrent * torrent;
|
||||||
while ((torrent = [enumerator nextObject]))
|
while ((torrent = [enumerator nextObject]))
|
||||||
{
|
if ([torrent isPaused])
|
||||||
if (![torrent isActive])
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2391,10 +2389,8 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
||||||
NSEnumerator * enumerator = [[fDisplayedTorrents objectsAtIndexes: [fTableView selectedRowIndexes]] objectEnumerator];
|
NSEnumerator * enumerator = [[fDisplayedTorrents objectsAtIndexes: [fTableView selectedRowIndexes]] objectEnumerator];
|
||||||
Torrent * torrent;
|
Torrent * torrent;
|
||||||
while ((torrent = [enumerator nextObject]))
|
while ((torrent = [enumerator nextObject]))
|
||||||
{
|
|
||||||
if ([torrent isActive] || [torrent waitingToStart])
|
if ([torrent isActive] || [torrent waitingToStart])
|
||||||
return YES;
|
return YES;
|
||||||
}
|
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2404,16 +2400,11 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
|
||||||
if (!canUseTable)
|
if (!canUseTable)
|
||||||
return NO;
|
return NO;
|
||||||
|
|
||||||
|
NSEnumerator * enumerator = [[fDisplayedTorrents objectsAtIndexes: [fTableView selectedRowIndexes]] objectEnumerator];
|
||||||
Torrent * torrent;
|
Torrent * torrent;
|
||||||
NSIndexSet * indexSet = [fTableView selectedRowIndexes];
|
while ((torrent = [enumerator nextObject]))
|
||||||
unsigned int i;
|
|
||||||
|
|
||||||
for (i = [indexSet firstIndex]; i != NSNotFound; i = [indexSet indexGreaterThanIndex: i])
|
|
||||||
{
|
|
||||||
torrent = [fDisplayedTorrents objectAtIndex: i];
|
|
||||||
if ([torrent isPaused] && ![torrent waitingToStart])
|
if ([torrent isPaused] && ![torrent waitingToStart])
|
||||||
return YES;
|
return YES;
|
||||||
}
|
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue