diff --git a/MacPass/MPAppDelegate.m b/MacPass/MPAppDelegate.m index 1003cb4b..3837b831 100644 --- a/MacPass/MPAppDelegate.m +++ b/MacPass/MPAppDelegate.m @@ -23,6 +23,7 @@ #import "MPAppDelegate.h" #import "MPAutotypeDaemon.h" +#import "MPConstants.h" #import "MPContextMenuHelper.h" #import "MPDockTileHelper.h" #import "MPDocument.h" @@ -45,7 +46,7 @@ #import NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDidChangeStoredKeyFilesSettings"; -NSString *const MPHelpURLKey = @"MPHelpURL"; + @interface MPAppDelegate () { @private MPDockTileHelper *_dockTileHelper; @@ -241,7 +242,7 @@ NSString *const MPHelpURLKey = @"MPHelpURL"; } - (void)showHelp:(id)sender { - NSString *urlString = [[NSBundle mainBundle] infoDictionary][MPHelpURLKey]; + NSString *urlString = NSBundle.mainBundle.infoDictionary[MPBundleHelpURLKey]; [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:urlString]]; } diff --git a/MacPass/MPConstants.h b/MacPass/MPConstants.h index f3ccf058..007906a2 100644 --- a/MacPass/MPConstants.h +++ b/MacPass/MPConstants.h @@ -25,10 +25,18 @@ #import + +/** + Common UTIs + */ FOUNDATION_EXPORT NSString *const MPPasteBoardType; FOUNDATION_EXPORT NSString *const MPKdbDocumentUTI; FOUNDATION_EXPORT NSString *const MPKdbxDocumentUTI; FOUNDATION_EXPORT NSString *const MPPluginUTI; - +/** + Bundle keys + */ +FOUNDATION_EXPORT NSString *const MPBundleHelpURLKey; // MPHelpURL +FOUNDATION_EXPORT NSString *const MPBundlePluginRepositoryURLKey; // MPPluginRepositoryURL #endif diff --git a/MacPass/MPConstants.m b/MacPass/MPConstants.m index 2d9e3f70..db9f025c 100644 --- a/MacPass/MPConstants.m +++ b/MacPass/MPConstants.m @@ -26,3 +26,7 @@ NSString *const MPPasteBoardType = @"com.hicknhack.macpass.pasteboard"; NSString *const MPKdbDocumentUTI = @"com.hicknhack.macpass.kdb"; NSString *const MPKdbxDocumentUTI = @"com.hicknhack.macpass.kdbx"; NSString *const MPPluginUTI = @"com.hicknhack.macpass.plugin"; + +NSString *const MPBundleHelpURLKey = @"MPHelpURL"; +NSString *const MPBundlePluginRepositoryURLKey = @"MPPluginRepositoryURL" + diff --git a/MacPass/MPPluginHost.h b/MacPass/MPPluginHost.h index 300aef2d..ddc83374 100644 --- a/MacPass/MPPluginHost.h +++ b/MacPass/MPPluginHost.h @@ -22,9 +22,11 @@ #import +/* Notifications for loading plugins */ FOUNDATION_EXPORT NSString *const MPPluginHostWillLoadPlugin; FOUNDATION_EXPORT NSString *const MPPluginHostDidLoadPlugin; +/* Keys used in info dictionary on notifications */ FOUNDATION_EXPORT NSString *const MPPluginHostPluginBundleIdentifiyerKey; @class MPPlugin; diff --git a/MacPass/MPPluginHost.m b/MacPass/MPPluginHost.m index 0b2214cc..5928596a 100644 --- a/MacPass/MPPluginHost.m +++ b/MacPass/MPPluginHost.m @@ -38,7 +38,6 @@ NSString *const MPPluginHostDidLoadPlugin = @"comt.hicknhack.macpass.MPPluginHos NSString *const MPPluginHostPluginBundleIdentifiyerKey = @"MPPluginHostPluginBundleIdentifiyerKey"; - @interface MPPluginHost () @property (strong) NSMutableArray *mutablePlugins; @property (nonatomic) BOOL loadUnsecurePlugins; diff --git a/MacPass/MacPass-Info.plist b/MacPass/MacPass-Info.plist index 1e04a25e..ff38dea8 100644 --- a/MacPass/MacPass-Info.plist +++ b/MacPass/MacPass-Info.plist @@ -67,6 +67,8 @@ ${MACOSX_DEPLOYMENT_TARGET} MPHelpURL https://github.com/mstarke/MacPass + MPPluginRepositoryURL + file:///Users/michael/Projekte/GitHub/MacPassPlugins/plugins.json NSHumanReadableCopyright Copyright © 2012-2017 HicknHack Software GmbH. All rights reserved. NSMainNibFile