From e7f78cb1cf6ecafe60dd259c9aee9640c8d302cd Mon Sep 17 00:00:00 2001 From: Bradley Sepos Date: Thu, 1 Feb 2018 02:39:59 -0500 Subject: 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. --- macosx/HBPresetsViewController.m | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'macosx') 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]; } } -- cgit v1.2.3