mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-03-17 08:01:24 +00:00
* Framework/PCProjectBrowser.m: (doubleClick:): open file with
external application only if NSWorkspace doesn't return "ProjectCenter.app" appliction name. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@25958 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
55e1d65d65
commit
d2852f9571
2 changed files with 32 additions and 13 deletions
|
@ -1,3 +1,9 @@
|
|||
2008-01-17 Sergii Stoian <stoyan255@gmail.com>
|
||||
|
||||
* Framework/PCProjectBrowser.m: (doubleClick:): open file with
|
||||
external application only if NSWorkspace doesn't return
|
||||
"ProjectCenter.app" appliction name.
|
||||
|
||||
2008-01-16 Sergii Stoian <stoyan255@gmail.com>
|
||||
|
||||
* GNUmakefile: Remove FileRTF.tiff from resoures.
|
||||
|
|
|
@ -395,14 +395,17 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification";
|
|||
|
||||
- (void)doubleClick:(id)sender
|
||||
{
|
||||
id selectedCell;
|
||||
NSString *category;
|
||||
NSString *fileName;
|
||||
PCProject *activeProject;
|
||||
NSString *key;
|
||||
NSString *filePath;
|
||||
id selectedCell;
|
||||
NSString *category;
|
||||
NSString *fileName;
|
||||
PCProject *activeProject;
|
||||
NSString *key;
|
||||
NSString *filePath;
|
||||
NSWorkspace *workspace;
|
||||
NSString *appName, *type;
|
||||
|
||||
if (sender != browser)
|
||||
if ((sender != browser) ||
|
||||
[[self nameOfSelectedCategory] isEqualToString:@"Libraries"])
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -418,13 +421,23 @@ NSString *PCBrowserDidSetPathNotification = @"PCBrowserDidSetPathNotification";
|
|||
{
|
||||
/* PCLogInfo(self, @"{doubleClick} filePath: %@", filePath);*/
|
||||
|
||||
if (![[self nameOfSelectedCategory] isEqualToString:@"Libraries"])
|
||||
workspace = [NSWorkspace sharedWorkspace];
|
||||
[workspace getInfoForFile:filePath application:&appName type:&type];
|
||||
// NSLog (@"Open file: %@ with app: %@", filePath, appName);
|
||||
|
||||
// If 'Editor' role was set in .GNUstepExtPrefs application
|
||||
// name will be returned according that setting. Otherwise
|
||||
// 'ProjectCenter.app' will be returned accoring to NSTypes
|
||||
// from Info-gnustep.plist file of PC.
|
||||
if (appName == nil ||
|
||||
[appName isEqualToString:@"ProjectCenter.app"])
|
||||
{
|
||||
if ([[NSWorkspace sharedWorkspace] openFile:filePath] == NO)
|
||||
{
|
||||
[[project projectEditor] openEditorForCategoryPath:[browser path]
|
||||
windowed:YES];
|
||||
}
|
||||
[[project projectEditor] openEditorForCategoryPath:[browser path]
|
||||
windowed:YES];
|
||||
}
|
||||
else
|
||||
{
|
||||
[workspace openFile:filePath];
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue