mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-24 12:01:16 +00:00
Corrected crash when changing class hierarchy.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@21576 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
738aefb672
commit
d0ab85ac95
9 changed files with 84 additions and 39 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
||||||
|
2005-07-30 15:57 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||||
|
|
||||||
|
* English.lproj/GormPreferences.gorm: Changed class hierarchy. Also
|
||||||
|
added panel outlet.
|
||||||
|
* GormCore/GormClassInspector.m: -[GormClassInspector _currentClass]
|
||||||
|
copy the className.
|
||||||
|
* GormCore/GormPrivate.m: -[GormClassProxy init] copy the className.
|
||||||
|
* Gorm.m: Changed to initialize preferences panel using init.
|
||||||
|
* GormPrefs/GormPrefController.[hm]: Added panel method, changed
|
||||||
|
derivation to a subclass of NSObject, instead of NSWindowController.
|
||||||
|
|
||||||
2005-07-30 09:30 Gregory John Casamento <greg_casamento@yahoo.com>
|
2005-07-30 09:30 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||||
|
|
||||||
* Documentation/Makefile.postamble: Generate documentation from
|
* Documentation/Makefile.postamble: Generate documentation from
|
||||||
|
|
|
@ -6,8 +6,9 @@
|
||||||
);
|
);
|
||||||
Outlets = (
|
Outlets = (
|
||||||
popup,
|
popup,
|
||||||
prefBox
|
prefBox,
|
||||||
|
panel
|
||||||
);
|
);
|
||||||
Super = NSWindowController;
|
Super = NSObject;
|
||||||
};
|
};
|
||||||
}
|
}
|
Binary file not shown.
Binary file not shown.
6
Gorm.m
6
Gorm.m
|
@ -35,7 +35,7 @@
|
||||||
@interface Gorm : NSApplication <IB, Gorm>
|
@interface Gorm : NSApplication <IB, Gorm>
|
||||||
{
|
{
|
||||||
id infoPanel;
|
id infoPanel;
|
||||||
id preferencesController;
|
GormPrefController *preferencesController;
|
||||||
GormClassManager *classManager;
|
GormClassManager *classManager;
|
||||||
GormInspectorsManager *inspectorsManager;
|
GormInspectorsManager *inspectorsManager;
|
||||||
GormPalettesManager *palettesManager;
|
GormPalettesManager *palettesManager;
|
||||||
|
@ -425,10 +425,10 @@
|
||||||
{
|
{
|
||||||
if(! preferencesController)
|
if(! preferencesController)
|
||||||
{
|
{
|
||||||
preferencesController = [[GormPrefController alloc] initWithWindowNibName:@"GormPreferences"];
|
preferencesController = [[GormPrefController alloc] init];
|
||||||
}
|
}
|
||||||
|
|
||||||
[[preferencesController window] makeKeyAndOrderFront:nil];
|
[[preferencesController panel] makeKeyAndOrderFront:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Document Menu Actions */
|
/** Document Menu Actions */
|
||||||
|
|
|
@ -657,7 +657,17 @@ objectValueForTableColumn: (NSTableColumn *)tc
|
||||||
|
|
||||||
- (NSString *) _currentClass
|
- (NSString *) _currentClass
|
||||||
{
|
{
|
||||||
return [object className];
|
if(object == nil)
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
if([object className] == nil)
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
return [NSString stringWithString: [object className]];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) handleNotification: (NSNotification *)notification
|
- (void) handleNotification: (NSNotification *)notification
|
||||||
|
|
|
@ -186,7 +186,8 @@ static BOOL _isInInterfaceBuilder = NO;
|
||||||
{
|
{
|
||||||
if([n isKindOfClass: [NSString class]])
|
if([n isKindOfClass: [NSString class]])
|
||||||
{
|
{
|
||||||
ASSIGN(name, n);
|
// create a copy.
|
||||||
|
name = [[NSString alloc] initWithString: n];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,9 +29,9 @@
|
||||||
#include <Foundation/NSObject.h>
|
#include <Foundation/NSObject.h>
|
||||||
#include <AppKit/NSWindowController.h>
|
#include <AppKit/NSWindowController.h>
|
||||||
|
|
||||||
@interface GormPrefController : NSWindowController
|
@interface GormPrefController : NSObject
|
||||||
{
|
{
|
||||||
id window;
|
id panel;
|
||||||
id popup;
|
id popup;
|
||||||
id prefBox;
|
id prefBox;
|
||||||
|
|
||||||
|
@ -48,6 +48,10 @@
|
||||||
*/
|
*/
|
||||||
- (void) popupAction: (id)sender;
|
- (void) popupAction: (id)sender;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the preferences panel.
|
||||||
|
*/
|
||||||
|
- (id) panel;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -13,6 +13,18 @@
|
||||||
|
|
||||||
@implementation GormPrefController
|
@implementation GormPrefController
|
||||||
|
|
||||||
|
- (id) init
|
||||||
|
{
|
||||||
|
if(self = [super init])
|
||||||
|
{
|
||||||
|
if(![NSBundle loadNibNamed: @"GormPreferences" owner: self])
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
- (void) awakeFromNib
|
- (void) awakeFromNib
|
||||||
{
|
{
|
||||||
_generalView = [[GormGeneralPref alloc] init];
|
_generalView = [[GormGeneralPref alloc] init];
|
||||||
|
@ -24,18 +36,19 @@
|
||||||
|
|
||||||
[prefBox setContentView:[_generalView view]];
|
[prefBox setContentView:[_generalView view]];
|
||||||
|
|
||||||
[[self window] setFrameUsingName: @"Preferences"];
|
[[self panel] setFrameUsingName: @"Preferences"];
|
||||||
[[self window] setFrameAutosaveName: @"Preferences"];
|
[[self panel] setFrameAutosaveName: @"Preferences"];
|
||||||
[[self window] center];
|
[[self panel] center];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) popupAction: (id)sender
|
- (void) popupAction: (id)sender
|
||||||
{
|
{
|
||||||
|
int tag = -1;
|
||||||
|
|
||||||
if ( sender != popup )
|
if ( sender != popup )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
{
|
tag = [[sender selectedItem] tag];
|
||||||
int tag = [[sender selectedItem] tag];
|
|
||||||
switch(tag)
|
switch(tag)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
@ -61,7 +74,6 @@
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
- (void) dealloc
|
- (void) dealloc
|
||||||
{
|
{
|
||||||
|
@ -70,6 +82,12 @@
|
||||||
RELEASE(_shelfView);
|
RELEASE(_shelfView);
|
||||||
RELEASE(_colorsView);
|
RELEASE(_colorsView);
|
||||||
RELEASE(_palettesView);
|
RELEASE(_palettesView);
|
||||||
|
RELEASE(panel);
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (id) panel
|
||||||
|
{
|
||||||
|
return panel;
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Reference in a new issue