when turning on group view, show all groups expanded

This commit is contained in:
Mitchell Livingston 2008-02-07 02:15:24 +00:00
parent 346060659d
commit 5e2308daf9
3 changed files with 14 additions and 2 deletions

View File

@ -1167,7 +1167,7 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
enumerator = [torrents objectEnumerator];
while ((torrent = [enumerator nextObject]))
{
//expand the group, since either the whole group is being removed or it is already expanded
//expand the group, since either the whole group is being removed, it is already expanded, or not showing groups
[fTableView removeCollapsedGroup: [torrent groupValue]];
if (deleteData)
@ -1664,7 +1664,13 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
- (void) setSortByGroup: (id) sender
{
[fDefaults setBool: ![fDefaults boolForKey: @"SortByGroup"] forKey: @"SortByGroup"];
BOOL sortByGroup = ![fDefaults boolForKey: @"SortByGroup"];
[fDefaults setBool: sortByGroup forKey: @"SortByGroup"];
//expand all groups
if (sortByGroup)
[fTableView removeAllCollapsedGroups];
[self applyFilter: nil];
}

View File

@ -53,6 +53,7 @@
- (NSIndexSet *) collapsedGroupsIndexes;
- (void) removeCollapsedGroup: (int) value;
- (void) removeAllCollapsedGroups;
- (void) removeButtonTrackingAreas;
- (void) setControlButtonHover: (int) row;

View File

@ -103,6 +103,11 @@
[fCollapsedGroups removeIndex: value];
}
- (void) removeAllCollapsedGroups
{
[fCollapsedGroups removeAllIndexes];
}
- (BOOL) outlineView: (NSOutlineView *) outlineView isGroupItem: (id) item
{
return ![item isKindOfClass: [Torrent class]];