opening files using the workspace now works a little bit better...

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@8492 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Robert Slover 2001-01-07 14:07:35 +00:00
parent 62b5d849d3
commit 04d292688f

View file

@ -56,7 +56,9 @@ NSString *FileShouldOpenNotification = @"FileShouldOpenNotification";
NSString *category = [[[browser path] componentsSeparatedByString:@"/"] objectAtIndex:1];
NSString *k = [[project rootCategories] objectForKey:category];
if ([k isEqualToString:PCClasses] || [k isEqualToString:PCHeaders] || [k isEqualToString:PCOtherSources]) {
if ([k isEqualToString:PCClasses] ||
[k isEqualToString:PCHeaders] ||
[k isEqualToString:PCOtherSources]) {
NSString *projectPath = [project projectPath];
NSString *fn = [self nameOfSelectedFile];
NSString *file = [projectPath stringByAppendingPathComponent:fn];
@ -65,6 +67,16 @@ NSString *FileShouldOpenNotification = @"FileShouldOpenNotification";
[[NSNotificationCenter defaultCenter] postNotificationName:FileShouldOpenNotification object:self userInfo:ui];
}
else {
NSString *fi;
NSString *sf = [self nameOfSelectedFile];
fi = [[project projectPath] stringByAppendingPathComponent:sf];
if([[NSWorkspace sharedWorkspace] openFile:fi] == NO) {
NSRunAlertPanel(@"Attention!",@"Could not open %@.",@"OK",nil,nil,fi);
}
}
}
else {
[[PCFileManager fileManager] showAddFileWindow];