Correction for bug #13780.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@21528 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2005-07-24 16:26:46 +00:00
parent b3e06f2c19
commit b1b9a402d5
5 changed files with 52 additions and 35 deletions

View file

@ -1,3 +1,16 @@
2005-07-24 12:29 Gregory John Casamento <greg_casamento@yahoo.com>
* Gorm.m: Eliminated [Gorm finishLaunching] and moved default
initialization code to init before paletteManager is called so
that the palette window is placed correctly.
* Palettes/1Windows/GormNSPanel.m
* Palettes/1Windows/GormNSWindow.m: Added override for
saveFrameUsingName: to prevent saving the position of windows
during testing in Gorm's defaults.
* Resources/Defaults.plist: Added defaults for Inspector, Palettes,
and Preferences windows so that they appear at a reasonable position
on the screen when Gorm is first used. Corrects bug#13780.
2005-07-24 11:20 Gregory John Casamento <greg_casamento@yahoo.com>
* Palettes/1Windows/GormNSPanel.m

61
Gorm.m
View file

@ -124,18 +124,42 @@
name: IBWillCloseDocumentNotification
object: nil];
/*
* establish registration domain defaults from file.
*/
path = [bundle pathForResource: @"Defaults" ofType: @"plist"];
if (path != nil)
{
NSDictionary *dict;
dict = [NSDictionary dictionaryWithContentsOfFile: path];
if (dict != nil)
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults registerDefaults: dict];
}
}
/*
* Make sure the palettes manager exists, so that the editors and
* inspectors provided in the standard palettes are available.
*/
[self palettesManager];
// load the interface...
/*
* load the interface...
*/
if(![NSBundle loadNibNamed: @"Gorm" owner: self])
{
NSLog(@"Failed to load interface");
exit(-1);
}
/*
* set the delegate.
*/
[self setDelegate: self];
}
return self;
}
@ -171,7 +195,6 @@
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSArray *a = nil;
if ( [defaults boolForKey: @"ShowInspectors"] )
{
[[[self inspectorsManager] panel] makeKeyAndOrderFront: self];
@ -209,7 +232,6 @@
}
}
- (void) applicationWillTerminate: (NSApplication*)sender
{
[[NSUserDefaults standardUserDefaults]
@ -225,7 +247,6 @@
id doc;
BOOL edited = NO;
NSEnumerator *enumerator = [documents objectEnumerator];
if (isTesting == YES)
{
@ -233,7 +254,6 @@
return NO;
}
while (( doc = [enumerator nextObject] ) != nil )
{
if ([[doc window] isDocumentEdited] == YES)
@ -937,7 +957,6 @@
NSEnumerator *e;
id val;
// CREATE_AUTORELEASE_POOL(pool);
[nc postNotificationName: IBWillEndTestingInterfaceNotification
object: self];
@ -1001,42 +1020,14 @@
DESTROY(testingWindows);
// RELEASE(pool);
// deallocate top leve objects
// deallocate top level objects
RELEASE(topObjects);
return self;
}
}
- (void) finishLaunching
{
NSBundle *bundle;
NSString *path;
/*
* establish registration domain defaults from file.
*/
bundle = [NSBundle mainBundle];
path = [bundle pathForResource: @"Defaults" ofType: @"plist"];
if (path != nil)
{
NSDictionary *dict;
dict = [NSDictionary dictionaryWithContentsOfFile: path];
if (dict != nil)
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults registerDefaults: dict];
}
}
[self setDelegate: self];
[super finishLaunching];
}
- (void) handleNotification: (NSNotification*)notification
{
NSString *name = [notification name];

View file

@ -128,4 +128,9 @@ static unsigned int defaultStyleMask = NSTitledWindowMask | NSClosableWindowMask
[editor makeSelectionVisible: YES];
}
}
- (void) saveFrameUsingName: (NSString*)name
{
// do nothing...
}
@end

View file

@ -150,4 +150,9 @@ static unsigned int defaultStyleMask = NSTitledWindowMask | NSClosableWindowMask
[editor makeSelectionVisible: YES];
}
}
- (void) saveFrameUsingName: (NSString*)name
{
// do nothing...
}
@end

View file

@ -24,4 +24,7 @@
ShowPalettes = YES;
UserPalettes = (
);
"NSWindow Frame Inspector" = "663 15 274 452 0 0 960 768 ";
"NSWindow Frame Palettes" = "663 470 274 298 0 0 960 768 ";
"NSWindow Frame Preferences" = "336 200 352 368 0 0 960 768 ";
}