mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 02:41:01 +00:00
Minor fix in last mod.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@16406 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a4ace9f14b
commit
4261e94931
1 changed files with 27 additions and 18 deletions
|
@ -58,9 +58,7 @@
|
||||||
|
|
||||||
#include <AppKit/GSServicesManager.h>
|
#include <AppKit/GSServicesManager.h>
|
||||||
|
|
||||||
@interface NSDocumentController (ApplicationPrivate)
|
static GSServicesManager *manager = nil;
|
||||||
+ (BOOL) isDocumentBasedApplication;
|
|
||||||
@end
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The GSListener class is for talking to other applications.
|
* The GSListener class is for talking to other applications.
|
||||||
|
@ -227,6 +225,14 @@ NSRegisterServicesProvider(id provider, NSString *name)
|
||||||
if ([delegate respondsToSelector: aSel] == YES)
|
if ([delegate respondsToSelector: aSel] == YES)
|
||||||
return [delegate performv: aSel :frame];
|
return [delegate performv: aSel :frame];
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If the selector matches the correct form for a file operaqtion
|
||||||
|
* send the message to the manager.
|
||||||
|
*/
|
||||||
|
if ([selName hasPrefix: @"application:"] == YES
|
||||||
|
&& [manager respondsToSelector: aSel] == YES)
|
||||||
|
return [(id)manager performv: aSel :frame];
|
||||||
|
|
||||||
[NSException raise: NSGenericException
|
[NSException raise: NSGenericException
|
||||||
format: @"method %@ not implemented", selName];
|
format: @"method %@ not implemented", selName];
|
||||||
return nil;
|
return nil;
|
||||||
|
@ -258,6 +264,17 @@ NSRegisterServicesProvider(id provider, NSString *name)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If the selector matches the correct form for a file operaqtion
|
||||||
|
* send the message to the manager.
|
||||||
|
*/
|
||||||
|
if ([selName hasPrefix: @"application:"] == YES
|
||||||
|
&& [manager respondsToSelector: aSel] == YES)
|
||||||
|
{
|
||||||
|
[anInvocation invokeWithTarget: manager];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
[NSException raise: NSGenericException
|
[NSException raise: NSGenericException
|
||||||
format: @"method %@ not implemented", selName];
|
format: @"method %@ not implemented", selName];
|
||||||
}
|
}
|
||||||
|
@ -322,7 +339,6 @@ NSRegisterServicesProvider(id provider, NSString *name)
|
||||||
|
|
||||||
@implementation GSServicesManager
|
@implementation GSServicesManager
|
||||||
|
|
||||||
static GSServicesManager *manager = nil;
|
|
||||||
static NSString *servicesName = @".GNUstepServices";
|
static NSString *servicesName = @".GNUstepServices";
|
||||||
static NSString *disabledName = @".GNUstepDisabled";
|
static NSString *disabledName = @".GNUstepDisabled";
|
||||||
|
|
||||||
|
@ -390,19 +406,15 @@ static NSString *disabledName = @".GNUstepDisabled";
|
||||||
id del = [NSApp delegate];
|
id del = [NSApp delegate];
|
||||||
BOOL result = NO;
|
BOOL result = NO;
|
||||||
|
|
||||||
|
[NSApp activateIgnoringOtherApps: YES];
|
||||||
if ([del respondsToSelector: _cmd])
|
if ([del respondsToSelector: _cmd])
|
||||||
{
|
{
|
||||||
[NSApp activateIgnoringOtherApps: YES];
|
|
||||||
result = [del application: theApp openFile: file];
|
result = [del application: theApp openFile: file];
|
||||||
}
|
}
|
||||||
else if ([NSDocumentController isDocumentBasedApplication] == YES)
|
else if ([[NSDocumentController sharedDocumentController]
|
||||||
|
openDocumentWithContentsOfFile: file display: YES] != nil)
|
||||||
{
|
{
|
||||||
[NSApp activateIgnoringOtherApps: YES];
|
result = YES;
|
||||||
if ([[NSDocumentController sharedDocumentController]
|
|
||||||
openDocumentWithContentsOfFile: file display: YES] != nil)
|
|
||||||
{
|
|
||||||
result = YES;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -417,13 +429,10 @@ static NSString *disabledName = @".GNUstepDisabled";
|
||||||
{
|
{
|
||||||
result = [del application: theApp openFileWithoutUI: file];
|
result = [del application: theApp openFileWithoutUI: file];
|
||||||
}
|
}
|
||||||
else if ([NSDocumentController isDocumentBasedApplication] == YES)
|
else if ([[NSDocumentController sharedDocumentController]
|
||||||
|
openDocumentWithContentsOfFile: file display: NO] != nil)
|
||||||
{
|
{
|
||||||
if ([[NSDocumentController sharedDocumentController]
|
result = YES;
|
||||||
openDocumentWithContentsOfFile: file display: NO] != nil)
|
|
||||||
{
|
|
||||||
result = YES;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue