diff options
| author | Vadim Shpakovski | 2014-06-14 15:44:37 +0300 | 
|---|---|---|
| committer | Vadim Shpakovski | 2014-06-14 15:44:37 +0300 | 
| commit | a21ac331ad7b06392035b17ddd4f5cdd934aa36e (patch) | |
| tree | 94991edee74e14ccffc7866f178400a952b4ce87 | |
| parent | ea5a30fe6d52fdc77c907ca044367008a5b5a7e5 (diff) | |
| parent | 7d3604820ec26cdc2a4d72f96ecda7eb65f78f12 (diff) | |
| download | MASShortcut-a21ac331ad7b06392035b17ddd4f5cdd934aa36e.tar.bz2 | |
Merge pull request #35 from ShadowLightz/master
Replace deprecated NSRunCriticalAlertPanel with NSAlert
| -rw-r--r-- | MASShortcutView.m | 17 | 
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; | 
