From 86758b498c56da3b63ba67bade2b879b955a6a75 Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Sat, 8 Jun 2013 18:12:49 -0400 Subject: [PATCH] Open at Login and initial window improvements. [ADDED] Mac: Open at Login. [UPDATED] Mac: Mark users menu item when no user selected. [ADDED] Mac: Toggle open-at-login and enable-cloud from initial window. --- MasterPassword/ObjC/Mac/MPAppsWindow.xib | 846 ----------- MasterPassword/ObjC/Mac/MPInitialWindow.xib | 1329 +++++++++++++++++ MasterPassword/ObjC/Mac/MPMacAppDelegate.h | 8 +- MasterPassword/ObjC/Mac/MPMacAppDelegate.m | 125 +- MasterPassword/ObjC/Mac/MPMacConfig.h | 1 - MasterPassword/ObjC/Mac/MPMacConfig.m | 2 - .../ObjC/Mac/MPPasswordWindowController.m | 12 + .../ObjC/Mac/MasterPassword-Info.plist | 6 +- .../project.pbxproj | 316 ++++ .../MPLoginAppDelegate.h | 13 + .../MPLoginAppDelegate.m | 39 + .../MasterPassword-Mac-LoginHelper-Info.plist | 34 + ...asterPassword-Mac-LoginHelper.entitlements | 8 + .../en.lproj/InfoPlist.strings | 2 + .../MasterPassword-Mac-LoginHelper/main.m | 14 + .../project.pbxproj | 77 +- .../MasterPassword Mac (App Store).xcscheme | 12 +- .../MasterPassword Mac (Development).xcscheme | 14 +- MasterPassword/ObjC/Mac/en.lproj/MainMenu.xib | 164 +- 19 files changed, 1985 insertions(+), 1037 deletions(-) delete mode 100644 MasterPassword/ObjC/Mac/MPAppsWindow.xib create mode 100644 MasterPassword/ObjC/Mac/MPInitialWindow.xib create mode 100644 MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper.xcodeproj/project.pbxproj create mode 100644 MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper/MPLoginAppDelegate.h create mode 100644 MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper/MPLoginAppDelegate.m create mode 100644 MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper-Info.plist create mode 100644 MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper.entitlements create mode 100644 MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper/en.lproj/InfoPlist.strings create mode 100644 MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper/main.m diff --git a/MasterPassword/ObjC/Mac/MPAppsWindow.xib b/MasterPassword/ObjC/Mac/MPAppsWindow.xib deleted file mode 100644 index 5a9001f8..00000000 --- a/MasterPassword/ObjC/Mac/MPAppsWindow.xib +++ /dev/null @@ -1,846 +0,0 @@ - - - - 1080 - 12D78 - 3084 - 1187.37 - 626.00 - - com.apple.InterfaceBuilder.CocoaPlugin - 3084 - - - IBNSLayoutConstraint - NSButton - NSButtonCell - NSCustomObject - NSImageCell - NSImageView - NSTextField - NSTextFieldCell - NSView - NSWindowTemplate - - - com.apple.InterfaceBuilder.CocoaPlugin - - - PluginDependencyRecalculationVersion - - - - - MPMacAppDelegate - - - FirstResponder - - - NSApplication - - - 3 - 2 - {{196, 240}, {1000, 600}} - 544735232 - - NSWindow - - - {1000, 600} - {1000, 600} - - - 256 - - - - 268 - - - Apple PDF pasteboard type - Apple PICT pasteboard type - Apple PNG pasteboard type - NSFilenamesPboardType - NeXT Encapsulated PostScript v1.2 pasteboard type - NeXT TIFF v4.0 pasteboard type - - {1000, 600} - - - _NS:9 - YES - - 134217728 - 33554432 - - NSImage - shot-laptop-leaning-iphone - - _NS:9 - 0 - 0 - 0 - NO - - NO - YES - - - - 268 - - {{18, 18}, {964, 18}} - - _NS:9 - YES - - -2080374784 - 0 - Don't Show Again - - LucidaGrande - 13 - 1044 - - _NS:9 - - 1211912448 - 2 - - NSImage - NSSwitch - - - NSSwitch - - - - 200 - 25 - - NO - - - - 268 - - {{425, 42}, {150, 44}} - - _NS:9 - YES - - 67108864 - 0 - - - _NS:9 - - -2039201792 - 6 - - NSImage - appstore - - - - 200 - 25 - - NO - - - - 268 - {{17, 508}, {966, 72}} - - - _NS:1535 - YES - - 68157504 - 272630784 - QWNjZXNzIHlvdXIgcGFzc3dvcmRzCmZyb20gYW55d2hlcmUuA - - MyriadPro-Bold - 36 - 16 - - _NS:1535 - - - 6 - System - controlColor - - 3 - MC42NjY2NjY2NjY3AA - - - - 1 - MSAxIDEAA - - - NO - - - - 268 - {{357, 94}, {286, 24}} - - - _NS:1535 - YES - - 68157504 - 138413056 - Master Password for iPhone - - MyriadPro-Regular - 24 - 16 - - _NS:1535 - - - - - NO - - - {1000, 600} - - - - {{0, 0}, {1920, 1058}} - {1000, 622} - {1000, 622} - YES - - - - - - - iphoneAppStore: - - - - 206 - - - - appWindowDontShow - - - - 207 - - - - - - 0 - - - - - - -2 - - - File's Owner - - - -1 - - - First Responder - - - -3 - - - Application - - - 1 - - - - - - - - 2 - - - - - 3 - 0 - - 4 - 1 - - 8 - - 1000 - - 6 - 24 - 3 - - - - 9 - 0 - - 9 - 1 - - 0.0 - - 1000 - - 9 - 40 - 2 - - - - 9 - 0 - - 9 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 3 - 0 - - 4 - 1 - - 8 - - 1000 - - 6 - 24 - 3 - - - - 6 - 0 - - 6 - 1 - - 20 - - 1000 - - 8 - 29 - 3 - - - - 4 - 0 - - 4 - 1 - - 20 - - 1000 - - 8 - 29 - 3 - - - - 5 - 0 - - 5 - 1 - - 20 - - 1000 - - 8 - 29 - 3 - - - - 6 - 0 - - 6 - 1 - - 20 - - 1000 - - 8 - 29 - 3 - - - - 5 - 0 - - 5 - 1 - - 20 - - 1000 - - 8 - 29 - 3 - - - - 3 - 0 - - 3 - 1 - - 20 - - 1000 - - 8 - 29 - 3 - - - - 4 - 0 - - 4 - 1 - - 0.0 - - 1000 - - 9 - 40 - 3 - - - - 3 - 0 - - 3 - 1 - - 0.0 - - 1000 - - 9 - 40 - 3 - - - - 6 - 0 - - 6 - 1 - - 0.0 - - 1000 - - 9 - 40 - 3 - - - - 5 - 0 - - 5 - 1 - - 0.0 - - 1000 - - 9 - 40 - 3 - - - - 3 - 0 - - 3 - 1 - - 0.0 - - 1000 - - 9 - 40 - 3 - - - - 9 - 0 - - 9 - 1 - - 0.0 - - 1000 - - 9 - 40 - 2 - - - - - - - - - Container - - - 3 - - - - - - 8 - 0 - - 0 - 1 - - 600 - - 1000 - - 9 - 40 - 1 - - - - 7 - 0 - - 0 - 1 - - 1000 - - 1000 - - 9 - 40 - 1 - - - - Image - - - 4 - - - - - 59 - - - - - - 8 - 0 - - 0 - 1 - - 14 - - 1000 - - 9 - 40 - 1 - - - - Check - - - 60 - - - - - 77 - - - - - 149 - - - - - 173 - - - - - - Store - - - 174 - - - - - 219 - - - - - 220 - - - - - 226 - - - - - 227 - - - - - 268 - - - - - - - - 269 - - - - - 280 - - - - - 281 - - - - - 283 - - - - - - - - 284 - - - - - 231 - - - - - 298 - - - - - 299 - - - - - 230 - - - - - 265 - - - - - 266 - - - - - 229 - - - - - 267 - - - - - 264 - - - - - 260 - - - - - 291 - - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - com.apple.InterfaceBuilder.CocoaPlugin - {{357, 418}, {480, 270}} - - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - - - - - - - - - - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - - - - - 337 - - - 0 - IBCocoaFramework - YES - 3 - - {15, 15} - {150, 44} - {1000, 600} - - YES - - diff --git a/MasterPassword/ObjC/Mac/MPInitialWindow.xib b/MasterPassword/ObjC/Mac/MPInitialWindow.xib new file mode 100644 index 00000000..b707dfb8 --- /dev/null +++ b/MasterPassword/ObjC/Mac/MPInitialWindow.xib @@ -0,0 +1,1329 @@ + + + + 1080 + 12D78 + 3084 + 1187.37 + 626.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 3084 + + + IBNSLayoutConstraint + NSButton + NSButtonCell + NSCustomObject + NSCustomView + NSImageCell + NSImageView + NSTextField + NSTextFieldCell + NSView + NSWindowTemplate + + + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + + MPMacAppDelegate + + + FirstResponder + + + NSApplication + + + 3 + 2 + {{196, 240}, {833, 540}} + 544735232 + + NSWindow + + + + + 256 + + + + 268 + + + + 268 + + {{341, 20}, {150, 44}} + + + + + 1 + 1 + + 3 + MAA + + + _NS:9 + YES + + 67108864 + 0 + + + LucidaGrande + 13 + 1044 + + _NS:9 + + -2039201792 + 6 + + NSImage + appstore + + + + 200 + 25 + + NO + + + + 268 + {{244, 72}, {345, 29}} + + + + + 1 + 1 + + + _NS:1535 + YES + + 68157504 + 138413056 + Get Master Password for iPhone + + HelveticaNeue-Light + 24 + 16 + + _NS:1535 + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 1 + MSAxIDEAA + + + NO + + + + 268 + {{17, 408}, {799, 72}} + + + + + 1 + 1 + + + _NS:1535 + YES + + 68157504 + 272630784 + QWNjZXNzIHlvdXIgcGFzc3dvcmRzCmZyb20gYW55d2hlcmUuA + + MyriadPro-Bold + 32 + 16 + + _NS:1535 + + + + + NO + + + + 268 + + + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + NSFilenamesPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT TIFF v4.0 pasteboard type + + {833, 500} + + + + _NS:9 + YES + + 134217728 + 33554432 + + NSImage + shot-laptop-leaning-iphone + + _NS:9 + 0 + 0 + 0 + NO + + NO + YES + + + {{0, 40}, {833, 500}} + + + + YES + _NS:9 + NSView + + + + 268 + {{691, 8}, {122, 25}} + + + + _NS:9 + YES + + 67108864 + 134217728 + Enable iCloud + + _NS:9 + + -1232846848 + 163 + + + 400 + 75 + + NO + + + + 268 + {{561, 8}, {122, 25}} + + + + _NS:9 + YES + + 67108864 + 134217728 + Open at Login + + _NS:9 + + -1232846848 + 163 + + + 400 + 75 + + NO + + + + 268 + {{20, 13}, {536, 17}} + + + + _NS:1535 + YES + + 68157504 + 272630784 + To begin, press: command, control and P or access the ●●●| menu icon. + + _NS:1535 + + + + 6 + System + controlTextColor + + + + NO + + + {833, 540} + + + + + {{0, 0}, {1920, 1058}} + {10000000000000, 10000000000000} + YES + + + + + + + iphoneAppStore: + + + + 206 + + + + openAtLoginButton + + + + 571 + + + + enableCloudButton + + + + 572 + + + + togglePreference: + + + + 573 + + + + togglePreference: + + + + 574 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + + + + + + 2 + + + + + 4 + 0 + + 4 + 1 + + 10 + + 1000 + + 9 + 40 + 3 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 6 + 0 + + 6 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 4 + 0 + + 4 + 1 + + 10 + + 1000 + + 9 + 40 + 3 + + + + 3 + 0 + + 4 + 1 + + 8 + + 1000 + + 9 + 40 + 3 + + + + 11 + 0 + + 11 + 1 + + 0.0 + + 1000 + + 9 + 40 + 2 + + + + 11 + 0 + + 11 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 5 + 1 + + 23 + + 1000 + + 3 + 9 + 3 + + + + 6 + 0 + + 6 + 1 + + 0.0 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 5 + 1 + + 0.0 + + 1000 + + 8 + 29 + 3 + + + + 3 + 0 + + 3 + 1 + + 0.0 + + 1000 + + 9 + 40 + 3 + + + + + + + + Container + + + 369 + + + + + 3 + 0 + + 4 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 4 + 0 + + 4 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 9 + 0 + + 9 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 9 + 0 + + 9 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 3 + 0 + + 3 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 6 + 0 + + 6 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 5 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 5 + 1 + + 0.0 + + 1000 + + 8 + 29 + 3 + + + + 3 + 0 + + 3 + 1 + + 0.0 + + 1000 + + 9 + 40 + 3 + + + + 6 + 0 + + 6 + 1 + + 0.0 + + 1000 + + 8 + 29 + 3 + + + + 4 + 0 + + 4 + 1 + + 0.0 + + 1000 + + 9 + 40 + 3 + + + + + + + + + + 374 + + + + + 375 + + + + + 3 + + + + + + 8 + 0 + + 0 + 1 + + 500 + + 1000 + + 3 + 9 + 1 + + + + Image + + + 4 + + + + + 378 + + + + + 379 + + + + + 380 + + + + + 381 + + + + + 268 + + + + + + + + 269 + + + + + 385 + + + + + 387 + + + + + 283 + + + + + + + + 284 + + + + + 393 + + + + + 409 + + + + + + 7 + 0 + + 0 + 1 + + 122 + + 1000 + + 3 + 9 + 1 + + + + + + 410 + + + + + 444 + + + + + 507 + + + + + 508 + + + + + 7 + 0 + + 0 + 1 + + 122 + + 1000 + + 3 + 9 + 1 + + + + + + + 509 + + + + + 510 + + + + + 513 + + + + + 514 + + + + + 515 + + + + + 396 + + + + + 173 + + + + + + Store + + + 395 + + + + + 174 + + + + + 542 + + + + + 543 + + + + + 544 + + + + + 545 + + + + + 546 + + + + + 562 + + + + + + 7 + 0 + + 0 + 1 + + 530 + + 1000 + + 3 + 9 + 1 + + + + + + 563 + + + + + 565 + + + + + 567 + + + + + 568 + + + + + 569 + + + + + 566 + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin + {{357, 418}, {480, 270}} + + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + + + + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + + + + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + 575 + + + + + MPAppDelegate_Shared + PearlAppDelegate + + IBProjectSource + ./Classes/MPAppDelegate_Shared.h + + + + MPMacAppDelegate + MPAppDelegate_Shared + + id + id + NSMenuItem + id + id + id + id + + + + iphoneAppStore: + id + + + lock: + id + + + newUser: + NSMenuItem + + + rebuildCloud: + id + + + showPasswordWindow: + id + + + terminate: + id + + + togglePreference: + id + + + + NSMenuItem + NSMenuItem + NSMenuItem + NSButton + NSMenuItem + NSButton + NSMenuItem + NSMenuItem + NSMenuItem + NSMenuItem + NSMenu + NSMenuItem + NSMenuItem + + + + createUserItem + NSMenuItem + + + dialogStyleHUD + NSMenuItem + + + dialogStyleRegular + NSMenuItem + + + enableCloudButton + NSButton + + + lockItem + NSMenuItem + + + openAtLoginButton + NSButton + + + openAtLoginItem + NSMenuItem + + + rememberPasswordItem + NSMenuItem + + + savePasswordItem + NSMenuItem + + + showItem + NSMenuItem + + + statusMenu + NSMenu + + + useCloudItem + NSMenuItem + + + usersItem + NSMenuItem + + + + IBProjectSource + ./Classes/MPMacAppDelegate.h + + + + NSLayoutConstraint + NSObject + + IBProjectSource + ./Classes/NSLayoutConstraint.h + + + + + 0 + IBCocoaFramework + YES + 3 + + {150, 44} + {1000, 600} + + YES + + diff --git a/MasterPassword/ObjC/Mac/MPMacAppDelegate.h b/MasterPassword/ObjC/Mac/MPMacAppDelegate.h index 4793f2b5..6162e200 100644 --- a/MasterPassword/ObjC/Mac/MPMacAppDelegate.h +++ b/MasterPassword/ObjC/Mac/MPMacAppDelegate.h @@ -18,17 +18,19 @@ @property(nonatomic, weak) IBOutlet NSMenuItem *lockItem; @property(nonatomic, weak) IBOutlet NSMenuItem *showItem; @property(nonatomic, strong) IBOutlet NSMenu *statusMenu; -@property(nonatomic, weak) IBOutlet NSMenuItem *useICloudItem; +@property(nonatomic, weak) IBOutlet NSMenuItem *useCloudItem; @property(nonatomic, weak) IBOutlet NSMenuItem *rememberPasswordItem; +@property(nonatomic, weak) IBOutlet NSMenuItem *openAtLoginItem; @property(nonatomic, weak) IBOutlet NSMenuItem *savePasswordItem; @property(nonatomic, weak) IBOutlet NSMenuItem *createUserItem; @property(nonatomic, weak) IBOutlet NSMenuItem *usersItem; @property(nonatomic, weak) IBOutlet NSMenuItem *dialogStyleRegular; @property(nonatomic, weak) IBOutlet NSMenuItem *dialogStyleHUD; -@property(nonatomic, weak) IBOutlet NSButton *appWindowDontShow; +@property(nonatomic, weak) IBOutlet NSButton *openAtLoginButton; +@property(nonatomic, weak) IBOutlet NSButton *enableCloudButton; - (IBAction)showPasswordWindow:(id)sender; -- (IBAction)togglePreference:(NSMenuItem *)sender; +- (IBAction)togglePreference:(id)sender; - (IBAction)newUser:(NSMenuItem *)sender; - (IBAction)lock:(id)sender; - (IBAction)rebuildCloud:(id)sender; diff --git a/MasterPassword/ObjC/Mac/MPMacAppDelegate.m b/MasterPassword/ObjC/Mac/MPMacAppDelegate.m index 08ab0bd9..7d4f50c9 100644 --- a/MasterPassword/ObjC/Mac/MPMacAppDelegate.m +++ b/MasterPassword/ObjC/Mac/MPMacAppDelegate.m @@ -10,10 +10,13 @@ #import "MPAppDelegate_Key.h" #import "MPAppDelegate_Store.h" #import +#import + +#define LOGIN_HELPER_BUNDLE_ID @"com.lyndir.lhunath.MasterPassword.Mac.LoginHelper" @interface MPMacAppDelegate() -@property(nonatomic, strong) NSWindowController *appsWindow; +@property(nonatomic, strong) NSWindowController *initialWindow; @end @implementation MPMacAppDelegate @@ -101,7 +104,7 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven if (!activeUser && [user.name isEqualToString:[MPMacConfig get].usedUserName]) [self selectUser:userItem]; } - + [self updateMenuItems]; } @@ -124,12 +127,18 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven [self.statusView popUpMenu]; } -- (IBAction)togglePreference:(NSMenuItem *)sender { +- (IBAction)togglePreference:(id)sender { - if (sender == self.useICloudItem) - [self storeManager].cloudEnabled = !(sender.state == NSOnState); + if (sender == self.enableCloudButton) + [self storeManager].cloudEnabled = (self.enableCloudButton.state == NSOnState); + if (sender == self.useCloudItem) + [self storeManager].cloudEnabled = !(self.useCloudItem.state == NSOnState); if (sender == self.rememberPasswordItem) [MPConfig get].rememberLogin = [NSNumber numberWithBool:![[MPConfig get].rememberLogin boolValue]]; + if (sender == self.openAtLoginButton) + [self setLoginItemEnabled:(self.openAtLoginButton.state == NSOnState)]; + if (sender == self.openAtLoginItem) + [self setLoginItemEnabled:!(self.openAtLoginItem.state == NSOnState)]; if (sender == self.savePasswordItem) { [MPMacAppDelegate managedObjectContextPerformBlockAndWait:^(NSManagedObjectContext *context) { MPUserEntity *activeUser = [[MPMacAppDelegate get] activeUserInContext:context]; @@ -151,8 +160,8 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven NSAlert *alert = [NSAlert alertWithMessageText:@"New User" defaultButton:@"Create User" alternateButton:nil otherButton:@"Cancel" informativeTextWithFormat:@"To begin, enter your full name.\n\n" - @"IMPORTANT: Enter your name correctly, including the right capitalization, " - @"as you would on an official document."]; + @"IMPORTANT: Enter your name correctly, including the right capitalization, " + @"as you would on an official document."]; NSTextField *nameField = [[NSTextField alloc] initWithFrame:NSMakeRect( 0, 0, 200, 22 )]; [alert setAccessoryView:nameField]; [alert layout]; @@ -195,10 +204,10 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven - (IBAction)terminate:(id)sender { - NSLog(@"Closing: Terminating"); + NSLog( @"Closing: Terminating" ); [self.passwordWindow close]; self.passwordWindow = nil; - + [NSApp terminate:nil]; } @@ -206,9 +215,9 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://itunes.apple.com/app/id510296984"]]; - NSLog(@"Closing: App Store"); - [self.appWindowDontShow.window close]; - self.appWindowDontShow = nil; + NSLog( @"Closing: App Store" ); + [self.initialWindow close]; + self.initialWindow = nil; } - (void)didUpdateConfigForKey:(SEL)configKey fromValue:(id)oldValue { @@ -236,7 +245,7 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven // Status item. self.statusView = [[RHStatusItemView alloc] initWithStatusBarItem: - [[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength]]; + [[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength]]; self.statusView.image = [NSImage imageNamed:@"menu-icon"]; self.statusView.menu = self.statusMenu; self.statusView.target = self; @@ -257,12 +266,12 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven self.savePasswordItem.state = [[MPMacAppDelegate get] activeUserForThread].saveKey? NSOnState: NSOffState; self.dialogStyleRegular.state = ![[MPMacConfig get].dialogStyleHUD boolValue]? NSOnState: NSOffState; self.dialogStyleHUD.state = [[MPMacConfig get].dialogStyleHUD boolValue]? NSOnState: NSOffState; - + if ([note.object isEqual:NSStringFromSelector( @selector(dialogStyleHUD) )]) { if (![self.passwordWindow.window isVisible]) self.passwordWindow = nil; else { - NSLog(@"Closing: dialogStyleHUD && passwordWindow.isVisible"); + NSLog( @"Closing: dialogStyleHUD && passwordWindow.isVisible" ); [self.passwordWindow close]; self.passwordWindow = nil; [self showPasswordWindow:nil]; @@ -275,7 +284,7 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven EventHotKeyRef hotKeyRef; EventTypeSpec hotKeyEvents[1] = { { .eventClass = kEventClassKeyboard, .eventKind = kEventHotKeyPressed } }; OSStatus status = InstallApplicationEventHandler(NewEventHandlerUPP( MPHotKeyHander ), GetEventTypeCount( hotKeyEvents ), - hotKeyEvents, (__bridge void *)self, NULL); + hotKeyEvents, (__bridge void *)self, NULL); if (status != noErr) err(@"Error installing application event handler: %d", status); status = RegisterEventHotKey( 35 /* p */, controlKey + cmdKey, MPShowHotKey, GetApplicationEventTarget(), 0, &hotKeyRef ); @@ -284,43 +293,37 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven status = RegisterEventHotKey( 35 /* p */, controlKey + optionKey + cmdKey, MPLockHotKey, GetApplicationEventTarget(), 0, &hotKeyRef ); if (status != noErr) err(@"Error registering 'lock' hotkey: %d", status); - + // Initial display. [NSApp activateIgnoringOtherApps:YES]; - if (YES || [[MPMacConfig get].showAppWindow boolValue]) { - [self.appsWindow = [[NSWindowController alloc] initWithWindowNibName:@"MPAppsWindow" owner:self] showWindow:self]; - [[NSNotificationCenter defaultCenter] addObserverForName:NSWindowWillCloseNotification object:self.appsWindow.window queue:nil - usingBlock:^(NSNotification *note) { - [MPMacConfig get].showAppWindow = @(self.appWindowDontShow.state == NSOffState); - }]; - } - [[NSOperationQueue mainQueue] addOperation:[NSBlockOperation blockOperationWithBlock:^{ - if (YES || [[MPMacConfig get].firstRun boolValue]) { - [self showMenu]; - } - }]]; + if ([[MPMacConfig get].firstRun boolValue]) + [self.initialWindow = [[NSWindowController alloc] initWithWindowNibName:@"MPInitialWindow" owner:self] showWindow:self]; } - (void)setActiveUser:(MPUserEntity *)activeUser { BOOL reopenPasswordWindow = [self.passwordWindow.window isVisible]; - + if (![[self activeUserForThread].objectID isEqual:activeUser.objectID]) { - NSLog(@"Closing: activeUser changed: %@ -> %@, reopening: %d", [self activeUserForThread].objectID, activeUser.objectID, reopenPasswordWindow); + NSLog( @"Closing: activeUser changed: %@ -> %@, reopening: %d", [self activeUserForThread].objectID, activeUser.objectID, + reopenPasswordWindow ); [self.passwordWindow close]; self.passwordWindow = nil; [super setActiveUser:activeUser]; } + self.usersItem.state = NSMixedState; [[[self.usersItem submenu] itemArray] enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - if ([[obj representedObject] isEqual:[activeUser objectID]]) + if ([[obj representedObject] isEqual:[activeUser objectID]]) { [obj setState:NSOnState]; + self.usersItem.state = NSOffState; + } else [obj setState:NSOffState]; }]; [MPMacConfig get].usedUserName = activeUser.name; - + if (reopenPasswordWindow) [self showPasswordWindow:nil]; } @@ -352,6 +355,9 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven self.lockItem.toolTip = @"Master Password is currently locked."; } + BOOL loginItemEnabled = [self loginItemEnabled]; + self.openAtLoginItem.state = loginItemEnabled? NSOnState: NSOffState; + self.openAtLoginButton.state = loginItemEnabled? NSOnState: NSOffState; self.rememberPasswordItem.state = [[MPConfig get].rememberLogin boolValue]? NSOnState: NSOffState; self.savePasswordItem.state = activeUser.saveKey? NSOnState: NSOffState; @@ -371,35 +377,68 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven self.savePasswordItem.toolTip = nil; } - self.useICloudItem.state = self.storeManager.cloudEnabled? NSOnState: NSOffState; - self.useICloudItem.enabled = self.storeManager.cloudAvailable; + self.useCloudItem.state = self.storeManager.cloudEnabled? NSOnState: NSOffState; + self.enableCloudButton.state = self.storeManager.cloudEnabled? NSOnState: NSOffState; + self.useCloudItem.enabled = self.storeManager.cloudAvailable; if (self.storeManager.cloudAvailable) { - self.useICloudItem.title = @"Use iCloud"; - self.useICloudItem.toolTip = nil; + self.useCloudItem.title = @"Use iCloud"; + self.useCloudItem.toolTip = nil; } else { - self.useICloudItem.title = @"Use iCloud (Unavailable)"; - self.useICloudItem.toolTip = @"iCloud is not set up for your Mac user."; + self.useCloudItem.title = @"Use iCloud (Unavailable)"; + self.useCloudItem.toolTip = @"iCloud is not set up for your Mac user."; } } - (IBAction)showPasswordWindow:(id)sender { - + [NSApp activateIgnoringOtherApps:YES]; - + // If no user, can't activate. if (![self activeUserForThread]) { - [[NSAlert alertWithMessageText:@"No User Selected" defaultButton:[PearlStrings get].commonButtonOkay alternateButton:nil otherButton:nil informativeTextWithFormat:@"Begin by selecting or creating your user from the status menu (●●●|) next to the clock.", nil] runModal]; + [[NSAlert alertWithMessageText:@"No User Selected" defaultButton:[PearlStrings get].commonButtonOkay alternateButton:nil + otherButton:nil informativeTextWithFormat: + @"Begin by selecting or creating your user from the status menu (●●●|) next to the clock."] + runModal]; return; } // Don't show window if we weren't already running (ie. if we haven't been activated before). if (!self.passwordWindow) self.passwordWindow = [[MPPasswordWindowController alloc] initWithWindowNibName:@"MPPasswordWindowController"]; - + [self.passwordWindow showWindow:self]; } +- (void)setLoginItemEnabled:(BOOL)enabled { + + BOOL loginItemEnabled = [self loginItemEnabled]; + if (loginItemEnabled != enabled) { + if (SMLoginItemSetEnabled( (__bridge CFStringRef)LOGIN_HELPER_BUNDLE_ID, (Boolean)enabled ) == true) + loginItemEnabled = enabled; + else + wrn(@"Failed to set login item."); + } + + self.openAtLoginItem.state = loginItemEnabled? NSOnState: NSOffState; + self.openAtLoginButton.state = loginItemEnabled? NSOnState: NSOffState; +} + +- (BOOL)loginItemEnabled { + + // The easy and sane method (SMJobCopyDictionary) can pose problems when the app is sandboxed. -_- + NSArray *jobs = (__bridge_transfer NSArray *)SMCopyAllJobDictionaries( kSMDomainUserLaunchd ); + + for (NSDictionary *job in jobs) + if ([LOGIN_HELPER_BUNDLE_ID isEqualToString:[job objectForKey:@"Label"]]) { + dbg(@"loginItemEnabled: %@", @([[job objectForKey:@"OnDemand"] boolValue])); + return [[job objectForKey:@"OnDemand"] boolValue]; + } + + dbg(@"loginItemEnabled: not found"); + return NO; +} + - (void)applicationWillResignActive:(NSNotification *)notification { if (![[MPConfig get].rememberLogin boolValue]) diff --git a/MasterPassword/ObjC/Mac/MPMacConfig.h b/MasterPassword/ObjC/Mac/MPMacConfig.h index a2e1c58e..9540e648 100644 --- a/MasterPassword/ObjC/Mac/MPMacConfig.h +++ b/MasterPassword/ObjC/Mac/MPMacConfig.h @@ -12,6 +12,5 @@ @property(nonatomic, retain) NSString *usedUserName; @property(nonatomic, retain) NSNumber *dialogStyleHUD; -@property(nonatomic, strong) NSNumber *showAppWindow; @end diff --git a/MasterPassword/ObjC/Mac/MPMacConfig.m b/MasterPassword/ObjC/Mac/MPMacConfig.m index a6aad9f0..693f8d26 100644 --- a/MasterPassword/ObjC/Mac/MPMacConfig.m +++ b/MasterPassword/ObjC/Mac/MPMacConfig.m @@ -10,7 +10,6 @@ @dynamic usedUserName; @dynamic dialogStyleHUD; -@dynamic showAppWindow; - (id)init { @@ -20,7 +19,6 @@ [self.defaults registerDefaults:@{ NSStringFromSelector( @selector(iTunesID) ) : @"510296984", NSStringFromSelector( @selector(dialogStyleHUD) ) : @NO, - NSStringFromSelector( @selector(showAppWindow) ) : @YES }]; return self; diff --git a/MasterPassword/ObjC/Mac/MPPasswordWindowController.m b/MasterPassword/ObjC/Mac/MPPasswordWindowController.m index 299347af..32d59084 100644 --- a/MasterPassword/ObjC/Mac/MPPasswordWindowController.m +++ b/MasterPassword/ObjC/Mac/MPPasswordWindowController.m @@ -84,6 +84,18 @@ [super windowDidLoad]; } +- (BOOL)shouldCloseDocument { + NSLog(@"shouldCloseDocument:\n%@", [NSThread callStackSymbols]); + + return [super shouldCloseDocument]; +} + +- (void)close { + NSLog(@"close:\n%@", [NSThread callStackSymbols]); + + [super close]; +} + - (void)handleUnloadedOrLocked { if (!self.inProgress && ![MPMacAppDelegate get].key) { diff --git a/MasterPassword/ObjC/Mac/MasterPassword-Info.plist b/MasterPassword/ObjC/Mac/MasterPassword-Info.plist index efc860f3..81cfdd52 100644 --- a/MasterPassword/ObjC/Mac/MasterPassword-Info.plist +++ b/MasterPassword/ObjC/Mac/MasterPassword-Info.plist @@ -2,6 +2,8 @@ + ATSApplicationFontsPath + . CFBundleDevelopmentRegion en CFBundleExecutable @@ -14,6 +16,8 @@ 6.0 CFBundleName ${PRODUCT_NAME} + CFBundleDisplayName + Master Password CFBundlePackageType APPL CFBundleShortVersionString @@ -34,7 +38,5 @@ MainMenu NSPrincipalClass NSApplication - ATSApplicationFontsPath - . diff --git a/MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper.xcodeproj/project.pbxproj b/MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper.xcodeproj/project.pbxproj new file mode 100644 index 00000000..1a27680f --- /dev/null +++ b/MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper.xcodeproj/project.pbxproj @@ -0,0 +1,316 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + DAD9B5CF176299B9001835F9 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = DAD9B5CD176299B9001835F9 /* InfoPlist.strings */; }; + DAD9B5D1176299B9001835F9 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DAD9B5D0176299B9001835F9 /* main.m */; }; + DAD9B5D8176299B9001835F9 /* MPLoginAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DAD9B5D7176299B9001835F9 /* MPLoginAppDelegate.m */; }; + DAD9B5EC1762AAA6001835F9 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DAD9B5EB1762AAA6001835F9 /* AppKit.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + DAD9B5C1176299B9001835F9 /* MasterPassword-Mac-LoginHelper.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "MasterPassword-Mac-LoginHelper.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + DAD9B5CC176299B9001835F9 /* MasterPassword-Mac-LoginHelper-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MasterPassword-Mac-LoginHelper-Info.plist"; sourceTree = ""; }; + DAD9B5CE176299B9001835F9 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + DAD9B5D0176299B9001835F9 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + DAD9B5D6176299B9001835F9 /* MPLoginAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPLoginAppDelegate.h; sourceTree = ""; }; + DAD9B5D7176299B9001835F9 /* MPLoginAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MPLoginAppDelegate.m; sourceTree = ""; }; + DAD9B5EA17629C56001835F9 /* MasterPassword-Mac-LoginHelper.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "MasterPassword-Mac-LoginHelper.entitlements"; sourceTree = ""; }; + DAD9B5EB1762AAA6001835F9 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + DAD9B5BE176299B9001835F9 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + DAD9B5EC1762AAA6001835F9 /* AppKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + DAD9B5B8176299B9001835F9 = { + isa = PBXGroup; + children = ( + DAD9B5CA176299B9001835F9 /* MasterPassword-Mac-LoginHelper */, + DAD9B5C3176299B9001835F9 /* Frameworks */, + DAD9B5C2176299B9001835F9 /* Products */, + ); + sourceTree = ""; + }; + DAD9B5C2176299B9001835F9 /* Products */ = { + isa = PBXGroup; + children = ( + DAD9B5C1176299B9001835F9 /* MasterPassword-Mac-LoginHelper.app */, + ); + name = Products; + sourceTree = ""; + }; + DAD9B5C3176299B9001835F9 /* Frameworks */ = { + isa = PBXGroup; + children = ( + DAD9B5EB1762AAA6001835F9 /* AppKit.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + DAD9B5CA176299B9001835F9 /* MasterPassword-Mac-LoginHelper */ = { + isa = PBXGroup; + children = ( + DAD9B5EA17629C56001835F9 /* MasterPassword-Mac-LoginHelper.entitlements */, + DAD9B5D6176299B9001835F9 /* MPLoginAppDelegate.h */, + DAD9B5D7176299B9001835F9 /* MPLoginAppDelegate.m */, + DAD9B5CB176299B9001835F9 /* Supporting Files */, + ); + path = "MasterPassword-Mac-LoginHelper"; + sourceTree = ""; + }; + DAD9B5CB176299B9001835F9 /* Supporting Files */ = { + isa = PBXGroup; + children = ( + DAD9B5CC176299B9001835F9 /* MasterPassword-Mac-LoginHelper-Info.plist */, + DAD9B5CD176299B9001835F9 /* InfoPlist.strings */, + DAD9B5D0176299B9001835F9 /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + DAD9B5C0176299B9001835F9 /* MasterPassword-Mac-LoginHelper */ = { + isa = PBXNativeTarget; + buildConfigurationList = DAD9B5DE176299B9001835F9 /* Build configuration list for PBXNativeTarget "MasterPassword-Mac-LoginHelper" */; + buildPhases = ( + DAD9B5BD176299B9001835F9 /* Sources */, + DAD9B5BE176299B9001835F9 /* Frameworks */, + DAD9B5BF176299B9001835F9 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "MasterPassword-Mac-LoginHelper"; + productName = "MasterPassword-Mac-LoginHelper"; + productReference = DAD9B5C1176299B9001835F9 /* MasterPassword-Mac-LoginHelper.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + DAD9B5B9176299B9001835F9 /* Project object */ = { + isa = PBXProject; + attributes = { + CLASSPREFIX = MP; + LastUpgradeCheck = 0460; + ORGANIZATIONNAME = "Maarten Billemont"; + }; + buildConfigurationList = DAD9B5BC176299B9001835F9 /* Build configuration list for PBXProject "MasterPassword-Mac-LoginHelper" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = DAD9B5B8176299B9001835F9; + productRefGroup = DAD9B5C2176299B9001835F9 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + DAD9B5C0176299B9001835F9 /* MasterPassword-Mac-LoginHelper */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + DAD9B5BF176299B9001835F9 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + DAD9B5CF176299B9001835F9 /* InfoPlist.strings in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + DAD9B5BD176299B9001835F9 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + DAD9B5D1176299B9001835F9 /* main.m in Sources */, + DAD9B5D8176299B9001835F9 /* MPLoginAppDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + DAD9B5CD176299B9001835F9 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + DAD9B5CE176299B9001835F9 /* en */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + DAD9B5DC176299B9001835F9 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES; + CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES; + CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_CXX0X_EXTENSIONS = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES; + CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CLANG_WARN__EXIT_TIME_DESTRUCTORS = YES; + CODE_SIGN_IDENTITY = "Developer ID Application: Maarten Billemont"; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; + GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_SIGN_COMPARE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNKNOWN_PRAGMAS = YES; + GCC_WARN_UNUSED_LABEL = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.8; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "${TARGET_NAME}"; + PROVISIONING_PROFILE = ""; + SDKROOT = macosx; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + DAD9B5DD176299B9001835F9 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + CLANG_ANALYZER_SECURITY_FLOATLOOPCOUNTER = YES; + CLANG_ANALYZER_SECURITY_INSECUREAPI_RAND = YES; + CLANG_ANALYZER_SECURITY_INSECUREAPI_STRCPY = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_CXX0X_EXTENSIONS = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_ATOMIC_PROPERTIES = YES; + CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CLANG_WARN__EXIT_TIME_DESTRUCTORS = YES; + CODE_SIGN_IDENTITY = "Developer ID Application: Maarten Billemont"; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; + GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; + GCC_WARN_ABOUT_MISSING_NEWLINE = YES; + GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES; + GCC_WARN_INITIALIZER_NOT_FULLY_BRACKETED = YES; + GCC_WARN_NON_VIRTUAL_DESTRUCTOR = YES; + GCC_WARN_SIGN_COMPARE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNKNOWN_PRAGMAS = YES; + GCC_WARN_UNUSED_LABEL = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.8; + PRODUCT_NAME = "${TARGET_NAME}"; + PROVISIONING_PROFILE = ""; + SDKROOT = macosx; + SKIP_INSTALL = YES; + }; + name = Release; + }; + DAD9B5DF176299B9001835F9 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_ENTITLEMENTS = "MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper.entitlements"; + CODE_SIGN_IDENTITY = "Developer ID Application: Maarten Billemont"; + INFOPLIST_FILE = "$(SRCROOT)/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper-Info.plist"; + PROVISIONING_PROFILE = ""; + }; + name = Debug; + }; + DAD9B5E0176299B9001835F9 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_ENTITLEMENTS = "MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper.entitlements"; + INFOPLIST_FILE = "$(SRCROOT)/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper-Info.plist"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + DAD9B5BC176299B9001835F9 /* Build configuration list for PBXProject "MasterPassword-Mac-LoginHelper" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + DAD9B5DC176299B9001835F9 /* Debug */, + DAD9B5DD176299B9001835F9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + DAD9B5DE176299B9001835F9 /* Build configuration list for PBXNativeTarget "MasterPassword-Mac-LoginHelper" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + DAD9B5DF176299B9001835F9 /* Debug */, + DAD9B5E0176299B9001835F9 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = DAD9B5B9176299B9001835F9 /* Project object */; +} diff --git a/MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper/MPLoginAppDelegate.h b/MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper/MPLoginAppDelegate.h new file mode 100644 index 00000000..cdf169f1 --- /dev/null +++ b/MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper/MPLoginAppDelegate.h @@ -0,0 +1,13 @@ +// +// MPAppDelegate.h +// MasterPassword-Mac-LoginHelper +// +// Created by Maarten Billemont on 2013-06-07. +// Copyright (c) 2013 Maarten Billemont. All rights reserved. +// + +#import + +@interface MPLoginAppDelegate : NSObject + +@end diff --git a/MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper/MPLoginAppDelegate.m b/MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper/MPLoginAppDelegate.m new file mode 100644 index 00000000..4807eb23 --- /dev/null +++ b/MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper/MPLoginAppDelegate.m @@ -0,0 +1,39 @@ +// +// MPAppDelegate.m +// MasterPassword-Mac-LoginHelper +// +// Created by Maarten Billemont on 2013-06-07. +// Copyright (c) 2013 Maarten Billemont. All rights reserved. +// + +#import "MPLoginAppDelegate.h" + +@implementation MPLoginAppDelegate + +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { + + NSLog(@"LoginHelper did start"); + for (NSRunningApplication *app in [[NSWorkspace sharedWorkspace] runningApplications]) + if ([[app bundleIdentifier] isEqualToString:@"com.lyndir.lhunath.MasterPassword.Mac"]) { + NSLog(@"Already running."); + [NSApp terminate:nil]; + return; + } + + NSString *path = [[NSBundle mainBundle] bundlePath]; + NSLog(@"Path: %@", path); + NSArray *p = [path pathComponents]; + NSLog(@"PathComponents: %@", p); + NSMutableArray *pathComponents = [NSMutableArray arrayWithArray:p]; + [pathComponents removeLastObject]; + [pathComponents removeLastObject]; + [pathComponents removeLastObject]; + [pathComponents addObject:@"MacOS"]; + [pathComponents addObject:@"MasterPassword"]; + NSLog(@"PathComponents modified: %@", pathComponents); + NSString *newPath = [NSString pathWithComponents:pathComponents]; + NSLog(@"newPath: %@", newPath); + NSLog(@"launchApplication: %@", @([[NSWorkspace sharedWorkspace] launchApplication:newPath])); +} + +@end diff --git a/MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper-Info.plist b/MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper-Info.plist new file mode 100644 index 00000000..f5fd9bb7 --- /dev/null +++ b/MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper-Info.plist @@ -0,0 +1,34 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.lyndir.lhunath.MasterPassword.Mac.LoginHelper + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSBackgroundOnly + + LSMinimumSystemVersion + ${MACOSX_DEPLOYMENT_TARGET} + NSHumanReadableCopyright + Copyright © 2013 Maarten Billemont. All rights reserved. + NSPrincipalClass + NSApplication + + diff --git a/MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper.entitlements b/MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper.entitlements new file mode 100644 index 00000000..852fa1a4 --- /dev/null +++ b/MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.security.app-sandbox + + + diff --git a/MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper/en.lproj/InfoPlist.strings b/MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper/en.lproj/InfoPlist.strings new file mode 100644 index 00000000..477b28ff --- /dev/null +++ b/MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper/en.lproj/InfoPlist.strings @@ -0,0 +1,2 @@ +/* Localized versions of Info.plist keys */ + diff --git a/MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper/main.m b/MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper/main.m new file mode 100644 index 00000000..835a0fd8 --- /dev/null +++ b/MasterPassword/ObjC/Mac/MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper/main.m @@ -0,0 +1,14 @@ +// +// main.m +// MasterPassword-Mac-LoginHelper +// +// Created by Maarten Billemont on 2013-06-07. +// Copyright (c) 2013 Maarten Billemont. All rights reserved. +// + +#import + +int main(int argc, char *argv[]) +{ + return NSApplicationMain(argc, (const char **)argv); +} diff --git a/MasterPassword/ObjC/Mac/MasterPassword-Mac.xcodeproj/project.pbxproj b/MasterPassword/ObjC/Mac/MasterPassword-Mac.xcodeproj/project.pbxproj index 914dc4c8..2146f2f1 100644 --- a/MasterPassword/ObjC/Mac/MasterPassword-Mac.xcodeproj/project.pbxproj +++ b/MasterPassword/ObjC/Mac/MasterPassword-Mac.xcodeproj/project.pbxproj @@ -11,7 +11,7 @@ 93D395F08A087F8A24689347 /* NSArray+Indexing.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39067C0AFDC581794E2B8 /* NSArray+Indexing.m */; }; 93D39C34FE35830EF5BE1D2A /* NSArray+Indexing.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D396D04E57792A54D437AC /* NSArray+Indexing.h */; }; 93D39E281E3658B30550CB55 /* NSDictionary+Indexing.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39AA1EE2E1E7B81372240 /* NSDictionary+Indexing.m */; }; - DA0933CA1747A56A00DE1CEF /* MPAppsWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = DA0933C91747A56A00DE1CEF /* MPAppsWindow.xib */; }; + DA0933CA1747A56A00DE1CEF /* MPInitialWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = DA0933C91747A56A00DE1CEF /* MPInitialWindow.xib */; }; DA0933CC1747AD2D00DE1CEF /* shot-laptop-leaning-iphone.png in Resources */ = {isa = PBXBuildFile; fileRef = DA0933CB1747AD2D00DE1CEF /* shot-laptop-leaning-iphone.png */; }; DA0933D01747B91B00DE1CEF /* appstore.png in Resources */ = {isa = PBXBuildFile; fileRef = DA0933CF1747B91B00DE1CEF /* appstore.png */; }; DA16B33F170661D4000A0EAB /* libUbiquityStoreManager.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DA4425CB1557BED40052177D /* libUbiquityStoreManager.a */; }; @@ -130,6 +130,8 @@ DACA29741705E1A8002C6C22 /* dictionary.lst in Resources */ = {isa = PBXBuildFile; fileRef = DACA29721705E1A8002C6C22 /* dictionary.lst */; }; DACA298D1705E2BD002C6C22 /* JRSwizzle.h in Headers */ = {isa = PBXBuildFile; fileRef = DACA29771705E2BD002C6C22 /* JRSwizzle.h */; }; DACA299A1705E2BD002C6C22 /* JRSwizzle.m in Sources */ = {isa = PBXBuildFile; fileRef = DACA298C1705E2BD002C6C22 /* JRSwizzle.m */; }; + DAD9B5F01762CAA4001835F9 /* ServiceManagement.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DAD9B5EF1762CAA4001835F9 /* ServiceManagement.framework */; }; + DAD9B5F11762CAB9001835F9 /* MasterPassword-Mac-LoginHelper.app in Copy LoginHelper */ = {isa = PBXBuildFile; fileRef = DAD9B5E6176299BA001835F9 /* MasterPassword-Mac-LoginHelper.app */; }; DAFE4A1315039824003ABA7C /* NSObject+PearlExport.h in Headers */ = {isa = PBXBuildFile; fileRef = DAFE45D815039823003ABA7C /* NSObject+PearlExport.h */; }; DAFE4A1415039824003ABA7C /* NSObject+PearlExport.m in Sources */ = {isa = PBXBuildFile; fileRef = DAFE45D915039823003ABA7C /* NSObject+PearlExport.m */; }; DAFE4A1515039824003ABA7C /* NSString+PearlNSArrayFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = DAFE45DA15039823003ABA7C /* NSString+PearlNSArrayFormat.h */; }; @@ -189,16 +191,25 @@ remoteGlobalIDString = DAC6326B148680650075AEA5; remoteInfo = jrswizzle; }; + DAD9B5E5176299BA001835F9 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = DAD9B5E1176299B9001835F9 /* MasterPassword-Mac-LoginHelper.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = DAD9B5C1176299B9001835F9; + remoteInfo = "MasterPassword-Mac-LoginHelper"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ - DABC6BFF175D8C85000C15D4 /* CopyFiles */ = { + DAD9B5EE1762CA3A001835F9 /* Copy LoginHelper */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; - dstPath = "include/${PRODUCT_NAME}"; - dstSubfolderSpec = 16; + dstPath = Contents/Library/LoginItems; + dstSubfolderSpec = 1; files = ( + DAD9B5F11762CAB9001835F9 /* MasterPassword-Mac-LoginHelper.app in Copy LoginHelper */, ); + name = "Copy LoginHelper"; runOnlyForDeploymentPostprocessing = 0; }; /* End PBXCopyFilesBuildPhase section */ @@ -208,7 +219,7 @@ 93D393B97158D7BE9332EA53 /* NSDictionary+Indexing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+Indexing.h"; sourceTree = ""; }; 93D396D04E57792A54D437AC /* NSArray+Indexing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+Indexing.h"; sourceTree = ""; }; 93D39AA1EE2E1E7B81372240 /* NSDictionary+Indexing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+Indexing.m"; sourceTree = ""; }; - DA0933C91747A56A00DE1CEF /* MPAppsWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MPAppsWindow.xib; sourceTree = ""; }; + DA0933C91747A56A00DE1CEF /* MPInitialWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MPInitialWindow.xib; sourceTree = ""; }; DA0933CB1747AD2D00DE1CEF /* shot-laptop-leaning-iphone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "shot-laptop-leaning-iphone.png"; sourceTree = ""; }; DA0933CF1747B91B00DE1CEF /* appstore.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = appstore.png; sourceTree = ""; }; DA16B340170661DB000A0EAB /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; }; @@ -226,7 +237,7 @@ DA4425CB1557BED40052177D /* libUbiquityStoreManager.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libUbiquityStoreManager.a; sourceTree = BUILT_PRODUCTS_DIR; }; DA4C45F2173B57B700745CC5 /* NSURL+UbiquityStoreManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSURL+UbiquityStoreManager.h"; sourceTree = ""; }; DA4C45F3173B57B700745CC5 /* NSURL+UbiquityStoreManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSURL+UbiquityStoreManager.m"; sourceTree = ""; }; - DA5BFA44147E415C00F98B1E /* Master Password.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Master Password.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + DA5BFA44147E415C00F98B1E /* MasterPassword.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MasterPassword.app; sourceTree = BUILT_PRODUCTS_DIR; }; DA5BFA4A147E415C00F98B1E /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; DA5BFA4C147E415C00F98B1E /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; DA5BFA4E147E415C00F98B1E /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; @@ -356,6 +367,8 @@ DACA29771705E2BD002C6C22 /* JRSwizzle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JRSwizzle.h; sourceTree = ""; }; DACA298C1705E2BD002C6C22 /* JRSwizzle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JRSwizzle.m; sourceTree = ""; }; DAD312C01552A20800A3F9ED /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = usr/lib/libsqlite3.dylib; sourceTree = SDKROOT; }; + DAD9B5E1176299B9001835F9 /* MasterPassword-Mac-LoginHelper.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "MasterPassword-Mac-LoginHelper.xcodeproj"; path = "MasterPassword-Mac-LoginHelper/MasterPassword-Mac-LoginHelper.xcodeproj"; sourceTree = ""; }; + DAD9B5EF1762CAA4001835F9 /* ServiceManagement.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ServiceManagement.framework; path = System/Library/Frameworks/ServiceManagement.framework; sourceTree = SDKROOT; }; DAEBC45214F6364500987BF6 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; DAFE45D815039823003ABA7C /* NSObject+PearlExport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSObject+PearlExport.h"; sourceTree = ""; }; DAFE45D915039823003ABA7C /* NSObject+PearlExport.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSObject+PearlExport.m"; sourceTree = ""; }; @@ -425,6 +438,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + DAD9B5F01762CAA4001835F9 /* ServiceManagement.framework in Frameworks */, DABC6C16175D8E3A000C15D4 /* libRHStatusItemView.a in Frameworks */, DA16B33F170661D4000A0EAB /* libUbiquityStoreManager.a in Frameworks */, DA16B341170661DB000A0EAB /* Carbon.framework in Frameworks */, @@ -477,7 +491,7 @@ DA5BFA45147E415C00F98B1E /* Products */ = { isa = PBXGroup; children = ( - DA5BFA44147E415C00F98B1E /* Master Password.app */, + DA5BFA44147E415C00F98B1E /* MasterPassword.app */, DAC77CAD148291A600BCF976 /* libPearl.a */, DAC6326C148680650075AEA5 /* libjrswizzle.a */, DA4425CB1557BED40052177D /* libUbiquityStoreManager.a */, @@ -490,6 +504,7 @@ DA5BFA47147E415C00F98B1E /* Frameworks */ = { isa = PBXGroup; children = ( + DAD9B5EF1762CAA4001835F9 /* ServiceManagement.framework */, DA16B343170661EE000A0EAB /* Cocoa.framework */, DA16B340170661DB000A0EAB /* Carbon.framework */, DA6701DD16406B7300B61001 /* Social.framework */, @@ -572,6 +587,7 @@ DA5E5CB21724A667003798D8 /* Mac */ = { isa = PBXGroup; children = ( + DAD9B5E1176299B9001835F9 /* MasterPassword-Mac-LoginHelper.xcodeproj */, DA5E5CB31724A667003798D8 /* MPMacAppDelegate.h */, DA5E5CB41724A667003798D8 /* MPMacAppDelegate.m */, DA5E5CB51724A667003798D8 /* MPMacConfig.h */, @@ -586,7 +602,7 @@ DA5E5CC21724A667003798D8 /* InfoPlist.strings */, DA5E5CC41724A667003798D8 /* MainMenu.xib */, DA5E5CC61724A667003798D8 /* main.m */, - DA0933C91747A56A00DE1CEF /* MPAppsWindow.xib */, + DA0933C91747A56A00DE1CEF /* MPInitialWindow.xib */, ); path = Mac; sourceTree = ""; @@ -766,6 +782,14 @@ path = Pearl/External/jrswizzle; sourceTree = ""; }; + DAD9B5E2176299B9001835F9 /* Products */ = { + isa = PBXGroup; + children = ( + DAD9B5E6176299BA001835F9 /* MasterPassword-Mac-LoginHelper.app */, + ); + name = Products; + sourceTree = ""; + }; DAFE45D715039823003ABA7C /* Pearl */ = { isa = PBXGroup; children = ( @@ -948,23 +972,24 @@ productReference = DA4425CB1557BED40052177D /* libUbiquityStoreManager.a */; productType = "com.apple.product-type.library.static"; }; - DA5BFA43147E415C00F98B1E /* Master Password */ = { + DA5BFA43147E415C00F98B1E /* MasterPassword */ = { isa = PBXNativeTarget; - buildConfigurationList = DA5BFA6D147E415C00F98B1E /* Build configuration list for PBXNativeTarget "Master Password" */; + buildConfigurationList = DA5BFA6D147E415C00F98B1E /* Build configuration list for PBXNativeTarget "MasterPassword" */; buildPhases = ( DA5BFA40147E415C00F98B1E /* Sources */, DA5BFA41147E415C00F98B1E /* Frameworks */, DA5BFA42147E415C00F98B1E /* Resources */, DA6556E314D55F3000841C99 /* Run Script: GIT version -> Info.plist */, DAD3125D155288AA00A3F9ED /* Run Script: Crashlytics */, + DAD9B5EE1762CA3A001835F9 /* Copy LoginHelper */, ); buildRules = ( ); dependencies = ( ); - name = "Master Password"; + name = MasterPassword; productName = MasterPassword; - productReference = DA5BFA44147E415C00F98B1E /* Master Password.app */; + productReference = DA5BFA44147E415C00F98B1E /* MasterPassword.app */; productType = "com.apple.product-type.application"; }; DABC6C00175D8C85000C15D4 /* RHStatusItemView */ = { @@ -973,7 +998,6 @@ buildPhases = ( DABC6BFD175D8C85000C15D4 /* Sources */, DABC6BFE175D8C85000C15D4 /* Frameworks */, - DABC6BFF175D8C85000C15D4 /* CopyFiles */, ); buildRules = ( ); @@ -1041,9 +1065,15 @@ mainGroup = DA5BFA39147E415C00F98B1E; productRefGroup = DA5BFA45147E415C00F98B1E /* Products */; projectDirPath = ""; + projectReferences = ( + { + ProductGroup = DAD9B5E2176299B9001835F9 /* Products */; + ProjectRef = DAD9B5E1176299B9001835F9 /* MasterPassword-Mac-LoginHelper.xcodeproj */; + }, + ); projectRoot = ""; targets = ( - DA5BFA43147E415C00F98B1E /* Master Password */, + DA5BFA43147E415C00F98B1E /* MasterPassword */, DAC77CAC148291A600BCF976 /* Pearl */, DAC6326B148680650075AEA5 /* jrswizzle */, DA4425CA1557BED40052177D /* UbiquityStoreManager */, @@ -1053,6 +1083,16 @@ }; /* End PBXProject section */ +/* Begin PBXReferenceProxy section */ + DAD9B5E6176299BA001835F9 /* MasterPassword-Mac-LoginHelper.app */ = { + isa = PBXReferenceProxy; + fileType = wrapper.application; + path = "MasterPassword-Mac-LoginHelper.app"; + remoteRef = DAD9B5E5176299BA001835F9 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + /* Begin PBXResourcesBuildPhase section */ DA3EF17615A47744003ABF4E /* Resources */ = { isa = PBXResourcesBuildPhase; @@ -1124,7 +1164,7 @@ DA5E5D0A1724A667003798D8 /* InfoPlist.strings in Resources */, DA5E5D0B1724A667003798D8 /* MainMenu.xib in Resources */, DA5E5D551724F9C8003798D8 /* MasterPassword.iconset in Resources */, - DA0933CA1747A56A00DE1CEF /* MPAppsWindow.xib in Resources */, + DA0933CA1747A56A00DE1CEF /* MPInitialWindow.xib in Resources */, DA0933CC1747AD2D00DE1CEF /* shot-laptop-leaning-iphone.png in Resources */, DA0933D01747B91B00DE1CEF /* appstore.png in Resources */, ); @@ -1275,7 +1315,7 @@ /* Begin PBXTargetDependency section */ DA3EF19E15A47AEB003ABF4E /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = DA5BFA43147E415C00F98B1E /* Master Password */; + target = DA5BFA43147E415C00F98B1E /* MasterPassword */; targetProxy = DA3EF19D15A47AEB003ABF4E /* PBXContainerItemProxy */; }; DAC63286148681200075AEA5 /* PBXTargetDependency */ = { @@ -1518,6 +1558,7 @@ CLANG_WARN__EXIT_TIME_DESTRUCTORS = YES; CODE_SIGN_IDENTITY = "3rd Party Mac Developer Application"; COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = ( "$(inherit)", "\"$(SRCROOT)/../../../External\"", @@ -1567,6 +1608,7 @@ OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = "${TARGET_NAME}"; PROVISIONING_PROFILE = ""; + RUN_CLANG_STATIC_ANALYZER = YES; SDKROOT = macosx; SKIP_INSTALL = YES; VALIDATE_PRODUCT = YES; @@ -1820,7 +1862,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = "AdHoc-Mac"; }; - DA5BFA6D147E415C00F98B1E /* Build configuration list for PBXNativeTarget "Master Password" */ = { + DA5BFA6D147E415C00F98B1E /* Build configuration list for PBXNativeTarget "MasterPassword" */ = { isa = XCConfigurationList; buildConfigurations = ( DA5BFA6E147E415C00F98B1E /* Debug-Mac */, @@ -1838,6 +1880,7 @@ DABC6C0D175D8C85000C15D4 /* AppStore-Mac */, ); defaultConfigurationIsVisible = 0; + defaultConfigurationName = "AdHoc-Mac"; }; DAC63274148680650075AEA5 /* Build configuration list for PBXNativeTarget "jrswizzle" */ = { isa = XCConfigurationList; diff --git a/MasterPassword/ObjC/Mac/MasterPassword-Mac.xcodeproj/xcshareddata/xcschemes/MasterPassword Mac (App Store).xcscheme b/MasterPassword/ObjC/Mac/MasterPassword-Mac.xcodeproj/xcshareddata/xcschemes/MasterPassword Mac (App Store).xcscheme index 52a0ed1d..be135976 100644 --- a/MasterPassword/ObjC/Mac/MasterPassword-Mac.xcodeproj/xcshareddata/xcschemes/MasterPassword Mac (App Store).xcscheme +++ b/MasterPassword/ObjC/Mac/MasterPassword-Mac.xcodeproj/xcshareddata/xcschemes/MasterPassword Mac (App Store).xcscheme @@ -15,8 +15,8 @@ @@ -43,8 +43,8 @@ @@ -61,8 +61,8 @@ diff --git a/MasterPassword/ObjC/Mac/MasterPassword-Mac.xcodeproj/xcshareddata/xcschemes/MasterPassword Mac (Development).xcscheme b/MasterPassword/ObjC/Mac/MasterPassword-Mac.xcodeproj/xcshareddata/xcschemes/MasterPassword Mac (Development).xcscheme index dcf4dc80..47d16316 100644 --- a/MasterPassword/ObjC/Mac/MasterPassword-Mac.xcodeproj/xcshareddata/xcschemes/MasterPassword Mac (Development).xcscheme +++ b/MasterPassword/ObjC/Mac/MasterPassword-Mac.xcodeproj/xcshareddata/xcschemes/MasterPassword Mac (Development).xcscheme @@ -15,8 +15,8 @@ @@ -43,15 +43,15 @@ + isEnabled = "NO"> @@ -74,8 +74,8 @@ diff --git a/MasterPassword/ObjC/Mac/en.lproj/MainMenu.xib b/MasterPassword/ObjC/Mac/en.lproj/MainMenu.xib index beaa3894..cecc2db5 100644 --- a/MasterPassword/ObjC/Mac/en.lproj/MainMenu.xib +++ b/MasterPassword/ObjC/Mac/en.lproj/MainMenu.xib @@ -128,6 +128,27 @@ + + + Open At Login + + 2147483647 + + + + + + YES + Always open Master Password at start-up. + + 2147483647 + + + + Always open Master Password at start-up. + + + Remember Password @@ -310,7 +331,7 @@ - useICloudItem + useCloudItem @@ -452,6 +473,22 @@ 784 + + + togglePreference: + + + + 787 + + + + openAtLoginItem + + + + 788 + @@ -548,6 +585,8 @@ + + @@ -662,6 +701,16 @@ + + 785 + + + + + 786 + + + @@ -704,121 +753,16 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin - 784 - - - - - MPAppDelegate_Shared - NSObject - - IBProjectSource - ./Classes/MPAppDelegate_Shared.h - - - - MPMacAppDelegate - MPAppDelegate_Shared - - id - NSMenuItem - id - id - id - NSMenuItem - - - - lock: - id - - - newUser: - NSMenuItem - - - rebuildCloud: - id - - - showPasswordWindow: - id - - - terminate: - id - - - togglePreference: - NSMenuItem - - - - NSMenuItem - NSMenuItem - NSMenuItem - NSMenuItem - NSMenuItem - NSMenuItem - NSMenuItem - NSMenu - NSMenuItem - NSMenuItem - - - - createUserItem - NSMenuItem - - - dialogStyleHUD - NSMenuItem - - - dialogStyleRegular - NSMenuItem - - - lockItem - NSMenuItem - - - rememberPasswordItem - NSMenuItem - - - savePasswordItem - NSMenuItem - - - showItem - NSMenuItem - - - statusMenu - NSMenu - - - useICloudItem - NSMenuItem - - - usersItem - NSMenuItem - - - - IBProjectSource - ./Classes/MPMacAppDelegate.h - - - + 788 + 0 IBCocoaFramework