summaryrefslogtreecommitdiffstats
path: root/macosx/HBJob+UIAdditions.m
diff options
context:
space:
mode:
authorritsuka <[email protected]>2014-12-27 10:46:04 +0000
committerritsuka <[email protected]>2014-12-27 10:46:04 +0000
commitdf8b2ff3e109699e3dadd88404911f8dfc7b210a (patch)
tree8489fee4edaf57adf55f69d0c0d28f61a5757057 /macosx/HBJob+UIAdditions.m
parent8df584534c0c39f5c2f298d8ba480cc906743bbf (diff)
MacGui: change the queue to work with serialized HBJob objects, remove the NSDictionary job representation and the duplicate prepareJob method. Implement NSCopying protocol in HBJob.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6655 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBJob+UIAdditions.m')
-rw-r--r--macosx/HBJob+UIAdditions.m38
1 files changed, 38 insertions, 0 deletions
diff --git a/macosx/HBJob+UIAdditions.m b/macosx/HBJob+UIAdditions.m
index 29836553a..6e5bf030a 100644
--- a/macosx/HBJob+UIAdditions.m
+++ b/macosx/HBJob+UIAdditions.m
@@ -21,4 +21,42 @@
}
}
+- (NSArray *)angles
+{
+ NSMutableArray *angles = [NSMutableArray array];
+ for (int i = 0; i < self.title.angles; i++)
+ {
+ [angles addObject:[NSString stringWithFormat: @"%d", i + 1]];
+ }
+ return angles;
+}
+
+@end
+
+@implementation HBURLTransformer
+
++ (Class)transformedValueClass
+{
+ return [NSString class];
+}
+
+- (id)transformedValue:(id)value
+{
+ if (value)
+ return [value path];
+ else
+ return nil;
+}
+
++ (BOOL)allowsReverseTransformation
+{
+ return YES;
+}
+
+- (id)reverseTransformedValue:(id)value
+{
+ return [NSURL fileURLWithPath:value];
+}
+
@end
+