diff options
author | Damiano Galassi <[email protected]> | 2018-06-08 16:59:25 +0200 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2018-06-08 16:59:25 +0200 |
commit | c762b2c0ec5b6fb58d1fd453e2b5aed526c6d693 (patch) | |
tree | e0ab43c5ddd28ed876158b689be0c93c2380d970 /macosx/HBPresetsViewController.m | |
parent | de7355d5ad5257c4cce5e0a99fffb3ee58264ba0 (diff) |
MacGui: set the minimum deployment target to 10.10. Remove Growl and use macOS standard notifications. Remove deprecated API usage and code that doesn't compile anymore (QTKit).
Diffstat (limited to 'macosx/HBPresetsViewController.m')
-rw-r--r-- | macosx/HBPresetsViewController.m | 32 |
1 files changed, 9 insertions, 23 deletions
diff --git a/macosx/HBPresetsViewController.m b/macosx/HBPresetsViewController.m index 95688424f..0c1a8abe7 100644 --- a/macosx/HBPresetsViewController.m +++ b/macosx/HBPresetsViewController.m @@ -224,21 +224,7 @@ static void *HBPresetsViewControllerContext = &HBPresetsViewControllerContext; _showHeader = showHeader; self.headerLabel.hidden = !showHeader; - if (NSAppKitVersionNumber < NSAppKitVersionNumber10_10) - { - if (showHeader) - { - [self.view addConstraint:self.headerBottomConstraint]; - } - else - { - [self.view removeConstraint:self.headerBottomConstraint]; - } - } - else - { - self.headerBottomConstraint.active = showHeader; - } + self.headerBottomConstraint.active = showHeader; } - (IBAction)clicked:(id)sender @@ -270,17 +256,17 @@ static void *HBPresetsViewControllerContext = &HBPresetsViewControllerContext; { if ([self.treeController canRemove]) { - /* 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) - alternateButton:NSLocalizedString(@"Cancel", nil) - otherButton:nil - informativeTextWithFormat:NSLocalizedString(@"You can't undo this action.", nil)]; - [alert setAlertStyle:NSCriticalAlertStyle]; + // Alert user before deleting preset + NSAlert *alert = [NSAlert init]; + alert.messageText = NSLocalizedString(@"Are you sure you want to permanently delete the selected preset?", nil); + alert.informativeText = NSLocalizedString(@"You can't undo this action.", nil); + [alert addButtonWithTitle:NSLocalizedString(@"Delete Preset", nil)]; + [alert addButtonWithTitle:NSLocalizedString(@"Cancel", nil)]; + alert.alertStyle = NSCriticalAlertStyle; NSInteger status = [alert runModal]; - if (status == NSAlertDefaultReturn) + if (status == NSAlertFirstButtonReturn) { [self.presets deletePresetAtIndexPath:[self.treeController selectionIndexPath]]; [self setSelection:self.presets.defaultPreset]; |