diff options
author | ritsuka <[email protected]> | 2014-08-10 16:05:07 +0000 |
---|---|---|
committer | ritsuka <[email protected]> | 2014-08-10 16:05:07 +0000 |
commit | 6aee3b7518264af46fd7d2f4580579313e2eaf72 (patch) | |
tree | 9e2839ae202e1c07baeb181abba643714ae71b21 /macosx/HBPresetsViewController.m | |
parent | c50899dd7361801c04463fe1630392500608ebab (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.m | 16 |
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 |