Fix for connections to NSOwner.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@23069 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2006-06-17 10:26:20 +00:00
parent c221647c27
commit f77fb0e8a1
2 changed files with 25 additions and 11 deletions

View file

@ -1,3 +1,7 @@
2006-06-17 06:25 Gregory John Casamento <greg_casamento@yahoo.com>
* GormCore/GormNibWrapperLoader.m: Fix for connections to NSOwner.
2006-06-15 00:48 Gregory John Casamento <greg_casamento@yahoo.com>
* GormCore/GModelDecoder.m: Removed old class.

View file

@ -52,6 +52,7 @@
{
NSIBObjectData *container;
NSMutableDictionary *swappedObjects;
id nibFilesOwner;
}
@end
@ -186,8 +187,8 @@
{
return NO;
}
nibFilesOwner = [container objectForName: @"File's Owner"];
id nibFilesOwner = [container objectForName: @"File's Owner"];
id docFilesOwner = [document filesOwner];
NSMapTable objects = [container objects];
NSArray *objs = NSAllMapTableKeys(objects);
@ -282,6 +283,18 @@
o = nil;
while((o = [en nextObject]) != nil)
{
id dest = [o destination];
if([o isKindOfClass: [NSNibControlConnector class]])
{
if(dest == nibFilesOwner)
{
[o setDestination: [document filesOwner]];
}
else if(dest == nil)
{
[o setDestination: [document firstResponder]];
}
}
[document addConnector: o];
}
@ -332,18 +345,15 @@
Class clz = [unarchiver classForClassName: className];
[obj setBaseWindowClass: clz];
}
else if([obj isKindOfClass: [NSNibOutletConnector class]] ||
[obj isKindOfClass: [NSNibControlConnector class]])
else if([obj respondsToSelector: @selector(setTarget:)] &&
[obj respondsToSelector: @selector(setAction:)] &&
[obj isKindOfClass: [NSCell class]] == NO)
{
if([obj source] == nil)
{
[obj setSource: [document firstResponder]];
}
if([obj destination] == nil)
{
[obj setDestination: [document firstResponder]];
}
// blank the target/action for all objects.
[obj setTarget: nil];
[obj setAction: NULL];
}
return obj;
}
@end