mirror of
https://github.com/nzbget/nzbget.git
synced 2025-12-23 22:27:45 -05:00
#181: show first script directory in OS X app
If option “ScriptDir” contains multiple paths the menu command “Show in Finder -> Scripts” of OS X application shows the first path contained in option (instead of failing).
This commit is contained in:
@@ -410,6 +410,8 @@ void InstallSignalHandlers()
|
||||
range:NSMakeRange(0, [dir length])];
|
||||
}
|
||||
|
||||
dir = [[dir componentsSeparatedByCharactersInSet: [NSCharacterSet characterSetWithCharactersInString:@";,"]] objectAtIndex:0];
|
||||
|
||||
if (dir.length == 0 || ![[NSFileManager defaultManager] fileExistsAtPath:dir]) {
|
||||
[NSApp activateIgnoringOtherApps:TRUE];
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
@@ -418,7 +420,7 @@ void InstallSignalHandlers()
|
||||
[alert runModal];
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
[[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:@[[NSURL fileURLWithPath:dir isDirectory:YES]]];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user