summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBradley Sepos <[email protected]>2018-02-01 02:39:59 -0500
committerBradley Sepos <[email protected]>2018-03-17 17:01:55 -0400
commite7f78cb1cf6ecafe60dd259c9aee9640c8d302cd (patch)
tree1c7cbae4d13b5e042f72fa4c12be25fca28f9de1
parent6e044c7715aabdc681a6b4f8c33d141712433cc9 (diff)
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.
-rw-r--r--macosx/HBPresetsViewController.m4
1 files changed, 1 insertions, 3 deletions
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];
}
}