Some fixes including one for bug #10026.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@19878 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2004-08-18 04:19:45 +00:00
parent e3f19322e9
commit 41ac255873
4 changed files with 62 additions and 24 deletions

View file

@ -1,3 +1,14 @@
2004-08-18 00:20 Gregory John Casamento <greg_casamento@yahoo.com>
* GormClassEditor.m: Cleaned up some code.
* GormClassInspector.m: Added code in the data source for
both the GormActionDataSource and GormOutletDataSource
classes in the class inspector to call the method in
GormDocument which removes connections when a connections'
name changes. Corrects Bug #100026.
* GormMenuEditor.m: If a menu item being added to a popup
has a submenu, reject it.
2004-08-13 18:30 Gregory John Casamento <greg_casamento@yahoo.com>
* Gorm.m: Disabled class parser menu item in [Gorm

View file

@ -269,7 +269,6 @@ objectValueForTableColumn: (NSTableColumn *)aTableColumn
{
int row = 0;
// RETAIN(item); // retain the new name
[classManager renameClassNamed: item newName: anObject];
[gov reloadData];
row = [gov rowForItem: anObject];

View file

@ -104,21 +104,32 @@ objectValueForTableColumn: (NSTableColumn *)tc
forTableColumn: (NSTableColumn *)tc
row: (int)rowIndex
{
NSArray *list = [[(Gorm *)NSApp classManager] allOutletsForClassNamed: [inspector _currentClass]];
id classManager = [(Gorm *)NSApp classManager];
NSString *currentClass = [inspector _currentClass];
NSArray *list = [classManager allOutletsForClassNamed: currentClass];
NSString *name = [list objectAtIndex: rowIndex];
NSString *formattedOutlet = [GormDocument formatOutlet: anObject];
id classManager = [(Gorm *)NSApp classManager];
GormDocument *document = (GormDocument *)[(id <IB>)NSApp activeDocument];
[classManager replaceOutlet: name
withOutlet: formattedOutlet
forClassNamed: [inspector _currentClass]];
// collapse the class in question if it's being edited and make
// certain that names in the list are kept in sync.
[document collapseClass: [inspector _currentClass]];
[document reloadClasses];
[document selectClass: [inspector _currentClass]];
if(![name isEqual: anObject])
{
BOOL removed = [document
removeConnectionsWithLabel: name
forClassNamed: currentClass
isAction: NO];
if(removed)
{
[classManager replaceOutlet: name
withOutlet: formattedOutlet
forClassNamed: currentClass];
// collapse the class in question if it's being edited and make
// certain that names in the list are kept in sync.
[document collapseClass: currentClass];
[document reloadClasses];
[document selectClass: currentClass];
}
}
}
// set methods
@ -148,21 +159,32 @@ objectValueForTableColumn: (NSTableColumn *)tc
forTableColumn: (NSTableColumn *)tc
row: (int)rowIndex
{
NSArray *list = [[(Gorm *)NSApp classManager] allActionsForClassNamed: [inspector _currentClass]];
id classManager = [(Gorm *)NSApp classManager];
NSString *currentClass = [inspector _currentClass];
NSArray *list = [classManager allOutletsForClassNamed: currentClass];
NSString *name = [list objectAtIndex: rowIndex];
NSString *formattedAction = [GormDocument formatAction: anObject];
id classManager = [(Gorm *)NSApp classManager];
GormDocument *document = (GormDocument *)[(id <IB>)NSApp activeDocument];
[classManager replaceAction: name
withAction: formattedAction
forClassNamed: [inspector _currentClass]];
// collapse the class in question if it's being edited and make
// certain that names in the list are kept in sync.
[document collapseClass: [inspector _currentClass]];
[document reloadClasses];
[document selectClass: [inspector _currentClass]];
if(![name isEqual: anObject])
{
BOOL removed = [document
removeConnectionsWithLabel: name
forClassNamed: currentClass
isAction: YES];
if(removed)
{
[classManager replaceAction: name
withAction: formattedAction
forClassNamed: currentClass];
// collapse the class in question if it's being edited and make
// certain that names in the list are kept in sync.
[document collapseClass: currentClass];
[document reloadClasses];
[document selectClass: currentClass];
}
}
}
// set method

View file

@ -853,6 +853,12 @@ void _attachAll(NSMenu *menu, id document)
NSDebugLog(@"owned by popup");
[item setOnStateImage: nil];
[item setMixedStateImage: nil];
// if the item has a submenu, reject the drag.
if([item hasSubmenu])
{
return NO;
}
}
else
NSDebugLog(@"not owned by popup");