summaryrefslogtreecommitdiffstats
path: root/macosx/HBPresetsViewController.m
diff options
context:
space:
mode:
authorritsuka <[email protected]>2014-08-10 16:05:07 +0000
committerritsuka <[email protected]>2014-08-10 16:05:07 +0000
commit6aee3b7518264af46fd7d2f4580579313e2eaf72 (patch)
tree9e2839ae202e1c07baeb181abba643714ae71b21 /macosx/HBPresetsViewController.m
parentc50899dd7361801c04463fe1630392500608ebab (diff)
MacGui: implemented the HBViewValidation protocol in each of the main window view controllers.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6285 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBPresetsViewController.m')
-rw-r--r--macosx/HBPresetsViewController.m16
1 files changed, 6 insertions, 10 deletions
diff --git a/macosx/HBPresetsViewController.m b/macosx/HBPresetsViewController.m
index 6dd76793a..08e03e31e 100644
--- a/macosx/HBPresetsViewController.m
+++ b/macosx/HBPresetsViewController.m
@@ -85,9 +85,9 @@
#pragma mark - HBViewValidation methods
-- (void)setEnabled:(BOOL)enabled
+- (void)setUIEnabled:(BOOL)flag
{
- _enabled = enabled;
+ self.enabled = flag;
}
#pragma mark - UI Methods
@@ -135,18 +135,14 @@
- (IBAction)insertFolder:(id)sender
{
NSIndexPath *selectionIndexPath = [self.treeController selectionIndexPath];
- if (!selectionIndexPath)
+ if (!selectionIndexPath || [[[self.treeController selectedObjects] firstObject] isBuiltIn])
{
selectionIndexPath = [NSIndexPath indexPathWithIndex:self.presets.root.children.count];
}
- HBPreset *selectedNode = [[self.treeController selectedObjects] firstObject];
- if (!selectedNode.isBuiltIn)
- {
- HBPreset *node = [[HBPreset alloc] initWithFolderName:@"New Folder" builtIn:NO];
- [self.treeController insertObject:node atArrangedObjectIndexPath:selectionIndexPath];
- [node autorelease];
- }
+ HBPreset *node = [[HBPreset alloc] initWithFolderName:@"New Folder" builtIn:NO];
+ [self.treeController insertObject:node atArrangedObjectIndexPath:selectionIndexPath];
+ [node autorelease];
}
- (IBAction)setDefault:(id)sender