]> granicus.if.org Git - handbrake/commitdiff
MacGUI: After deleting a preset, select the default preset.
authorBradley Sepos <bradley@bradleysepos.com>
Thu, 1 Feb 2018 07:39:59 +0000 (02:39 -0500)
committerBradley Sepos <bradley@bradleysepos.com>
Sat, 17 Mar 2018 21:01:55 +0000 (17:01 -0400)
Both the popover and main window control were selecting nothing at all in some/all cases.

macosx/HBPresetsViewController.m

index b9a975c91295f6e1607971b281d705830a2626cc..2e44985f6078f79589b0099ad969b6fa35bf9c32 100644 (file)
@@ -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];
     }
 }