From 055388add7edcc8904e9da33e537de2b883b44e8 Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Wed, 28 Jul 2004 03:54:42 +0000 Subject: [PATCH] More changes for standalone views. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@19782 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 11 +++++++++++ GormDocument.m | 5 +++-- GormLib/IBInspector.m | 4 ++-- GormViewEditor.m | 14 +++++++++++--- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 44ba40e2..59efbe90 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2004-07-27 02:15 Gregory John Casamento + + * GormLib/IBInspector.m: Change the name of the method called + when receiving IBDocumentWillCloseNotification to _releaseObject: + instead of handleNotification:. This prevents confusion as some + of the subclasses define handleNotification for other + purposes. + * GormDocument.m: Modified the code in instantiateObject so that + NSView itself can be instantiated. + + 2004-07-27 02:15 Gregory John Casamento * Gorm.m: Cleaned up some commented out code. diff --git a/GormDocument.m b/GormDocument.m index f789bc8f..24cb0709 100644 --- a/GormDocument.m +++ b/GormDocument.m @@ -1448,7 +1448,7 @@ static NSImage *fileImage = nil; [link setDestination: editor]; [connections addObject: link]; - if(![openEditors containsObject: editor]) + if(![openEditors containsObject: editor] && editor != nil) { [openEditors addObject: editor]; } @@ -1727,7 +1727,8 @@ static NSImage *fileImage = nil; if([object isEqualToString: @"FirstResponder"]) return nil; - if([classManager isSuperclass: @"NSView" linkedToClass: object]) + if([classManager isSuperclass: @"NSView" linkedToClass: object] || + [object isEqual: @"NSView"]) { Class cls; NSString *className = object; diff --git a/GormLib/IBInspector.m b/GormLib/IBInspector.m index 3272aa84..4ed8b0f4 100644 --- a/GormLib/IBInspector.m +++ b/GormLib/IBInspector.m @@ -45,7 +45,7 @@ static NSNotificationCenter *nc = nil; if((self = [super init]) != nil) { [nc addObserver: self - selector: @selector(handleNotification:) + selector: @selector(_releaseObject:) name: IBWillCloseDocumentNotification object: nil]; } @@ -60,7 +60,7 @@ static NSNotificationCenter *nc = nil; [super dealloc]; } -- (void) handleNotification: (NSNotification *)notification +- (void) _releaseObject: (NSNotification *)notification { id doc = [notification object]; if([doc nameForObject: object] != nil) diff --git a/GormViewEditor.m b/GormViewEditor.m index c42deb3f..d6f971a7 100644 --- a/GormViewEditor.m +++ b/GormViewEditor.m @@ -1357,11 +1357,19 @@ static BOOL currently_displaying = NO; - (void) resetObject: (id)anObject { - /// NSLog(@"resetObject should not be called on GormViewEditor !"); - if(viewWindow != nil) + NS_DURING { - [viewWindow orderFront: self]; + // display the view, if it's standalone. + if(viewWindow != nil) + { + [viewWindow orderFront: self]; + } } + NS_HANDLER + { + NSLog(@"Exception while trying to display standalone view: %@",[localException reason]); + } + NS_ENDHANDLER } - (void) orderFront