mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-23 19:51:00 +00:00
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:
parent
dac82139d4
commit
2085f591e6
2 changed files with 14 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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];
|
||||
|
|
Loading…
Reference in a new issue