Corrected problem with window being brough forward after document close.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@19843 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2004-08-08 17:23:17 +00:00
parent 22c995beb5
commit 6915b501c0
4 changed files with 66 additions and 8 deletions

View file

@ -1,4 +1,14 @@
2004-08-06 07:20 Gregory John Casamento <greg_casamento@yahoo.com>
2004-08-08 13:23 Gregory John Casamento <greg_casamento@yahoo.com>
* GormDocument.[hm]: Added ivar isDocumentOpened
to track when document is opened and closed.
The document was being made active while closing and was
causing an issue with some of the windows in the document
being edited being brought to the front even though the
document itself had been deallocated. This is the
permanent fix for the previously discovered issue.
2004-08-07 06:10 Gregory John Casamento <greg_casamento@yahoo.com>
* GormObjectEditor.m: Temporary fix for recently discovered
crash.

View file

@ -51,7 +51,6 @@
NSString *documentPath;
NSMapTable *objToName;
NSWindow *window;
// NSMatrix *selectionView;
NSBox *selectionBox;
NSScrollView *scrollView;
NSScrollView *classesScrollView;
@ -63,6 +62,7 @@
id imagesView;
BOOL hasSetDefaults;
BOOL isActive;
BOOL isDocumentOpen;
NSMenu *savedMenu;
NSMenuItem *quitItem; /* Replaced during test */
NSMutableArray *savedEditors;

View file

@ -410,6 +410,8 @@ static NSImage *fileImage = nil;
// are we upgrading an archive?
isOlderArchive = NO;
// document is open...
isDocumentOpen = YES;
}
else
{
@ -1061,6 +1063,9 @@ static NSImage *fileImage = nil;
// Get rid of the selection box.
[selectionBox removeFromSuperviewWithoutNeedingDisplay];
// remove objects from the topLevelObjects set...
// [topLevelObjects removeAllObjects];
// release the managers...
RELEASE(classManager);
RELEASE(filePrefsManager);
@ -2196,6 +2201,9 @@ static NSImage *fileImage = nil;
[nc postNotificationName: IBDidOpenDocumentNotification
object: self];
// document opened...
isDocumentOpen = YES;
// release the unarchiver.. now that we're all done...
RELEASE(u);
}
@ -3062,7 +3070,7 @@ static NSImage *fileImage = nil;
- (void) setDocumentActive: (BOOL)flag
{
if (flag != isActive)
if (flag != isActive && isDocumentOpen)
{
NSEnumerator *enumerator;
id obj;
@ -3254,12 +3262,23 @@ static NSImage *fileImage = nil;
{
//Save
if (! [self saveGormDocument: self] )
return NO;
{
return NO;
}
else
{
isDocumentOpen = NO;
}
}
//Cancel
else if (result == NSAlertOtherReturn)
return NO;
{
//Cancel
return NO;
}
else // Don't save...
{
isDocumentOpen = NO;
}
}
return YES;

View file

@ -70,6 +70,11 @@
return NO;
}
- (BOOL) canBecomeKeyWindow
{
return NO;
}
- (NSString *) className
{
return @"NSWindow";
@ -98,11 +103,35 @@
NSLog(@"Being released... %d: %@", [self retainCount], self);
[super release];
}
*/
- (void) dealloc
{
NSLog(@"Deallocing %@",self);
[super dealloc];
}
*/
- (void) orderFront: (id)sender
{
NSLog(@"Ordering front...%@",self);
[super orderFront: sender];
}
- (void) orderFrontRegardless
{
NSLog(@"Ordering front regardless...%@",self);
[super orderFrontRegardless];
}
- (void) orderWindow: (NSWindowOrderingMode)place relativeTo: (int)otherWin
{
// NSLog(@"Ordering window %@",self);
[super orderWindow: place relativeTo: otherWin];
}
- (void) orderOut: (id)sender
{
NSLog(@"Ordering out...%@",self);
[super orderOut: sender];
}
@end