mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-29 21:27:40 +00:00
Added NSWindowController and the NSDocument* classes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4868 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
33dbd8054f
commit
dd6369058e
12 changed files with 1841 additions and 2 deletions
|
@ -52,6 +52,7 @@
|
|||
|
||||
#include <AppKit/NSGraphicsContext.h>
|
||||
#include <AppKit/NSApplication.h>
|
||||
#include <AppKit/NSDocumentController.h>
|
||||
#include <AppKit/NSPopUpButton.h>
|
||||
#include <AppKit/NSPasteboard.h>
|
||||
#include <AppKit/NSPanel.h>
|
||||
|
@ -217,6 +218,10 @@ NSApplication *NSApp = nil;
|
|||
{
|
||||
[delegate application: self openFile: filePath];
|
||||
}
|
||||
else
|
||||
{
|
||||
[[NSDocumentController sharedDocumentController] openDocumentWithContentsOfFile:filePath display:YES];
|
||||
}
|
||||
}
|
||||
else if ((filePath = [defs stringForKey: @"GSTempPath"]) != nil)
|
||||
{
|
||||
|
@ -224,6 +229,10 @@ NSApplication *NSApp = nil;
|
|||
{
|
||||
[delegate application: self openTempFile: filePath];
|
||||
}
|
||||
else
|
||||
{
|
||||
[[NSDocumentController sharedDocumentController] openDocumentWithContentsOfFile:filePath display:YES];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1448,6 +1457,9 @@ NSAssert([event retainCount] > 0, NSInternalInconsistencyException);
|
|||
|
||||
if ([delegate respondsToSelector: @selector(applicationShouldTerminate:)])
|
||||
shouldTerminate = [delegate applicationShouldTerminate: sender];
|
||||
else
|
||||
shouldTerminate = [[NSDocumentController sharedDocumentController] reviewUnsavedDocumentsWithAlertTitle:@"Quit" cancellable:YES];
|
||||
|
||||
if (shouldTerminate)
|
||||
{
|
||||
app_should_quit = YES;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue