Enhancement to allow loading of older palettes.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@20500 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2004-12-28 21:37:44 +00:00
parent fb898530c6
commit 985d7c9a41
2 changed files with 34 additions and 4 deletions

View file

@ -1,3 +1,9 @@
2004-12-28 16:38 Gregory John Casamento <greg_casamento@yahoo.com>
* GormPalettesManager.m: Enhancment in loadPalette: to allow
loading using either the plist or the strings format for
palette.table.
2004-12-28 12:10 Gregory John Casamento <greg_casamento@yahoo.com>
* Palettes/1Windows/GormNSPanel.m

View file

@ -397,13 +397,37 @@ static NSImage *dragImage = nil;
return NO;
}
paletteInfo = [[NSString stringWithContentsOfFile: path] propertyList];
if (paletteInfo == nil)
// attempt to load the palette table in either the strings or plist format.
NS_DURING
{
NSRunAlertPanel(nil, _(@"Failed to load 'palette.table', you may need to update GNUstep-make and do a clean build of Gorm and it's palettes."),
_(@"OK"), nil, nil);
paletteInfo = [[NSString stringWithContentsOfFile: path] propertyList];
if (paletteInfo == nil)
{
paletteInfo = [[NSString stringWithContentsOfFile: path] propertyListFromStringsFileFormat];
if(paletteInfo == nil)
{
NSRunAlertPanel(_(@"Problem Loading Palette"),
_(@"Failed to load 'palette.table' using strings or property list format."),
_(@"OK"),
nil,
nil);
return NO;
}
}
}
NS_HANDLER
{
NSString *message = [NSString stringWithFormat:
_(@"Encountered exception %@ attempting to load 'palette.table'."),
[localException reason]];
NSRunAlertPanel(_(@"Problem Loading Palette"),
message,
_(@"OK"),
nil,
nil);
return NO;
}
NS_ENDHANDLER
className = [paletteInfo objectForKey: @"Class"];
if (className == nil)