[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:
FredKiefer 2001-12-01 21:15:27 +00:00
parent 898bec3810
commit 71d0c24c41

View file

@ -533,6 +533,7 @@ static NSCell* tileCell = nil;
NSString *mainModelFile; NSString *mainModelFile;
NSString *appIconFile; NSString *appIconFile;
NSUserDefaults *defs = [NSUserDefaults standardUserDefaults]; NSUserDefaults *defs = [NSUserDefaults standardUserDefaults];
NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
NSString *filePath; NSString *filePath;
NSDictionary *userInfo; NSDictionary *userInfo;
NSArray *windows_list; NSArray *windows_list;
@ -653,6 +654,7 @@ static NSCell* tileCell = nil;
} }
else else
{ {
// FIXME: Should remember that this is a temp file
[[NSDocumentController sharedDocumentController] [[NSDocumentController sharedDocumentController]
openDocumentWithContentsOfFile: filePath display: YES]; openDocumentWithContentsOfFile: filePath display: YES];
} }
@ -666,9 +668,9 @@ static NSCell* tileCell = nil;
userInfo = [NSDictionary dictionaryWithObject: userInfo = [NSDictionary dictionaryWithObject:
[[NSProcessInfo processInfo] processName] forKey: @"NSApplicationName"]; [[NSProcessInfo processInfo] processName] forKey: @"NSApplicationName"];
NS_DURING NS_DURING
[[[NSWorkspace sharedWorkspace] notificationCenter] [[workspace notificationCenter]
postNotificationName: NSWorkspaceDidLaunchApplicationNotification postNotificationName: NSWorkspaceDidLaunchApplicationNotification
object: self object: workspace
userInfo: userInfo]; userInfo: userInfo];
NS_HANDLER NS_HANDLER
NSLog(@"Problem during launch app notification: %@", NSLog(@"Problem during launch app notification: %@",
@ -2170,7 +2172,8 @@ IF_NO_GC(NSAssert([event retainCount] > 0, NSInternalInconsistencyException));
if (shouldTerminate) if (shouldTerminate)
{ {
NSDictionary *userInfo; NSDictionary *userInfo;
NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
[nc postNotificationName: NSApplicationWillTerminateNotification [nc postNotificationName: NSApplicationWillTerminateNotification
object: self]; object: self];
@ -2182,9 +2185,9 @@ IF_NO_GC(NSAssert([event retainCount] > 0, NSInternalInconsistencyException));
// Tell the Workspace that we really did terminate // Tell the Workspace that we really did terminate
userInfo = [NSDictionary dictionaryWithObject: userInfo = [NSDictionary dictionaryWithObject:
[[NSProcessInfo processInfo] processName] forKey: @"NSApplicationName"]; [[NSProcessInfo processInfo] processName] forKey: @"NSApplicationName"];
[[[NSWorkspace sharedWorkspace] notificationCenter] [[workspace notificationCenter]
postNotificationName: NSWorkspaceDidTerminateApplicationNotification postNotificationName: NSWorkspaceDidTerminateApplicationNotification
object: self object: workspace
userInfo: userInfo]; userInfo: userInfo];
// Free the memory of self // Free the memory of self
DESTROY(NSApp); DESTROY(NSApp);