diff options
Diffstat (limited to 'macosx/HBAudioDefaultsController.m')
-rw-r--r-- | macosx/HBAudioDefaultsController.m | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/macosx/HBAudioDefaultsController.m b/macosx/HBAudioDefaultsController.m index 413fba727..b7c975016 100644 --- a/macosx/HBAudioDefaultsController.m +++ b/macosx/HBAudioDefaultsController.m @@ -33,6 +33,7 @@ static void *HBAudioDefaultsContex = &HBAudioDefaultsContex; _settings = settings; _languagesList = [[HBLanguagesSelection alloc] initWithLanguages:_settings.trackSelectionLanguages]; _settings.undo = self.window.undoManager; + _languagesList.undo = self.window.undoManager; } return self; } @@ -84,16 +85,16 @@ static void *HBAudioDefaultsContex = &HBAudioDefaultsContex; - (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 { - @try { [self removeObserver:self forKeyPath:@"tableController.showSelectedOnly"]; } @catch (NSException * __unused exception) {} |