summaryrefslogtreecommitdiffstats
path: root/macosx/HBSubtitlesController.m
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2019-01-15 14:26:33 +0100
committerDamiano Galassi <[email protected]>2019-01-15 14:26:33 +0100
commit8fcde66f6ae16352e8473a35d5b87cd4482e70e7 (patch)
tree207e5a76d09a219d40b9b944bb689377657e58b3 /macosx/HBSubtitlesController.m
parent89742d0c72d8cfe67f9236f0361e606cf5fab8ae (diff)
MacGui: support SSA file import.
Diffstat (limited to 'macosx/HBSubtitlesController.m')
-rw-r--r--macosx/HBSubtitlesController.m20
1 files changed, 10 insertions, 10 deletions
diff --git a/macosx/HBSubtitlesController.m b/macosx/HBSubtitlesController.m
index 623f3053a..b9c88e940 100644
--- a/macosx/HBSubtitlesController.m
+++ b/macosx/HBSubtitlesController.m
@@ -70,14 +70,14 @@
}];
}
-#pragma mark - Srt import
+#pragma mark - External subtitles import
/**
- * Imports a srt file.
+ * Imports a srt/ssa file.
*
* @param sender
*/
-- (IBAction)browseImportSrtFile:(id)sender
+- (IBAction)browseImportExternalFile:(id)sender
{
NSOpenPanel *panel = [NSOpenPanel openPanel];
panel.allowsMultipleSelection = NO;
@@ -85,9 +85,9 @@
panel.canChooseDirectories = NO;
NSURL *sourceDirectory;
- if ([[NSUserDefaults standardUserDefaults] URLForKey:@"LastSrtImportDirectoryURL"])
+ if ([[NSUserDefaults standardUserDefaults] URLForKey:@"LastExternalSubImportDirectoryURL"])
{
- sourceDirectory = [[NSUserDefaults standardUserDefaults] URLForKey:@"LastSrtImportDirectoryURL"];
+ sourceDirectory = [[NSUserDefaults standardUserDefaults] URLForKey:@"LastExternalSubImportDirectoryURL"];
}
else
{
@@ -95,17 +95,17 @@
}
panel.directoryURL = sourceDirectory;
- panel.allowedFileTypes = @[@"srt"];
+ panel.allowedFileTypes = @[@"srt", @"ssa", @"ass"];
[panel beginSheetModalForWindow:self.view.window completionHandler:^(NSInteger result)
{
if (result == NSModalResponseOK)
{
- NSURL *importSrtFileURL = panel.URL;
- NSURL *importSrtDirectory = importSrtFileURL.URLByDeletingLastPathComponent;
- [[NSUserDefaults standardUserDefaults] setURL:importSrtDirectory forKey:@"LastSrtImportDirectoryURL"];
+ NSURL *importFileURL = panel.URL;
+ NSURL *importDirectory = importFileURL.URLByDeletingLastPathComponent;
+ [[NSUserDefaults standardUserDefaults] setURL:importDirectory forKey:@"LastExternalSubImportDirectoryURL"];
- [self.subtitles addSrtTrackFromURL:importSrtFileURL];
+ [self.subtitles addExternalTrackFromURL:importFileURL];
}
}];
}