From 039a1c284f79286e4320ed5af48020fd58876c4e Mon Sep 17 00:00:00 2001 From: ritsuka Date: Sun, 1 Feb 2015 12:30:07 +0000 Subject: MacGui: fix chapters range auto naming. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6855 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- macosx/HBController.m | 10 +++++----- macosx/HBRange.h | 2 ++ macosx/HBRange.m | 11 +++++++++++ 3 files changed, 18 insertions(+), 5 deletions(-) (limited to 'macosx') diff --git a/macosx/HBController.m b/macosx/HBController.m index a484f1838..e3725bff7 100644 --- a/macosx/HBController.m +++ b/macosx/HBController.m @@ -471,6 +471,7 @@ [[NSNotificationCenter defaultCenter] removeObserver:_job.filters]; [[NSNotificationCenter defaultCenter] removeObserver:_job.video]; [[NSNotificationCenter defaultCenter] removeObserver:_job.audio]; + [[NSNotificationCenter defaultCenter] removeObserver:_job.range]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pictureSettingsDidChange) name:HBPictureChangedNotification object:job.picture]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pictureSettingsDidChange) name:HBFiltersChangedNotification object:job.filters]; @@ -478,6 +479,7 @@ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(customSettingUsed) name:HBVideoChangedNotification object:job.video]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateFileExtension:) name:HBMixdownChangedNotification object:job.audio]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateFileExtension:) name:HBChaptersChangedNotification object:job]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(chapterPopUpChanged:) name:HBRangeChangedNotification object:job.range]; } // Retain the new job @@ -886,11 +888,9 @@ { [self updateFileExtension:notification]; } - else - { - // If Auto Naming is on it might need to be update if it includes the chapters range - [self updateFileName]; - } + + // If Auto Naming is on it might need to be update if it includes the chapters range + [self updateFileName]; } - (void)formatChanged:(NSNotification *)notification diff --git a/macosx/HBRange.h b/macosx/HBRange.h index 110beab91..fcf455b2f 100644 --- a/macosx/HBRange.h +++ b/macosx/HBRange.h @@ -8,6 +8,8 @@ @class HBTitle; +extern NSString *HBRangeChangedNotification; + typedef NS_ENUM(NSUInteger, HBRangeType) { HBRangeTypeChapters, HBRangeTypeSeconds, diff --git a/macosx/HBRange.m b/macosx/HBRange.m index bd0e5730c..73e8909cb 100644 --- a/macosx/HBRange.m +++ b/macosx/HBRange.m @@ -8,6 +8,8 @@ #import "HBTitle.h" #import "NSCodingMacro.h" +NSString *HBRangeChangedNotification = @"HBRangeChangedNotification"; + @implementation HBRange #pragma mark - NSCoding @@ -31,6 +33,11 @@ return self; } +- (void)postChangedNotification +{ + [[NSNotificationCenter defaultCenter] postNotificationName:HBRangeChangedNotification object:self]; +} + - (void)setChapterStart:(int)chapterStart { if (chapterStart > self.chapterStop) @@ -39,6 +46,8 @@ } _chapterStart = chapterStart; + + [self postChangedNotification]; } - (void)setChapterStop:(int)chapterStop @@ -49,6 +58,8 @@ } _chapterStop = chapterStop; + + [self postChangedNotification]; } - (NSString *)duration -- cgit v1.2.3