mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-03-19 00:51:51 +00:00
New DO code
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@7350 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e568aa4b2e
commit
d8da8ad908
1 changed files with 23 additions and 28 deletions
|
@ -153,35 +153,30 @@
|
|||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)notification
|
||||
{
|
||||
[logger logMessage:@"Loading additional subsystems..." tag:INFORMATION];
|
||||
NSString *h = [[NSProcessInfo processInfo] hostName];
|
||||
NSString *connectionName = [NSString stringWithFormat:@"ProjectCenter:%@",h];
|
||||
[logger logMessage:@"Loading additional subsystems..." tag:INFORMATION];
|
||||
|
||||
[bundleLoader loadBundles];
|
||||
|
||||
// The DO server
|
||||
doServer = [[PCServer alloc] init];
|
||||
|
||||
NS_DURING
|
||||
|
||||
doConnection = [[NSConnection alloc] init];
|
||||
[doConnection registerName:connectionName];
|
||||
|
||||
NS_HANDLER
|
||||
|
||||
NSRunAlertPanel(@"Warning!",@"Could not register the DO connection %@",@"OK",nil,nil,nil,connectionName);
|
||||
NS_ENDHANDLER
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:doServer selector:@selector(connectionDidDie:) name:NSConnectionDidDieNotification object:doConnection];
|
||||
|
||||
[doConnection setDelegate:doServer];
|
||||
|
||||
[bundleLoader loadBundles];
|
||||
|
||||
// The DO server
|
||||
doServer = [[PCServer alloc] init];
|
||||
|
||||
#if defined(GNUSTEP)
|
||||
NS_DURING
|
||||
doConnection = [NSConnection newRegisteringAtName:@"ProjectCenter" withRootObject:doServer];
|
||||
[logger logMessage:@"Successful initialisation of the DO connection 'ProjectCenter'." tag:INFORMATION];
|
||||
NS_HANDLER
|
||||
[logger logMessage:@"Could not initialise the DO connection 'ProjectCenter'!" tag:WARNING];
|
||||
NSRunAlertPanel(@"Warning!",@"Could not register the DO connection 'ProjectCenter'",@"OK",nil,nil,nil);
|
||||
NS_ENDHANDLER
|
||||
#else
|
||||
doConnection = [NSConnection defaultConnection];
|
||||
[doConnection setRootObject:doServer];
|
||||
if (![doConnection registerName:@"ProjectCenter"]) {
|
||||
[logger logMessage:@"Could not initialise the DO connection 'ProjectCenter'!" tag:WARNING];
|
||||
}
|
||||
else {
|
||||
[logger logMessage:@"Successful initialisation of the DO connection 'ProjectCenter'." tag:INFORMATION];
|
||||
}
|
||||
#endif
|
||||
[[NSNotificationCenter defaultCenter] addObserver:doServer selector:@selector(connectionDidDie:) name:NSConnectionDidDieNotification object:doConnection];
|
||||
[doConnection setDelegate:doServer];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:PCAppDidInitNotification object:nil];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:PCAppDidInitNotification object:nil];
|
||||
}
|
||||
|
||||
- (BOOL)applicationShouldTerminate:(id)sender
|
||||
|
|
Loading…
Reference in a new issue