Corrected calls to NSRunAlertPanel

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@20464 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2004-12-18 15:06:18 +00:00
parent 57ffd597ea
commit c08135357b
6 changed files with 59 additions and 44 deletions

View file

@ -1,3 +1,12 @@
2004-12-18 10:05 Gregory John Casamento <greg_casamento@yahoo.com>
* GormDocument.m:
* GormFilesOwner.m:
* Gorm.m:
* GormPalettesManager.m:
* GormWindowEditor.m: Changed NSRunAlertPanel(...) calls
to use nil instead of NULL. NULL shouldn't be used.
2004-12-18 08:53 Gregory John Casamento <greg_casamento@yahoo.com>
* GormLib/GNUmakefile: Added new header

12
Gorm.m
View file

@ -331,7 +331,7 @@ static NSImage *testingImage = nil;
{
NSRunAlertPanel(_(@"Incorrect GNUstep Version"),
_(@"The version of GNUstep you are using is too old for this version of Gorm, please update."),
_(@"OK"), NULL, NULL);
_(@"OK"), nil, nil);
[self terminate: self];
}
}
@ -373,7 +373,7 @@ static NSImage *testingImage = nil;
if (edited == YES)
{
int result;
result = NSRunAlertPanel(NULL, _(@"There are edited windows"),
result = NSRunAlertPanel(nil, _(@"There are edited windows"),
_(@"Review Unsaved"),_( @"Quit Anyway"), _(@"Cancel"));
if (result == NSAlertDefaultReturn)
{
@ -801,9 +801,11 @@ static NSImage *testingImage = nil;
// reset the application after the error.
NSLog(@"Error while testing interface: %@",
[localException reason]);
NSRunAlertPanel(_(@"An Error Occurred"), [NSString stringWithFormat: @"Problem testing interface. Make sure connections are to appropriate objects. Exception: %@",
[localException reason]],
_(@"OK"), NULL, NULL);
NSRunAlertPanel(_(@"An Error Occurred"),
[NSString stringWithFormat:
@"Problem testing interface. Make sure connections are to appropriate objects. Exception: %@",
[localException reason]],
_(@"OK"), nil, nil);
[self endTesting: self];
}
NS_ENDHANDLER;

View file

@ -1607,6 +1607,10 @@ static NSImage *fileImage = nil;
NSEnumerator *en = [[nameTable allKeys] objectEnumerator];
NSString *key = nil;
NSRunAlertPanel(_(@"Warning"),
_(@"You are running with 'GormRepairFileOnLoad' set to YES."),
nil, nil, nil);
while((key = [en nextObject]) != nil)
{
id obj = [nameTable objectForKey: key];
@ -1701,9 +1705,9 @@ static NSImage *fileImage = nil;
if([lastComponent isEqual: @"objects.gorm"] &&
[parentExt isEqual: @"gorm"])
{
NSRunAlertPanel(NULL,
NSRunAlertPanel(nil,
_(@"Cannot load directly from objects.gorm file, please load from the gorm package."),
@"OK", NULL, NULL);
@"OK", nil, nil);
return nil;
}
@ -1728,9 +1732,9 @@ static NSImage *fileImage = nil;
// check the data...
if (data == nil)
{
NSRunAlertPanel(NULL,
NSRunAlertPanel(nil,
[NSString stringWithFormat: @"Could not read '%@' data", aFile],
@"OK", NULL, NULL);
@"OK", nil, nil);
return nil;
}
@ -1769,8 +1773,8 @@ static NSImage *fileImage = nil;
c = [u decodeObject];
if (c == nil || [c isKindOfClass: [GSNibContainer class]] == NO)
{
NSRunAlertPanel(NULL, _(@"Could not unarchive document data"),
_(@"OK"), NULL, NULL);
NSRunAlertPanel(nil, _(@"Could not unarchive document data"),
_(@"OK"), nil, nil);
return nil;
}
[GSClassSwapper setIsInInterfaceBuilder: NO]; // turn on custom classes.
@ -1795,9 +1799,9 @@ static NSImage *fileImage = nil;
s = [s stringByAppendingPathExtension: @"classes"];
if (![classManager loadCustomClasses: s])
{
NSRunAlertPanel(NULL, _(@"Could not open the associated classes file.\n"
NSRunAlertPanel(nil, _(@"Could not open the associated classes file.\n"
@"You won't be able to edit connections on custom classes"),
_(@"OK"), NULL, NULL);
_(@"OK"), nil, nil);
}
}
else
@ -1807,9 +1811,9 @@ static NSImage *fileImage = nil;
s = [aFile stringByAppendingPathComponent: @"data.classes"];
if (![classManager loadCustomClasses: s])
{
NSRunAlertPanel(NULL, _(@"Could not open the associated classes file.\n"
NSRunAlertPanel(nil, _(@"Could not open the associated classes file.\n"
@"You won't be able to edit connections on custom classes"),
_(@"OK"), NULL, NULL);
_(@"OK"), nil, nil);
}
s = [aFile stringByAppendingPathComponent: @"data.info"];
@ -1828,8 +1832,8 @@ static NSImage *fileImage = nil;
_(@"The file being loaded was created with a newer build, continue?"),
_(@"OK"),
_(@"Cancel"),
NULL,
NULL);
nil,
nil);
if(retval != NSAlertDefaultReturn)
{
return nil;
@ -1997,8 +2001,8 @@ static NSImage *fileImage = nil;
}
NS_HANDLER
{
NSRunAlertPanel(NULL, [NSString stringWithFormat: @"Failed to load file. Exception: %@",[localException reason]],
_(@"OK"), NULL, NULL);
NSRunAlertPanel(nil, [NSString stringWithFormat: @"Failed to load file. Exception: %@",[localException reason]],
_(@"OK"), nil, nil);
return nil; // This will cause the calling method to release the document.
}
NS_ENDHANDLER
@ -2083,8 +2087,8 @@ static NSImage *fileImage = nil;
else
{
// if we get this far, we didn't succeed..
NSRunAlertPanel(NULL,_( @"Attempted to load a model which is already opened."),
_(@"OK"), NULL, NULL);
NSRunAlertPanel(nil,_( @"Attempted to load a model which is already opened."),
_(@"OK"), nil, nil);
}
}
@ -2840,8 +2844,8 @@ static NSImage *fileImage = nil;
if (archiveResult == NO)
{
NSRunAlertPanel(NULL,_( @"Could not save document"),
_(@"OK"), NULL, NULL);
NSRunAlertPanel(nil,_( @"Could not save document"),
_(@"OK"), nil, nil);
}
else
{
@ -3044,7 +3048,7 @@ static NSImage *fileImage = nil;
msg = [NSString stringWithFormat: _(@"Document '%@' has been modified"),
[documentPath lastPathComponent]];
}
result = NSRunAlertPanel(NULL, msg, _(@"Save"), _(@"Don't Save"), _(@"Cancel"));
result = NSRunAlertPanel(nil, msg, _(@"Save"), _(@"Don't Save"), _(@"Cancel"));
if (result == NSAlertDefaultReturn)
{

View file

@ -215,8 +215,8 @@
NSDebugLog(@"Selected %d, %@", [browser selectedRowInColumn: 0], title);
if (hasConnections > 0 && [title isEqual: [object className]] == NO)
{
if (NSRunAlertPanel(0, _(@"This operation will break existing connection"),
_(@"OK"), _(@"Cancel"), NULL) != NSAlertDefaultReturn)
if (NSRunAlertPanel(nil, _(@"This operation will break existing connection"),
_(@"OK"), _(@"Cancel"), nil) != NSAlertDefaultReturn)
{
unsigned pos = [classes indexOfObject: [object className]];

View file

@ -186,8 +186,8 @@ static NSImage *dragImage = nil;
if (active == nil)
{
NSRunAlertPanel (NULL, _(@"No document is currently active"),
_(@"OK"), NULL, NULL);
NSRunAlertPanel (nil, _(@"No document is currently active"),
_(@"OK"), nil, nil);
return;
}
@ -376,56 +376,56 @@ static NSImage *dragImage = nil;
bundle = [bundles objectAtIndex: col];
if ([path isEqualToString: [bundle bundlePath]] == YES)
{
NSRunAlertPanel (NULL, _(@"Palette has already been loaded"),
_(@"OK"), NULL, NULL);
NSRunAlertPanel (nil, _(@"Palette has already been loaded"),
_(@"OK"), nil, nil);
return NO;
}
}
bundle = [NSBundle bundleWithPath: path];
if (bundle == nil)
{
NSRunAlertPanel(NULL, _(@"Could not load Palette"),
_(@"OK"), NULL, NULL);
NSRunAlertPanel(nil, _(@"Could not load Palette"),
_(@"OK"), nil, nil);
return NO;
}
path = [bundle pathForResource: @"palette" ofType: @"table"];
if (path == nil)
{
NSRunAlertPanel(NULL, _(@"File 'palette.table' missing"),
_(@"OK"), NULL, NULL);
NSRunAlertPanel(nil, _(@"File 'palette.table' missing"),
_(@"OK"), nil, nil);
return NO;
}
paletteInfo = [[NSString stringWithContentsOfFile: path] propertyList];
if (paletteInfo == nil)
{
NSRunAlertPanel(NULL, _(@"Failed to load 'palette.table', you may need to update GNUstep-make and do a clean build of Gorm and it's palettes."),
_(@"OK"), NULL, NULL);
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);
return NO;
}
className = [paletteInfo objectForKey: @"Class"];
if (className == nil)
{
NSRunAlertPanel(NULL, _(@"No palette class in 'palette.table'"),
_(@"OK"), NULL, NULL);
NSRunAlertPanel(nil, _(@"No palette class in 'palette.table'"),
_(@"OK"), nil, nil);
return NO;
}
paletteClass = [bundle classNamed: className];
if (paletteClass == 0)
{
NSRunAlertPanel (NULL, _(@"Could not load palette class"),
_(@"OK"), NULL, NULL);
NSRunAlertPanel (nil, _(@"Could not load palette class"),
_(@"OK"), nil, nil);
return NO;
}
palette = [paletteClass new];
if ([palette isKindOfClass: [IBPalette class]] == NO)
{
NSRunAlertPanel (NULL, _(@"Palette contains wrong type of class"),
_(@"OK"), NULL, NULL);
NSRunAlertPanel (nil, _(@"Palette contains wrong type of class"),
_(@"OK"), nil, nil);
RELEASE(palette);
return NO;
}

View file

@ -277,8 +277,8 @@
if(f == NO)
{
NSRunAlertPanel(NULL, _(@"Window drag failed."),
_(@"OK"), NULL, NULL);
NSRunAlertPanel(nil, _(@"Window drag failed."),
_(@"OK"), nil, nil);
}
}