diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index 160339ad..f119444b 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -42,6 +42,7 @@ 4C2E381F16D11FF900037A9D /* 05_LanguagesTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C2E381C16D11FF900037A9D /* 05_LanguagesTemplate.pdf */; }; 4C2E382316D1421B00037A9D /* MPIconHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C2E382216D1421B00037A9D /* MPIconHelper.m */; }; 4C2E382616D1470200037A9D /* MPViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C2E382516D1470200037A9D /* MPViewController.m */; }; + 4C2F17A21FD69BCA0097418D /* MPUserNotificationCenterDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C2F17A11FD69BCA0097418D /* MPUserNotificationCenterDelegate.m */; }; 4C32B0E71A1D4436007E12F1 /* KPKFormat+MPUTIDetection.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C32B0E61A1D4436007E12F1 /* KPKFormat+MPUTIDetection.m */; }; 4C3666411787327E00B249F1 /* MPDocument+Attachments.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C3666401787327E00B249F1 /* MPDocument+Attachments.m */; }; 4C37A84015B8B474005EF8EE /* MPOutlineDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C37A83F15B8B474005EF8EE /* MPOutlineDataSource.m */; }; @@ -371,6 +372,8 @@ 4C2E382216D1421B00037A9D /* MPIconHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPIconHelper.m; sourceTree = ""; }; 4C2E382416D1470200037A9D /* MPViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPViewController.h; sourceTree = ""; }; 4C2E382516D1470200037A9D /* MPViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPViewController.m; sourceTree = ""; }; + 4C2F17A01FD69BCA0097418D /* MPUserNotificationCenterDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPUserNotificationCenterDelegate.h; sourceTree = ""; }; + 4C2F17A11FD69BCA0097418D /* MPUserNotificationCenterDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MPUserNotificationCenterDelegate.m; sourceTree = ""; }; 4C32B0E51A1D4436007E12F1 /* KPKFormat+MPUTIDetection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "KPKFormat+MPUTIDetection.h"; sourceTree = ""; }; 4C32B0E61A1D4436007E12F1 /* KPKFormat+MPUTIDetection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "KPKFormat+MPUTIDetection.m"; sourceTree = ""; }; 4C3666401787327E00B249F1 /* MPDocument+Attachments.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MPDocument+Attachments.m"; sourceTree = ""; }; @@ -1089,6 +1092,8 @@ 4CA0F3EC1A3074B50067C0E5 /* MPWindowTitleComboBoxDelegate.m */, 4CE501321BBC47F500FB819D /* MPTagsTokenFieldDelegate.h */, 4CE501331BBC47F500FB819D /* MPTagsTokenFieldDelegate.m */, + 4C2F17A01FD69BCA0097418D /* MPUserNotificationCenterDelegate.h */, + 4C2F17A11FD69BCA0097418D /* MPUserNotificationCenterDelegate.m */, ); name = Delegates; sourceTree = ""; @@ -1647,7 +1652,7 @@ isa = PBXProject; attributes = { CLASSPREFIX = MP; - LastUpgradeCheck = 0910; + LastUpgradeCheck = 0920; ORGANIZATIONNAME = "HicknHack Software GmbH"; TargetAttributes = { 4C77E36115B84A240093A587 = { @@ -1935,6 +1940,7 @@ 4C3666411787327E00B249F1 /* MPDocument+Attachments.m in Sources */, 4CF6C3021FBF39BF0055AD03 /* MPPluginTabelCellView.m in Sources */, 4C10412C178CDD44001B5239 /* NSDate+Humanized.m in Sources */, + 4C2F17A21FD69BCA0097418D /* MPUserNotificationCenterDelegate.m in Sources */, 4C0C59F118B17F10009C7B76 /* DDHotKeyUtilities.m in Sources */, 4CEE46DD181C301D006BF1E5 /* MPAutotypeDaemon.m in Sources */, 4C50CC041F6C18830095629D /* MPCollectionViewItem.m in Sources */, diff --git a/MacPass.xcodeproj/xcshareddata/xcschemes/MacPass.xcscheme b/MacPass.xcodeproj/xcshareddata/xcschemes/MacPass.xcscheme index 491f9834..ae4f7dd1 100644 --- a/MacPass.xcodeproj/xcshareddata/xcschemes/MacPass.xcscheme +++ b/MacPass.xcodeproj/xcshareddata/xcschemes/MacPass.xcscheme @@ -1,6 +1,6 @@ * _Nullable bindings) { @@ -183,7 +184,7 @@ static MPAutotypeDaemon *_sharedInstance; [NSApp.mainWindow makeKeyAndOrderFront:self]; /* show the actual document window to the user */ [documents.firstObject showWindows]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didUnlockDatabase:) name:MPDocumentDidUnlockDatabaseNotification object:nil]; + [NSNotificationCenter.defaultCenter addObserver:self selector:@selector(_didUnlockDatabase:) name:MPDocumentDidUnlockDatabaseNotification object:nil]; return; // wait for the unlock to happen } @@ -201,7 +202,7 @@ static MPAutotypeDaemon *_sharedInstance; else { notification.informativeText = [NSString stringWithFormat:NSLocalizedString(@"AUTOTYPE_OVERLAY_NO_MATCH_FOR_%@", "Noticiation: Autotype failed to find a match for %@ (string placeholder)"), self.targetWindowTitle]; } - [[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification]; + [NSUserNotificationCenter.defaultUserNotificationCenter deliverNotification:notification]; } [self _performAutotypeForContext:context]; } diff --git a/MacPass/MPUserNotificationCenterDelegate.h b/MacPass/MPUserNotificationCenterDelegate.h new file mode 100644 index 00000000..b2690559 --- /dev/null +++ b/MacPass/MPUserNotificationCenterDelegate.h @@ -0,0 +1,13 @@ +// +// MPUserNotificationCenterDelegate.h +// MacPass +// +// Created by Michael Starke on 05.12.17. +// Copyright © 2017 HicknHack Software GmbH. All rights reserved. +// + +#import + +@interface MPUserNotificationCenterDelegate : NSObject + +@end diff --git a/MacPass/MPUserNotificationCenterDelegate.m b/MacPass/MPUserNotificationCenterDelegate.m new file mode 100644 index 00000000..a08f4d43 --- /dev/null +++ b/MacPass/MPUserNotificationCenterDelegate.m @@ -0,0 +1,21 @@ +// +// MPUserNotificationCenterDelegate.m +// MacPass +// +// Created by Michael Starke on 05.12.17. +// Copyright © 2017 HicknHack Software GmbH. All rights reserved. +// + +#import "MPUserNotificationCenterDelegate.h" + +@implementation MPUserNotificationCenterDelegate + +- (instancetype)init { + self = [super init]; + if(self) { + NSUserNotificationCenter.defaultUserNotificationCenter.delegate = self; + } + return self; +} + +@end diff --git a/MacPass/PickfieldView.xib b/MacPass/PickfieldView.xib index bb9c1d70..a13ae53d 100644 --- a/MacPass/PickfieldView.xib +++ b/MacPass/PickfieldView.xib @@ -1,8 +1,8 @@ - + - + @@ -66,7 +66,7 @@ - + @@ -125,7 +125,7 @@ -