Possible correction for #14004. Also, improvement in the table view inspector.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@21628 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2005-08-10 06:28:55 +00:00
parent 63115670b7
commit 8647cb211f
7 changed files with 78 additions and 9 deletions

View file

@ -1,3 +1,13 @@
2005-08-10 02:36 Gregory John Casamento <greg_casamento@yahoo.com>
* GormCore/GormDocument.[hm]: Added retrieveObjectForParent:recursive:
which retrieves all of the children of a given parent. Also modified
detachObject: to use this method.
* GormCore/GormFilePrefsManager.m: Bumped version to 0.13.1
* GormInfo.plist: Bumped version to 0.13.1
* Palettes/3Containers/GormNSTableViewInspector.gorm: Corrected minor
spacing issue.
2005-08-07 21:15 Gregory John Casamento <greg_casamento@yahoo.com>
* GNUmakefile: Added new GormObjectInspector.gorm file.

View file

@ -128,6 +128,12 @@
*/
- (id) openDocument: (id)sender;
/**
* Retrieve all objects which have parent as thier parent. If flag is YES,
* then retrieve the entire graph of objects starting with the parent.
*/
- (NSArray *) retrieveObjectsForParent: (id)parent recursively: (BOOL)flag;
/**
* To revert to a saved version, we actually load a new document and
* close the original document, returning the id of the new document.

View file

@ -471,6 +471,8 @@ static NSImage *fileImage = nil;
[selectionBox setContentView: scrollView];
}
/**
* Attach anObject to the document with aParent.
*/
@ -610,17 +612,17 @@ static NSImage *fileImage = nil;
id tv = [anObject documentView];
tc = [tv tableColumns];
count = [tc count];
[self attachObject: tv toParent: aParent];
[self attachObject: tv toParent: anObject];
for (i = 0; i < count; i++)
{
[self attachObject: [tc objectAtIndex: i]
toParent: aParent];
toParent: tv];
}
}
else if ([[anObject documentView] isKindOfClass: [NSTextView class]] == YES)
{
[self attachObject: [anObject documentView] toParent: aParent];
[self attachObject: [anObject documentView] toParent: anObject];
}
}
@ -1097,15 +1099,57 @@ static NSImage *fileImage = nil;
[super dealloc];
}
/**
* Pull all objects which are under the given parent, into array.
*/
- (void) _retrieveObjectsForParent: (id)parent
intoArray: (NSMutableArray *)array
recursively: (BOOL)flag
{
NSArray *cons = [self connectorsForDestination: parent
ofClass: [NSNibConnector class]];
NSEnumerator *en = [cons objectEnumerator];
id con = nil;
while((con = [en nextObject]) != nil)
{
id obj = [con source];
[array addObject: obj];
if(flag)
{
[self _retrieveObjectsForParent: obj intoArray: array recursively: flag];
}
}
}
/**
* Pull all of the objects which are under a given parent. Returns an
* autoreleased array.
*/
- (NSArray *) retrieveObjectsForParent: (id)parent recursively: (BOOL)flag
{
NSMutableArray *result = [NSMutableArray array];
[self _retrieveObjectsForParent: parent intoArray: result recursively: flag];
return result;
}
/**
* Deteach anObject from the document.
*/
- (void) detachObject: (id)anObject
{
NSString *name = RETAIN([self nameForObject: anObject]); // released at end of method...
NSString *name = RETAIN([self nameForObject: anObject]); // released at end of method...
GormClassManager *cm = [self classManager];
unsigned count;
unsigned count;
NSArray *objs = [self retrieveObjectsForParent: anObject recursively: NO];
id obj = nil;
NSEnumerator *en = [objs objectEnumerator];
if([self containsObject: anObject] == NO)
{
return;
}
[[self editorForObject: anObject create: NO] close];
count = [connections count];
@ -1182,6 +1226,15 @@ static NSImage *fileImage = nil;
NSMapRemove(objToName, (void*)anObject);
RELEASE(name);
}
// iterate over the list and remove any subordinate objects.
if(en != nil)
{
while((obj = [en nextObject]) != nil)
{
[self detachObject: obj];
}
}
}
/**

View file

@ -83,7 +83,7 @@ NSString *formatVersion(int version)
+ (int) currentVersion
{
return appVersion(0,13,0);
return appVersion(0,13,1);
}
- (void) awakeFromNib

View file

@ -14,9 +14,9 @@
ApplicationDescription = "[GNUstep | Graphical] Object Relationship Modeller";
ApplicationIcon = "Gorm.tiff";
ApplicationName = "Gorm";
ApplicationRelease = "Gorm 0.13.0 (Alpha)";
ApplicationRelease = "Gorm 0.13.1 (Alpha)";
Authors = ("Gregory John Casamento <greg_casamento@yahoo.com>","Richard Frith-Macdonald <rfm@gnu.org>","Pierre-Yves Rivaille <pyrivail@ens-lyon.fr>");
Copyright = "Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 FSF";
CopyrightDescription = "Released under the GNU General Public License 2.0";
NSBuildVersion = "0.13.0 Aug 07 2005";
NSBuildVersion = "0.13.1 Aug 07 2005";
}