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
This commit is contained in:
Gregory John Casamento 2003-01-09 06:17:07 +00:00
parent 242b6d5b82
commit 7801ab1a9c
2 changed files with 20 additions and 5 deletions

View file

@ -1,3 +1,9 @@
2003-01-09 Gregory John Casamento <greg_casamento@yahoo.com
* GormDocument.m: [GormDocument remove:]: added code
to break connections when a class, action or outlet
is deleted.
2003-01-09 Gregory John Casamento <greg_casamento@yahoo.com>
* ClassInformation.plist: added missing orderFrontFontPanel:

View file

@ -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];
}