mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-13 22:52:26 +00:00
Always show autotype notifications. Fixes #814
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#import "MPPasteBoardController.h"
|
||||
#import "MPSettingsHelper.h"
|
||||
#import "MPAutotypeCandidateSelectionViewController.h"
|
||||
#import "MPUserNotificationCenterDelegate.h"
|
||||
|
||||
#import "NSApplication+MPAdditions.h"
|
||||
#import "NSUserNotification+MPAdditions.h"
|
||||
@@ -41,9 +42,6 @@
|
||||
NSString *const kMPWindowTitleKey = @"kMPWindowTitleKey";
|
||||
NSString *const kMPProcessIdentifierKey = @"kMPProcessIdentifierKey";
|
||||
|
||||
NSString *const kMPUserNotificationInfoKeyNotificationType = @"kMPUserNotificationInfoKeyNotificationType";
|
||||
NSString *const kMPUserNotificationTypeAutotype = @"kMPUserNotificationTypeAutotype";
|
||||
|
||||
@interface MPAutotypeDaemon ()
|
||||
|
||||
@property (nonatomic, assign) BOOL enabled;
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
FOUNDATION_EXTERN NSString *const kMPUserNotificationInfoKeyNotificationType;
|
||||
FOUNDATION_EXTERN NSString *const kMPUserNotificationTypeAutotype;
|
||||
|
||||
@interface MPUserNotificationCenterDelegate : NSObject <NSUserNotificationCenterDelegate>
|
||||
|
||||
@end
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
|
||||
#import "MPUserNotificationCenterDelegate.h"
|
||||
|
||||
NSString *const kMPUserNotificationInfoKeyNotificationType = @"kMPUserNotificationInfoKeyNotificationType";
|
||||
NSString *const kMPUserNotificationTypeAutotype = @"kMPUserNotificationTypeAutotype";
|
||||
|
||||
@implementation MPUserNotificationCenterDelegate
|
||||
|
||||
- (instancetype)init {
|
||||
@@ -22,4 +25,14 @@
|
||||
NSLog(@"%@", notification);
|
||||
}
|
||||
|
||||
- (BOOL)userNotificationCenter:(NSUserNotificationCenter *)center shouldPresentNotification:(NSUserNotification *)notification {
|
||||
NSDictionary *userInfo = notification.userInfo;
|
||||
if(!userInfo) {
|
||||
return NO;
|
||||
}
|
||||
NSString *value = userInfo[kMPUserNotificationInfoKeyNotificationType];
|
||||
return [value isEqualToString:kMPUserNotificationTypeAutotype];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user