Added code to improve the outlet and action initial names.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@20289 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2004-11-04 03:11:38 +00:00
parent dac82139d4
commit 2085f591e6
2 changed files with 14 additions and 4 deletions

View file

@ -1,3 +1,10 @@
2004-11-03 10:07 Gregory John Casamento <greg_casamento@yahoo.com>
* GormClassManager.m: modified addNewActionToClassNamed: and
addNewOutletToClassNamed: so that the initial names for outlets
and actions are newOutet1, newOutlet2, and similar for actions
newAction1:, newAction2:, etc.
2004-11-03 21:45 Gregory John Casamento <greg_casamento@yahoo.com>
* GormDocument.m: Added alert panel to loadDocument: so that

View file

@ -93,13 +93,15 @@
NSArray *array = [classInfo objectForKey: @"Actions"];
NSArray *extra = [classInfo objectForKey: @"ExtraActions"];
NSMutableArray *combined = [NSMutableArray arrayWithArray: array];
NSString *new = @"newAction", *search = [new stringByAppendingString: @":"];
NSString *newAction = @"newAction";
NSString *search = [newAction stringByAppendingString: @":"];
NSString *new = nil;
int i = 1;
[combined addObjectsFromArray: extra];
while ([combined containsObject: search])
{
new = [new stringByAppendingFormat: @"%d", i++];
new = [newAction stringByAppendingFormat: @"%d", i++];
search = [new stringByAppendingString: @":"];
}
@ -113,13 +115,14 @@
NSArray *array = [classInfo objectForKey: @"Outlets"];
NSArray *extra = [classInfo objectForKey: @"ExtraOutlets"];
NSMutableArray *combined = [NSMutableArray arrayWithArray: array];
NSString *new = @"newOutlet";
NSString *newOutlet = @"newOutlet";
NSString *new = newOutlet;
int i = 1;
[combined addObjectsFromArray: extra];
while ([combined containsObject: new])
{
new = [new stringByAppendingFormat: @"%d", i++];
new = [newOutlet stringByAppendingFormat: @"%d", i++];
}
[self addOutlet: new forClassNamed: name];