git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4997 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 1999-10-12 18:43:57 +00:00
parent 1334dec400
commit 0e1e8d6ffa
2 changed files with 16 additions and 18 deletions

View file

@ -61,6 +61,7 @@
#include <AppKit/NSMenu.h>
#include <AppKit/NSMenuItem.h>
#include <AppKit/NSCursor.h>
#include <AppKit/NSWorkspace.h>
#include <AppKit/GSServicesManager.h>
#include <AppKit/IMLoading.h>
#include <AppKit/DPSOperators.h>
@ -173,6 +174,7 @@ NSApplication *NSApp = nil;
NSString *appIconFile;
NSUserDefaults *defs = [NSUserDefaults standardUserDefaults];
NSString *filePath;
NSDictionary *userInfo;
mainModelFile = [infoDict objectForKey: @"NSMainNibFile"];
if (mainModelFile && ![mainModelFile isEqual: @""])
@ -238,6 +240,13 @@ NSApplication *NSApp = nil;
[[NSDocumentController sharedDocumentController] openDocumentWithContentsOfFile:filePath display:YES];
}
}
userInfo = [NSDictionary dictionaryWithObject:
[[NSProcessInfo processInfo] processName] forKey: @"NSApplicationName"];
[[[NSWorkspace sharedWorkspace] notificationCenter]
postNotificationName: NSWorkspaceDidLaunchApplicationNotification
object: self
userInfo: userInfo];
}
- (void) dealloc

View file

@ -597,7 +597,6 @@ extIconForApp(NSWorkspace *ws, NSString *appName, NSDictionary *typeInfo)
{
NSString *port = [appName stringByDeletingPathExtension];
id app = nil;
NSDictionary *userinfo = nil;
/*
* Try to contact a running application.
@ -617,6 +616,7 @@ extIconForApp(NSWorkspace *ws, NSString *appName, NSDictionary *typeInfo)
{
NSString *path;
NSArray *args;
NSDictionary *userinfo = nil;
path = [self locateApplicationBinary: appName];
if (path == nil)
@ -628,10 +628,10 @@ extIconForApp(NSWorkspace *ws, NSString *appName, NSDictionary *typeInfo)
return NO;
}
userinfo = [NSDictionary dictionaryWithObject: appName
forKey: @"NSApplicationName"];
// App being launched, raise NSWorkspaceWillLaunchApplicationNotification
userinfo = [NSDictionary dictionaryWithObject: port
forKey: @"NSApplicationName"];
[workspaceCenter
postNotificationName: NSWorkspaceWillLaunchApplicationNotification
object: self
@ -647,11 +647,6 @@ extIconForApp(NSWorkspace *ws, NSString *appName, NSDictionary *typeInfo)
return NO;
}
[workspaceCenter
postNotificationName: NSWorkspaceDidLaunchApplicationNotification
object: self
userInfo: userinfo];
return YES;
}
else
@ -959,10 +954,10 @@ inFileViewerRootedAtPath: (NSString *)rootFullpath
if (path == nil)
return NO;
userinfo = [NSDictionary dictionaryWithObject: appName
forKey: @"NSApplicationName"];
// App being launched, raise NSWorkspaceWillLaunchApplicationNotification
userinfo = [NSDictionary dictionaryWithObject:
[[appName lastPathComponent] stringByDeletingPathExtension]
forKey: @"NSApplicationName"];
[workspaceCenter
postNotificationName: NSWorkspaceWillLaunchApplicationNotification
object: self
@ -971,12 +966,6 @@ inFileViewerRootedAtPath: (NSString *)rootFullpath
if ([NSTask launchedTaskWithLaunchPath: path arguments: nil] == nil)
return NO;
// App has been launched raise NSWorkspaceDidLaunchApplicationNotification
[workspaceCenter
postNotificationName: NSWorkspaceDidLaunchApplicationNotification
object: self
userInfo: userinfo];
return YES;
}