Merged galad87/subler into master

This commit is contained in:
János Kis committed 2017-03-14 17:41:01 +00:00
commit be359d9bc2
1 file changed
+6 -3
+6 -3
View File
@@ -488,7 +488,7 @@ static NSDictionary *_detailMonospacedAttr;
if (action == @selector(sendToExternalApp:)) if (action == @selector(sendToExternalApp:))
return YES; return YES;
if (action == @selector(showTrackOffsetSheet:) && self.tracksTable.selectedRow != -1) if (action == @selector(showTrackOffsetSheet:) && self.tracksTable.selectedRowIndexes.count == 1 && self.tracksTable.selectedRow != -1)
return YES; return YES;
if (action == @selector(addChaptersEvery:)) if (action == @selector(addChaptersEvery:))
@@ -503,7 +503,7 @@ static NSDictionary *_detailMonospacedAttr;
if (action == @selector(fixAudioFallbacks:)) if (action == @selector(fixAudioFallbacks:))
return YES; return YES;
if (action == @selector(export:) && self.tracksTable.selectedRow != -1) if (action == @selector(export:) && self.tracksTable.selectedRowIndexes.count == 1 && self.tracksTable.selectedRow != -1)
if ([[self trackAtAtTableRow:self.tracksTable.selectedRow] respondsToSelector:@selector(exportToURL:error:)] && if ([[self trackAtAtTableRow:self.tracksTable.selectedRow] respondsToSelector:@selector(exportToURL:error:)] &&
[self trackAtAtTableRow:self.tracksTable.selectedRow].muxed) [self trackAtAtTableRow:self.tracksTable.selectedRow].muxed)
return YES; return YES;
@@ -518,7 +518,8 @@ static NSDictionary *_detailMonospacedAttr;
} }
if (toolbarItem == deleteTrack) { if (toolbarItem == deleteTrack) {
return self.tracksTable.selectedRow > 0 && NSApp.active; NSIndexSet *indexes = self.tracksTable.selectedRowIndexes;
return (indexes.count && ![self.tracksTable.selectedRowIndexes containsIndex:0] && NSApp.isActive);
} }
if (toolbarItem == searchMetadata) { if (toolbarItem == searchMetadata) {
@@ -949,7 +950,9 @@ static NSDictionary *_detailMonospacedAttr;
} }
[self.tracksTable.selectedRowIndexes enumerateIndexesUsingBlock:^(NSUInteger index, BOOL *stop) { [self.tracksTable.selectedRowIndexes enumerateIndexesUsingBlock:^(NSUInteger index, BOOL *stop) {
if (index > 0) {
[trackIndexes addIndex:[self trackIndexAtAtTableRow:index]]; [trackIndexes addIndex:[self trackIndexAtAtTableRow:index]];
}
}]; }];
[self.mp4 removeTracksAtIndexes:trackIndexes]; [self.mp4 removeTracksAtIndexes:trackIndexes];