Fixed bug which was causing NSOKButton to be returned on abort.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5425 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 1999-12-09 04:58:20 +00:00
parent aa695d88db
commit 14b72cfc87

View file

@ -524,7 +524,17 @@ static BOOL _gs_display_reading_progress = NO;
[[_form cellAtIndex: 0] setStringValue: filename];
[_form setNeedsDisplay: YES];
return [NSApp runModalForWindow: self];
// We need to take care of the possibility of
// the panel being aborted. We return NSCancelButton
// in that case.
_OKButtonPressed = NO;
[NSApp runModalForWindow: self];
if (_OKButtonPressed)
return NSOKButton;
else
return NSCancelButton;
}
- (NSString *) directory
@ -557,7 +567,7 @@ static BOOL _gs_display_reading_progress = NO;
{
_fullFileName = nil;
_directory = nil;
[NSApp stopModalWithCode: NSCancelButton];
[NSApp stopModal];
[self close];
}
@ -567,7 +577,8 @@ static BOOL _gs_display_reading_progress = NO;
if (![_delegate panel:self isValidFilename: [self filename]])
return;
[NSApp stopModalWithCode: NSOKButton];
_OKButtonPressed = YES;
[NSApp stopModal];
[self close];
}