]> granicus.if.org Git - handbrake/commitdiff
MacGui: fix chapters range auto naming.
authorritsuka <damiog@gmail.com>
Sun, 1 Feb 2015 12:30:07 +0000 (12:30 +0000)
committerritsuka <damiog@gmail.com>
Sun, 1 Feb 2015 12:30:07 +0000 (12:30 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6855 b64f7644-9d1e-0410-96f1-a4d463321fa5

macosx/HBController.m
macosx/HBRange.h
macosx/HBRange.m

index a484f1838c2c58256aa592b027f6080c177493b8..e3725bff7e16587d078c270b81548bf7300ec978 100644 (file)
         [[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];
         [[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
     {
         [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
index 110beab9194889f18cc110bbe6cccbd323a184cb..fcf455b2f4a7adc348e606fafa1b9168839116ed 100644 (file)
@@ -8,6 +8,8 @@
 
 @class HBTitle;
 
+extern NSString *HBRangeChangedNotification;
+
 typedef NS_ENUM(NSUInteger, HBRangeType) {
     HBRangeTypeChapters,
     HBRangeTypeSeconds,
index bd0e5730c195a86e7536ffe6a978434c2580a0d8..73e8909cb433be799d22dfb9bb5f7320633493db 100644 (file)
@@ -8,6 +8,8 @@
 #import "HBTitle.h"
 #import "NSCodingMacro.h"
 
+NSString *HBRangeChangedNotification = @"HBRangeChangedNotification";
+
 @implementation HBRange
 
 #pragma mark - NSCoding
     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