1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-27 18:18:10 +00:00

Only append an ellipsis when removing will show a warning.

This commit is contained in:
Mitchell Livingston 2006-06-30 01:14:52 +00:00
parent f0e54da33b
commit 77736a625a

View file

@ -1436,7 +1436,7 @@ static void sleepCallBack(void * controller, io_service_t y,
if (action == @selector(removeNoDelete:) || action == @selector(removeDeleteData:) if (action == @selector(removeNoDelete:) || action == @selector(removeDeleteData:)
|| action == @selector(removeDeleteTorrent:) || action == @selector(removeDeleteBoth:)) || action == @selector(removeDeleteTorrent:) || action == @selector(removeDeleteBoth:))
{ {
BOOL active = NO, BOOL warning = NO, onlyDownloading = [fDefaults boolForKey: @"CheckRemoveDownloading"],
canDelete = action != @selector(removeDeleteTorrent:) && action != @selector(removeDeleteBoth:); canDelete = action != @selector(removeDeleteTorrent:) && action != @selector(removeDeleteBoth:);
Torrent * torrent; Torrent * torrent;
NSIndexSet * indexSet = [fTableView selectedRowIndexes]; NSIndexSet * indexSet = [fTableView selectedRowIndexes];
@ -1445,23 +1445,23 @@ static void sleepCallBack(void * controller, io_service_t y,
for (i = [indexSet firstIndex]; i != NSNotFound; i = [indexSet indexGreaterThanIndex: i]) for (i = [indexSet firstIndex]; i != NSNotFound; i = [indexSet indexGreaterThanIndex: i])
{ {
torrent = [fTorrents objectAtIndex: i]; torrent = [fTorrents objectAtIndex: i];
if (!active && [torrent isActive]) if (!warning && [torrent isActive])
{ {
active = YES; warning = onlyDownloading ? ![torrent isSeeding] : YES;
if (canDelete) if (warning && canDelete)
break; break;
} }
if (!canDelete && [torrent publicTorrent]) if (!canDelete && [torrent publicTorrent])
{ {
canDelete = YES; canDelete = YES;
if (active) if (warning)
break; break;
} }
} }
//append or remove ellipsis when needed //append or remove ellipsis when needed
NSString * title = [menuItem title], * ellipsis = [NSString ellipsis]; NSString * title = [menuItem title], * ellipsis = [NSString ellipsis];
if (active && [fDefaults boolForKey: @"CheckRemove"]) if (warning && [fDefaults boolForKey: @"CheckRemove"])
{ {
if (![title hasSuffix: ellipsis]) if (![title hasSuffix: ellipsis])
[menuItem setTitle: [title stringByAppendingEllipsis]]; [menuItem setTitle: [title stringByAppendingEllipsis]];