mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 02:22:28 +00:00
added user info to notfication
This commit is contained in:
@@ -41,6 +41,9 @@
|
|||||||
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;
|
||||||
@@ -194,6 +197,7 @@ static MPAutotypeDaemon *_sharedInstance;
|
|||||||
if(!entryOrNil) {
|
if(!entryOrNil) {
|
||||||
NSUserNotification *notification = [[NSUserNotification alloc] init];
|
NSUserNotification *notification = [[NSUserNotification alloc] init];
|
||||||
notification.title = NSApp.applicationName;
|
notification.title = NSApp.applicationName;
|
||||||
|
notification.userInfo = @{ kMPUserNotificationInfoKeyNotificationType: kMPUserNotificationTypeAutotype };
|
||||||
if(context) {
|
if(context) {
|
||||||
notification.informativeText = [NSString stringWithFormat:NSLocalizedString(@"AUTOTYPE_OVERLAY_SINGLE_MATCH_FOR_%@", "Notification: Autotype found a single match for %@ (string placeholder)."), self.targetWindowTitle];
|
notification.informativeText = [NSString stringWithFormat:NSLocalizedString(@"AUTOTYPE_OVERLAY_SINGLE_MATCH_FOR_%@", "Notification: Autotype found a single match for %@ (string placeholder)."), self.targetWindowTitle];
|
||||||
}
|
}
|
||||||
@@ -313,7 +317,7 @@ static MPAutotypeDaemon *_sharedInstance;
|
|||||||
#pragma mark MPDocument Notifications
|
#pragma mark MPDocument Notifications
|
||||||
- (void)_didUnlockDatabase:(NSNotification *)notification {
|
- (void)_didUnlockDatabase:(NSNotification *)notification {
|
||||||
/* Remove ourselves and call again to search matches */
|
/* Remove ourselves and call again to search matches */
|
||||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
[NSNotificationCenter.defaultCenter removeObserver:self name:MPDocumentDidUnlockDatabaseNotification object:nil];
|
||||||
[self _performAutotypeForEntry:nil];
|
[self _performAutotypeForEntry:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user