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/HBLanguagesSelection.m | |
parent | 97e6ad384476b97cbc36bfb0a81ac179b1fc7d70 (diff) |
MacGui: add redo/undo supports to the audio part of HBJob.
Diffstat (limited to 'macosx/HBLanguagesSelection.m')
-rw-r--r-- | macosx/HBLanguagesSelection.m | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/macosx/HBLanguagesSelection.m b/macosx/HBLanguagesSelection.m index d9d5a9b1e..65b06e862 100644 --- a/macosx/HBLanguagesSelection.m +++ b/macosx/HBLanguagesSelection.m @@ -36,6 +36,15 @@ return lang; } +- (void)setIsSelected:(BOOL)isSelected +{ + if (_isSelected != isSelected) + { + [[self.undo prepareWithInvocationTarget:self] setIsSelected:_isSelected]; + } + _isSelected = isSelected; +} + - (NSString *)description { return self.language; @@ -47,17 +56,17 @@ - (instancetype)init { - self = [self initWithLanguages:nil]; + self = [self initWithLanguages:@[]]; return self; } -- (instancetype)initWithLanguages:(NSArray *)languages +- (instancetype)initWithLanguages:(NSArray<NSString *> *)languages { self = [super init]; if (self) { - NSMutableArray *internal = [[NSMutableArray alloc] init]; - NSMutableArray *selected = [[NSMutableArray alloc] init]; + NSMutableArray<HBLang *> *internal = [[NSMutableArray alloc] init]; + NSMutableArray<HBLang *> *selected = [[NSMutableArray alloc] init]; const iso639_lang_t *lang = lang_get_next(NULL); for (lang = lang_get_next(lang); lang != NULL; lang = lang_get_next(lang)) @@ -116,6 +125,15 @@ return [selected copy]; } +- (void)setUndo:(NSUndoManager *)undo +{ + _undo = undo; + for (HBLang *lang in self.languagesArray) + { + lang.undo = undo; + } +} + @end |