Prevent renaming of widgets which can't be renamed. This was causing a crash.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@18271 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2003-12-25 05:50:05 +00:00
parent a86a6c4eb4
commit 334b41f7e1
2 changed files with 30 additions and 17 deletions

View file

@ -1,3 +1,9 @@
2003-12-25 00:55 Gregory John Casamento <greg_casamento@yahoo.com>
* Gorm.m: -validateMenuItem: added code to grey out
the "set name" menu item, if the object selected cannot
be renamed.
2003-12-24 23:17 Gregory John Casamento <greg_casamento@yahoo.com>
* Gorm.m: Added a NS_DURING block around the main portions of the
@ -9,22 +15,25 @@
* Gorm.m: Update the minor release number. Add call to
method which checks if an object is a "top level object"
before allowing the user to rename it.
* GormClassInspector.m: There was a bug which was preventing users
from removing outlets/actions. Also added a call to the method which
removes connections when an outlet or action is deleted from the document.
* GormClassManager.m: Added code to correct problem removing actions/outlets.
The outlets were not being properly deleted from the dictionary.
* GormCustomClassInspector.m: The special case for NSSecureTextField, which
allows it to replace NSTextField, was not properly replacing the cell with
a secure one for archiving. A new method called _replaceCellClassForObject:
className: was added to allow the cell to be replace as appropriate for the
assigned class.
* GormDocument.[hm]: Added code to properly notify the class inspector when
something is deleted from the class it's editing. Added implementation
for isTopLevelObject.
* GormSetNameController.m: Removed RELEASE for outlets. RELEASE
and deallocation of the toplevel panel object should release the outlets
pointed to by the gorm file.
* GormClassInspector.m: There was a bug which was preventing
users from removing outlets/actions. Also added a call to
the method which removes connections when an outlet or action
is deleted from the document.
* GormClassManager.m: Added code to correct problem removing
actions/outlets. The outlets were not being properly deleted
from the dictionary.
* GormCustomClassInspector.m: The special case for
NSSecureTextField, which allows it to replace NSTextField,
was not properly replacing the cell with a secure one for
archiving. A new method called _replaceCellClassForObject:
className: was added to allow the cell to be replace as
appropriate for the assigned class.
* GormDocument.[hm]: Added code to properly notify the class
inspector when something is deleted from the class it's editing.
Added implementation for isTopLevelObject.
* GormSetNameController.m: Removed RELEASE for outlets.
RELEASE and deallocation of the toplevel panel object
should release the outlets pointed to by the gorm file.
* Testing/GormTest.gorm: Added.
* Testing/GormTest.m: Modified to use the .gorm file.

6
Gorm.m
View file

@ -1291,7 +1291,11 @@ NSString *GormWillDetachObjectFromDocumentNotification = @"GormWillDetachObjectF
n = [active nameForObject: o];
if ([n isEqual: @"NSOwner"] || [n isEqual: @"NSFirst"]
|| [n isEqual: @"NSFont"])
|| [n isEqual: @"NSFont"] || [n isEqual: @"NSMenu"])
{
return NO;
}
else if(![(GormDocument *)[self activeDocument] isTopLevelObject: o])
{
return NO;
}