/* if not then select the main feature title */
[fSrcTitlePopUp selectItemAtIndex: feature_title];
}
- [self titlePopUpChanged:nil];
-
+
SuccessfulScan = YES;
- [self enableUI: YES];
+ [self titlePopUpChanged:nil];
[self encodeStartStopPopUpChanged:nil];
+ [self enableUI: YES];
+
// Open preview window now if it was visible when HB was closed
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"PreviewWindowIsOpen"])
[self showPreviewWindow:nil];
- (void)applyPreset:(HBPreset *)preset
{
- if (preset != nil)
+ self.selectedPreset = preset;
+
+ if (preset != nil && SuccessfulScan)
{
hb_job_t * job = fTitle->job;
- (void)selectionDidChange
{
- self.selectedPreset = fPresetsView.selectedPreset;
- if (SuccessfulScan)
- {
- [self applyPreset:self.selectedPreset];
- }
+ [self applyPreset:fPresetsView.selectedPreset];
}
#pragma mark -
- (IBAction)selectDefaultPreset:(id)sender
{
- [fPresetsView selectPreset:presetManager.defaultPreset];
+ [self applyPreset:presetManager.defaultPreset];
+ [fPresetsView setSelection:_selectedPreset];
}
- (IBAction)insertFolder:(id)sender
i++;
}];
- [fPresetsView selectPreset:preset];
+ [self applyPreset:preset];
+ [fPresetsView setSelection:_selectedPreset];
}
/**
@property (nonatomic, readwrite, assign) id<HBPresetsViewControllerDelegate> delegate;
- (void)deselect;
-- (void)selectPreset:(HBPreset *)preset;
+- (void)setSelection:(HBPreset *)preset;
- (IBAction)insertFolder:(id)sender;
// Re-expand the items
[self expandNodes:[self.treeController.arrangedObjects childNodes]];
- [self deselect];
+ [self.treeController setSelectionIndexPath:[self.presets indexPathOfPreset:self.presets.defaultPreset]];
}
- (BOOL)validateUserInterfaceItem:(id < NSValidatedUserInterfaceItem >)anItem
- (IBAction)clicked:(id)sender
{
- if (self.delegate && [[self.treeController.selectedObjects firstObject] isLeaf] && self.enabled)
+ if (self.delegate && [[self.treeController.selectedObjects firstObject] isLeaf])
{
[self.delegate selectionDidChange];
}
[self.treeController setSelectionIndexPath:nil];
}
-- (void)selectPreset:(HBPreset *)preset
+- (void)setSelection:(HBPreset *)preset
{
NSIndexPath *idx = [self.presets indexPathOfPreset:preset];
if (idx)
{
[self.treeController setSelectionIndexPath:idx];
- [self clicked:self];
}
}