From 48a311eb9096cf7680a91fc7906c0487fce33473 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Mon, 31 Mar 2014 15:27:35 +0200 Subject: Fixed string literal warning --- MASShortcutView.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'MASShortcutView.m') diff --git a/MASShortcutView.m b/MASShortcutView.m index ba28e47..9f1b7f4 100644 --- a/MASShortcutView.m +++ b/MASShortcutView.m @@ -380,9 +380,9 @@ 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, + NSRunCriticalAlertPanel([NSString stringWithFormat:format, shortcut], @"%@", NSLocalizedString(@"OK", @"Alert button when shortcut is already used"), - nil, nil); + nil, nil, error.localizedDescription); weakSelf.shortcutPlaceholder = nil; [weakSelf activateResignObserver:YES]; [weakSelf activateEventMonitoring:YES]; -- cgit v1.2.3 From 7d3604820ec26cdc2a4d72f96ecda7eb65f78f12 Mon Sep 17 00:00:00 2001 From: ShadowLightz Date: Sat, 14 Jun 2014 14:08:03 +0200 Subject: Replace depr. NSRunCriticalAlertPanel with NSAlert - Now using modern API - The dialog is now shown as a modal sheet, which suits better - The alert style is changed to NSWarningAlertStyle, - NSCriticalAlertStyle was not required --- MASShortcutView.m | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'MASShortcutView.m') 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; -- cgit v1.2.3 From 549b3ef29edd64d3911968d381712500295da655 Mon Sep 17 00:00:00 2001 From: Antonin Hildebrand Date: Tue, 26 Aug 2014 13:16:04 +0200 Subject: allow [MODIFIER]+ESC shortcuts only naked ESC without modifiers should cancel editing http://discuss.binaryage.com/t/cant-change-activation-key-to-control-esc tested in TotalTerminal codebase --- MASShortcutView.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'MASShortcutView.m') diff --git a/MASShortcutView.m b/MASShortcutView.m index 82f4b4b..96dcc86 100644 --- a/MASShortcutView.m +++ b/MASShortcutView.m @@ -359,7 +359,7 @@ void *kUserDataHint = &kUserDataHint; weakSelf.recording = NO; event = nil; } - else if (shortcut.keyCode == kVK_Escape) { + else if (shortcut.keyCode == kVK_Escape && !shortcut.modifierFlags) { // Cancel recording weakSelf.recording = NO; event = nil; -- cgit v1.2.3