* DBModeler/SQLGenerator.m (-executeSQL:): Fix memory leak,

Remove a hack, add a FIXME.
        * EOInterface/EODisplayGroup.m (-initWithCoder:): Move fetching 
	on load to -awakeFromNib
        * GDL2Palette/DisplayGroupInspector.[hm]
        * GDL2Palette/GDL2DisplayGroupInspector.gorm: New files.
        * GDL2Palette/IB+Categories.m: Add display group Inspector.



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@23552 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
ratmice 2006-09-18 23:39:37 +00:00
parent 37e786a3cb
commit 546fad51de
10 changed files with 118 additions and 26 deletions

View file

@ -1,3 +1,13 @@
2006-09-18 Matt Rice <ratmice@yahoo.com>
* DBModeler/SQLGenerator.m (-executeSQL:): Fix memory leak,
Remove a hack, add a FIXME.
* EOInterface/EODisplayGroup.m (-initWithCoder:): Move fetching on
load to -awakeFromNib
* GDL2Palette/DisplayGroupInspector.[hm]
* GDL2Palette/GDL2DisplayGroupInspector.gorm: New files.
* GDL2Palette/IB+Categories.m: Add display group Inspector.
2006-09-17 Matt Rice <ratmice@yahoo.com>
* DBModeler/SQLGenerator.m

View file

@ -128,7 +128,7 @@ static NSString *_otherScript;
EOAdaptorChannel *channel;
Class exprClass = [[[EOMApp activeDocument] adaptor] expressionClass];
EOSQLExpression *expr;
NSDictionary *connDict = RETAIN([adaptor connectionDictionary]);
NSDictionary *connDict = [adaptor connectionDictionary];
if ([[_sqlOutput string] length] == 0)
return;
@ -156,31 +156,16 @@ static NSString *_otherScript;
nil);
return;
}
if ([adaptor hasOpenChannels])
{
NSArray *contexts = [adaptor contexts];
int i,c;
for (i = 0, c = [contexts count]; i < c; i++)
{
EOAdaptorContext *ctxt = [contexts objectAtIndex:i];
if ([ctxt hasOpenChannels])
{
int j, d;
NSArray *channels = [ctxt channels];
for (j = 0, d = [channels count]; j < d; j++)
{
EOAdaptorChannel *channel = [channels objectAtIndex:j];
if ([channel isOpen])
[channel closeChannel];
}
}
}
}
RETAIN(connDict);
context = [adaptor createAdaptorContext];
channel = [context createAdaptorChannel];
/* FIXME
* this is a hack for PostgreSQL because it requires you to connect to an
* existing database to run 'CREATE DATABASE' statements, it should probably
* not be in DBModeler.
*/
if (_adminScript && [_adminScript length]
&& [[connDict objectForKey:@"adaptorName"] isEqual:@"PostgreSQLEOAdaptor"])
{

View file

@ -273,11 +273,15 @@ static BOOL _globalDefaultForValidatesChangesImmediately = NO;
_flags.selectsFirstObjectAfterFetch = tmpI;
[decoder decodeValueOfObjCType: @encode(int) at: &tmpI];
_flags.autoFetch = tmpI;
return self;
}
- (void) awakeFromNib
{
if (_flags.autoFetch)
{
[self fetch];
}
return self;
}
- (void)encodeWithCoder: (NSCoder *)encoder

View file

@ -0,0 +1,15 @@
#include <InterfaceBuilder/IBInspector.h>
#include <AppKit/NSNibDeclarations.h>
#include <AppKit/NSButton.h>
@interface GDL2DisplayGroupInspector : IBInspector
{
IBOutlet NSButton *_fetchesOnLoad;
IBOutlet NSButton *_refresh;
IBOutlet NSButton *_validate;
}
-(IBAction) setValidatesImmediately:(id)sender;
-(IBAction) setRefreshesAll:(id)sender;
-(IBAction) setFetchesOnLoad:(id)sender;
@end

View file

@ -0,0 +1,43 @@
#include "DisplayGroupInspector.h"
#include <EOInterface/EODisplayGroup.h>
#include <AppKit/NSNibLoading.h>
@implementation GDL2DisplayGroupInspector
- (id) init
{
self = [super init];
[NSBundle loadNibNamed:@"GDL2DisplayGroupInspector" owner:self];
return self;
}
-(IBAction) setValidatesImmediately:(id)sender;
{
[(EODisplayGroup *)[self object]
setValidatesChangesImmediately:[sender intValue]];
}
-(IBAction) setRefreshesAll:(id)sender;
{
[(EODisplayGroup *)[self object]
setUsesOptimisticRefresh:([sender intValue] ? NO : YES)];
}
-(IBAction) setFetchesOnLoad:(id)sender;
{
[(EODisplayGroup *)[self object]
setFetchesOnLoad:[sender intValue]];
}
- (void) revert:(id)sender
{
if (object == nil)
return;
[_fetchesOnLoad setIntValue:[object fetchesOnLoad]];
[_validate setIntValue:[object validatesChangesImmediately]];
[_refresh setIntValue:[object usesOptimisticRefresh] ? NO : YES];
}
@end

View file

@ -0,0 +1,24 @@
{
"## Comment" = "Do NOT change this file, Gorm maintains it";
FirstResponder = {
Actions = (
"setFetchesOnLoad:",
"setRefreshesAll:",
"setValidatesImmediately:"
);
Super = NSObject;
};
GDL2DisplayGroupInspector = {
Actions = (
"setValidatesImmediately:",
"setRefreshesAll:",
"setFetchesOnLoad:"
);
Outlets = (
_fetchesOnLoad,
_refresh,
_validate
);
Super = IBInspector;
};
}

Binary file not shown.

View file

@ -39,7 +39,12 @@ ADDITIONAL_INCLUDE_DIRS+=-I../
ADDITIONAL_NATIVE_LIB_DIRS+=../EOAccess/ ../EOControl/ ../EOInterface ../EOModeler
ADDITIONAL_NATIVE_LIBS+=EOAccess EOControl EOInterface EOModeler
GDL2_RESOURCE_FILES=GDL2Palette.tiff GDL2ConnectionInspector.gorm palette.table
GDL2_RESOURCE_FILES= \
GDL2Palette.tiff \
GDL2ConnectionInspector.gorm \
GDL2DisplayGroupInspector.gorm \
palette.table
GDL2_OBJC_FILES= \
Palette.m \
@ -47,7 +52,8 @@ GDL2_OBJC_FILES= \
ConnectionInspector.m \
IB+Categories.m \
Foundation+Categories.m \
KeyWrapper.m
KeyWrapper.m \
DisplayGroupInspector.m
include ../common.make
PALETTE_LIBS=$(ADDITIONAL_OBJC_LIBS)

View file

@ -10,6 +10,11 @@
{
return @"GDL2ConnectionInspector";
}
- (NSString *)inspectorClassName;
{
return @"GDL2DisplayGroupInspector";
}
@end
#include <AppKit/NSView.h>