aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaulo F. Andrade2014-04-03 11:25:28 +0100
committerPaulo F. Andrade2014-04-03 11:25:28 +0100
commitda2773633059df112bd3c25fc8ae633f73c9f42b (patch)
tree2b8909559614f1d0968eacc7ba095aa56ddd95c7
parent9c0b4a327c2315bb6d27fe97dedad53e36e3c567 (diff)
downloadMASShortcut-da2773633059df112bd3c25fc8ae633f73c9f42b.tar.bz2
Replaced call to deprecated NSRunCriticalAlertPanel API
-rw-r--r--MASShortcutView.m10
1 files changed, 7 insertions, 3 deletions
diff --git a/MASShortcutView.m b/MASShortcutView.m
index ba28e47..17ad0f1 100644
--- a/MASShortcutView.m
+++ b/MASShortcutView.m
@@ -380,9 +380,13 @@ void *kUserDataHint = &kUserDataHint;
[weakSelf activateEventMonitoring:NO];
NSString *format = NSLocalizedString(@"The key combination %@ cannot be used",
@"Title for alert when shortcut is already used");
- NSRunCriticalAlertPanel([NSString stringWithFormat:format, shortcut], error.localizedDescription,
- NSLocalizedString(@"OK", @"Alert button when shortcut is already used"),
- nil, nil);
+ NSAlert *alert = [[NSAlert alloc] init];
+ alert.alertStyle = NSCriticalAlertStyle;
+ alert.informativeText = [NSString stringWithFormat:format, shortcut];
+ alert.messageText = error.localizedDescription;
+ [alert addButtonWithTitle:NSLocalizedString(@"OK", @"Alert button when shortcut is already used")];
+
+ [alert runModal];
weakSelf.shortcutPlaceholder = nil;
[weakSelf activateResignObserver:YES];
[weakSelf activateEventMonitoring:YES];