mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 20:01:11 +00:00
[finishLaunching] and [terminate:] send workspace notification
with the shared workspace as object. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@11592 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4229cb0b79
commit
5e5c0b1156
1 changed files with 8 additions and 5 deletions
|
@ -533,6 +533,7 @@ static NSCell* tileCell = nil;
|
|||
NSString *mainModelFile;
|
||||
NSString *appIconFile;
|
||||
NSUserDefaults *defs = [NSUserDefaults standardUserDefaults];
|
||||
NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
|
||||
NSString *filePath;
|
||||
NSDictionary *userInfo;
|
||||
NSArray *windows_list;
|
||||
|
@ -653,6 +654,7 @@ static NSCell* tileCell = nil;
|
|||
}
|
||||
else
|
||||
{
|
||||
// FIXME: Should remember that this is a temp file
|
||||
[[NSDocumentController sharedDocumentController]
|
||||
openDocumentWithContentsOfFile: filePath display: YES];
|
||||
}
|
||||
|
@ -666,9 +668,9 @@ static NSCell* tileCell = nil;
|
|||
userInfo = [NSDictionary dictionaryWithObject:
|
||||
[[NSProcessInfo processInfo] processName] forKey: @"NSApplicationName"];
|
||||
NS_DURING
|
||||
[[[NSWorkspace sharedWorkspace] notificationCenter]
|
||||
[[workspace notificationCenter]
|
||||
postNotificationName: NSWorkspaceDidLaunchApplicationNotification
|
||||
object: self
|
||||
object: workspace
|
||||
userInfo: userInfo];
|
||||
NS_HANDLER
|
||||
NSLog(@"Problem during launch app notification: %@",
|
||||
|
@ -2170,7 +2172,8 @@ IF_NO_GC(NSAssert([event retainCount] > 0, NSInternalInconsistencyException));
|
|||
|
||||
if (shouldTerminate)
|
||||
{
|
||||
NSDictionary *userInfo;
|
||||
NSDictionary *userInfo;
|
||||
NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
|
||||
|
||||
[nc postNotificationName: NSApplicationWillTerminateNotification
|
||||
object: self];
|
||||
|
@ -2182,9 +2185,9 @@ IF_NO_GC(NSAssert([event retainCount] > 0, NSInternalInconsistencyException));
|
|||
// Tell the Workspace that we really did terminate
|
||||
userInfo = [NSDictionary dictionaryWithObject:
|
||||
[[NSProcessInfo processInfo] processName] forKey: @"NSApplicationName"];
|
||||
[[[NSWorkspace sharedWorkspace] notificationCenter]
|
||||
[[workspace notificationCenter]
|
||||
postNotificationName: NSWorkspaceDidTerminateApplicationNotification
|
||||
object: self
|
||||
object: workspace
|
||||
userInfo: userInfo];
|
||||
// Free the memory of self
|
||||
DESTROY(NSApp);
|
||||
|
|
Loading…
Reference in a new issue