mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-02-21 02:20:55 +00:00
* 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:
parent
7fe1dba6fd
commit
c7840e1ec0
7 changed files with 39 additions and 16 deletions
15
ChangeLog
15
ChangeLog
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -187,6 +187,8 @@ static NSMatrix *_iconBar;
|
|||
}
|
||||
else
|
||||
{
|
||||
[[lastInspector view] removeFromSuperview];
|
||||
lastInspector = nil;
|
||||
NSLog(@"no selection");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue