From 7801ab1a9cacf2a876ac04cf8e437bff1ab01826 Mon Sep 17 00:00:00 2001 From: Gregory John Casamento Date: Thu, 9 Jan 2003 06:17:07 +0000 Subject: [PATCH] Added code to remove connections when an action, outlet or class is deleted. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@15567 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ GormDocument.m | 19 ++++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 93ae2671..d3f29fde 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-01-09 Gregory John Casamento * ClassInformation.plist: added missing orderFrontFontPanel: diff --git a/GormDocument.m b/GormDocument.m index d2e95ca3..fabdf6ce 100644 --- a/GormDocument.m +++ b/GormDocument.m @@ -954,18 +954,23 @@ static NSImage *classesImage = nil; if([anitem isKindOfClass: [GormOutletActionHolder class]]) { id itemBeingEdited = [classesView itemBeingEdited]; - + // if the class being edited is a custom class, then allow the deletion... if([classManager isCustomClass: itemBeingEdited]) { + NSString *name = [anitem getName]; + if([classesView editType] == Actions) { // if this action is an action on the class, not it's superclass // allow the deletion... - if([classManager isAction: [anitem getName] + if([classManager isAction: name ofClass: itemBeingEdited]) { - [classManager removeAction: [anitem getName] + BOOL removed = [self removeConnectionsWithLabel: name + forClassNamed: itemBeingEdited + isAction: YES]; + [classManager removeAction: name fromClassNamed: itemBeingEdited]; [classesView removeItemAtRow: i]; } @@ -974,10 +979,13 @@ static NSImage *classesImage = nil; { // if this outlet is an outlet on the class, not it's superclass // allow the deletion... - if([classManager isOutlet: [anitem getName] + if([classManager isOutlet: name ofClass: itemBeingEdited]) { - [classManager removeOutlet: [anitem getName] + BOOL removed = [self removeConnectionsWithLabel: name + forClassNamed: itemBeingEdited + isAction: NO]; + [classManager removeOutlet: name fromClassNamed: itemBeingEdited]; [classesView removeItemAtRow: i]; } @@ -993,6 +1001,7 @@ static NSImage *classesImage = nil; // if the class being edited is a custom class, then allow the deletion... if([classManager isCustomClass: anitem]) { + BOOL removed = [self removeConnectionsForClassNamed: anitem]; [classManager removeClassNamed: anitem]; [classesView reloadData]; }