diff options
author | Damiano Galassi <[email protected]> | 2015-10-24 10:50:27 +0200 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2015-10-24 10:50:27 +0200 |
commit | 7e32b94a04e073aa94b51811200b664a5001f983 (patch) | |
tree | 8b328e88162db42ee1d9237a61ea2c97f4c0183d /macosx/HBAudioDefaultsController.m | |
parent | 97e6ad384476b97cbc36bfb0a81ac179b1fc7d70 (diff) |
MacGui: add redo/undo supports to the audio part of HBJob.
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) {} |