Improved automatic name generation in the name table.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@23035 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2006-06-06 01:25:51 +00:00
parent 8cf554d371
commit 5fa3ae3247
3 changed files with 22 additions and 3 deletions

View file

@ -1,3 +1,13 @@
2006-06-05 21:20 Gregory John Casamento <greg_casamento@yahoo.com>
* GormCore/GormDocumentController.m: touches the initial document
so that the user cannot simply quit after. Also sets the initial
fileType.
* GormCore/GormDocument.m: Compose the names used in Gorm name table
using the base class name (without NS or GS) and a number in
parenthesis starting with 0. A new panel or window might look like
Window(0) or Panel(1).
2006-06-05 01:46 Gregory John Casamento <greg_casamento@yahoo.com>
* GormCore/GormClassManager.h: Added classes.nib loading and

View file

@ -2417,14 +2417,21 @@ static NSImage *fileImage = nil;
{
base = NSStringFromClass([object class]);
}
// pare down the name, if we're generating it.
if ([base hasPrefix: @"Gorm"])
{
base = [base substringFromIndex: 4];
}
if ([base hasPrefix: @"NS"] || [base hasPrefix: @"GS"])
{
base = [base substringFromIndex: 2];
}
aName = base;
aName = [base stringByAppendingFormat: @"(%u)", i];
while ([[container nameTable] objectForKey: aName] != nil)
{
aName = [base stringByAppendingFormat: @"%u", ++i];
aName = [base stringByAppendingFormat: @"(%u)", ++i];
}
}
else

View file

@ -186,7 +186,9 @@
}
}
// [doc touch];
// set the filetype and touch the document.
[doc setFileType: @"GSGormFileType"];
[doc touch];
}
@end