implement openFiles: delegate

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35355 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Riccardo Mottola 2012-08-07 14:05:51 +00:00
parent fe24efe3d6
commit e431a592c8
3 changed files with 34 additions and 6 deletions

View file

@ -1,3 +1,9 @@
2012-08-06 Riccardo Mottola <rm@gnu.org>
* Source/NSApplication.m
* Source/GSServicesManager.m
Implement openFiles: delegate
2012-07-31 Wolfgang Lux <wolfgang.lux@gmail.com>
* Source/NSTextView_actions.m (-yank:): Don't call -insertText: at

View file

@ -591,6 +591,32 @@ static NSString *disabledName = @".GNUstepDisabled";
return result;
}
- (void) application: (NSApplication*)theApp
openFiles: (NSArray*)files
{
id del = [NSApp delegate];
if ([files count] == 1)
{
[self application: theApp openFile: [files objectAtIndex:0]];
}
else if ([del respondsToSelector: _cmd])
{
[del application: theApp openFiles: files];
}
else
{
NSString *filePath;
NSEnumerator *en = [files objectEnumerator];
while ((filePath = (NSString *)[en nextObject]) != nil)
{
[self application: theApp openFile: filePath];
}
}
}
- (BOOL) application: (NSApplication*)theApp
openFileWithoutUI: (NSString*)file
{

View file

@ -1120,12 +1120,7 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
if ((files = [self _openFiles]) != nil)
{
NSEnumerator *en = [files objectEnumerator];
while ((filePath = (NSString *)[en nextObject]) != nil)
{
[_listener application: self openFile: filePath];
}
[_listener application: self openFiles: files];
}
else if ((filePath = [defs stringForKey: @"GSFilePath"]) != nil
|| (filePath = [defs stringForKey: @"NSOpen"]) != nil)
@ -3555,6 +3550,7 @@ struct _DelegateWrapper
* <item>application:shouldTerminateAfterLastWindowClosed:</item>
* <item>application:shouldOpenUntitledFile:</item>
* <item>application:openFile:</item>
* <item>application:openFiles:</item>
* <item>application:openFileWithoutUI:</item>
* <item>application:openTempFile:</item>
* <item>application:openUntitledFile:</item>