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:
parent
f0e54da33b
commit
77736a625a
1 changed files with 6 additions and 6 deletions
|
@ -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]];
|
||||||
|
|
Loading…
Reference in a new issue