From: Adam M. <ama...@us...> - 2006-02-21 23:04:12
|
Update of /cvsroot/bibdesk/bibdesk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32388 Modified Files: Tag: BR_1x BibDocument.m BibEditor.m Log Message: Less hackish way of setting the window frame in BibEditor, and fix the problem with BibDocument getting reset to nib values when a second document is opened. Index: BibEditor.m =================================================================== RCS file: /cvsroot/bibdesk/bibdesk/BibEditor.m,v retrieving revision 1.159.2.218 retrieving revision 1.159.2.219 diff -C2 -d -r1.159.2.218 -r1.159.2.219 *** BibEditor.m 21 Feb 2006 05:03:01 -0000 1.159.2.218 --- BibEditor.m 21 Feb 2006 23:04:05 -0000 1.159.2.219 *************** *** 324,345 **** [cell release]; - // Make sure the window size is set correctly from defaults (bug #1385840); this keeps setupToolbar from overwriting defaults with the nib size when it causes a window size change notification - [[self window] setFrameAutosaveName:@""]; [self setupToolbar]; ! // The height should be valid now, including the toolbar height, so we can reset the autosave name // Only cascade editor windows if we have multiple editors open; bug #1299305 if([[self window] setFrameAutosaveName:BDSKBibEditorFrameAutosaveName]) [self setShouldCascadeWindows:NO]; - // Set the window frame from defaults manually, since we're bypassing some of the autosave size stuff - NSString *rectStr = [[OFPreferenceWrapper sharedPreferenceWrapper] objectForKey:BDSKBibEditorFrameAutosaveName]; - if([NSString isEmptyString:rectStr] == NO){ - NSRect frame = [[self window] frame]; - NSRect defaultsFrame = NSRectFromString(rectStr); - frame.size = defaultsFrame.size; - [[self window] setFrame:frame display:NO]; - } - [splitView setPositionAutosaveName:@"OASplitView Position BibEditor"]; --- 324,334 ---- [cell release]; [self setupToolbar]; ! [[self window] setFrameUsingName:BDSKBibEditorFrameAutosaveName]; // Only cascade editor windows if we have multiple editors open; bug #1299305 if([[self window] setFrameAutosaveName:BDSKBibEditorFrameAutosaveName]) [self setShouldCascadeWindows:NO]; [splitView setPositionAutosaveName:@"OASplitView Position BibEditor"]; *************** *** 2294,2303 **** - (void)windowDidMove:(NSNotification *)aNotification{ [self updateDocumentSnoopButton]; - if([[self window] frameAutosaveName]) [[OFPreferenceWrapper sharedPreferenceWrapper] setObject:NSStringFromRect([[self window] frame]) forKey:[[self window] frameAutosaveName]]; } - (void)windowDidResize:(NSNotification *)notification{ [self updateDocumentSnoopButton]; - if([[self window] frameAutosaveName]) [[OFPreferenceWrapper sharedPreferenceWrapper] setObject:NSStringFromRect([[self window] frame]) forKey:[[self window] frameAutosaveName]]; } --- 2283,2290 ---- *************** *** 2615,2619 **** - (void)windowWillClose:(NSNotification *)notification{ - //@@citekey [[self window] makeFirstResponder:citeKeyField]; // makes the field check if there is a duplicate field. [self finalizeChangesPreservingSelection:NO]; [macroTextFieldWC close]; // close so it's not hanging around by itself; this works if the doc window closes, also --- 2602,2605 ---- Index: BibDocument.m =================================================================== RCS file: /cvsroot/bibdesk/bibdesk/BibDocument.m,v retrieving revision 1.307.2.353 retrieving revision 1.307.2.354 diff -C2 -d -r1.307.2.353 -r1.307.2.354 *** BibDocument.m 21 Feb 2006 16:01:25 -0000 1.307.2.353 --- BibDocument.m 21 Feb 2006 23:04:04 -0000 1.307.2.354 *************** *** 344,351 **** - (void)windowControllerDidLoadNib:(NSWindowController *) aController { - // NSLog(@"windowcontroller didloadnib"); [super windowControllerDidLoadNib:aController]; [self setupToolbar]; ! [[aController window] setFrameAutosaveName:@"Main Window Frame Autosave"]; [documentWindow makeFirstResponder:tableView]; [tableView removeAllTableColumns]; --- 344,355 ---- - (void)windowControllerDidLoadNib:(NSWindowController *) aController { [super windowControllerDidLoadNib:aController]; [self setupToolbar]; ! ! // set the frame from prefs first, or setFrameAutosaveName: will overwrite the prefs with the nib values if it returns NO ! [[aController window] setFrameUsingName:@"Main Window Frame Autosave"]; ! if([[aController window] setFrameAutosaveName:@"Main Window Frame Autosave"]) ! [aController setShouldCascadeWindows:NO]; ! [documentWindow makeFirstResponder:tableView]; [tableView removeAllTableColumns]; *************** *** 2966,2969 **** --- 2970,2974 ---- // safety call here, in case the pasteboard is retaining the document; we don't want notifications after the window closes, since all the pointers to UI elements will be garbage [[NSNotificationCenter defaultCenter] removeObserver:self]; + } |