From: Michael M. <mm...@us...> - 2004-07-28 20:14:20
|
Update of /cvsroot/bibdesk/bibdesk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19010 Modified Files: BibDocument.h BibDocument.m BibAppController.h BibAppController.m Log Message: changes to make posting errors more efficient and to appropriately change the menu items in the window menu according to state. Index: BibAppController.m =================================================================== RCS file: /cvsroot/bibdesk/bibdesk/BibAppController.m,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** BibAppController.m 17 Jul 2004 19:23:06 -0000 1.22 --- BibAppController.m 28 Jul 2004 20:13:55 -0000 1.23 *************** *** 138,142 **** [errorTableView setDoubleAction:@selector(gotoError:)]; [openUsingFilterAccessoryView retain]; ! } --- 138,142 ---- [errorTableView setDoubleAction:@selector(gotoError:)]; [openUsingFilterAccessoryView retain]; ! [showHideCustomCiteStringsMenuItem setRepresentedObject:@"showHideCustomCiteMenuItem"]; } *************** *** 413,420 **** --- 413,422 ---- - (IBAction)hideErrorPanel:(id)sender{ [errorPanel orderOut:sender]; + [showHideErrorsMenuItem setTitle:NSLocalizedString(@"Show Errors",@"show errors - should be same as menu title in nib")]; } - (IBAction)showErrorPanel:(id)sender{ [errorPanel makeKeyAndOrderFront:sender]; + [showHideErrorsMenuItem setTitle:NSLocalizedString(@"Hide Errors",@"hide errors")]; } *************** *** 425,436 **** if (errorClass) { [_errors addObject:errDict]; ! [errorTableView reloadData]; ! //[errorTableView scrollRowToVisible:[_errors count]]; ! if ([[OFPreferenceWrapper sharedPreferenceWrapper] boolForKey:BDSKShowWarningsKey]) { ! [self showErrorPanel:self]; ! } } } - (void)removeErrorObjsForFileName:(NSString *)fileName{ NSMutableArray *errorsToRemove = [NSMutableArray arrayWithCapacity:10]; --- 427,448 ---- if (errorClass) { [_errors addObject:errDict]; ! [NSObject cancelPreviousPerformRequestsWithTarget:self ! selector:@selector(updateErrorPanelUI) ! object:nil]; ! ! [self performSelector:@selector(updateErrorPanelUI)]; } } + - (void)updateErrorPanelUI{ + [errorTableView reloadData]; + NSLog(@"err panel"); + //[errorTableView scrollRowToVisible:[_errors count]]; + if ([[OFPreferenceWrapper sharedPreferenceWrapper] boolForKey:BDSKShowWarningsKey]) { + [self showErrorPanel:self]; + [showHideErrorsMenuItem setTitle:NSLocalizedString(@"Hide Errors",@"hide errors")]; + } + } + - (void)removeErrorObjsForFileName:(NSString *)fileName{ NSMutableArray *errorsToRemove = [NSMutableArray arrayWithCapacity:10]; *************** *** 500,510 **** } - - (IBAction)showPreviewPanel:(id)sender{ - if(!showingPreviewPanel){ - [[BDSKPreviewer sharedPreviewer] showWindow:self]; // why self? - showingPreviewPanel = YES; - [[OFPreferenceWrapper sharedPreferenceWrapper] setObject:@"showing" forKey:@"BDSK Showing Preview Key"]; - } - } - (IBAction)toggleShowingPreviewPanel:(id)sender{ --- 512,515 ---- *************** *** 513,520 **** --- 518,527 ---- showingPreviewPanel = YES; [[OFPreferenceWrapper sharedPreferenceWrapper] setObject:@"showing" forKey:@"BDSK Showing Preview Key"]; + [showHidePreviewMenuItem setTitle:NSLocalizedString(@"Hide Preview",@"hide preview")]; }else{ [[[BDSKPreviewer sharedPreviewer] window] close]; showingPreviewPanel = NO; // redundant. [[OFPreferenceWrapper sharedPreferenceWrapper] setObject:@"not showing" forKey:@"BDSK Showing Preview Key"]; + [showHidePreviewMenuItem setTitle:NSLocalizedString(@"Show Preview",@"show preview, should be same as title in nib")]; } } *************** *** 542,546 **** if([@"showing" isEqualToString:[[OFPreferenceWrapper sharedPreferenceWrapper] objectForKey:@"BDSK Showing Preview Key"]]){ ! [self showPreviewPanel:self]; } --- 549,553 ---- if([@"showing" isEqualToString:[[OFPreferenceWrapper sharedPreferenceWrapper] objectForKey:@"BDSK Showing Preview Key"]]){ ! [self toggleShowingPreviewPanel:self]; } Index: BibDocument.h =================================================================== RCS file: /cvsroot/bibdesk/bibdesk/BibDocument.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** BibDocument.h 30 Jun 2004 18:52:47 -0000 1.22 --- BibDocument.h 28 Jul 2004 20:13:54 -0000 1.23 *************** *** 88,91 **** --- 88,92 ---- IBOutlet BDSKCustomCiteTableView* ccTableView; NSMutableArray* customStringArray; + BOOL showingCustomCiteDrawer; NSMutableArray *publications; // holds all the publications Index: BibAppController.h =================================================================== RCS file: /cvsroot/bibdesk/bibdesk/BibAppController.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** BibAppController.h 10 Jul 2004 01:12:28 -0000 1.12 --- BibAppController.h 28 Jul 2004 20:13:55 -0000 1.13 *************** *** 57,60 **** --- 57,64 ---- IBOutlet NSTextView* readmeTextView; IBOutlet NSWindow* readmeWindow; + + IBOutlet NSMenuItem* showHidePreviewMenuItem; + IBOutlet NSMenuItem* showHideCustomCiteStringsMenuItem; + IBOutlet NSMenuItem* showHideErrorsMenuItem; } *************** *** 109,112 **** --- 113,117 ---- - (IBAction)showErrorPanel:(id)sender; - (void)removeErrorObjsForFileName:(NSString *)fileName; + - (void)updateErrorPanelUI; - (IBAction)gotoError:(id)sender; - (IBAction)gotoErrorObj:(id)errObj; *************** *** 120,124 **** - (IBAction)showPreferencePanel:(id)sender; - (IBAction)showFindPanel:(id)sender; - - (IBAction)showPreviewPanel:(id)sender; - (IBAction)toggleShowingPreviewPanel:(id)sender; --- 125,128 ---- Index: BibDocument.m =================================================================== RCS file: /cvsroot/bibdesk/bibdesk/BibDocument.m,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** BibDocument.m 24 Jul 2004 18:23:47 -0000 1.54 --- BibDocument.m 28 Jul 2004 20:13:55 -0000 1.55 *************** *** 156,159 **** --- 156,161 ---- [customCiteDrawer setContentSize:NSMakeSize(100,drawerSize.height)]; + showingCustomCiteDrawer = NO; + // finally, make sure the font is correct initially: [self handleFontChangedNotification:nil]; *************** *** 1691,1698 **** - (IBAction)toggleShowingCustomCiteDrawer:(id)sender{ [customCiteDrawer toggle:sender]; } - - - (BOOL)validateMenuItem:(id <NSMenuItem>)menuItem{ if([[menuItem title] isEqualToString:@"Copy BibTex"] || --- 1693,1703 ---- - (IBAction)toggleShowingCustomCiteDrawer:(id)sender{ [customCiteDrawer toggle:sender]; + if(showingCustomCiteDrawer){ + showingCustomCiteDrawer = NO; + }else{ + showingCustomCiteDrawer = YES; + } } - (BOOL)validateMenuItem:(id <NSMenuItem>)menuItem{ if([[menuItem title] isEqualToString:@"Copy BibTex"] || *************** *** 1710,1714 **** // Localization note: does using this string work under localizations? return NO; ! }else{ return YES; } --- 1715,1726 ---- // Localization note: does using this string work under localizations? return NO; ! }else if([[menuItem representedObject] isEqualToString:@"showHideCustomCiteMenuItem"] ){ ! ! if(showingCustomCiteDrawer){ ! [menuItem setTitle:NSLocalizedString(@"Hide Custom Citation Strings",@"")]; ! }else{ ! [menuItem setTitle:NSLocalizedString(@"Show Custom Citation Strings",@"should be the same as in the nib")]; ! } ! }else{ return YES; } |