1999-12-08 15:04:57 +00:00
|
|
|
|
/* GormInspectorsManager.m
|
|
|
|
|
*
|
|
|
|
|
* Copyright (C) 1999 Free Software Foundation, Inc.
|
|
|
|
|
*
|
|
|
|
|
* Author: Richard Frith-Macdonald <richard@brainstrom.co.uk>
|
|
|
|
|
* Date: 1999
|
2001-05-08 09:43:11 +00:00
|
|
|
|
*
|
1999-12-08 15:04:57 +00:00
|
|
|
|
* This file is part of GNUstep.
|
2001-05-08 09:43:11 +00:00
|
|
|
|
*
|
1999-12-08 15:04:57 +00:00
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
2001-05-08 09:43:11 +00:00
|
|
|
|
*
|
1999-12-08 15:04:57 +00:00
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
2001-05-08 09:43:11 +00:00
|
|
|
|
*
|
1999-12-08 15:04:57 +00:00
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
2005-05-26 03:37:38 +00:00
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111 USA.
|
1999-12-08 15:04:57 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2003-05-23 02:25:34 +00:00
|
|
|
|
#include <AppKit/NSNibConnector.h>
|
2004-04-04 16:37:16 +00:00
|
|
|
|
#include <Foundation/NSException.h>
|
2004-11-18 05:34:19 +00:00
|
|
|
|
#include <InterfaceBuilder/IBInspector.h>
|
2005-07-02 20:16:10 +00:00
|
|
|
|
#include <InterfaceBuilder/IBInspectorMode.h>
|
2004-12-05 20:52:36 +00:00
|
|
|
|
#include <InterfaceBuilder/IBObjectAdditions.h>
|
2004-12-19 13:39:56 +00:00
|
|
|
|
#include <InterfaceBuilder/IBInspectorManager.h>
|
1999-12-08 15:04:57 +00:00
|
|
|
|
#include "GormPrivate.h"
|
2004-12-05 20:52:36 +00:00
|
|
|
|
#include "GormImage.h"
|
|
|
|
|
#include "GormSound.h"
|
1999-12-08 15:04:57 +00:00
|
|
|
|
|
2005-07-02 20:16:10 +00:00
|
|
|
|
|
|
|
|
|
#define NUM_DEFAULT_INSPECTORS 5
|
2001-12-04 22:26:00 +00:00
|
|
|
|
|
1999-12-08 15:19:11 +00:00
|
|
|
|
/*
|
|
|
|
|
* The GormEmptyInspector is a placeholder for an empty selection.
|
|
|
|
|
*/
|
|
|
|
|
@interface GormEmptyInspector : IBInspector
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
@implementation GormEmptyInspector
|
|
|
|
|
- (void) dealloc
|
|
|
|
|
{
|
|
|
|
|
[super dealloc];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (id) init
|
|
|
|
|
{
|
|
|
|
|
self = [super init];
|
|
|
|
|
if (self != nil)
|
|
|
|
|
{
|
|
|
|
|
NSView *contents;
|
|
|
|
|
NSButton *button;
|
|
|
|
|
|
2000-01-05 17:06:48 +00:00
|
|
|
|
window = [[NSWindow alloc] initWithContentRect: NSMakeRect(0, 0, IVW, IVH)
|
2001-05-08 09:43:11 +00:00
|
|
|
|
styleMask: NSBorderlessWindowMask
|
1999-12-08 15:19:11 +00:00
|
|
|
|
backing: NSBackingStoreRetained
|
|
|
|
|
defer: NO];
|
|
|
|
|
contents = [window contentView];
|
|
|
|
|
button = [[NSButton alloc] initWithFrame: [contents bounds]];
|
|
|
|
|
[button setAutoresizingMask:
|
|
|
|
|
NSViewHeightSizable | NSViewWidthSizable];
|
2003-05-24 12:40:54 +00:00
|
|
|
|
[button setStringValue: _(@"Empty Selection")];
|
1999-12-08 15:19:11 +00:00
|
|
|
|
[button setBordered: NO];
|
1999-12-17 12:10:42 +00:00
|
|
|
|
[button setEnabled: NO];
|
1999-12-08 15:19:11 +00:00
|
|
|
|
[contents addSubview: button];
|
|
|
|
|
RELEASE(button);
|
|
|
|
|
}
|
|
|
|
|
return self;
|
|
|
|
|
}
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* The GormMultipleInspector is a placeholder for a multiple selection.
|
|
|
|
|
*/
|
|
|
|
|
@interface GormMultipleInspector : IBInspector
|
1999-12-08 15:04:57 +00:00
|
|
|
|
@end
|
|
|
|
|
|
1999-12-08 15:19:11 +00:00
|
|
|
|
@implementation GormMultipleInspector
|
|
|
|
|
- (void) dealloc
|
|
|
|
|
{
|
|
|
|
|
[super dealloc];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (id) init
|
|
|
|
|
{
|
|
|
|
|
self = [super init];
|
|
|
|
|
if (self != nil)
|
|
|
|
|
{
|
|
|
|
|
NSView *contents;
|
|
|
|
|
NSButton *button;
|
|
|
|
|
|
2000-01-05 17:06:48 +00:00
|
|
|
|
window = [[NSWindow alloc] initWithContentRect: NSMakeRect(0, 0, IVW, IVH)
|
2001-05-08 09:43:11 +00:00
|
|
|
|
styleMask: NSBorderlessWindowMask
|
1999-12-08 15:19:11 +00:00
|
|
|
|
backing: NSBackingStoreRetained
|
|
|
|
|
defer: NO];
|
|
|
|
|
contents = [window contentView];
|
|
|
|
|
button = [[NSButton alloc] initWithFrame: [contents bounds]];
|
|
|
|
|
[button setAutoresizingMask:
|
|
|
|
|
NSViewHeightSizable | NSViewWidthSizable];
|
2003-05-24 12:40:54 +00:00
|
|
|
|
[button setStringValue: _(@"Multiple Selection")];
|
1999-12-08 15:19:11 +00:00
|
|
|
|
[button setBordered: NO];
|
1999-12-17 12:10:42 +00:00
|
|
|
|
[button setEnabled: NO];
|
1999-12-08 15:19:11 +00:00
|
|
|
|
[contents addSubview: button];
|
|
|
|
|
RELEASE(button);
|
|
|
|
|
}
|
|
|
|
|
return self;
|
|
|
|
|
}
|
|
|
|
|
@end
|
|
|
|
|
|
1999-12-21 16:48:32 +00:00
|
|
|
|
/*
|
|
|
|
|
* The GormNotApplicableInspector is a uitility for odd objects.
|
|
|
|
|
*/
|
|
|
|
|
@interface GormNotApplicableInspector : IBInspector
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
@implementation GormNotApplicableInspector
|
|
|
|
|
- (void) dealloc
|
|
|
|
|
{
|
|
|
|
|
[super dealloc];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (id) init
|
|
|
|
|
{
|
|
|
|
|
self = [super init];
|
|
|
|
|
if (self != nil)
|
|
|
|
|
{
|
|
|
|
|
NSView *contents;
|
|
|
|
|
NSButton *button;
|
|
|
|
|
|
2000-01-05 17:06:48 +00:00
|
|
|
|
window = [[NSWindow alloc] initWithContentRect: NSMakeRect(0, 0, IVW, IVH)
|
2001-05-08 09:43:11 +00:00
|
|
|
|
styleMask: NSBorderlessWindowMask
|
1999-12-21 16:48:32 +00:00
|
|
|
|
backing: NSBackingStoreRetained
|
|
|
|
|
defer: NO];
|
|
|
|
|
contents = [window contentView];
|
|
|
|
|
button = [[NSButton alloc] initWithFrame: [contents bounds]];
|
|
|
|
|
[button setAutoresizingMask:
|
|
|
|
|
NSViewHeightSizable | NSViewWidthSizable];
|
2003-05-24 12:40:54 +00:00
|
|
|
|
[button setStringValue: _(@"Not Applicable")];
|
1999-12-21 16:48:32 +00:00
|
|
|
|
[button setBordered: NO];
|
|
|
|
|
[button setEnabled: NO];
|
|
|
|
|
[contents addSubview: button];
|
|
|
|
|
RELEASE(button);
|
|
|
|
|
}
|
|
|
|
|
return self;
|
|
|
|
|
}
|
|
|
|
|
@end
|
|
|
|
|
|
2004-05-14 15:41:31 +00:00
|
|
|
|
|
1999-12-21 16:48:32 +00:00
|
|
|
|
|
1999-12-17 12:10:42 +00:00
|
|
|
|
@interface GormISelectionView : NSView
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
@implementation GormISelectionView : NSView
|
|
|
|
|
@end
|
|
|
|
|
|
1999-12-08 15:19:11 +00:00
|
|
|
|
|
|
|
|
|
|
1999-12-08 15:04:57 +00:00
|
|
|
|
@implementation GormInspectorsManager
|
|
|
|
|
|
|
|
|
|
- (void) dealloc
|
|
|
|
|
{
|
|
|
|
|
[[NSNotificationCenter defaultCenter] removeObserver: self];
|
1999-12-21 16:48:32 +00:00
|
|
|
|
RELEASE(oldInspector);
|
|
|
|
|
RELEASE(cache);
|
1999-12-08 15:04:57 +00:00
|
|
|
|
RELEASE(panel);
|
|
|
|
|
[super dealloc];
|
|
|
|
|
}
|
|
|
|
|
|
1999-12-15 15:29:27 +00:00
|
|
|
|
- (void) handleNotification: (NSNotification*)aNotification
|
|
|
|
|
{
|
|
|
|
|
NSString *name = [aNotification name];
|
|
|
|
|
|
|
|
|
|
if ([name isEqual: IBWillBeginTestingInterfaceNotification] == YES)
|
|
|
|
|
{
|
|
|
|
|
if ([panel isVisible] == YES)
|
|
|
|
|
{
|
|
|
|
|
hiddenDuringTest = YES;
|
|
|
|
|
[panel orderOut: self];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if ([name isEqual: IBWillEndTestingInterfaceNotification] == YES)
|
|
|
|
|
{
|
|
|
|
|
if (hiddenDuringTest == YES)
|
|
|
|
|
{
|
|
|
|
|
hiddenDuringTest = NO;
|
|
|
|
|
[panel orderFront: self];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1999-12-08 15:04:57 +00:00
|
|
|
|
- (id) init
|
|
|
|
|
{
|
2005-07-16 01:44:41 +00:00
|
|
|
|
NSDebugLog(@"====== init ======");
|
2004-12-19 14:05:10 +00:00
|
|
|
|
if((self = [super init]) != nil)
|
|
|
|
|
{
|
|
|
|
|
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
|
|
|
|
NSBox *bar;
|
|
|
|
|
NSMenuItem *item;
|
|
|
|
|
NSRect contentRect = {{0, 0}, {IVW, 420}};
|
|
|
|
|
NSRect popupRect = {{60, 5}, {152, 20}};
|
|
|
|
|
NSRect selectionRect = {{0, 390}, {IVW, 30}};
|
|
|
|
|
NSRect inspectorRect = {{0, 0}, {IVW, IVH}};
|
|
|
|
|
unsigned int style = NSTitledWindowMask | NSClosableWindowMask | NSResizableWindowMask;
|
|
|
|
|
|
2005-06-17 04:41:24 +00:00
|
|
|
|
cache = [[NSMutableDictionary alloc] init];
|
2004-12-19 14:05:10 +00:00
|
|
|
|
panel = [[NSPanel alloc] initWithContentRect: contentRect
|
|
|
|
|
styleMask: style
|
|
|
|
|
backing: NSBackingStoreRetained
|
|
|
|
|
defer: NO];
|
|
|
|
|
[panel setTitle: _(@"Inspector")];
|
|
|
|
|
[panel setMinSize: [panel frame].size];
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* The selection view sits at the top of the panel and is always the
|
|
|
|
|
* same height.
|
|
|
|
|
*/
|
|
|
|
|
selectionView = [[GormISelectionView alloc] initWithFrame: selectionRect];
|
|
|
|
|
[selectionView setAutoresizingMask:
|
|
|
|
|
NSViewMinYMargin | NSViewWidthSizable];
|
|
|
|
|
[[panel contentView] addSubview: selectionView];
|
|
|
|
|
RELEASE(selectionView);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* The selection view contains a popup menu identifying the type of
|
|
|
|
|
* inspector being used.
|
|
|
|
|
*/
|
|
|
|
|
popup = [[NSPopUpButton alloc] initWithFrame: popupRect pullsDown: NO];
|
|
|
|
|
[popup setAutoresizingMask: NSViewMinXMargin | NSViewMaxXMargin];
|
|
|
|
|
[selectionView addSubview: popup];
|
|
|
|
|
RELEASE(popup);
|
|
|
|
|
|
|
|
|
|
[popup addItemWithTitle: _(@"Attributes")];
|
|
|
|
|
item = (NSMenuItem *)[popup itemAtIndex: 0];
|
|
|
|
|
[item setTarget: self];
|
|
|
|
|
[item setAction: @selector(setCurrentInspector:)];
|
|
|
|
|
[item setKeyEquivalent: @"1"];
|
|
|
|
|
[item setTag: 0];
|
|
|
|
|
|
|
|
|
|
[popup addItemWithTitle: _(@"Connections")];
|
|
|
|
|
item = (NSMenuItem *)[popup itemAtIndex: 1];
|
|
|
|
|
[item setTarget: self];
|
|
|
|
|
[item setAction: @selector(setCurrentInspector:)];
|
|
|
|
|
[item setKeyEquivalent: @"2"];
|
|
|
|
|
[item setTag: 1];
|
|
|
|
|
|
|
|
|
|
[popup addItemWithTitle: _(@"Size")];
|
|
|
|
|
item = (NSMenuItem *)[popup itemAtIndex: 2];
|
|
|
|
|
[item setTarget: self];
|
|
|
|
|
[item setAction: @selector(setCurrentInspector:)];
|
|
|
|
|
[item setKeyEquivalent: @"3"];
|
|
|
|
|
[item setTag: 2];
|
|
|
|
|
|
|
|
|
|
[popup addItemWithTitle: _(@"Help")];
|
|
|
|
|
item = (NSMenuItem *)[popup itemAtIndex: 3];
|
|
|
|
|
[item setTarget: self];
|
|
|
|
|
[item setAction: @selector(setCurrentInspector:)];
|
|
|
|
|
[item setKeyEquivalent: @"4"];
|
|
|
|
|
[item setTag: 3];
|
|
|
|
|
|
|
|
|
|
[popup addItemWithTitle: _(@"Custom Class")];
|
|
|
|
|
item = (NSMenuItem *)[popup itemAtIndex: 4];
|
|
|
|
|
[item setTarget: self];
|
|
|
|
|
[item setAction: @selector(setCurrentInspector:)];
|
|
|
|
|
[item setKeyEquivalent: @"5"];
|
|
|
|
|
[item setTag: 4];
|
|
|
|
|
[item setEnabled: NO];
|
|
|
|
|
|
|
|
|
|
bar = [[NSBox alloc] initWithFrame: NSMakeRect (0, 0, IVW, 2)];
|
|
|
|
|
[bar setBorderType: NSGrooveBorder];
|
|
|
|
|
[bar setTitlePosition: NSNoTitle];
|
|
|
|
|
[bar setAutoresizingMask: NSViewWidthSizable|NSViewMinYMargin];
|
|
|
|
|
[selectionView addSubview: bar];
|
|
|
|
|
RELEASE(bar);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* The inspector view fills the area below the selection view.
|
|
|
|
|
*/
|
|
|
|
|
inspectorView = [[NSView alloc] initWithFrame: inspectorRect];
|
|
|
|
|
[inspectorView setAutoresizingMask:
|
|
|
|
|
NSViewHeightSizable | NSViewWidthSizable];
|
|
|
|
|
[[panel contentView] addSubview: inspectorView];
|
|
|
|
|
RELEASE(inspectorView);
|
|
|
|
|
|
|
|
|
|
[panel setFrameUsingName: @"Inspector"];
|
|
|
|
|
[panel setFrameAutosaveName: @"Inspector"];
|
|
|
|
|
|
|
|
|
|
current = -1;
|
|
|
|
|
|
2005-06-17 04:41:24 +00:00
|
|
|
|
inspector = [[GormEmptyInspector alloc] init];
|
2004-12-19 14:05:10 +00:00
|
|
|
|
[cache setObject: inspector forKey: @"GormEmptyInspector"];
|
|
|
|
|
RELEASE(inspector);
|
2005-06-17 04:41:24 +00:00
|
|
|
|
inspector = [[GormMultipleInspector alloc] init];
|
2004-12-19 14:05:10 +00:00
|
|
|
|
[cache setObject: inspector forKey: @"GormMultipleInspector"];
|
|
|
|
|
DESTROY(inspector);
|
|
|
|
|
|
|
|
|
|
[self setCurrentInspector: 0];
|
|
|
|
|
|
|
|
|
|
[nc addObserver: self
|
|
|
|
|
selector: @selector(handleNotification:)
|
|
|
|
|
name: IBWillBeginTestingInterfaceNotification
|
|
|
|
|
object: nil];
|
|
|
|
|
[nc addObserver: self
|
|
|
|
|
selector: @selector(handleNotification:)
|
|
|
|
|
name: IBWillEndTestingInterfaceNotification
|
|
|
|
|
object: nil];
|
|
|
|
|
}
|
2004-09-06 21:41:32 +00:00
|
|
|
|
|
1999-12-08 15:04:57 +00:00
|
|
|
|
return self;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (NSPanel*) panel
|
|
|
|
|
{
|
|
|
|
|
return panel;
|
|
|
|
|
}
|
|
|
|
|
|
1999-12-08 15:19:11 +00:00
|
|
|
|
- (void) updateSelection
|
1999-12-08 15:04:57 +00:00
|
|
|
|
{
|
1999-12-17 17:22:18 +00:00
|
|
|
|
if ([NSApp isConnecting] == YES)
|
|
|
|
|
{
|
|
|
|
|
[popup selectItemAtIndex: 1];
|
|
|
|
|
[popup setNeedsDisplay: YES];
|
|
|
|
|
[panel makeKeyAndOrderFront: self];
|
1999-12-20 14:20:06 +00:00
|
|
|
|
current = 1;
|
1999-12-17 17:22:18 +00:00
|
|
|
|
}
|
2001-12-04 22:26:00 +00:00
|
|
|
|
else if (current >= [popup numberOfItems])
|
1999-12-23 07:49:27 +00:00
|
|
|
|
{
|
|
|
|
|
current = 1;
|
|
|
|
|
}
|
|
|
|
|
[self setCurrentInspector: self];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void) setClassInspector
|
|
|
|
|
{
|
|
|
|
|
current = 4;
|
1999-12-18 06:40:48 +00:00
|
|
|
|
[self setCurrentInspector: self];
|
1999-12-08 15:04:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2003-05-25 19:08:36 +00:00
|
|
|
|
- (void) setEmptyInspector
|
|
|
|
|
{
|
|
|
|
|
NSString *newInspector = @"GormEmptyInspector";
|
|
|
|
|
NSView *newView = nil;
|
|
|
|
|
|
|
|
|
|
// current = 1;
|
|
|
|
|
[panel setTitle: @"Inspector"];
|
|
|
|
|
inspector = [cache objectForKey: newInspector];
|
|
|
|
|
if(inspector == nil)
|
|
|
|
|
{
|
|
|
|
|
Class c = NSClassFromString(newInspector);
|
2005-06-17 04:41:24 +00:00
|
|
|
|
inspector = [[c alloc] init];
|
2003-05-25 19:08:36 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
newView = [[inspector window] contentView];
|
|
|
|
|
if (newView != nil)
|
|
|
|
|
{
|
|
|
|
|
NSView *outer = [panel contentView];
|
|
|
|
|
NSRect rect = [outer bounds];
|
|
|
|
|
|
|
|
|
|
if (buttonView != nil)
|
|
|
|
|
{
|
|
|
|
|
[buttonView removeFromSuperview];
|
|
|
|
|
buttonView = nil;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rect.size.height = [selectionView frame].origin.y;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Make the inspector view the correct size for the viewable panel,
|
|
|
|
|
* and set the frame size for the new contents before adding them.
|
|
|
|
|
*/
|
|
|
|
|
[inspectorView setFrame: rect];
|
|
|
|
|
rect.origin = NSZeroPoint;
|
|
|
|
|
[newView setFrame: rect];
|
|
|
|
|
[inspectorView addSubview: newView];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2005-07-02 20:16:10 +00:00
|
|
|
|
- (void) _addDefaultModes
|
|
|
|
|
{
|
|
|
|
|
// remove all items... clear out current state
|
|
|
|
|
[modes removeAllObjects];
|
|
|
|
|
currentMode = nil;
|
|
|
|
|
|
|
|
|
|
// Attributes inspector...
|
|
|
|
|
[self addInspectorModeWithIdentifier: @"AttributesInspector"
|
|
|
|
|
forObject: selectedObject
|
|
|
|
|
localizedLabel: _(@"Attributes")
|
|
|
|
|
inspectorClassName: [selectedObject inspectorClassName]
|
|
|
|
|
ordering: 0.0];
|
|
|
|
|
|
|
|
|
|
// Connection inspector...
|
|
|
|
|
[self addInspectorModeWithIdentifier: @"ConnectionInspector"
|
|
|
|
|
forObject: selectedObject
|
|
|
|
|
localizedLabel: _(@"Connections")
|
|
|
|
|
inspectorClassName: [selectedObject connectInspectorClassName]
|
|
|
|
|
ordering: 1.0];
|
|
|
|
|
|
|
|
|
|
// Size inspector...
|
|
|
|
|
[self addInspectorModeWithIdentifier: @"SizeInspector"
|
|
|
|
|
forObject: selectedObject
|
|
|
|
|
localizedLabel: _(@"Size")
|
|
|
|
|
inspectorClassName: [selectedObject sizeInspectorClassName]
|
|
|
|
|
ordering: 2.0];
|
|
|
|
|
|
|
|
|
|
// Help inspector...
|
|
|
|
|
[self addInspectorModeWithIdentifier: @"HelpInspector"
|
|
|
|
|
forObject: selectedObject
|
|
|
|
|
localizedLabel: _(@"Help")
|
|
|
|
|
inspectorClassName: [selectedObject helpInspectorClassName]
|
|
|
|
|
ordering: 3.0];
|
|
|
|
|
|
|
|
|
|
// Custom class inspector...
|
|
|
|
|
[self addInspectorModeWithIdentifier: @"CustomClassInspector"
|
|
|
|
|
forObject: selectedObject
|
|
|
|
|
localizedLabel: _(@"Custom Class")
|
|
|
|
|
inspectorClassName: [selectedObject classInspectorClassName]
|
|
|
|
|
ordering: 4.0];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void) _refreshPopUp
|
|
|
|
|
{
|
|
|
|
|
NSEnumerator *en = [modes objectEnumerator];
|
|
|
|
|
int index = 0;
|
|
|
|
|
id obj = nil;
|
|
|
|
|
|
|
|
|
|
[popup removeAllItems];
|
|
|
|
|
while((obj = [en nextObject]) != nil)
|
|
|
|
|
{
|
|
|
|
|
int tag = index + 1;
|
|
|
|
|
NSMenuItem *item;
|
|
|
|
|
[popup addItemWithTitle: [obj localizedLabel]];
|
|
|
|
|
|
|
|
|
|
item = (NSMenuItem *)[popup itemAtIndex: index];
|
|
|
|
|
[item setTarget: self];
|
|
|
|
|
[item setAction: @selector(setCurrentInspector:)];
|
|
|
|
|
[item setKeyEquivalent: [NSString stringWithFormat: @"%d",tag]];
|
|
|
|
|
[item setTag: tag];
|
|
|
|
|
index++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1999-12-08 15:04:57 +00:00
|
|
|
|
- (void) setCurrentInspector: (id)anObj
|
|
|
|
|
{
|
2004-12-19 13:39:56 +00:00
|
|
|
|
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
|
1999-12-08 15:19:11 +00:00
|
|
|
|
NSArray *selection = [[(id<IB>)NSApp selectionOwner] selection];
|
|
|
|
|
unsigned count = [selection count];
|
|
|
|
|
id obj = [selection lastObject];
|
|
|
|
|
NSView *newView = nil;
|
1999-12-21 16:48:32 +00:00
|
|
|
|
NSString *newInspector = nil;
|
2005-07-02 20:16:10 +00:00
|
|
|
|
int tag = 0;
|
1999-12-08 15:04:57 +00:00
|
|
|
|
|
|
|
|
|
if (anObj != self)
|
|
|
|
|
{
|
2005-07-02 20:16:10 +00:00
|
|
|
|
tag = [anObj tag];
|
|
|
|
|
current = ((tag > 0)?(tag - 1):tag);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// reset current under certain conditions.
|
|
|
|
|
if(current < 0)
|
|
|
|
|
{
|
|
|
|
|
current = 0;
|
1999-12-08 15:04:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-07-15 04:51:27 +00:00
|
|
|
|
NSDebugLog(@"current %i",current);
|
2005-07-11 13:45:34 +00:00
|
|
|
|
|
2001-11-20 16:48:18 +00:00
|
|
|
|
// Operate on the document view if the selected object is a NSScrollView
|
2003-03-02 19:26:51 +00:00
|
|
|
|
if ([obj isKindOfClass: [NSScrollView class]]
|
|
|
|
|
&& ([(NSScrollView *)obj documentView] != nil)
|
|
|
|
|
&& ([[(NSScrollView *)obj documentView] isKindOfClass: [NSTableView class]]
|
|
|
|
|
|| [[(NSScrollView *)obj documentView] isKindOfClass: [NSTextView class]]))
|
2001-11-20 16:48:18 +00:00
|
|
|
|
{
|
|
|
|
|
obj = [(NSScrollView *)obj documentView];
|
2005-04-15 06:39:21 +00:00
|
|
|
|
if ([obj isKindOfClass: [NSTableView class]])
|
|
|
|
|
if ([obj selectedColumn] != -1)
|
|
|
|
|
obj = [[obj tableColumns] objectAtIndex:[obj selectedColumn]];
|
2001-11-20 16:48:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
2005-07-02 20:16:10 +00:00
|
|
|
|
// if(obj != selectedObject)
|
1999-12-08 15:04:57 +00:00
|
|
|
|
{
|
2005-07-02 20:16:10 +00:00
|
|
|
|
selectedObject = obj;
|
|
|
|
|
|
|
|
|
|
// remove any items beyond the original items on the list..
|
|
|
|
|
[self _addDefaultModes];
|
|
|
|
|
|
|
|
|
|
// inform the world that the object is about to be inspected.
|
|
|
|
|
[nc postNotificationName: IBWillInspectObjectNotification object: obj];
|
|
|
|
|
|
|
|
|
|
// set key equivalent
|
|
|
|
|
[self _refreshPopUp];
|
|
|
|
|
|
|
|
|
|
if([modes count] == NUM_DEFAULT_INSPECTORS)
|
|
|
|
|
{
|
|
|
|
|
if(current > (NUM_DEFAULT_INSPECTORS - 1))
|
|
|
|
|
{
|
|
|
|
|
current = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
1999-12-08 15:19:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-10-14 03:26:08 +00:00
|
|
|
|
if (count == 0)
|
1999-12-08 15:19:11 +00:00
|
|
|
|
{
|
1999-12-21 16:48:32 +00:00
|
|
|
|
newInspector = @"GormEmptyInspector";
|
1999-12-08 15:04:57 +00:00
|
|
|
|
}
|
|
|
|
|
else if (count > 1)
|
|
|
|
|
{
|
1999-12-21 16:48:32 +00:00
|
|
|
|
newInspector = @"GormMultipleInspector";
|
1999-12-08 15:04:57 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2005-07-02 20:16:10 +00:00
|
|
|
|
currentMode = [modes objectAtIndex: current];
|
|
|
|
|
newInspector = [currentMode inspectorClassName];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Set panel title for the type of object being inspected.
|
|
|
|
|
*/
|
|
|
|
|
if (selectedObject == nil)
|
|
|
|
|
{
|
|
|
|
|
[panel setTitle: _(@"Inspector")];
|
|
|
|
|
}
|
|
|
|
|
else if([selectedObject isKindOfClass: [GormClassProxy class]])
|
|
|
|
|
{
|
|
|
|
|
[panel setTitle: [NSString stringWithFormat: @"Class Edit Inspector:%@",
|
|
|
|
|
[selectedObject className]]];
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
NSString *newTitle = [selectedObject objectNameForInspectorTitle];
|
|
|
|
|
[panel setTitle: [NSString stringWithFormat:_(@"%@ Inspector"), newTitle]];
|
1999-12-08 15:04:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
2002-10-14 03:26:08 +00:00
|
|
|
|
if (newInspector == nil)
|
|
|
|
|
newInspector = @"GormNotApplicableInspector";
|
|
|
|
|
|
1999-12-21 16:48:32 +00:00
|
|
|
|
if ([oldInspector isEqual: newInspector] == NO)
|
2001-05-08 09:43:11 +00:00
|
|
|
|
{
|
1999-12-21 16:48:32 +00:00
|
|
|
|
/*
|
|
|
|
|
* Return the inspector view to its original window and release the old
|
|
|
|
|
* inspector.
|
|
|
|
|
*/
|
|
|
|
|
[[inspector okButton] removeFromSuperview];
|
|
|
|
|
[[inspector revertButton] removeFromSuperview];
|
|
|
|
|
[[inspector window] setContentView:
|
|
|
|
|
[[inspectorView subviews] lastObject]];
|
2001-05-08 09:43:11 +00:00
|
|
|
|
|
1999-12-21 16:48:32 +00:00
|
|
|
|
ASSIGN(oldInspector, newInspector);
|
|
|
|
|
inspector = [cache objectForKey: newInspector];
|
|
|
|
|
if (inspector == nil)
|
1999-12-08 15:04:57 +00:00
|
|
|
|
{
|
1999-12-21 16:48:32 +00:00
|
|
|
|
Class c = NSClassFromString(newInspector);
|
|
|
|
|
|
2005-06-17 04:41:24 +00:00
|
|
|
|
inspector = [[c alloc] init];
|
2001-09-28 03:37:59 +00:00
|
|
|
|
/* Try to gracefully handle an inspector creation error */
|
|
|
|
|
while (inspector == nil && (obj = [obj superclass])
|
|
|
|
|
&& current == 0)
|
|
|
|
|
{
|
2004-02-21 18:48:48 +00:00
|
|
|
|
NSDebugLog(@"Error loading %@ inspector", newInspector);
|
2001-09-28 03:37:59 +00:00
|
|
|
|
newInspector = [obj inspectorClassName];
|
2005-06-17 04:41:24 +00:00
|
|
|
|
inspector = [[NSClassFromString(newInspector) alloc] init];
|
2001-09-28 03:37:59 +00:00
|
|
|
|
}
|
1999-12-21 16:48:32 +00:00
|
|
|
|
[cache setObject: inspector forKey: newInspector];
|
|
|
|
|
RELEASE(inspector);
|
1999-12-08 15:04:57 +00:00
|
|
|
|
}
|
1999-12-08 15:19:11 +00:00
|
|
|
|
|
1999-12-21 16:48:32 +00:00
|
|
|
|
newView = [[inspector window] contentView];
|
2005-07-11 13:45:34 +00:00
|
|
|
|
|
1999-12-21 16:48:32 +00:00
|
|
|
|
if (newView != nil)
|
1999-12-08 15:04:57 +00:00
|
|
|
|
{
|
2005-07-11 13:45:34 +00:00
|
|
|
|
/* Keep the initialFirstResponder */
|
|
|
|
|
id initialResponder = [[inspector window] initialFirstResponder];
|
1999-12-21 16:48:32 +00:00
|
|
|
|
NSView *outer = [panel contentView];
|
|
|
|
|
NSRect rect = [outer bounds];
|
2005-07-11 13:45:34 +00:00
|
|
|
|
|
|
|
|
|
/* Set initialFirstResponder */
|
1999-12-21 16:48:32 +00:00
|
|
|
|
|
|
|
|
|
if (buttonView != nil)
|
1999-12-08 15:19:11 +00:00
|
|
|
|
{
|
1999-12-21 16:48:32 +00:00
|
|
|
|
[buttonView removeFromSuperview];
|
|
|
|
|
buttonView = nil;
|
1999-12-08 15:19:11 +00:00
|
|
|
|
}
|
1999-12-21 08:13:35 +00:00
|
|
|
|
|
1999-12-21 16:48:32 +00:00
|
|
|
|
rect.size.height = [selectionView frame].origin.y;
|
|
|
|
|
if ([inspector wantsButtons] == YES)
|
1999-12-08 15:19:11 +00:00
|
|
|
|
{
|
1999-12-21 16:48:32 +00:00
|
|
|
|
NSRect buttonsRect;
|
|
|
|
|
NSRect bRect = NSMakeRect(0, 0, 60, 20);
|
|
|
|
|
NSButton *ok;
|
|
|
|
|
NSButton *revert;
|
|
|
|
|
|
|
|
|
|
buttonsRect = rect;
|
|
|
|
|
buttonsRect.size.height = IVB;
|
|
|
|
|
rect.origin.y += IVB;
|
|
|
|
|
rect.size.height -= IVB;
|
|
|
|
|
|
|
|
|
|
buttonView = [[NSView alloc] initWithFrame: buttonsRect];
|
|
|
|
|
[buttonView setAutoresizingMask:
|
|
|
|
|
NSViewHeightSizable | NSViewWidthSizable];
|
|
|
|
|
[outer addSubview: buttonView];
|
|
|
|
|
RELEASE(buttonView);
|
|
|
|
|
|
|
|
|
|
ok = [inspector okButton];
|
|
|
|
|
if (ok != nil)
|
|
|
|
|
{
|
|
|
|
|
bRect = [ok frame];
|
|
|
|
|
bRect.origin.y = 10;
|
|
|
|
|
bRect.origin.x = buttonsRect.size.width-10-bRect.size.width;
|
|
|
|
|
[ok setFrame: bRect];
|
|
|
|
|
[buttonView addSubview: ok];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
revert = [inspector revertButton];
|
|
|
|
|
if (revert != nil)
|
|
|
|
|
{
|
|
|
|
|
bRect = [revert frame];
|
2003-05-25 19:08:36 +00:00
|
|
|
|
bRect.origin.y = 10;
|
1999-12-21 16:48:32 +00:00
|
|
|
|
bRect.origin.x = 10;
|
|
|
|
|
[revert setFrame: bRect];
|
|
|
|
|
[buttonView addSubview: revert];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
[buttonView removeFromSuperview];
|
1999-12-08 15:19:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
1999-12-21 16:48:32 +00:00
|
|
|
|
/*
|
|
|
|
|
* Make the inspector view the correct size for the viewable panel,
|
|
|
|
|
* and set the frame size for the new contents before adding them.
|
|
|
|
|
*/
|
|
|
|
|
[inspectorView setFrame: rect];
|
|
|
|
|
rect.origin = NSZeroPoint;
|
|
|
|
|
[newView setFrame: rect];
|
|
|
|
|
[inspectorView addSubview: newView];
|
2005-07-11 13:45:34 +00:00
|
|
|
|
|
|
|
|
|
/* Set the default First responder to the new View */
|
|
|
|
|
if ( initialResponder )
|
|
|
|
|
[panel setInitialFirstResponder:initialResponder];
|
1999-12-21 16:48:32 +00:00
|
|
|
|
}
|
1999-12-08 15:04:57 +00:00
|
|
|
|
}
|
2001-12-04 22:26:00 +00:00
|
|
|
|
|
2005-07-02 20:16:10 +00:00
|
|
|
|
// reset the popup..
|
|
|
|
|
[popup selectItemAtIndex: current];
|
2004-12-19 13:39:56 +00:00
|
|
|
|
|
|
|
|
|
// inspect the object.
|
2005-07-02 20:16:10 +00:00
|
|
|
|
[inspector setObject: [currentMode object]];
|
1999-12-08 15:04:57 +00:00
|
|
|
|
}
|
|
|
|
|
@end
|
1999-12-20 14:20:06 +00:00
|
|
|
|
|
1999-12-21 08:13:35 +00:00
|
|
|
|
|
1999-12-20 14:20:06 +00:00
|
|
|
|
|
|
|
|
|
@interface GormConnectionInspector : IBInspector
|
|
|
|
|
{
|
|
|
|
|
id currentConnector;
|
|
|
|
|
NSMutableArray *connectors;
|
|
|
|
|
NSArray *actions;
|
|
|
|
|
NSArray *outlets;
|
|
|
|
|
NSBrowser *newBrowser;
|
|
|
|
|
NSBrowser *oldBrowser;
|
|
|
|
|
}
|
|
|
|
|
- (void) updateButtons;
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
@implementation GormConnectionInspector
|
|
|
|
|
|
|
|
|
|
- (int) browser: (NSBrowser*)sender numberOfRowsInColumn: (int)column
|
|
|
|
|
{
|
|
|
|
|
int rows = 0;
|
|
|
|
|
|
|
|
|
|
if (sender == newBrowser)
|
|
|
|
|
{
|
|
|
|
|
if (column == 0)
|
|
|
|
|
{
|
|
|
|
|
rows = [outlets count];
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
NSString *name = [[sender selectedCellInColumn: 0] stringValue];
|
|
|
|
|
|
|
|
|
|
if ([name isEqual: @"target"])
|
|
|
|
|
{
|
|
|
|
|
rows = [actions count];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
rows = [connectors count];
|
|
|
|
|
}
|
|
|
|
|
return rows;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (NSString*) browser: (NSBrowser*)sender titleOfColumn: (int)column
|
|
|
|
|
{
|
|
|
|
|
if (sender == newBrowser)
|
|
|
|
|
{
|
|
|
|
|
if (column == 0)
|
|
|
|
|
{
|
|
|
|
|
return @"Outlets";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
NSString *name = [[sender selectedCellInColumn: 0] stringValue];
|
|
|
|
|
|
|
|
|
|
if ([name isEqual: @"target"])
|
|
|
|
|
{
|
|
|
|
|
return @"Actions";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return @"";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return @"Connections";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2004-06-26 22:08:42 +00:00
|
|
|
|
- (void) _selectAction: (NSString *)action
|
|
|
|
|
{
|
|
|
|
|
/*
|
|
|
|
|
* Ensure that the actions are displayed in column one,
|
|
|
|
|
* and select the action for the current connection (if any).
|
|
|
|
|
*/
|
|
|
|
|
[newBrowser reloadColumn: 1];
|
|
|
|
|
if (action != nil)
|
|
|
|
|
{
|
|
|
|
|
[newBrowser selectRow: [actions indexOfObject: action]
|
|
|
|
|
inColumn: 1];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2003-02-11 06:55:50 +00:00
|
|
|
|
- (void) _internalCall: (NSBrowser*)sender
|
2002-09-21 15:24:59 +00:00
|
|
|
|
{
|
2003-02-11 06:55:50 +00:00
|
|
|
|
unsigned numConnectors = [connectors count];
|
|
|
|
|
unsigned index;
|
|
|
|
|
NSBrowserCell *cell = [sender selectedCell];
|
|
|
|
|
NSString *title = [cell stringValue];
|
|
|
|
|
int col = [sender selectedColumn];
|
2002-09-21 15:24:59 +00:00
|
|
|
|
|
1999-12-20 14:20:06 +00:00
|
|
|
|
if (sender == newBrowser)
|
|
|
|
|
{
|
|
|
|
|
if (col == 0)
|
|
|
|
|
{
|
|
|
|
|
if ([title isEqual: @"target"])
|
|
|
|
|
{
|
2000-01-13 21:19:03 +00:00
|
|
|
|
id con = nil;
|
|
|
|
|
|
1999-12-20 14:20:06 +00:00
|
|
|
|
for (index = 0; index < numConnectors; index++)
|
|
|
|
|
{
|
2000-01-13 21:19:03 +00:00
|
|
|
|
con = [connectors objectAtIndex: index];
|
1999-12-20 14:20:06 +00:00
|
|
|
|
if ([con isKindOfClass: [NSNibControlConnector class]] == YES)
|
|
|
|
|
{
|
2000-01-13 21:19:03 +00:00
|
|
|
|
RELEASE(actions);
|
2005-03-31 03:01:36 +00:00
|
|
|
|
actions = RETAIN([[(id<Gorm>)NSApp classManager]
|
2003-02-11 06:55:50 +00:00
|
|
|
|
allActionsForObject: [con destination]]);
|
1999-12-20 14:20:06 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
2004-05-30 03:48:38 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
con = nil;
|
|
|
|
|
}
|
1999-12-20 14:20:06 +00:00
|
|
|
|
}
|
2004-05-30 03:48:38 +00:00
|
|
|
|
|
2004-06-26 22:08:42 +00:00
|
|
|
|
if (con == nil) // && [actions containsObject: [currentConnector label]] == NO)
|
2000-01-13 21:19:03 +00:00
|
|
|
|
{
|
|
|
|
|
RELEASE(actions);
|
2005-03-31 03:01:36 +00:00
|
|
|
|
actions = RETAIN([[(id<Gorm>)NSApp classManager]
|
2003-02-11 06:55:50 +00:00
|
|
|
|
allActionsForObject: [NSApp connectDestination]]);
|
2000-01-13 21:19:03 +00:00
|
|
|
|
if ([actions count] > 0)
|
|
|
|
|
{
|
2005-06-17 04:41:24 +00:00
|
|
|
|
con = [[NSNibControlConnector alloc] init];
|
2000-01-13 21:19:03 +00:00
|
|
|
|
[con setSource: object];
|
|
|
|
|
[con setDestination: [NSApp connectDestination]];
|
|
|
|
|
[con setLabel: [actions objectAtIndex: 0]];
|
|
|
|
|
AUTORELEASE(con);
|
|
|
|
|
}
|
|
|
|
|
}
|
2004-05-30 03:48:38 +00:00
|
|
|
|
|
2004-06-26 22:08:42 +00:00
|
|
|
|
// if we changed the current connector, update to the new one...
|
2002-09-21 15:24:59 +00:00
|
|
|
|
if (currentConnector != con)
|
|
|
|
|
{
|
|
|
|
|
ASSIGN(currentConnector, con);
|
|
|
|
|
}
|
2004-06-26 22:08:42 +00:00
|
|
|
|
|
2003-02-11 06:55:50 +00:00
|
|
|
|
/*
|
|
|
|
|
* Ensure that the actions are displayed in column one,
|
|
|
|
|
* and select the action for the current connection (if any).
|
|
|
|
|
*/
|
2004-06-26 22:08:42 +00:00
|
|
|
|
[self _selectAction: [con label]];
|
1999-12-20 14:20:06 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
BOOL found = NO;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* See if there already exists a connector for this outlet.
|
|
|
|
|
*/
|
|
|
|
|
for (index = 0; index < numConnectors; index++)
|
|
|
|
|
{
|
|
|
|
|
id con = [connectors objectAtIndex: index];
|
|
|
|
|
|
2000-01-13 21:19:03 +00:00
|
|
|
|
if ([con label] == nil || [[con label] isEqual: title] == YES)
|
1999-12-20 14:20:06 +00:00
|
|
|
|
{
|
|
|
|
|
ASSIGN(currentConnector, con);
|
|
|
|
|
found = YES;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/*
|
|
|
|
|
* if there was no connector, make one.
|
|
|
|
|
*/
|
|
|
|
|
if (found == NO)
|
|
|
|
|
{
|
|
|
|
|
RELEASE(currentConnector);
|
2005-06-17 04:41:24 +00:00
|
|
|
|
currentConnector = [[NSNibOutletConnector alloc] init];
|
1999-12-20 14:20:06 +00:00
|
|
|
|
[currentConnector setSource: object];
|
|
|
|
|
[currentConnector setDestination: [NSApp connectDestination]];
|
|
|
|
|
[currentConnector setLabel: title];
|
|
|
|
|
}
|
|
|
|
|
}
|
2000-01-13 21:19:03 +00:00
|
|
|
|
/*
|
|
|
|
|
* Update the bottom browser.
|
|
|
|
|
*/
|
|
|
|
|
[oldBrowser loadColumnZero];
|
|
|
|
|
[oldBrowser selectRow: index inColumn: 0];
|
|
|
|
|
[NSApp displayConnectionBetween: object
|
|
|
|
|
and: [currentConnector destination]];
|
1999-12-20 14:20:06 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
BOOL found = NO;
|
|
|
|
|
|
|
|
|
|
for (index = 0; index < numConnectors; index++)
|
|
|
|
|
{
|
|
|
|
|
id con = [connectors objectAtIndex: index];
|
|
|
|
|
|
|
|
|
|
if ([con isKindOfClass: [NSNibControlConnector class]] == YES)
|
|
|
|
|
{
|
|
|
|
|
NSString *action = [con label];
|
|
|
|
|
|
|
|
|
|
if ([action isEqual: title] == YES)
|
|
|
|
|
{
|
|
|
|
|
ASSIGN(currentConnector, con);
|
|
|
|
|
found = YES;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (found == NO)
|
|
|
|
|
{
|
|
|
|
|
RELEASE(currentConnector);
|
2005-06-17 04:41:24 +00:00
|
|
|
|
currentConnector = [[NSNibControlConnector alloc] init];
|
1999-12-20 14:20:06 +00:00
|
|
|
|
[currentConnector setSource: object];
|
|
|
|
|
[currentConnector setDestination: [NSApp connectDestination]];
|
|
|
|
|
[currentConnector setLabel: title];
|
|
|
|
|
[oldBrowser loadColumnZero];
|
|
|
|
|
}
|
|
|
|
|
[oldBrowser selectRow: index inColumn: 0];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
for (index = 0; index < numConnectors; index++)
|
|
|
|
|
{
|
2003-02-11 06:55:50 +00:00
|
|
|
|
id con = [connectors objectAtIndex: index];
|
|
|
|
|
NSString *label = [con label];
|
1999-12-20 14:20:06 +00:00
|
|
|
|
|
2003-02-11 06:55:50 +00:00
|
|
|
|
if ([title hasPrefix: label] == YES)
|
1999-12-20 14:20:06 +00:00
|
|
|
|
{
|
|
|
|
|
NSString *name;
|
|
|
|
|
id dest = [NSApp connectDestination];
|
|
|
|
|
|
|
|
|
|
dest = [con destination];
|
|
|
|
|
name = [[(id<IB>)NSApp activeDocument] nameForObject: dest];
|
2001-05-08 09:43:11 +00:00
|
|
|
|
name = [label stringByAppendingFormat: @" (%@)", name];
|
1999-12-20 14:20:06 +00:00
|
|
|
|
if ([title isEqual: name] == YES)
|
|
|
|
|
{
|
2003-02-11 06:55:50 +00:00
|
|
|
|
NSString *path = label;
|
|
|
|
|
|
1999-12-20 14:20:06 +00:00
|
|
|
|
ASSIGN(currentConnector, con);
|
2003-02-11 06:55:50 +00:00
|
|
|
|
/*
|
|
|
|
|
* Update the main browser to reflect selected connection
|
|
|
|
|
*/
|
|
|
|
|
path = [@"/" stringByAppendingString: label];
|
|
|
|
|
if ([con isKindOfClass: [NSNibControlConnector class]] == YES)
|
|
|
|
|
{
|
|
|
|
|
path = [@"/target" stringByAppendingString: path];
|
|
|
|
|
}
|
|
|
|
|
[newBrowser setPath: path];
|
1999-12-20 14:20:06 +00:00
|
|
|
|
[NSApp displayConnectionBetween: object
|
|
|
|
|
and: [con destination]];
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2004-06-08 03:53:48 +00:00
|
|
|
|
|
|
|
|
|
// if it's a control connection select target, if not, don't
|
|
|
|
|
// if([currentConnector isKindOfClass: [NSNib
|
|
|
|
|
|
1999-12-20 14:20:06 +00:00
|
|
|
|
[self updateButtons];
|
2003-02-11 06:55:50 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (BOOL) browser: (NSBrowser*)sender
|
|
|
|
|
selectCellWithString: (NSString*)title
|
|
|
|
|
inColumn: (int)col
|
|
|
|
|
{
|
|
|
|
|
NSMatrix *matrix = [sender matrixInColumn: col];
|
|
|
|
|
int rows = [matrix numberOfRows];
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < rows; i++)
|
|
|
|
|
{
|
|
|
|
|
NSBrowserCell *cell = [matrix cellAtRow: i column: 0];
|
|
|
|
|
|
|
|
|
|
if ([[cell stringValue] isEqual: title] == YES)
|
|
|
|
|
{
|
|
|
|
|
[matrix selectCellAtRow: i column: 0];
|
|
|
|
|
return YES;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return NO;
|
1999-12-20 14:20:06 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void) browser: (NSBrowser*)sender
|
|
|
|
|
willDisplayCell: (id)aCell
|
|
|
|
|
atRow: (int)row
|
|
|
|
|
column: (int)col
|
|
|
|
|
{
|
|
|
|
|
if (sender == newBrowser)
|
|
|
|
|
{
|
|
|
|
|
NSString *name;
|
|
|
|
|
|
|
|
|
|
if (col == 0)
|
|
|
|
|
{
|
|
|
|
|
if (row >= 0 && row < [outlets count])
|
|
|
|
|
{
|
|
|
|
|
name = [outlets objectAtIndex: row];
|
|
|
|
|
[aCell setStringValue: name];
|
|
|
|
|
if ([name isEqual: @"target"])
|
|
|
|
|
{
|
|
|
|
|
[aCell setLeaf: NO];
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
[aCell setLeaf: YES];
|
|
|
|
|
}
|
|
|
|
|
[aCell setEnabled: YES];
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
[aCell setStringValue: @""];
|
|
|
|
|
[aCell setLeaf: YES];
|
|
|
|
|
[aCell setEnabled: NO];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
name = [[sender selectedCellInColumn: 0] stringValue];
|
|
|
|
|
if ([name isEqual: @"target"] == NO)
|
|
|
|
|
{
|
2004-02-21 18:48:48 +00:00
|
|
|
|
NSDebugLog(@"cell selected in actions column without target");
|
1999-12-20 14:20:06 +00:00
|
|
|
|
}
|
|
|
|
|
if (row >= 0 && row < [actions count])
|
|
|
|
|
{
|
|
|
|
|
[aCell setStringValue: [actions objectAtIndex: row]];
|
|
|
|
|
[aCell setEnabled: YES];
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
[aCell setStringValue: @""];
|
|
|
|
|
[aCell setEnabled: NO];
|
|
|
|
|
}
|
|
|
|
|
[aCell setLeaf: YES];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (row >= 0 && row < [connectors count])
|
|
|
|
|
{
|
|
|
|
|
NSString *label;
|
|
|
|
|
NSString *name;
|
|
|
|
|
id dest = [NSApp connectDestination];
|
|
|
|
|
|
|
|
|
|
label = [[connectors objectAtIndex: row] label];
|
|
|
|
|
dest = [[connectors objectAtIndex: row] destination];
|
|
|
|
|
name = [[(id<IB>)NSApp activeDocument] nameForObject: dest];
|
2001-05-08 09:43:11 +00:00
|
|
|
|
name = [label stringByAppendingFormat: @" (%@)", name];
|
1999-12-20 14:20:06 +00:00
|
|
|
|
|
|
|
|
|
[aCell setStringValue: name];
|
|
|
|
|
[aCell setEnabled: YES];
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
[aCell setStringValue: @""];
|
|
|
|
|
[aCell setEnabled: NO];
|
|
|
|
|
}
|
|
|
|
|
[aCell setLeaf: YES];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void) dealloc
|
|
|
|
|
{
|
|
|
|
|
RELEASE(currentConnector);
|
|
|
|
|
RELEASE(connectors);
|
|
|
|
|
RELEASE(actions);
|
|
|
|
|
RELEASE(outlets);
|
|
|
|
|
RELEASE(okButton);
|
|
|
|
|
RELEASE(revertButton);
|
|
|
|
|
[super dealloc];
|
|
|
|
|
}
|
|
|
|
|
|
2003-05-25 19:08:36 +00:00
|
|
|
|
- (void) handleNotification: (NSNotification *)notification
|
|
|
|
|
{
|
|
|
|
|
// got the notification... since we only subscribe to one, just do what
|
|
|
|
|
// needs to be done.
|
2004-06-26 22:08:42 +00:00
|
|
|
|
[self setObject: object]; // resets the browser...
|
2003-05-25 19:08:36 +00:00
|
|
|
|
}
|
|
|
|
|
|
1999-12-20 14:20:06 +00:00
|
|
|
|
- (id) init
|
|
|
|
|
{
|
|
|
|
|
self = [super init];
|
|
|
|
|
if (self != nil)
|
|
|
|
|
{
|
|
|
|
|
NSView *contents;
|
|
|
|
|
NSSplitView *split;
|
|
|
|
|
NSRect rect;
|
|
|
|
|
|
|
|
|
|
rect = NSMakeRect(0, 0, IVW, IVH);
|
|
|
|
|
window = [[NSWindow alloc] initWithContentRect: rect
|
2001-05-08 09:43:11 +00:00
|
|
|
|
styleMask: NSBorderlessWindowMask
|
1999-12-20 14:20:06 +00:00
|
|
|
|
backing: NSBackingStoreRetained
|
|
|
|
|
defer: NO];
|
|
|
|
|
contents = [window contentView];
|
|
|
|
|
split = [[NSSplitView alloc] initWithFrame: [contents bounds]];
|
|
|
|
|
[split setAutoresizingMask: NSViewWidthSizable|NSViewHeightSizable];
|
|
|
|
|
|
|
|
|
|
newBrowser = [[NSBrowser alloc] initWithFrame: rect];
|
|
|
|
|
[newBrowser setAutoresizingMask: NSViewWidthSizable|NSViewHeightSizable];
|
|
|
|
|
[newBrowser setMaxVisibleColumns: 2];
|
|
|
|
|
[newBrowser setAllowsMultipleSelection: NO];
|
|
|
|
|
[newBrowser setHasHorizontalScroller: NO];
|
|
|
|
|
[newBrowser setDelegate: self];
|
2002-09-21 15:24:59 +00:00
|
|
|
|
[newBrowser setTarget: self];
|
|
|
|
|
[newBrowser setAction: @selector(_internalCall:)];
|
1999-12-20 14:20:06 +00:00
|
|
|
|
|
|
|
|
|
[split addSubview: newBrowser];
|
|
|
|
|
RELEASE(newBrowser);
|
|
|
|
|
|
|
|
|
|
rect.size.height /= 2;
|
|
|
|
|
oldBrowser = [[NSBrowser alloc] initWithFrame: rect];
|
|
|
|
|
[oldBrowser setAutoresizingMask: NSViewWidthSizable|NSViewHeightSizable];
|
|
|
|
|
[oldBrowser setMaxVisibleColumns: 1];
|
|
|
|
|
[oldBrowser setAllowsMultipleSelection: NO];
|
|
|
|
|
[oldBrowser setHasHorizontalScroller: NO];
|
|
|
|
|
[oldBrowser setDelegate: self];
|
2003-02-11 06:55:50 +00:00
|
|
|
|
[oldBrowser setTarget: self];
|
|
|
|
|
[oldBrowser setAction: @selector(_internalCall:)];
|
1999-12-20 14:20:06 +00:00
|
|
|
|
|
|
|
|
|
[split addSubview: oldBrowser];
|
|
|
|
|
RELEASE(oldBrowser);
|
|
|
|
|
|
|
|
|
|
[contents addSubview: split];
|
|
|
|
|
RELEASE(split);
|
|
|
|
|
|
2001-02-07 07:06:16 +00:00
|
|
|
|
okButton = [[NSButton alloc] initWithFrame: NSMakeRect(0,0,70,20)];
|
1999-12-20 14:20:06 +00:00
|
|
|
|
[okButton setAutoresizingMask: NSViewMaxYMargin | NSViewMinXMargin];
|
|
|
|
|
[okButton setAction: @selector(ok:)];
|
|
|
|
|
[okButton setTarget: self];
|
2003-05-24 12:40:54 +00:00
|
|
|
|
[okButton setTitle: _(@"Connect")];
|
1999-12-20 14:20:06 +00:00
|
|
|
|
[okButton setEnabled: NO];
|
|
|
|
|
|
|
|
|
|
revertButton = [[NSButton alloc] initWithFrame: NSMakeRect(0,0,60,20)];
|
|
|
|
|
[revertButton setAutoresizingMask: NSViewMaxYMargin | NSViewMinXMargin];
|
|
|
|
|
[revertButton setAction: @selector(revert:)];
|
|
|
|
|
[revertButton setTarget: self];
|
2003-05-24 12:40:54 +00:00
|
|
|
|
[revertButton setTitle: _(@"Revert")];
|
1999-12-20 14:20:06 +00:00
|
|
|
|
[revertButton setEnabled: NO];
|
|
|
|
|
}
|
|
|
|
|
return self;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void) ok: (id)sender
|
|
|
|
|
{
|
2004-04-04 16:37:16 +00:00
|
|
|
|
if([currentConnector destination] == nil ||
|
|
|
|
|
[currentConnector source] == nil)
|
2003-09-08 03:34:40 +00:00
|
|
|
|
{
|
|
|
|
|
NSRunAlertPanel(_(@"Problem making connection"),
|
2003-09-08 03:53:49 +00:00
|
|
|
|
_(@"Please select a valid destination."),
|
2003-09-08 03:34:40 +00:00
|
|
|
|
_(@"OK"), nil, nil, nil);
|
|
|
|
|
}
|
|
|
|
|
else if ([connectors containsObject: currentConnector] == YES)
|
1999-12-20 14:20:06 +00:00
|
|
|
|
{
|
2004-06-26 12:19:18 +00:00
|
|
|
|
id con = currentConnector;
|
2005-07-31 14:49:06 +00:00
|
|
|
|
|
2004-06-26 12:19:18 +00:00
|
|
|
|
[[(id<IB>)NSApp activeDocument] removeConnector: con];
|
|
|
|
|
[connectors removeObject: con];
|
2003-02-11 06:55:50 +00:00
|
|
|
|
[oldBrowser loadColumnZero];
|
1999-12-20 14:20:06 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2003-02-11 06:55:50 +00:00
|
|
|
|
NSString *path;
|
|
|
|
|
id dest;
|
|
|
|
|
|
2000-01-13 21:19:03 +00:00
|
|
|
|
/*
|
|
|
|
|
* Establishing a target/action type connection will automatically
|
|
|
|
|
* remove any previous target/action connection.
|
|
|
|
|
*/
|
|
|
|
|
if ([currentConnector isKindOfClass: [NSNibControlConnector class]])
|
|
|
|
|
{
|
|
|
|
|
NSEnumerator *enumerator = [connectors objectEnumerator];
|
|
|
|
|
id con;
|
|
|
|
|
|
|
|
|
|
while ((con = [enumerator nextObject]) != nil)
|
|
|
|
|
{
|
|
|
|
|
if ([con isKindOfClass: [NSNibControlConnector class]])
|
|
|
|
|
{
|
|
|
|
|
[[(id<IB>)NSApp activeDocument] removeConnector: con];
|
|
|
|
|
[connectors removeObjectIdenticalTo: con];
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2004-06-26 22:08:42 +00:00
|
|
|
|
|
|
|
|
|
// select the new action from the list...
|
|
|
|
|
[self _selectAction: [currentConnector label]];
|
2000-01-13 21:19:03 +00:00
|
|
|
|
}
|
1999-12-20 14:20:06 +00:00
|
|
|
|
[connectors addObject: currentConnector];
|
|
|
|
|
[[(id<IB>)NSApp activeDocument] addConnector: currentConnector];
|
2004-06-26 22:08:42 +00:00
|
|
|
|
|
2001-05-08 09:43:11 +00:00
|
|
|
|
/*
|
2003-02-11 06:55:50 +00:00
|
|
|
|
* When we establish a connection, we want to highlight it in
|
|
|
|
|
* the browser so the user can see it has been done.
|
2001-05-08 09:43:11 +00:00
|
|
|
|
*/
|
2003-02-11 06:55:50 +00:00
|
|
|
|
dest = [currentConnector destination];
|
|
|
|
|
path = [[(id<IB>)NSApp activeDocument] nameForObject: dest];
|
|
|
|
|
path = [[currentConnector label] stringByAppendingFormat: @" (%@)", path];
|
|
|
|
|
path = [@"/" stringByAppendingString: path];
|
|
|
|
|
[oldBrowser loadColumnZero];
|
|
|
|
|
[oldBrowser setPath: path];
|
1999-12-20 14:20:06 +00:00
|
|
|
|
}
|
1999-12-21 16:48:32 +00:00
|
|
|
|
[[(id<IB>)NSApp activeDocument] touch]; /* mark as edited. */
|
1999-12-20 14:20:06 +00:00
|
|
|
|
[self updateButtons];
|
|
|
|
|
}
|
|
|
|
|
|
1999-12-21 08:13:35 +00:00
|
|
|
|
- (void) setObject: (id)anObject
|
|
|
|
|
{
|
2004-04-04 16:37:16 +00:00
|
|
|
|
if (anObject != nil)
|
1999-12-21 08:13:35 +00:00
|
|
|
|
{
|
|
|
|
|
NSArray *array;
|
|
|
|
|
|
2004-05-14 06:32:24 +00:00
|
|
|
|
[super setObject: anObject];
|
1999-12-21 08:13:35 +00:00
|
|
|
|
RELEASE(connectors);
|
2004-04-04 16:37:16 +00:00
|
|
|
|
|
1999-12-21 08:13:35 +00:00
|
|
|
|
/*
|
|
|
|
|
* Create list of existing connections for selected object.
|
|
|
|
|
*/
|
2005-06-17 04:41:24 +00:00
|
|
|
|
connectors = [[NSMutableArray alloc] init];
|
1999-12-21 08:13:35 +00:00
|
|
|
|
array = [[(id<IB>)NSApp activeDocument] connectorsForSource: object
|
|
|
|
|
ofClass: [NSNibControlConnector class]];
|
|
|
|
|
[connectors addObjectsFromArray: array];
|
|
|
|
|
array = [[(id<IB>)NSApp activeDocument] connectorsForSource: object
|
|
|
|
|
ofClass: [NSNibOutletConnector class]];
|
|
|
|
|
[connectors addObjectsFromArray: array];
|
|
|
|
|
|
|
|
|
|
RELEASE(outlets);
|
2005-03-31 03:01:36 +00:00
|
|
|
|
outlets = RETAIN([[(id<Gorm>)NSApp classManager] allOutletsForObject: object]);
|
1999-12-21 08:13:35 +00:00
|
|
|
|
DESTROY(actions);
|
|
|
|
|
|
|
|
|
|
[oldBrowser loadColumnZero];
|
2004-04-04 16:37:16 +00:00
|
|
|
|
|
1999-12-21 08:13:35 +00:00
|
|
|
|
/*
|
|
|
|
|
* See if we can do initial selection based on pre-existing connections.
|
|
|
|
|
*/
|
|
|
|
|
if ([NSApp isConnecting] == YES)
|
|
|
|
|
{
|
2004-04-04 16:37:16 +00:00
|
|
|
|
id dest = [currentConnector destination];
|
|
|
|
|
unsigned row;
|
1999-12-21 08:13:35 +00:00
|
|
|
|
|
|
|
|
|
for (row = 0; row < [connectors count]; row++)
|
|
|
|
|
{
|
|
|
|
|
id<IBConnectors> con = [connectors objectAtIndex: row];
|
|
|
|
|
|
|
|
|
|
if ([con destination] == dest)
|
|
|
|
|
{
|
|
|
|
|
ASSIGN(currentConnector, con);
|
|
|
|
|
[oldBrowser selectRow: row inColumn: 0];
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[newBrowser loadColumnZero];
|
|
|
|
|
if (currentConnector == nil)
|
|
|
|
|
{
|
2003-02-11 06:55:50 +00:00
|
|
|
|
if ([connectors count] > 0)
|
|
|
|
|
{
|
|
|
|
|
currentConnector = RETAIN([connectors objectAtIndex: 0]);
|
|
|
|
|
}
|
|
|
|
|
else if ([outlets count] == 1)
|
1999-12-21 08:13:35 +00:00
|
|
|
|
{
|
|
|
|
|
[newBrowser selectRow: 0 inColumn: 0];
|
2003-02-11 06:55:50 +00:00
|
|
|
|
[newBrowser sendAction];
|
1999-12-21 08:13:35 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2004-06-08 03:53:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ([currentConnector isKindOfClass: [NSNibControlConnector class]] == YES &&
|
|
|
|
|
[NSApp isConnecting] == NO)
|
2000-01-13 21:19:03 +00:00
|
|
|
|
{
|
2003-02-11 06:55:50 +00:00
|
|
|
|
[newBrowser setPath: @"/target"];
|
|
|
|
|
[newBrowser sendAction];
|
2000-01-13 21:19:03 +00:00
|
|
|
|
}
|
|
|
|
|
|
1999-12-21 08:13:35 +00:00
|
|
|
|
[self updateButtons];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1999-12-20 14:20:06 +00:00
|
|
|
|
- (void) updateButtons
|
|
|
|
|
{
|
|
|
|
|
if (currentConnector == nil)
|
|
|
|
|
{
|
|
|
|
|
[okButton setEnabled: NO];
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2004-11-18 05:34:19 +00:00
|
|
|
|
GormDocument *active = (GormDocument *)[(id<IB>)NSApp activeDocument];
|
2004-04-04 16:37:16 +00:00
|
|
|
|
id src = [currentConnector source];
|
|
|
|
|
id dest = [currentConnector destination];
|
|
|
|
|
|
|
|
|
|
// highlight or unhiglight the connection depending on
|
|
|
|
|
// the object being connected to.
|
|
|
|
|
if((src == nil || src == [active firstResponder]) ||
|
|
|
|
|
((dest == nil || dest == [active firstResponder]) &&
|
|
|
|
|
[currentConnector isKindOfClass: [NSNibOutletConnector class]] == YES))
|
|
|
|
|
|
1999-12-20 14:20:06 +00:00
|
|
|
|
{
|
2004-04-04 16:37:16 +00:00
|
|
|
|
[okButton setEnabled: NO];
|
1999-12-20 14:20:06 +00:00
|
|
|
|
}
|
2004-04-04 16:37:16 +00:00
|
|
|
|
else
|
1999-12-20 14:20:06 +00:00
|
|
|
|
{
|
2004-04-04 16:37:16 +00:00
|
|
|
|
[okButton setEnabled: YES];
|
|
|
|
|
if ([connectors containsObject: currentConnector] == YES)
|
|
|
|
|
{
|
|
|
|
|
[okButton setTitle: _(@"Disconnect")];
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
[okButton setTitle: _(@"Connect")];
|
|
|
|
|
}
|
1999-12-20 14:20:06 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (BOOL) wantsButtons
|
|
|
|
|
{
|
|
|
|
|
return YES;
|
|
|
|
|
}
|
|
|
|
|
@end
|