mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-02-23 11:41:05 +00:00
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:
parent
fb898530c6
commit
985d7c9a41
2 changed files with 34 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue