summaryrefslogtreecommitdiffstats
path: root/macosx/HBAddPresetController.m
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2015-10-13 10:22:02 +0200
committerDamiano Galassi <[email protected]>2015-10-13 10:22:02 +0200
commit14839ed2b8a7e4615b2c30fe8a46bb63819d0b40 (patch)
treef8684e1d7eb41fa1df0c420da50cd4f53f692e64 /macosx/HBAddPresetController.m
parentb8bcf81a60e505135cab3f6deeb090989012ba5e (diff)
MacGui: remove some HBPreset -> NSDictionary conversions and add a mutable version of HBPreset.
Diffstat (limited to 'macosx/HBAddPresetController.m')
-rw-r--r--macosx/HBAddPresetController.m26
1 files changed, 11 insertions, 15 deletions
diff --git a/macosx/HBAddPresetController.m b/macosx/HBAddPresetController.m
index 61483a675..10165ecb5 100644
--- a/macosx/HBAddPresetController.m
+++ b/macosx/HBAddPresetController.m
@@ -8,8 +8,7 @@
#import "HBAddPresetController.h"
#import "HBPreset.h"
-
-#include "hb.h"
+#import "HBMutablePreset.h"
@interface HBAddPresetController ()
@@ -53,7 +52,7 @@
[self.picSettingsPopUp addItemWithTitle:NSLocalizedString(@"None", @"")];
[[self.picSettingsPopUp lastItem] setTag: 0];
- if ([self.preset.content[@"PicturePAR"] integerValue] != HB_ANAMORPHIC_STRICT)
+ if (![self.preset[@"PicturePAR"] isEqualToString:@"strict"])
{
// not Strict, Custom is applicable
[self.picSettingsPopUp addItemWithTitle:NSLocalizedString(@"Custom", @"")];
@@ -94,27 +93,24 @@
}
else
{
- self.preset.name = self.name.stringValue;
- self.preset.presetDescription = self.desc.stringValue;
-
- NSMutableDictionary *dict = [self.preset.content mutableCopy];
+ HBMutablePreset *newPreset = [self.preset mutableCopy];
- dict[@"PresetName"] = self.name.stringValue;
- dict[@"PresetDescription"] = self.desc.stringValue;
+ newPreset.name = self.name.stringValue;
+ newPreset.presetDescription = self.desc.stringValue;
// Get the picture size
- dict[@"PictureWidth"] = @(self.picWidth.integerValue);
- dict[@"PictureHeight"] = @(self.picHeight.integerValue);
+ newPreset[@"PictureWidth"] = @(self.picWidth.integerValue);
+ newPreset[@"PictureHeight"] = @(self.picHeight.integerValue);
//Get the whether or not to apply pic Size and Cropping (includes Anamorphic)
- dict[@"UsesPictureSettings"] = @(self.picSettingsPopUp.selectedItem.tag);
+ newPreset[@"UsesPictureSettings"] = @(self.picSettingsPopUp.selectedItem.tag);
// Always use Picture Filter settings for the preset
- dict[@"UsesPictureFilters"] = @YES;
+ newPreset[@"UsesPictureFilters"] = @YES;
- self.preset.content = [dict copy];
+ [newPreset cleanUp];
- [self.preset cleanUp];
+ self.preset = [newPreset copy];
[[self window] orderOut:nil];
[NSApp endSheet:[self window] returnCode:NSModalResponseContinue];