summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorritsuka <[email protected]>2015-01-31 17:09:16 +0000
committerritsuka <[email protected]>2015-01-31 17:09:16 +0000
commit4e77613d95597cbaac2d7166eed9dedd1e881145 (patch)
tree9a4ebd23ef960bf875e0b241227a344e3838bf1f /macosx
parentf4fae8fcc8a58329717b6375c6a142675dacac9b (diff)
MacGui: add a HBChaptersChangedNotification notification, used to notify when the chapters are enabled or disabled.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6842 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx')
-rw-r--r--macosx/HBChapterTitlesController.m5
-rw-r--r--macosx/HBController.m5
-rw-r--r--macosx/HBJob.h2
-rw-r--r--macosx/HBJob.m17
4 files changed, 14 insertions, 15 deletions
diff --git a/macosx/HBChapterTitlesController.m b/macosx/HBChapterTitlesController.m
index ad50d3b86..582e9bd52 100644
--- a/macosx/HBChapterTitlesController.m
+++ b/macosx/HBChapterTitlesController.m
@@ -42,11 +42,6 @@
[fChapterTable reloadData];
}
-- (IBAction)createChapterMarkersChanged:(id)sender
-{
- [[NSNotificationCenter defaultCenter] postNotificationName:HBMixdownChangedNotification object:self];
-}
-
- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView
{
return self.chapterTitles.count;
diff --git a/macosx/HBController.m b/macosx/HBController.m
index 24969c0dd..1fdcbc25a 100644
--- a/macosx/HBController.m
+++ b/macosx/HBController.m
@@ -83,8 +83,6 @@
presetManager = manager;
_selectedPreset = [presetManager.defaultPreset retain];
-
- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(autoSetM4vExtension:) name:HBMixdownChangedNotification object:nil];
}
return self;
@@ -472,11 +470,14 @@
[[NSNotificationCenter defaultCenter] removeObserver:_job.picture];
[[NSNotificationCenter defaultCenter] removeObserver:_job.filters];
[[NSNotificationCenter defaultCenter] removeObserver:_job.video];
+ [[NSNotificationCenter defaultCenter] removeObserver:_job.audio];
[[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(formatChanged:) name:HBContainerChangedNotification object:job];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(customSettingUsed) name:HBVideoChangedNotification object:job.video];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(autoSetM4vExtension:) name:HBMixdownChangedNotification object:job.audio];
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(autoSetM4vExtension:) name:HBChaptersChangedNotification object:job];
}
// Retain the new job
diff --git a/macosx/HBJob.h b/macosx/HBJob.h
index 26a004f95..046bebeaa 100644
--- a/macosx/HBJob.h
+++ b/macosx/HBJob.h
@@ -17,8 +17,8 @@
#import "HBAudio.h"
#import "HBSubtitles.h"
-extern NSString *HBMixdownChangedNotification;
extern NSString *HBContainerChangedNotification;
+extern NSString *HBChaptersChangedNotification;
/**
* A flag to indicate the job's state
diff --git a/macosx/HBJob.m b/macosx/HBJob.m
index 62000a9c2..d991d9709 100644
--- a/macosx/HBJob.m
+++ b/macosx/HBJob.m
@@ -14,8 +14,8 @@
#include "hb.h"
-NSString *HBMixdownChangedNotification = @"HBMixdownChangedNotification";
-NSString *HBContainerChangedNotification = @"HBContainerChangedNotification";
+NSString *HBContainerChangedNotification = @"HBContainerChangedNotification";
+NSString *HBChaptersChangedNotification = @"HBChaptersChangedNotification";
@implementation HBJob
@@ -98,11 +98,8 @@ NSString *HBContainerChangedNotification = @"HBContainerChangedNotificatio
[self.subtitles containerChanged:container];
[self.video containerChanged];
- /* post a notification for any interested observers to indicate that our video container has changed */
- [[NSNotificationCenter defaultCenter] postNotification:
- [NSNotification notificationWithName:HBContainerChangedNotification
- object:self
- userInfo:nil]];
+ // post a notification for any interested observers to indicate that our video container has changed
+ [[NSNotificationCenter defaultCenter] postNotificationName:HBContainerChangedNotification object:self];
}
- (void)setTitle:(HBTitle *)title
@@ -112,6 +109,12 @@ NSString *HBContainerChangedNotification = @"HBContainerChangedNotificatio
self.picture.title = title;
}
+- (void)setChaptersEnabled:(BOOL)chaptersEnabled
+{
+ _chaptersEnabled = chaptersEnabled;
+ [[NSNotificationCenter defaultCenter] postNotificationName:HBChaptersChangedNotification object:self];
+}
+
+ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key
{
NSSet *retval = nil;