Don’t show the import sheet if we are importing only subtitles. Patch by Aymeric Bard.

This commit is contained in:
Damiano Galassi committed 2014-03-16 09:57:56 +01:00
1 parent 494f2f537e
commit ff487cfd2f
3 files changed
+32 -5

No files matched your search

+20 -1
View File
@@ -35,7 +35,7 @@
return self;
}
- (void)awakeFromNib
- (void)_prepareActionArray
{
_importCheckArray = [[NSMutableArray alloc] initWithCapacity:[_tracks count]];
_actionArray = [[NSMutableArray alloc] initWithCapacity:[_tracks count]];
@@ -84,10 +84,26 @@
[importMetadata setEnabled:YES];
else
[importMetadata setEnabled:NO];
}
- (void)awakeFromNib
{
[self _prepareActionArray];
[addTracksButton setEnabled:YES];
}
- (BOOL)onlyContainsSubtitleTracks
{
BOOL onlySubtitle = YES;
for (id track in _tracks) {
if ([track isKindOfClass:[MP42Track class]]) {
if (![track isMemberOfClass:[MP42SubtitleTrack class]])
onlySubtitle = NO;
}
}
return onlySubtitle;
}
- (NSInteger)numberOfRowsInTableView:(NSTableView *)t
{
return [_tracks count];
@@ -318,6 +334,9 @@
- (IBAction)addTracks:(id)sender
{
if (!_actionArray) // if add tracks is called directly, need to prepare actions
[self _prepareActionArray];
NSMutableArray *tracks = [[NSMutableArray alloc] init];
NSInteger i = 0;