Skip to content
This repository has been archived by the owner on Mar 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #35 from ShadowLightz/master
Browse files Browse the repository at this point in the history
Replace deprecated NSRunCriticalAlertPanel with NSAlert
  • Loading branch information
Vadim Shpakovski committed Jun 14, 2014
2 parents ea5a30f + 7d36048 commit a21ac33
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions MASShortcutView.m
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,17 @@ - (void)activateEventMonitoring:(BOOL)shouldActivate
[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;
Expand Down

0 comments on commit a21ac33

Please sign in to comment.