diff options
author | Damiano Galassi <[email protected]> | 2015-10-20 18:55:08 +0200 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2015-10-20 18:55:08 +0200 |
commit | 7f50c27989a63e87d2f17c6495d29e136ccfd837 (patch) | |
tree | 280036131fa6d7dd1a11ef84a55c4dfad3e96aca /macosx/HBJob.m | |
parent | c32d5236135c6be0b4987fb74de511e3332d7396 (diff) |
MacGui: added undo/redo support to the video, picture, filters, chapters and range parts of HBJob.
Diffstat (limited to 'macosx/HBJob.m')
-rw-r--r-- | macosx/HBJob.m | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/macosx/HBJob.m b/macosx/HBJob.m index b8df8e2cd..f03520bac 100644 --- a/macosx/HBJob.m +++ b/macosx/HBJob.m @@ -92,8 +92,39 @@ NSString *HBChaptersChangedNotification = @"HBChaptersChangedNotification"; withObject:preset]; } +- (void)setUndo:(NSUndoManager *)undo +{ + _undo = undo; + [@[self.video, self.range, self.filters, self.picture, /*self.audio, self.subtitles*/] makeObjectsPerformSelector:@selector(setUndo:) + withObject:_undo]; + [self.chapterTitles makeObjectsPerformSelector:@selector(setUndo:) withObject:_undo]; +} + +- (void)setPresetName:(NSString *)presetName +{ + if (![presetName isEqualToString:_presetName]) + { + [[self.undo prepareWithInvocationTarget:self] setPresetName:_presetName]; + } + _presetName = [presetName copy]; +} + +- (void)setDestURL:(NSURL *)destURL +{ + if (![destURL isEqualTo:_destURL]) + { + [[self.undo prepareWithInvocationTarget:self] setDestURL:_destURL]; + } + _destURL = [destURL copy]; +} + - (void)setContainer:(int)container { + if (container != _container) + { + [[self.undo prepareWithInvocationTarget:self] setContainer:_container]; + } + _container = container; [self.audio containerChanged:container]; @@ -104,14 +135,45 @@ NSString *HBChaptersChangedNotification = @"HBChaptersChangedNotification"; [[NSNotificationCenter defaultCenter] postNotificationName:HBContainerChangedNotification object:self]; } +- (void)setAngle:(int)angle +{ + if (angle != _angle) + { + [[self.undo prepareWithInvocationTarget:self] setAngle:_angle]; + } + _angle = angle; +} + - (void)setTitle:(HBTitle *)title { _title = title; self.range.title = title; } +- (void)setMp4HttpOptimize:(BOOL)mp4HttpOptimize +{ + if (mp4HttpOptimize != _mp4HttpOptimize) + { + [[self.undo prepareWithInvocationTarget:self] setMp4HttpOptimize:_mp4HttpOptimize]; + } + _mp4HttpOptimize = mp4HttpOptimize; +} + +- (void)setMp4iPodCompatible:(BOOL)mp4iPodCompatible +{ + if (mp4iPodCompatible != _mp4iPodCompatible) + { + [[self.undo prepareWithInvocationTarget:self] setMp4iPodCompatible:_mp4iPodCompatible]; + } + _mp4iPodCompatible = mp4iPodCompatible; +} + - (void)setChaptersEnabled:(BOOL)chaptersEnabled { + if (chaptersEnabled != _chaptersEnabled) + { + [[self.undo prepareWithInvocationTarget:self] setChaptersEnabled:_chaptersEnabled]; + } _chaptersEnabled = chaptersEnabled; [[NSNotificationCenter defaultCenter] postNotificationName:HBChaptersChangedNotification object:self]; } |