diff --git a/ChangeLog b/ChangeLog index 5a81a485..53596190 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-10-12 01:49 Gregory John Casamento + + * GormDocument.m: Added code to help with copy/paste issue. + * GormInspectorsManager.m: Added code to do addional checks to + ensure that the user cannot make erroneous connections. + 2003-10-08 01:03 Gregory John Casamento * GormDocument.m: Added include for GSNibTemplates.h removed some diff --git a/Gorm.m b/Gorm.m index 42d7ad9c..6925bffd 100644 --- a/Gorm.m +++ b/Gorm.m @@ -517,9 +517,9 @@ NSString *GormDidDeleteClassNotification = @"GormDidDeleteClassNotification"; forKey: @"ApplicationName"]; [dict setObject: @"[GNUstep | Graphical] Object Relationship Modeller" forKey: @"ApplicationDescription"]; - [dict setObject: @"Gorm 0.4.0 (Beta)" + [dict setObject: @"Gorm 0.4.1 (Beta)" forKey: @"ApplicationRelease"]; - [dict setObject: @"0.4.0 Oct 01 2003" + [dict setObject: @"0.4.1 Oct 12 2003" forKey: @"FullVersionID"]; [dict setObject: [NSArray arrayWithObjects: @"Gregory John Casamento ", @"Richard Frith-Macdonald ", diff --git a/GormDocument.m b/GormDocument.m index 6e0154a7..3f4c38bb 100644 --- a/GormDocument.m +++ b/GormDocument.m @@ -575,7 +575,8 @@ static NSImage *classesImage = nil; NSEnumerator *enumerator; NSMutableSet *editors; id obj; - NSData *data; + NSMutableData *data; + NSArchiver *archiver; /* * Remove all editors from the selected objects before archiving @@ -593,7 +594,15 @@ static NSImage *classesImage = nil; [editor deactivate]; } } - data = [NSArchiver archivedDataWithRootObject: anArray]; + + // encode the data + data = [NSMutableData dataWithCapacity: 0]; + archiver = [[NSArchiver alloc] initForWritingWithMutableData: data]; + [archiver encodeClassName: @"GormCustomView" + intoClassName: @"GSCustomView"]; + [archiver encodeRootObject: anArray]; + + // reactivate enumerator = [editors objectEnumerator]; while ((obj = [enumerator nextObject]) != nil) { diff --git a/GormInspectorsManager.m b/GormInspectorsManager.m index 70f81b0a..03038b27 100644 --- a/GormInspectorsManager.m +++ b/GormInspectorsManager.m @@ -1067,7 +1067,19 @@ selectCellWithString: (NSString*)title if ([[currentConnector source] isKindOfClass: [GormObjectProxy class]] == NO) { + // prevent invalid connections from being made... + NS_DURING [currentConnector establishConnection]; + NS_HANDLER + NSString *msg = [NSString stringWithFormat: @"Cannot establish connection: %@", + [localException reason]]; + // get rid of the bad connector and recover. + [[currentConnector source] setTarget: nil]; // unset these values on the source. + [[currentConnector source] setAction: nil]; // ibid. + [[(id)NSApp activeDocument] removeConnector: currentConnector]; + NSRunAlertPanel(_(@"Problem making connection"), msg, + _(@"OK"),nil,nil,nil); + NS_ENDHANDLER } } if ([currentConnector isKindOfClass: [NSNibControlConnector class]]) @@ -1123,6 +1135,8 @@ selectCellWithString: (NSString*)title NSString *msg = [NSString stringWithFormat: @"Cannot establish connection: %@", [localException reason]]; // get rid of the bad connector and recover. + [[currentConnector source] setTarget: nil]; // unset these values on the source. + [[currentConnector source] setAction: nil]; // ibid. [[(id)NSApp activeDocument] removeConnector: currentConnector]; NSRunAlertPanel(_(@"Problem making connection"), msg, _(@"OK"),nil,nil,nil);