mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-04-22 22:20:44 +00:00
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:
parent
8cf554d371
commit
5fa3ae3247
3 changed files with 22 additions and 3 deletions
10
ChangeLog
10
ChangeLog
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -186,7 +186,9 @@
|
|||
}
|
||||
}
|
||||
|
||||
// [doc touch];
|
||||
// set the filetype and touch the document.
|
||||
[doc setFileType: @"GSGormFileType"];
|
||||
[doc touch];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue