* EOModeler/EOModelerDocument.m (-windowWillClose:): If document

owns the current editor, reset the seletion path, and unset the
        current editor.
        * EOModeler/EOModelerInspectorController.m (-selectionChanged:):
        handle an empty selection path.
        * EOModeler/EOModelerApp.m: Remove usage of
        EOModel -setCreatesMutableObjects:.
        * EOModeler/EOModelerEditor.m
        (EOModelerCompoundEditor -setSelectionPath:): Fix if statement which
        always returned yes.
        * DBModeler/MainModelEditor.m: Add more information to comment.
        * EOModeler/EOModelerApp.h: Whitespace changes.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@23868 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Matt Rice 2006-10-14 00:51:32 +00:00
parent 7fe1dba6fd
commit c7840e1ec0
7 changed files with 39 additions and 16 deletions

View file

@ -1,3 +1,18 @@
2006-10-13 Matt Rice <ratmice@yahoo.com>
* EOModeler/EOModelerDocument.m (-windowWillClose:): If document
owns the current editor, reset the seletion path, and unset the
current editor.
* EOModeler/EOModelerInspectorController.m (-selectionChanged:):
handle an empty selection path.
* EOModeler/EOModelerApp.m: Remove usage of
EOModel -setCreatesMutableObjects:.
* EOModeler/EOModelerEditor.m
(EOModelerCompoundEditor -setSelectionPath:): Fix if statement which
always returned yes.
* DBModeler/MainModelEditor.m: Add more information to comment.
* EOModeler/EOModelerApp.h: Whitespace changes.
2006-10-13 David Ayers <ayers@fsfe.org>
* EOAccess/EOAdaptor.m (databaseEncoding): Reimplement to not

View file

@ -123,13 +123,15 @@
[[_window contentView] addSubview:_vSplit];
RELEASE(_vSplit);
/* so addEntity: addAttribute: ... menu items work */
/* so addEntity: addAttribute: ... menu items work,
* and it gets close notifications */
[_window setDelegate: document];
[[NSNotificationCenter defaultCenter] addObserver: self
selector:@selector(ecStuff:)
name: EOObjectsChangedInEditingContextNotification
object: [[self document] editingContext]];
[self setViewedObjectPath:[NSArray arrayWithObject:[document model]]];
}
return self;

View file

@ -187,6 +187,8 @@ static NSMatrix *_iconBar;
}
else
{
[[lastInspector view] removeFromSuperview];
lastInspector = nil;
NSLog(@"no selection");
}
}

View file

@ -36,9 +36,11 @@
@class NSMutableDictionary;
@class EODisplayGroup;
@class NSTableColumn;
GDL2MODELER_EXPORT NSString *EOMSelectionChangedNotification;
GDL2MODELER_EXPORT EOModelerApp *EOMApp;
GDL2MODELER_EXPORT NSString *EOMPropertyPboardType;
@protocol EOMColumnProvider
- (void) initColumn:(NSTableColumn *)tableColumn
class:(Class)objectClass

View file

@ -31,6 +31,7 @@
#include <EOAccess/EOModel.h>
#include <EOAccess/EOModelGroup.h>
#include <Foundation/NSArray.h>
EOModelerApp *EOMApp;
NSString *EOMSelectionChangedNotification = @"EOModelerSelectionChanged";
@ -38,10 +39,6 @@ NSString *EOMPropertyPboardType = @"EOModelProperty";
static EOModelerDocument *_activeDocument;
@interface EOModel (Private)
- (void) setCreateMutableObjects:(BOOL)flag;
@end
@implementation EOModelerApp : NSApplication
- (id) init
@ -97,7 +94,6 @@ static EOModelerDocument *_activeDocument;
- (EOModelerDocument *)loadDocumentAtPath:(NSString *)path
{
EOModel *loadedModel = [[EOModel alloc] initWithContentsOfFile:path];
[loadedModel setCreateMutableObjects:YES];
[[EOModelGroup defaultGroup] addModel:loadedModel];
EOModelerDocument *loadedDocument = [[EOModelerDocument alloc] initWithModel: loadedModel];
[self addDocument: loadedDocument];
@ -163,7 +159,6 @@ static EOModelerDocument *_activeDocument;
+ (EOModel *)modelWithPath:(NSString *)path
{
id _eom = [[EOModel alloc] initWithContentsOfFile:path];
[_eom setCreateMutableObjects:YES];
[[EOModelGroup defaultGroup] addModel: _eom];
return _eom;
}

View file

@ -665,6 +665,14 @@ NSString *EOMConsistencyModelObjectKey = @"EOMConsistencyModelObjectKey";
- (void) windowWillClose:(NSNotification *)notif
{
if ([_editors containsObject:[EOMApp currentEditor]])
{
// Clear inspected object.
[[EOMApp currentEditor] setSelectionPath:[NSArray array]];
// No longer current editor
[EOMApp setCurrentEditor:nil];
}
[EOMApp removeDocument:self];
}

View file

@ -250,8 +250,13 @@
}
*/
if (indexOfLast != NSNotFound || indexOfLast != 1)
if (indexOfLast == NSNotFound)
{
ASSIGN(_viewedObjectPath, [NSArray array]);
ASSIGN(_selectionWithinViewedObject, [NSArray array]);
}
else
{
allButLastElement.location = 0;
allButLastElement.length = indexOfLast;
@ -259,12 +264,6 @@
ASSIGN(_viewedObjectPath, [newSelection subarrayWithRange:allButLastElement]);
ASSIGN(_selectionWithinViewedObject, [newSelection lastObject]);
}
else
{
[[NSException exceptionWithName:@"foo" reason:@"bar" userInfo:nil] raise];
ASSIGN(_viewedObjectPath, [NSArray array]);
ASSIGN(_selectionWithinViewedObject, [NSArray array]);
}
[self selectionDidChange];
}