From: Adam M. <ama...@us...> - 2006-02-08 18:59:16
|
Update of /cvsroot/bibdesk/bibdesk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22347 Modified Files: Tag: BR_1x BibDocument_Groups.h BibDocument_Groups.m Log Message: add methods for selecting a group or array of groups Index: BibDocument_Groups.h =================================================================== RCS file: /cvsroot/bibdesk/bibdesk/Attic/BibDocument_Groups.h,v retrieving revision 1.1.2.14 retrieving revision 1.1.2.15 diff -C2 -d -r1.1.2.14 -r1.1.2.15 *** BibDocument_Groups.h 6 Feb 2006 19:52:52 -0000 1.1.2.14 --- BibDocument_Groups.h 8 Feb 2006 18:59:09 -0000 1.1.2.15 *************** *** 49,55 **** --- 49,59 ---- - (void)setCurrentGroupField:(NSString *)field; - (NSString *)currentGroupField; + - (NSArray *)selectedGroups; - (void)updateGroupsPreservingSelection:(BOOL)preserve; - (void)displaySelectedGroups; + - (void)selectGroup:(BDSKGroup *)aGroup; + - (void)selectGroups:(NSArray *)theGroups; + - (void)updateAllSmartGroups; - (NSArray *)publicationsInCurrentGroups; Index: BibDocument_Groups.m =================================================================== RCS file: /cvsroot/bibdesk/bibdesk/Attic/BibDocument_Groups.m,v retrieving revision 1.1.2.49 retrieving revision 1.1.2.50 diff -C2 -d -r1.1.2.49 -r1.1.2.50 *** BibDocument_Groups.m 6 Feb 2006 19:52:52 -0000 1.1.2.49 --- BibDocument_Groups.m 8 Feb 2006 18:59:09 -0000 1.1.2.50 *************** *** 239,242 **** --- 239,259 ---- } + - (void)selectGroup:(BDSKGroup *)aGroup{ + [self selectGroups:[NSArray arrayWithObject:aGroup]]; + } + + - (void)selectGroups:(NSArray *)theGroups{ + unsigned count = [self countOfGroups]; + NSMutableIndexSet *indexes = [NSMutableIndexSet indexSet]; + while(count--){ + if([theGroups containsObject:[self objectInGroupsAtIndex:count]]) + [indexes addIndex:count]; + } + + OBPOSTCONDITION([indexes count]); + [groupTableView deselectAll:nil]; + [groupTableView selectRowIndexes:indexes byExtendingSelection:NO]; + } + // force the smart groups to refilter their items, so the group content and count get redisplayed // if this becomes slow, we could make filters thread safe and update them in the background |