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