Document close fixes.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17688 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2003-09-20 03:07:55 +00:00
parent 50ed66958a
commit 1d187a4550
3 changed files with 29 additions and 14 deletions

View file

@ -2304,6 +2304,8 @@ resetCursorRectsForView(NSView *theView)
- (void) performClose: (id)sender
{
NSDocument *document = [_windowController document];
/* Don't close if a modal session is running and we are not the
modal window */
if ([NSApp modalWindow] && self != [NSApp modalWindow])
@ -2318,8 +2320,6 @@ resetCursorRectsForView(NSView *theView)
if (_windowController)
{
NSDocument *document = [_windowController document];
if (document && ![document shouldCloseWindowController: _windowController])
{
NSBeep();
@ -2355,7 +2355,14 @@ resetCursorRectsForView(NSView *theView)
}
// FIXME: The button should be highlighted
[self close];
if (document)
{
[document close];
}
else
{
[self close];
}
}
- (BOOL) performKeyEquivalent: (NSEvent*)theEvent