mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-02-19 01:51:09 +00:00
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:
parent
62b5d849d3
commit
04d292688f
1 changed files with 13 additions and 1 deletions
|
@ -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];
|
||||
|
|
Loading…
Reference in a new issue