mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-04-23 13:10:48 +00:00
* EOInterface/EOGenericControlAssociation.m (-endEditing):
Fix copy/paste error. * GDL2Palette/Palette.[hm]: Load bundles from GDL2PaletteBundles key. * GDL2Palette/ConnectInspector.m: Replace static map table with walking the list of connectors. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@23579 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b6725c1ce5
commit
a41849407a
5 changed files with 35 additions and 12 deletions
|
@ -1,3 +1,11 @@
|
|||
2006-09-20 Matt Rice <ratmice@yahoo.com>
|
||||
|
||||
* EOInterface/EOGenericControlAssociation.m (-endEditing):
|
||||
Fix copy/paste error.
|
||||
* GDL2Palette/Palette.[hm]: Load bundles from GDL2PaletteBundles key.
|
||||
* GDL2Palette/ConnectInspector.m: Replace static map table with
|
||||
walking the list of connectors.
|
||||
|
||||
2006-09-19 Matt Rice <ratmice@yahoo.com>
|
||||
|
||||
* GDL2Palette/KeyWrapper.h: Add LocalType.
|
||||
|
|
|
@ -189,7 +189,7 @@ textShouldBeginEditing: (NSText *)fieldEditor
|
|||
EODisplayGroup *dg2 = [self displayGroupForAspect:@"enabled"];
|
||||
if (dg2 != dg || flag == NO)
|
||||
{
|
||||
flag = [dg endEditing];
|
||||
flag = [dg2 endEditing];
|
||||
if (flag == YES)
|
||||
{
|
||||
[dg2 associationDidBeginEditing:self];
|
||||
|
|
|
@ -35,18 +35,12 @@
|
|||
/* TODO get notifications for IB{Will,Did}RemoveConnectorNotification
|
||||
* and remove the object from the _objectToAssociation map table if
|
||||
* there are no more connectors for it */
|
||||
static NSMapTable *_objectToAssociation;
|
||||
|
||||
@interface NSApplication(missingStuff)
|
||||
- (GormClassManager *)classManager;
|
||||
@end
|
||||
|
||||
@implementation GDL2ConnectionInspector
|
||||
+ (void) initialize
|
||||
{
|
||||
_objectToAssociation = NSCreateMapTableWithZone(NSObjectMapKeyCallBacks,
|
||||
NSObjectMapValueCallBacks,
|
||||
0, [self zone]);
|
||||
}
|
||||
|
||||
- (NSButton *)okButton
|
||||
{
|
||||
|
@ -413,10 +407,23 @@ static NSMapTable *_objectToAssociation;
|
|||
|
||||
if (!found)
|
||||
{
|
||||
ASSIGN(_association,NSMapGet(_objectToAssociation, object));
|
||||
NSArray *aConns = [[(id<IB>)NSApp activeDocument] connectorsForSource:object ofClass:[EOAspectConnector class]];
|
||||
Class assocClass = [[popUp selectedItem] representedObject];
|
||||
|
||||
_association = nil;
|
||||
|
||||
for (i = 0; i < c; i++)
|
||||
{
|
||||
EOAspectConnector *aConn = [aConns objectAtIndex:i];
|
||||
EOAssociation *assoc = [aConn association];
|
||||
if ([[assoc class] isEqual: assocClass])
|
||||
{
|
||||
ASSIGN(_association, assoc);
|
||||
}
|
||||
}
|
||||
|
||||
if (!_association)
|
||||
{
|
||||
Class assocClass = [[popUp selectedItem] representedObject];
|
||||
_association = [[assocClass alloc] initWithObject:object];
|
||||
/* this shouldn't happen until ok:. */
|
||||
}
|
||||
|
@ -770,7 +777,6 @@ willDisplayCell:(id)cell atRow:(int)row column:(int)column
|
|||
else if ([_currentConnector isKindOfClass:[EOAspectConnector class]])
|
||||
{
|
||||
[_connectors addObject:_currentConnector];
|
||||
NSMapInsert(_objectToAssociation, object, _association);
|
||||
[[(id<IB>)NSApp activeDocument]
|
||||
attachObject:_association toParent:object];
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include <InterfaceBuilder/IBPalette.h>
|
||||
static NSConstantString *GDL2PaletteBundles;
|
||||
|
||||
@interface GDL2Palette : IBPalette
|
||||
{
|
||||
|
|
|
@ -1,13 +1,21 @@
|
|||
#include "Palette.h"
|
||||
#include "ResourceManager.h"
|
||||
#include <Foundation/NSUserDefaults.h>
|
||||
#include <Foundation/NSBundle.h>
|
||||
|
||||
|
||||
static NSConstantString *GDL2PaletteBundles = @"GDL2PaletteBundles";
|
||||
@implementation GDL2Palette
|
||||
|
||||
+(void) initialize
|
||||
{
|
||||
// NSLog(@"GDL2Palette initialize");
|
||||
NSArray *bundles;
|
||||
int i, c;
|
||||
|
||||
[IBResourceManager registerResourceManagerClass:[GDL2ResourceManager class]];
|
||||
bundles = [[NSUserDefaults standardUserDefaults] arrayForKey:GDL2PaletteBundles];
|
||||
for (i = 0, c = [bundles count]; i < c; i++)
|
||||
[[NSBundle bundleWithPath:[bundles objectAtIndex:i]] load];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue