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
1 changed files with 6 additions and 6 deletions

View File

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