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:
rmottola 2012-08-07 14:05:51 +00:00
parent 9dbc0b0dfc
commit 6dc25f660a
3 changed files with 34 additions and 6 deletions

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
{