summaryrefslogtreecommitdiffstats
path: root/macosx/HBSubtitlesDefaultsController.m
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/HBSubtitlesDefaultsController.m')
-rw-r--r--macosx/HBSubtitlesDefaultsController.m11
1 files changed, 6 insertions, 5 deletions
diff --git a/macosx/HBSubtitlesDefaultsController.m b/macosx/HBSubtitlesDefaultsController.m
index 83d98b72e..678ceb204 100644
--- a/macosx/HBSubtitlesDefaultsController.m
+++ b/macosx/HBSubtitlesDefaultsController.m
@@ -66,11 +66,12 @@ static void *HBSubtitlesDefaultsContex = &HBSubtitlesDefaultsContex;
- (IBAction)done:(id)sender
{
- [[self window] orderOut:nil];
- [NSApp endSheet:[self window]];
-
- [self.settings.trackSelectionLanguages removeAllObjects];
- [self.settings.trackSelectionLanguages addObjectsFromArray:self.languagesList.selectedLanguages];
+ [self.window orderOut:nil];
+ if (self.window.undoManager.canUndo)
+ {
+ self.settings.trackSelectionLanguages = [self.languagesList.selectedLanguages mutableCopy];
+ }
+ [NSApp endSheet:self.window returnCode:self.window.undoManager.canUndo];
}
- (void)dealloc