mirror of
https://github.com/MacPass/MacPass.git
synced 2026-02-02 09:58:16 +00:00
Enabled always verify autotype match settings. UI is missing for this setting
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15705" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="17156" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15705"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17156"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
@@ -173,7 +173,7 @@
|
||||
<constraint firstItem="lOo-NI-b07" firstAttribute="firstBaseline" secondItem="ehI-gq-lsb" secondAttribute="firstBaseline" id="gFK-Ce-Q3b"/>
|
||||
<constraint firstItem="lOo-NI-b07" firstAttribute="leading" secondItem="1" secondAttribute="leading" constant="20" symbolic="YES" id="kaP-lB-tDY"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="-2" y="125"/>
|
||||
<point key="canvasLocation" x="-752" y="-257"/>
|
||||
</customView>
|
||||
</objects>
|
||||
</document>
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
@property (strong) IBOutlet NSTableView *contextTableView;
|
||||
@property (strong) IBOutlet NSTextField *messageTextField;
|
||||
@property (strong) IBOutlet NSImageView *targetApplicationImageView;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MPAutotypeCandidateSelectionViewController
|
||||
@@ -45,13 +44,24 @@
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
NSString *template = NSLocalizedString(@"AUTOTYPE_CANDIDATE_SELECTION_WINDOW_MESSAGE_%@", "Message text in the autotype selection window. Placeholder is %1 - windowTitle");
|
||||
self.messageTextField.stringValue = [NSString stringWithFormat:template, self.environment.windowTitle];
|
||||
|
||||
self.selectAutotypeContextButton.enabled = NO;
|
||||
|
||||
NSRunningApplication *targetApplication = [NSRunningApplication runningApplicationWithProcessIdentifier:self.environment.pid];
|
||||
if(nil != targetApplication) {
|
||||
self.targetApplicationImageView.image = targetApplication.icon;
|
||||
}
|
||||
|
||||
NSString *template = @"";
|
||||
if(self.candidates.count > 1) {
|
||||
template = NSLocalizedString(@"AUTOTYPE_CANDIDATE_SELECTION_WINDOW_MESSAGE_%@_%@", "Message text in the autotype selection window. Placeholder is %1 - applicationName, %2 windowTitle");
|
||||
self.messageTextField.stringValue = [NSString stringWithFormat:template, targetApplication.localizedName, self.environment.windowTitle];
|
||||
}
|
||||
else {
|
||||
template = NSLocalizedString(@"AUTOTYPE_CANDIDATE_CONFIRMATION_WINDOW_MESSAGE_%@_%@", "Message text in the autotype confirmation window. Placeholder is %1 - applicationName, %2 windowTitle");
|
||||
self.messageTextField.stringValue = [NSString stringWithFormat:template, targetApplication.localizedName, self.environment.windowTitle];
|
||||
}
|
||||
|
||||
NSNotification *notification = [NSNotification notificationWithName:NSTableViewSelectionDidChangeNotification object:self.contextTableView];
|
||||
[self tableViewSelectionDidChange:notification];
|
||||
}
|
||||
@@ -96,5 +106,4 @@
|
||||
[MPAutotypeDaemon.defaultDaemon cancelAutotypeContextSelectionForEnvironment:self.environment];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -290,9 +290,14 @@ static MPAutotypeDaemon *_sharedInstance;
|
||||
}
|
||||
}
|
||||
|
||||
if(autotypeCandidates.count <= 1) {
|
||||
BOOL isGlobalAutotype = (environment.preferredEntry == nil);
|
||||
BOOL alwaysShowCandidateSelection = [NSUserDefaults.standardUserDefaults boolForKey:kMPSettingsKeyGloablAutotypeAlwaysShowCandidateSelection];
|
||||
|
||||
/* if we have only one candidate and do not need to show the windows, return only the last candiadate */
|
||||
if(autotypeCandidates.count <= 1 && !(isGlobalAutotype && alwaysShowCandidateSelection)) {
|
||||
return autotypeCandidates.lastObject;
|
||||
}
|
||||
/* otherwise show the candidate selection window */
|
||||
[self _presentCandiadates:autotypeCandidates forEnvironment:environment];
|
||||
return nil; // Nothing to do, we get called back by the window
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ APPKIT_EXTERN NSString *const kMPSettingsKeyAutotypeMatchTitle; //
|
||||
APPKIT_EXTERN NSString *const kMPSettingsKeyAutotypeMatchURL; // Autotype lookup includes entry URL
|
||||
APPKIT_EXTERN NSString *const kMPSettingsKeyAutotypeMatchHost; // Autotype lookup includes host part of entry URL
|
||||
APPKIT_EXTERN NSString *const kMPSettingsKeyAutotypeMatchTags; // Autotype lookup includes tags for entries
|
||||
APPKIT_EXTERN NSString *const kMPSettingsKeyAutotpyeHideMissingPermissionsWarning;
|
||||
APPKIT_EXTERN NSString *const kMPSettingsKeyGloablAutotypeAlwaysShowCandidateSelection; // If YES, will always display then candidate selection window befor perfoming an Autotype
|
||||
|
||||
/* Search */
|
||||
APPKIT_EXTERN NSString *const kMPSettingsKeyEntrySearchFilterContext;
|
||||
|
||||
@@ -60,7 +60,7 @@ NSString *const kMPSettingsKeyAutotypeMatchTitle = @"Autoty
|
||||
NSString *const kMPSettingsKeyAutotypeMatchURL = @"AutotypeMatchURL";
|
||||
NSString *const kMPSettingsKeyAutotypeMatchHost = @"AutotypeMatchHost";
|
||||
NSString *const kMPSettingsKeyAutotypeMatchTags = @"AutotypeMatchTags";
|
||||
NSString *const kMPSettingsKeyAutotpyeHideMissingPermissionsWarning = @"AutotpyeHideMissingPermissionsWarning";
|
||||
NSString *const kMPSettingsKeyGloablAutotypeAlwaysShowCandidateSelection = @"GloablAutotypeAlwaysShowCandidateSelection";
|
||||
|
||||
NSString *const kMPSettingsKeyEntrySearchFilterContext = @"EntrySearchFilterContext";
|
||||
|
||||
@@ -167,7 +167,8 @@ NSString *const kMPDepricatedSettingsKeyAutotypeHideAccessibiltyWarning = @"Au
|
||||
kMPSettingsKeyQuitOnLastWindowClose: @NO,
|
||||
kMPSettingsKeyEnableAutosave: @YES,
|
||||
kMPSettingsKeyHideAfterCopyToClipboard: @NO,
|
||||
kMPSettingsKeyFaviconDownloadMethod: @(MPFaviconDownloadMethodDirect) // Download directly from host
|
||||
kMPSettingsKeyFaviconDownloadMethod: @(MPFaviconDownloadMethodDirect), // Download directly from host
|
||||
kMPSettingsKeyGloablAutotypeAlwaysShowCandidateSelection: @NO
|
||||
};
|
||||
});
|
||||
return standardDefaults;
|
||||
|
||||
Reference in New Issue
Block a user