diff --git a/MacPass/Base.lproj/IntegrationSettings.xib b/MacPass/Base.lproj/IntegrationSettings.xib
index bfda4eec..3adf0b8e 100644
--- a/MacPass/Base.lproj/IntegrationSettings.xib
+++ b/MacPass/Base.lproj/IntegrationSettings.xib
@@ -8,6 +8,8 @@
+
+
@@ -16,6 +18,7 @@
+
@@ -23,120 +26,161 @@
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+ Autotype is not available, because MacPass does not have the right to control you computer. To enable Autotype, go to the Security and Privacy Preferences and add MacPass to the Accessibilty group. Changes require that you restart MacPass.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
@@ -161,6 +205,9 @@
+
+
+
@@ -182,7 +229,7 @@
-
+
diff --git a/MacPass/MPAutotypeDaemon.m b/MacPass/MPAutotypeDaemon.m
index afbce23e..87b63548 100644
--- a/MacPass/MPAutotypeDaemon.m
+++ b/MacPass/MPAutotypeDaemon.m
@@ -100,8 +100,8 @@ static MPAutotypeDaemon *_sharedInstance;
}
- (void)dealloc {
- [[NSNotificationCenter defaultCenter] removeObserver:self];
- [[[NSWorkspace sharedWorkspace] notificationCenter] removeObserver:self];
+ [NSNotificationCenter.defaultCenter removeObserver:self];
+ [NSWorkspace.sharedWorkspace.notificationCenter removeObserver:self];
[self unbind:NSStringFromSelector(@selector(enabled))];
[self unbind:NSStringFromSelector(@selector(hotKeyData))];
}
diff --git a/MacPass/MPIntegrationSettingsController.h b/MacPass/MPIntegrationSettingsController.h
index 5178336c..656a459c 100644
--- a/MacPass/MPIntegrationSettingsController.h
+++ b/MacPass/MPIntegrationSettingsController.h
@@ -27,18 +27,23 @@
@interface MPIntegrationSettingsController : MPViewController
/* Autotype */
-@property (weak) IBOutlet NSButton *enableGlobalAutotypeCheckBox;
-@property (weak) IBOutlet DDHotKeyTextField *hotKeyTextField;
-@property (weak) IBOutlet NSTextField *hotkeyWarningTextField;
+@property (strong) IBOutlet NSButton *enableGlobalAutotypeCheckBox;
+@property (strong) IBOutlet DDHotKeyTextField *hotKeyTextField;
+@property (strong) IBOutlet NSTextField *hotkeyWarningTextField;
-@property (weak) IBOutlet NSButton *matchTitleCheckBox;
-@property (weak) IBOutlet NSButton *matchURLCheckBox;
-@property (weak) IBOutlet NSButton *matchHostCheckBox;
-@property (weak) IBOutlet NSButton *matchTagsCheckBox;
+@property (strong) IBOutlet NSTextField *autotypeWarningTextField;
+@property (strong) IBOutlet NSStackView *autotypeStackView;
+@property (strong) IBOutlet NSButton *openPreferencesButton;
+@property (strong) IBOutlet NSButton *matchTitleCheckBox;
+@property (strong) IBOutlet NSButton *matchURLCheckBox;
+@property (strong) IBOutlet NSButton *matchHostCheckBox;
+@property (strong) IBOutlet NSButton *matchTagsCheckBox;
-@property (weak) IBOutlet NSButton *sendCommandForControlCheckBox;
+@property (strong) IBOutlet NSButton *sendCommandForControlCheckBox;
/* Preview */
-@property (weak) IBOutlet NSButton *enableQuicklookCheckBox;
+@property (strong) IBOutlet NSButton *enableQuicklookCheckBox;
+
+- (IBAction)openAccessibiltyPreferences:(id)sender;
@end
diff --git a/MacPass/MPIntegrationSettingsController.m b/MacPass/MPIntegrationSettingsController.m
index a2d2fee4..4fd4a099 100644
--- a/MacPass/MPIntegrationSettingsController.m
+++ b/MacPass/MPIntegrationSettingsController.m
@@ -23,6 +23,7 @@
#import "MPIntegrationSettingsController.h"
#import "MPSettingsHelper.h"
#import "MPIconHelper.h"
+#import "MPAutotypeDaemon.h"
#import "DDHotKeyCenter.h"
#import "DDHotKey+MacPassAdditions.h"
@@ -67,8 +68,9 @@
[self.matchTagsCheckBox bind:NSValueBinding toObject:defaultsController withKeyPath:[MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyAutotypeMatchTags] options:nil];
[self.sendCommandForControlCheckBox bind:NSValueBinding toObject:defaultsController withKeyPath:[MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeySendCommandForControlKey] options:nil];
-
- [self _showWarning:NO];
+
+ [self _showKeyCodeMissingKeyWarning:NO];
+ [self _updateAccessabilityWarning];
}
- (void)willShowTab {
@@ -92,14 +94,42 @@
- (void)controlTextDidChange:(NSNotification *)obj {
BOOL validHotKey = self.hotKeyTextField.hotKey.valid;
- [self _showWarning:!validHotKey];
+ [self _showKeyCodeMissingKeyWarning:!validHotKey];
if(validHotKey) {
self.hotKey = self.hotKeyTextField.hotKey;
}
}
-- (void)_showWarning:(BOOL)show {
+- (void)_showKeyCodeMissingKeyWarning:(BOOL)show {
self.hotkeyWarningTextField.hidden = !show;
}
+- (void)_updateAccessabilityWarning {
+ BOOL hasAutotypeSupport = MPAutotypeDaemon.defaultDaemon.autotypeSupported;
+
+ if(hasAutotypeSupport) {
+ [self.autotypeStackView setVisibilityPriority:NSStackViewVisibilityPriorityNotVisible forView:self.autotypeWarningTextField];
+ [self.autotypeStackView setVisibilityPriority:NSStackViewVisibilityPriorityNotVisible forView:self.openPreferencesButton];
+ }
+ else {
+ [self.autotypeStackView setVisibilityPriority:NSStackViewVisibilityPriorityMustHold forView:self.autotypeWarningTextField];
+ [self.autotypeStackView setVisibilityPriority:NSStackViewVisibilityPriorityMustHold forView:self.openPreferencesButton];
+ }
+
+ NSArray *controls = @[ self.enableGlobalAutotypeCheckBox,
+ self.hotKeyTextField,
+ self.matchTitleCheckBox,
+ self.matchURLCheckBox,
+ self.matchHostCheckBox,
+ self.matchTagsCheckBox,
+ self.sendCommandForControlCheckBox ];
+ for(NSControl *control in controls) {
+ control.enabled = hasAutotypeSupport;
+ }
+}
+
+- (void)openAccessibiltyPreferences:(id)sender {
+ [NSWorkspace.sharedWorkspace openURL:[NSURL URLWithString:@"x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility"]];
+
+}
@end