Fix .txt import not working.
This commit is contained in:
1 parent
31280c4f41
commit
b6c5407917
1 file changed
+7
-4
@@ -768,13 +768,16 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
|
|||||||
panel.canChooseDirectories = NO;
|
panel.canChooseDirectories = NO;
|
||||||
|
|
||||||
MP42ChapterTrack *chapters = self.mp4.chapters;
|
MP42ChapterTrack *chapters = self.mp4.chapters;
|
||||||
|
|
||||||
|
NSMutableArray<NSString *> *supportedFileFormats = [[MP42FileImporter supportedFileFormats] mutableCopy];
|
||||||
|
[supportedFileFormats addObject:@"txt"];
|
||||||
|
|
||||||
if (chapters) {
|
if (chapters) {
|
||||||
panel.allowedFileTypes = [[MP42FileImporter supportedFileFormats] arrayByAddingObject:@"csv"];
|
[supportedFileFormats addObject:@"csv"];
|
||||||
}
|
|
||||||
else {
|
|
||||||
panel.allowedFileTypes = [MP42FileImporter supportedFileFormats];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
panel.allowedFileTypes = supportedFileFormats;
|
||||||
|
|
||||||
[panel beginSheetModalForWindow:documentWindow completionHandler:^(NSInteger result) {
|
[panel beginSheetModalForWindow:documentWindow completionHandler:^(NSInteger result) {
|
||||||
if (result == NSFileHandlingPanelOKButton) {
|
if (result == NSFileHandlingPanelOKButton) {
|
||||||
NSString *fileExtension = panel.URLs.firstObject.pathExtension;
|
NSString *fileExtension = panel.URLs.firstObject.pathExtension;
|
||||||
|
|||||||
Reference in new issue
Block a user