mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-23 16:19:29 +00:00
Revert "Adjusted checks for auto-type permissions"
This reverts commit 7095d55670.
# Conflicts:
# MacPass/MPAutotypeEnvironment.h
# MacPass/MPAutotypeEnvironment.m
This commit is contained in:
@@ -55,6 +55,7 @@
|
||||
@property (strong) NSRunningApplication *previousApplication; // The application that was active before we got invoked
|
||||
@property (assign) NSTimeInterval userActionRequested;
|
||||
@property (strong) id applicationActivationObserver;
|
||||
@property (nonatomic, readonly) BOOL hasNecessaryAutotypePermissions;
|
||||
@end
|
||||
|
||||
@implementation MPAutotypeDaemon
|
||||
@@ -130,6 +131,10 @@ static MPAutotypeDaemon *_sharedInstance;
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)hasNecessaryAutotypePermissions {
|
||||
return MPAutotypeDoctor.defaultDoctor.hasNecessaryAutotypePermissions;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Autotype Invocation
|
||||
- (void)performAutotypeForEntry:(KPKEntry *)entry {
|
||||
@@ -144,7 +149,7 @@ static MPAutotypeDaemon *_sharedInstance;
|
||||
}
|
||||
|
||||
- (void)_didPressHotKey {
|
||||
MPAutotypeEnvironment *env = [MPAutotypeEnvironment environmentWithTargetApplication:nil entry:nil overrideSequence:nil];
|
||||
MPAutotypeEnvironment *env = [MPAutotypeEnvironment environmentWithTargetApplication:NSWorkspace.sharedWorkspace.frontmostApplication entry:nil overrideSequence:nil];
|
||||
[self _runAutotypeWithEnvironment:env];
|
||||
}
|
||||
|
||||
@@ -188,14 +193,8 @@ static MPAutotypeDaemon *_sharedInstance;
|
||||
if(env.isSelfTargeting) {
|
||||
return; // we do not want to target ourselves
|
||||
}
|
||||
BOOL hasNeededPermissions = NO;
|
||||
if(env.globalAutotype) {
|
||||
hasNeededPermissions = [MPAutotypeDoctor.defaultDoctor hasNecessaryPermissionForTask:MPAutotypeTaskGlobalAutotype];
|
||||
}
|
||||
else {
|
||||
hasNeededPermissions = [MPAutotypeDoctor.defaultDoctor hasNecessaryPermissionForTask:MPAutotypeTaskAutotype];
|
||||
}
|
||||
if(!hasNeededPermissions) {
|
||||
|
||||
if(!self.hasNecessaryAutotypePermissions) {
|
||||
NSUserNotification *notification = [[NSUserNotification alloc] init];
|
||||
notification.title = NSLocalizedString(@"AUTOTYPE_NOTIFICATION_PERMISSIONS_MISSING_TITLE", "Title for autotype feedback on missing permissions");
|
||||
notification.informativeText = NSLocalizedString(@"AUTOTYPE_NOTIFICATION_MACPASS_IS_MISSING_PERMISSIONS", "Notification: Autotype failed, MacPass has not enough permissions to perform autotype");
|
||||
|
||||
Reference in New Issue
Block a user