1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-04 02:28:03 +00:00

expand a torrent's group when removing it, since either the whole group is being removed or it is already expanded

This commit is contained in:
Mitchell Livingston 2008-02-07 02:11:26 +00:00
parent 015f40e498
commit 346060659d
3 changed files with 13 additions and 0 deletions

View file

@ -1167,6 +1167,9 @@ 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
[fTableView removeCollapsedGroup: [torrent groupValue]];
if (deleteData)
[torrent trashData];
if (deleteTorrent)
@ -1938,6 +1941,7 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
[fTableView selectValues: selectedValues];
//reset expanded/collapsed rows
#warning redo to not require storing an indexset?
if (groupRows && [fDisplayedTorrents count] > 0 && [NSApp isOnLeopardOrBetter])
{
NSIndexSet * collapsed = [fTableView collapsedGroupsIndexes];

View file

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

View file

@ -95,6 +95,14 @@
return fCollapsedGroups;
}
- (void) removeCollapsedGroup: (int) value
{
if (value < 0)
value = INT_MAX;
[fCollapsedGroups removeIndex: value];
}
- (BOOL) outlineView: (NSOutlineView *) outlineView isGroupItem: (id) item
{
return ![item isKindOfClass: [Torrent class]];