mirror of
https://github.com/transmission/transmission
synced 2025-02-22 06:00:41 +00:00
unconditionally expand all groups when toggling group rows
This commit is contained in:
parent
6777c6f0f6
commit
66a268bb7f
1 changed files with 7 additions and 16 deletions
|
@ -1880,10 +1880,6 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
|
||||||
BOOL sortByGroup = ![fDefaults boolForKey: @"SortByGroup"];
|
BOOL sortByGroup = ![fDefaults boolForKey: @"SortByGroup"];
|
||||||
[fDefaults setBool: sortByGroup forKey: @"SortByGroup"];
|
[fDefaults setBool: sortByGroup forKey: @"SortByGroup"];
|
||||||
|
|
||||||
//expand all groups
|
|
||||||
if (sortByGroup)
|
|
||||||
[fTableView removeAllCollapsedGroups];
|
|
||||||
|
|
||||||
[self applyFilter];
|
[self applyFilter];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2374,6 +2370,9 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
|
||||||
{
|
{
|
||||||
NSAssert(groupRows != wasGroupRows, @"Trying toggling group-torrent reordering when we weren't expecting to.");
|
NSAssert(groupRows != wasGroupRows, @"Trying toggling group-torrent reordering when we weren't expecting to.");
|
||||||
|
|
||||||
|
//set all groups as expanded
|
||||||
|
[fTableView removeAllCollapsedGroups];
|
||||||
|
|
||||||
//since we're not doing this the right way (boo buggy animation), we need to remember selected values
|
//since we're not doing this the right way (boo buggy animation), we need to remember selected values
|
||||||
#warning when Lion-only and using views instead of cells, this likely won't be needed
|
#warning when Lion-only and using views instead of cells, this likely won't be needed
|
||||||
NSArray * selectedValues = [fTableView selectedValues];
|
NSArray * selectedValues = [fTableView selectedValues];
|
||||||
|
@ -2404,6 +2403,10 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
|
||||||
|
|
||||||
[fDisplayedTorrents setArray: [groupsByIndex allValues]];
|
[fDisplayedTorrents setArray: [groupsByIndex allValues]];
|
||||||
|
|
||||||
|
//actually expand group rows
|
||||||
|
for (TorrentGroup * group in fDisplayedTorrents)
|
||||||
|
[fTableView expandItem: group];
|
||||||
|
|
||||||
//we need the groups to be sorted, and we can do it without moving items in the table, too!
|
//we need the groups to be sorted, and we can do it without moving items in the table, too!
|
||||||
NSSortDescriptor * groupDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"groupOrderValue" ascending: YES];
|
NSSortDescriptor * groupDescriptor = [NSSortDescriptor sortDescriptorWithKey: @"groupOrderValue" ascending: YES];
|
||||||
[fDisplayedTorrents sortUsingDescriptors: [NSArray arrayWithObject: groupDescriptor]];
|
[fDisplayedTorrents sortUsingDescriptors: [NSArray arrayWithObject: groupDescriptor]];
|
||||||
|
@ -2414,18 +2417,6 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy
|
||||||
if (onLion)
|
if (onLion)
|
||||||
[fTableView insertItemsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [fDisplayedTorrents count])] inParent: nil withAnimation: NSTableViewAnimationEffectFade];
|
[fTableView insertItemsAtIndexes: [NSIndexSet indexSetWithIndexesInRange: NSMakeRange(0, [fDisplayedTorrents count])] inParent: nil withAnimation: NSTableViewAnimationEffectFade];
|
||||||
|
|
||||||
//reset expanded/collapsed rows
|
|
||||||
if (groupRows)
|
|
||||||
{
|
|
||||||
for (TorrentGroup * group in fDisplayedTorrents)
|
|
||||||
{
|
|
||||||
if ([fTableView isGroupCollapsed: [group groupIndex]])
|
|
||||||
[fTableView collapseItem: group];
|
|
||||||
else
|
|
||||||
[fTableView expandItem: group];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (selectedValues)
|
if (selectedValues)
|
||||||
[fTableView selectValues: selectedValues];
|
[fTableView selectValues: selectedValues];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue