aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Shpakovski2014-06-14 15:44:37 +0300
committerVadim Shpakovski2014-06-14 15:44:37 +0300
commita21ac331ad7b06392035b17ddd4f5cdd934aa36e (patch)
tree94991edee74e14ccffc7866f178400a952b4ce87
parentea5a30fe6d52fdc77c907ca044367008a5b5a7e5 (diff)
parent7d3604820ec26cdc2a4d72f96ecda7eb65f78f12 (diff)
downloadMASShortcut-a21ac331ad7b06392035b17ddd4f5cdd934aa36e.tar.bz2
Merge pull request #35 from ShadowLightz/master
Replace deprecated NSRunCriticalAlertPanel with NSAlert
-rw-r--r--MASShortcutView.m17
1 files changed, 11 insertions, 6 deletions
diff --git a/MASShortcutView.m b/MASShortcutView.m
index 9f1b7f4..82f4b4b 100644
--- a/MASShortcutView.m
+++ b/MASShortcutView.m
@@ -380,12 +380,17 @@ 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], @"%@",
- NSLocalizedString(@"OK", @"Alert button when shortcut is already used"),
- nil, nil, error.localizedDescription);
- weakSelf.shortcutPlaceholder = nil;
- [weakSelf activateResignObserver:YES];
- [weakSelf activateEventMonitoring:YES];
+ NSAlert* alert = [[NSAlert alloc]init];
+ alert.messageText = [NSString stringWithFormat:format, shortcut];
+ alert.informativeText = error.localizedDescription;
+ alert.alertStyle = NSWarningAlertStyle;
+ weakSelf.recording = NO;
+ [alert beginSheetModalForWindow:self.window completionHandler:^(NSModalResponse returnCode) {
+ weakSelf.shortcutPlaceholder = nil;
+ [weakSelf activateResignObserver:YES];
+ [weakSelf activateEventMonitoring:YES];
+ weakSelf.recording = YES;
+ }];
}
else {
weakSelf.shortcutValue = shortcut;