Correction for report #7938 and minor cleanup.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@18720 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2004-02-29 16:52:30 +00:00
parent 562eee3f9c
commit 9ca5ae8069
3 changed files with 25 additions and 6 deletions

View file

@ -1,3 +1,11 @@
2004-02-29 11:56 Gregory John Casamento <greg_casamento@yahoo.com>
* GormCustomClassInspector.m: -[GormCustomClassInspector setObject:]
corrected Report #7938. Inspector now properly selects the subclass
of the object when the .gorm is initially loaded.
* GormInspectorsManager.m: Removed some uneeded calls to
"establishConnection".
2004-02-23 23:56 Gregory John Casamento <greg_casamento@yahoo.com> 2004-02-23 23:56 Gregory John Casamento <greg_casamento@yahoo.com>
* ClassInformation.plist: reformatted and added/removed some * ClassInformation.plist: reformatted and added/removed some

View file

@ -66,9 +66,10 @@
- (void) _setCurrentSelectionClassName: (id)anobject - (void) _setCurrentSelectionClassName: (id)anobject
{ {
NSString *className; NSString *className;
NSMutableArray *classes = nil;
className = [_classManager customClassForObject: anobject]; // nameForObject]; className = [_classManager customClassForObject: anobject];
if ([className isEqualToString: @""] if ([className isEqualToString: @""]
|| className == nil) || className == nil)
{ {
@ -79,6 +80,14 @@
[GormClassManager correctClassName: className]); [GormClassManager correctClassName: className]);
ASSIGN(_parentClassName, ASSIGN(_parentClassName,
[GormClassManager correctClassName: NSStringFromClass([anobject class])]); [GormClassManager correctClassName: NSStringFromClass([anobject class])]);
// get a list of all of the classes allowed and the class to be shown.
classes = [NSMutableArray arrayWithObject: _parentClassName];
[classes addObjectsFromArray: [_classManager allCustomSubclassesOf: _parentClassName]];
// select the appropriate row in the inspector...
_rowToSelect = [classes indexOfObject: className];
_rowToSelect = (_rowToSelect != NSNotFound)?_rowToSelect:0;
} }
- (void) setObject: (id)anObject - (void) setObject: (id)anObject
@ -87,14 +96,15 @@
_document = [(Gorm *)NSApp activeDocument]; _document = [(Gorm *)NSApp activeDocument];
_classManager = [(Gorm *)NSApp classManager]; _classManager = [(Gorm *)NSApp classManager];
_currentSelection = anObject; _currentSelection = anObject;
[browser loadColumnZero];
NSDebugLog(@"Current selection %@", _currentSelection); NSDebugLog(@"Current selection %@", _currentSelection);
[self _setCurrentSelectionClassName: _currentSelection]; [self _setCurrentSelectionClassName: _currentSelection];
[browser reloadColumn: 0];
// select the class... // select the class...
[browser selectRow: _rowToSelect inColumn: 0]; [browser selectRow: _rowToSelect inColumn: 0];
[browser setNeedsDisplay: YES]; [browser setNeedsDisplay: YES];
} }
@ -102,6 +112,7 @@
{ {
[browser setTarget: self]; [browser setTarget: self];
[browser setAction: @selector(select:)]; [browser setAction: @selector(select:)];
[browser reloadColumn: 0];
} }
- (void) _replaceCellClassForObject: (id)obj - (void) _replaceCellClassForObject: (id)obj

View file

@ -1071,7 +1071,7 @@ selectCellWithString: (NSString*)title
[localException reason]]; [localException reason]];
// get rid of the bad connector and recover. // get rid of the bad connector and recover.
[currentConnector setDestination: nil]; [currentConnector setDestination: nil];
[currentConnector establishConnection]; // [currentConnector establishConnection];
[[(id<IB>)NSApp activeDocument] removeConnector: currentConnector]; [[(id<IB>)NSApp activeDocument] removeConnector: currentConnector];
NSRunAlertPanel(_(@"Problem making connection"), msg, NSRunAlertPanel(_(@"Problem making connection"), msg,
_(@"OK"),nil,nil,nil); _(@"OK"),nil,nil,nil);
@ -1132,7 +1132,7 @@ selectCellWithString: (NSString*)title
[localException reason]]; [localException reason]];
// get rid of the bad connector and recover. // get rid of the bad connector and recover.
[currentConnector setDestination: nil]; [currentConnector setDestination: nil];
[currentConnector establishConnection]; // [currentConnector establishConnection];
[[(id<IB>)NSApp activeDocument] removeConnector: currentConnector]; [[(id<IB>)NSApp activeDocument] removeConnector: currentConnector];
NSRunAlertPanel(_(@"Problem making connection"), msg, NSRunAlertPanel(_(@"Problem making connection"), msg,
_(@"OK"),nil,nil,nil); _(@"OK"),nil,nil,nil);