More filter stuff added

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17058 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2003-06-28 06:46:14 +00:00
parent baeae6ea50
commit 17d4b32bba
8 changed files with 276 additions and 184 deletions

View file

@ -1330,18 +1330,23 @@ GSPerformService(NSString *serviceItem, NSPasteboard *pboard, BOOL isFilter)
if (isFilter == YES)
{
service = [[manager filters] objectForKey: serviceItem];
if (service == nil)
{
NSLog(@"No service matching '%@'", serviceItem);
return NO; /* No matching service. */
}
}
else
{
service = [[manager menuServices] objectForKey: serviceItem];
}
if (service == nil)
{
NSRunAlertPanel(nil,
@"No service matching '%@'",
@"Continue", nil, nil,
serviceItem);
return NO; /* No matching service. */
if (service == nil)
{
NSRunAlertPanel(nil,
@"No service matching '%@'",
@"Continue", nil, nil,
serviceItem);
return NO; /* No matching service. */
}
}
port = [service objectForKey: @"NSPortName"];
@ -1358,6 +1363,10 @@ GSPerformService(NSString *serviceItem, NSPasteboard *pboard, BOOL isFilter)
appPath = [service objectForKey: @"ServicePath"];
userData = [service objectForKey: @"NSUserData"];
message = [service objectForKey: @"NSMessage"];
if (isFilter == YES && [message length] == 0)
{
message = [service objectForKey: @"NSFilter"];
}
selName = [message stringByAppendingString: @":userData:error:"];
/*
@ -1367,10 +1376,17 @@ GSPerformService(NSString *serviceItem, NSPasteboard *pboard, BOOL isFilter)
provider = GSContactApplication(appPath, port, finishBy);
if (provider == nil)
{
NSRunAlertPanel(nil,
@"Failed to contact service provider for '%@'",
@"Continue", nil, nil,
serviceItem);
if (isFilter == YES)
{
NSLog(@"Failed to contact service provider for '%@'", serviceItem);
}
else
{
NSRunAlertPanel(nil,
@"Failed to contact service provider for '%@'",
@"Continue", nil, nil,
serviceItem);
}
return NO;
}
@ -1406,10 +1422,18 @@ GSPerformService(NSString *serviceItem, NSPasteboard *pboard, BOOL isFilter)
if (error != nil)
{
NSRunAlertPanel(nil,
@"Failed to contact service provider for '%@': %@",
@"Continue", nil, nil,
serviceItem, error);
if (isFilter == YES)
{
NSLog(@"Failed to contact service provider for '%@': %@",
serviceItem, error);
}
else
{
NSRunAlertPanel(nil,
@"Failed to contact service provider for '%@': %@",
@"Continue", nil, nil,
serviceItem, error);
}
return NO;
}

View file

@ -971,7 +971,10 @@ static NSMapTable *mimeMap = NULL;
* pasteboard server using the -setData:forType: method.
* </p>
* <p>Data written using this method can be read by -propertyListForType:
* or, of it was a simple string, by -stringForType:
* or, if it was a simple string, by -stringForType:
* </p>
* <p>If the data is retrieved using -dataForType: then it needs to be
* deserialized into a property list.
* </p>
*/
- (BOOL) setPropertyList: (id)propertyList
@ -989,6 +992,9 @@ static NSMapTable *mimeMap = NULL;
* <p>The data may subsequently be read from the reciver using the
* -stringForType: or -propertyListForType: method.
* </p>
* <p>If the data is retrieved using -dataForType: then it needs to be
* deserialized into a property list.
* </p>
*/
- (BOOL) setString: (NSString*)string
forType: (NSString*)dataType
@ -1006,6 +1012,9 @@ static NSMapTable *mimeMap = NULL;
* <p>Data written to a pasteboard by this method should be read using
* the -readFileContentsType:toFile: or -readFileWrapper method.
* </p>
* <p>If the data is retrieved using -dataForType: then it needs to be
* deserialized by the NSFileWrapper class.
* </p>
*/
- (BOOL) writeFileContents: (NSString*)filename
{
@ -1062,6 +1071,9 @@ static NSMapTable *mimeMap = NULL;
* <p>Data written to a pasteboard by this method should be read using
* the -readFileContentsType:toFile: or -readFileWrapper method.
* </p>
* <p>If the data is retrieved using -dataForType: then it needs to be
* deserialized by the NSFileWrapper class.
* </p>
*/
- (BOOL) writeFileWrapper: (NSFileWrapper *)wrapper
{