From: Bradley Sepos Date: Thu, 1 Feb 2018 07:39:59 +0000 (-0500) Subject: MacGUI: After deleting a preset, select the default preset. X-Git-Tag: 1.1.0~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e7f78cb1cf6ecafe60dd259c9aee9640c8d302cd;p=handbrake MacGUI: After deleting a preset, select the default preset. Both the popover and main window control were selecting nothing at all in some/all cases. --- diff --git a/macosx/HBPresetsViewController.m b/macosx/HBPresetsViewController.m index b9a975c91..2e44985f6 100644 --- a/macosx/HBPresetsViewController.m +++ b/macosx/HBPresetsViewController.m @@ -261,8 +261,6 @@ static void *HBPresetsViewControllerContext = &HBPresetsViewControllerContext; { if ([self.treeController canRemove]) { - // Save the current selection path and apply it again after the deletion - NSIndexPath *currentSelection = [self.treeController selectionIndexPath]; /* Alert user before deleting preset */ NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"Are you sure you want to permanently delete the selected preset?", nil) defaultButton:NSLocalizedString(@"Delete Preset", nil) @@ -276,8 +274,8 @@ static void *HBPresetsViewControllerContext = &HBPresetsViewControllerContext; if (status == NSAlertDefaultReturn) { [self.presets deletePresetAtIndexPath:[self.treeController selectionIndexPath]]; + [self setSelection:self.presets.defaultPreset]; } - [self.treeController setSelectionIndexPath:currentSelection]; } }