From: Andrew M. <fit...@us...> - 2006-08-31 04:25:22
|
Update of /cvsroot/radmind/radmind-assistant/rte In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6978 Modified Files: RXAppController.m Log Message: KVO for creating and re-creating filter menu. Improved menu item tagging. Index: RXAppController.m =================================================================== RCS file: /cvsroot/radmind/radmind-assistant/rte/RXAppController.m,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** RXAppController.m 29 Aug 2006 01:26:52 -0000 1.7 --- RXAppController.m 31 Aug 2006 04:25:18 -0000 1.8 *************** *** 101,104 **** --- 101,112 ---- #endif notdef + - ( void )observeValueForKeyPath: ( NSString * )keyPath + ofObject: ( id )object + change: ( NSDictionary * )change + context: ( void * )context + { + [ self createFilterMenu ]; + } + - ( IBAction )getPrefPanel: ( id )sender { *************** *** 106,109 **** --- 114,122 ---- prefController = [[ RXPrefs alloc ] init ]; [ NSBundle loadNibNamed: @"RXPrefs" owner: prefController ]; + [[ prefController transcriptFilterController ] + addObserver: self + forKeyPath: @"arrangedObjects" + options: 0 + context: NULL ]; } *************** *** 163,170 **** continue; } - - /* set tag for menu item */ - [ filter setObject: [ NSNumber numberWithInt: tag ] - forKey: @"menuTag" ]; /* user cannot modify these */ --- 176,179 ---- *************** *** 229,233 **** for ( i = 0; i < [ tmp count ]; i++ ) { if (( filter = [ NSMutableDictionary dictionaryWithContentsOfFile: ! [ tmp objectAtIndex: i ]] ) == nil ) { NSLog( @"Couldn't read %@, skipping", [ tmp objectAtIndex: i ] ); --- 238,243 ---- for ( i = 0; i < [ tmp count ]; i++ ) { if (( filter = [ NSMutableDictionary dictionaryWithContentsOfFile: ! [ path stringByAppendingPathComponent: ! [ tmp objectAtIndex: i ]]] ) == nil ) { NSLog( @"Couldn't read %@, skipping", [ tmp objectAtIndex: i ] ); *************** *** 260,264 **** return( nil ); } ! return( [[ self transcriptFilters ] objectAtIndex: i ] ); } --- 270,274 ---- return( nil ); } ! return( [[ self transcriptFilters ] objectAtIndex: i ] ); } *************** *** 278,281 **** --- 288,292 ---- newFilterMenu = [[ NSMenu alloc ] initWithTitle: NSLocalizedString( @"Filters", @"Filters" ) ]; + for ( i = 0; i < [ filters count ]; i++ ) { title = [[ filters objectAtIndex: i ] objectForKey: @"filterName" ]; *************** *** 291,297 **** continue; } ! [ item setTag: [[[ filters objectAtIndex: i ] ! objectForKey: @"menuTag" ] intValue ]]; ! [ newFilterMenu insertItem: item atIndex: i ]; } --- 302,310 ---- continue; } ! ! [ item setTag: i ]; ! [[ filters objectAtIndex: i ] setObject: [ NSNumber numberWithInt: i ] ! forKey: @"menuTag" ]; ! [ newFilterMenu insertItem: item atIndex: i ]; } |