diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index b4c77e95..e1fb4308 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -149,6 +149,7 @@ 4C701CBC178618A000581B88 /* 12_RemoteTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C701CBB178618A000581B88 /* 12_RemoteTemplate.pdf */; }; 4C7155D81A10DB6D00979307 /* IconSelection.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C7155DA1A10DB6D00979307 /* IconSelection.xib */; }; 4C735FC02035FCBF00708D53 /* MPPluginEntryActionContext.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C735FBF2035FCBF00708D53 /* MPPluginEntryActionContext.m */; }; + 4C73B6F1215E64A7009787F7 /* MPWelcomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C73B6EF215E64A7009787F7 /* MPWelcomeViewController.m */; }; 4C76155C1764C04C0015A1A6 /* GeneralSettings.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C76155E1764C04C0015A1A6 /* GeneralSettings.xib */; }; 4C7615681764C0C40015A1A6 /* PasswordInputView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C76156A1764C0C40015A1A6 /* PasswordInputView.xib */; }; 4C76156D1764C0E20015A1A6 /* InspectorView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C76156F1764C0E20015A1A6 /* InspectorView.xib */; }; @@ -180,7 +181,7 @@ 4C7B637F1C0CB57300D7038C /* KeePassKit.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 4C7B63791C0CB55600D7038C /* KeePassKit.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 4C7B63801C0CB57300D7038C /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 4C7B637A1C0CB55600D7038C /* Sparkle.framework */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 4C7BD07619FE94C900C7AA5C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4C7BD07519FE94C900C7AA5C /* Assets.xcassets */; }; - 4C7F8B681A10B68400CCB83D /* WelcomeWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C7F8B6A1A10B68400CCB83D /* WelcomeWindow.xib */; }; + 4C7F8B681A10B68400CCB83D /* WelcomeView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C7F8B6A1A10B68400CCB83D /* WelcomeView.xib */; }; 4C80304A1E2FBAA300133E4C /* MPTestKeyMapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C8030491E2FBAA300133E4C /* MPTestKeyMapper.m */; }; 4C82046A1FCDC07800EB24A4 /* MPPickfieldViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C8204681FCDC07800EB24A4 /* MPPickfieldViewController.m */; }; 4C82046E1FCDC8A100EB24A4 /* MPPickfieldTableModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C82046D1FCDC8A100EB24A4 /* MPPickfieldTableModel.m */; }; @@ -300,7 +301,7 @@ /* Begin PBXFileReference section */ 4825CC811C414D57003E37E9 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/DatabaseSettingsWindow.strings; sourceTree = ""; }; 4825CC821C414D57003E37E9 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/PasswordEditWindow.strings; sourceTree = ""; }; - 4825CC831C414D57003E37E9 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/WelcomeWindow.strings; sourceTree = ""; }; + 4825CC831C414D57003E37E9 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/WelcomeView.strings; sourceTree = ""; }; 4825CC841C414D57003E37E9 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/GeneralSettings.strings; sourceTree = ""; }; 4825CC851C414D57003E37E9 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/IntegrationSettings.strings; sourceTree = ""; }; 4825CC861C414D57003E37E9 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/WorkflowSettings.strings; sourceTree = ""; }; @@ -465,7 +466,7 @@ 4C41610E1F50333C003BC0AF /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/IconSelection.strings; sourceTree = ""; }; 4C41610F1F50333C003BC0AF /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/DatePickingView.strings; sourceTree = ""; }; 4C4161101F50333C003BC0AF /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/ReferenceBuilderView.strings; sourceTree = ""; }; - 4C4161111F50333C003BC0AF /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/WelcomeWindow.strings; sourceTree = ""; }; + 4C4161111F50333C003BC0AF /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/WelcomeView.strings; sourceTree = ""; }; 4C4161121F50333C003BC0AF /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/MainMenu.strings; sourceTree = ""; }; 4C4161131F50333C003BC0AF /* es */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = ""; }; 4C4161141F50333C003BC0AF /* es */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = es; path = es.lproj/Credits.rtf; sourceTree = ""; }; @@ -574,6 +575,8 @@ 4C7155EC1A10DB7900979307 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/IconSelection.strings; sourceTree = ""; }; 4C735FBE2035FCBF00708D53 /* MPPluginEntryActionContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPPluginEntryActionContext.h; sourceTree = ""; }; 4C735FBF2035FCBF00708D53 /* MPPluginEntryActionContext.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MPPluginEntryActionContext.m; sourceTree = ""; }; + 4C73B6EE215E64A7009787F7 /* MPWelcomeViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPWelcomeViewController.h; sourceTree = ""; }; + 4C73B6EF215E64A7009787F7 /* MPWelcomeViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MPWelcomeViewController.m; sourceTree = ""; }; 4C73EB941FBB58730033000F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/DatabaseSettingsWindow.strings; sourceTree = ""; }; 4C73EB951FBB5A8F0033000F /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/AutotypeCandidateSelectionView.strings; sourceTree = ""; }; 4C73EB961FBB5A910033000F /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/AutotypeBuilderView.strings; sourceTree = ""; }; @@ -633,12 +636,12 @@ 4C7B63791C0CB55600D7038C /* KeePassKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = KeePassKit.framework; path = Carthage/Build/Mac/KeePassKit.framework; sourceTree = ""; }; 4C7B637A1C0CB55600D7038C /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sparkle.framework; path = Carthage/Build/Mac/Sparkle.framework; sourceTree = ""; }; 4C7BD07519FE94C900C7AA5C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 4C7F8B691A10B68400CCB83D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/WelcomeWindow.xib; sourceTree = ""; }; - 4C7F8B741A10B69300CCB83D /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/WelcomeWindow.strings; sourceTree = ""; }; - 4C7F8B761A10B69400CCB83D /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/WelcomeWindow.strings"; sourceTree = ""; }; - 4C7F8B781A10B69500CCB83D /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/WelcomeWindow.strings; sourceTree = ""; }; - 4C7F8B7A1A10B69700CCB83D /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/WelcomeWindow.strings; sourceTree = ""; }; - 4C7F8B7C1A10B69800CCB83D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/WelcomeWindow.strings; sourceTree = ""; }; + 4C7F8B691A10B68400CCB83D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/WelcomeView.xib; sourceTree = ""; }; + 4C7F8B741A10B69300CCB83D /* nl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nl; path = nl.lproj/WelcomeView.strings; sourceTree = ""; }; + 4C7F8B761A10B69400CCB83D /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/WelcomeView.strings"; sourceTree = ""; }; + 4C7F8B781A10B69500CCB83D /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/WelcomeView.strings; sourceTree = ""; }; + 4C7F8B7A1A10B69700CCB83D /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/WelcomeView.strings; sourceTree = ""; }; + 4C7F8B7C1A10B69800CCB83D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/WelcomeView.strings; sourceTree = ""; }; 4C8030491E2FBAA300133E4C /* MPTestKeyMapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPTestKeyMapper.m; sourceTree = ""; }; 4C8204671FCDC07800EB24A4 /* MPPickfieldViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPPickfieldViewController.h; sourceTree = ""; }; 4C8204681FCDC07800EB24A4 /* MPPickfieldViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MPPickfieldViewController.m; sourceTree = ""; }; @@ -648,7 +651,7 @@ 4C83814115BF4677001AE468 /* MPDocumentWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPDocumentWindowController.m; sourceTree = ""; }; 4C840C441D773E5D0081F605 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/DatabaseSettingsWindow.strings; sourceTree = ""; }; 4C840C451D773E5D0081F605 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/PasswordEditWindow.strings; sourceTree = ""; }; - 4C840C461D773E5D0081F605 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/WelcomeWindow.strings; sourceTree = ""; }; + 4C840C461D773E5D0081F605 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/WelcomeView.strings; sourceTree = ""; }; 4C840C471D773E5D0081F605 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/GeneralSettings.strings; sourceTree = ""; }; 4C840C481D773E5D0081F605 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/IntegrationSettings.strings; sourceTree = ""; }; 4C840C491D773E5D0081F605 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = pl.lproj/WorkflowSettings.strings; sourceTree = ""; }; @@ -901,7 +904,7 @@ 6A74B0742076F4B50049BC29 /* sv-SE */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "sv-SE"; path = "sv-SE.lproj/AutotypeCandidateSelectionView.strings"; sourceTree = ""; }; 6A74B0752076F4B50049BC29 /* sv-SE */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "sv-SE"; path = "sv-SE.lproj/PickcharView.strings"; sourceTree = ""; }; 6A74B0762076F4B50049BC29 /* sv-SE */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "sv-SE"; path = "sv-SE.lproj/PickfieldView.strings"; sourceTree = ""; }; - 6A74B0772076F4B50049BC29 /* sv-SE */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "sv-SE"; path = "sv-SE.lproj/WelcomeWindow.strings"; sourceTree = ""; }; + 6A74B0772076F4B50049BC29 /* sv-SE */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "sv-SE"; path = "sv-SE.lproj/WelcomeView.strings"; sourceTree = ""; }; 6A74B0782076F4B50049BC29 /* sv-SE */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "sv-SE"; path = "sv-SE.lproj/MainMenu.strings"; sourceTree = ""; }; 6A74B0792076F4B50049BC29 /* sv-SE */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = "sv-SE"; path = "sv-SE.lproj/Localizable.stringsdict"; sourceTree = ""; }; 6A74B07A2076F4B60049BC29 /* sv-SE */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "sv-SE"; path = "sv-SE.lproj/Localizable.strings"; sourceTree = ""; }; @@ -937,7 +940,7 @@ FA13910E1F9CDB2D0033D256 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.stringsdict; name = pl; path = pl.lproj/Localizable.stringsdict; sourceTree = ""; }; FA638D0E1C39BFCB00B10CC6 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/DatabaseSettingsWindow.strings; sourceTree = ""; }; FA638D0F1C39BFCB00B10CC6 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/PasswordEditWindow.strings; sourceTree = ""; }; - FA638D101C39BFCB00B10CC6 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/WelcomeWindow.strings; sourceTree = ""; }; + FA638D101C39BFCB00B10CC6 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/WelcomeView.strings; sourceTree = ""; }; FA638D111C39BFCB00B10CC6 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/GeneralSettings.strings; sourceTree = ""; }; FA638D121C39BFCB00B10CC6 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/IntegrationSettings.strings; sourceTree = ""; }; FA638D131C39BFCC00B10CC6 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/WorkflowSettings.strings; sourceTree = ""; }; @@ -1541,6 +1544,9 @@ 4C8204671FCDC07800EB24A4 /* MPPickfieldViewController.h */, 4C8204681FCDC07800EB24A4 /* MPPickfieldViewController.m */, 4C0B5341205C1561003D277E /* PickfieldView.xib */, + 4C73B6EE215E64A7009787F7 /* MPWelcomeViewController.h */, + 4C73B6EF215E64A7009787F7 /* MPWelcomeViewController.m */, + 4C7F8B6A1A10B68400CCB83D /* WelcomeView.xib */, ); name = "View Controller"; sourceTree = ""; @@ -1624,7 +1630,6 @@ isa = PBXGroup; children = ( 4C1DDCDC1711ECEB00C98DA3 /* PasswordCreatorWindow.xib */, - 4C7F8B6A1A10B68400CCB83D /* WelcomeWindow.xib */, ); name = Windows; sourceTree = ""; @@ -1877,7 +1882,7 @@ 4C3826761AD04C24007D7D67 /* harddiskTemplate.pdf in Resources */, 4C0DBEF51BF508DE00F9B287 /* PluginSettings.xib in Resources */, 4CF6653820E67A140008A25C /* PluginDataView.xib in Resources */, - 4C7F8B681A10B68400CCB83D /* WelcomeWindow.xib in Resources */, + 4C7F8B681A10B68400CCB83D /* WelcomeView.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1928,6 +1933,7 @@ 4C37A84015B8B474005EF8EE /* MPOutlineDataSource.m in Sources */, 4CA0B2F915BCAF6700654E32 /* MPGeneralSettingsController.m in Sources */, 4C8F0C791FD05A6A00BE157F /* NSString+MPPrettyPasswordDisplay.m in Sources */, + 4C73B6F1215E64A7009787F7 /* MPWelcomeViewController.m in Sources */, 4C6B7C7D18BE7EB0001D5D77 /* MPDocument+History.m in Sources */, 4CA0B2FC15BCAF8600654E32 /* MPSettingsWindowController.m in Sources */, 4C4F72D118DF704400E8D378 /* DDHotKeyTextField.m in Sources */, @@ -2251,7 +2257,7 @@ name = MainMenu.xib; sourceTree = ""; }; - 4C7F8B6A1A10B68400CCB83D /* WelcomeWindow.xib */ = { + 4C7F8B6A1A10B68400CCB83D /* WelcomeView.xib */ = { isa = PBXVariantGroup; children = ( 4C7F8B691A10B68400CCB83D /* Base */, @@ -2266,7 +2272,7 @@ 4C4161111F50333C003BC0AF /* es */, 6A74B0772076F4B50049BC29 /* sv-SE */, ); - name = WelcomeWindow.xib; + name = WelcomeView.xib; sourceTree = ""; }; 4C888C8E16EB6C91003D34A1 /* Localizable.strings */ = { diff --git a/MacPass/Base.lproj/WelcomeView.xib b/MacPass/Base.lproj/WelcomeView.xib new file mode 100644 index 00000000..95d7f820 --- /dev/null +++ b/MacPass/Base.lproj/WelcomeView.xib @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MacPass/Base.lproj/WelcomeWindow.xib b/MacPass/Base.lproj/WelcomeWindow.xib deleted file mode 100644 index 5b7ed2af..00000000 --- a/MacPass/Base.lproj/WelcomeWindow.xib +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/MacPass/MPAppDelegate.h b/MacPass/MPAppDelegate.h index b5f17a00..0e2c1315 100644 --- a/MacPass/MPAppDelegate.h +++ b/MacPass/MPAppDelegate.h @@ -24,12 +24,8 @@ APPKIT_EXTERN NSString *const MPDidChangeStoredKeyFilesSettings; -@class MPAutotypeDaemon; - @interface MPAppDelegate : NSObject -@property (strong) IBOutlet NSWindow *passwordCreatorWindow; -@property (strong) IBOutlet NSWindow *welcomeWindow; @property (weak) IBOutlet NSMenuItem *saveMenuItem; @property (weak) IBOutlet NSMenuItem *fixAutotypeMenuItem; @property (weak) IBOutlet NSMenuItem *fileNewMenuItem; @@ -52,5 +48,6 @@ APPKIT_EXTERN NSString *const MPDidChangeStoredKeyFilesSettings; - (void)lockAllDocuments; - (void)showWelcomeWindow; +- (void)hideWelcomeWindow; @end diff --git a/MacPass/MPAppDelegate.m b/MacPass/MPAppDelegate.m index 65b08d7d..e8a61b41 100644 --- a/MacPass/MPAppDelegate.m +++ b/MacPass/MPAppDelegate.m @@ -39,6 +39,7 @@ #import "MPTemporaryFileStorageCenter.h" #import "MPValueTransformerHelper.h" #import "MPUserNotificationCenterDelegate.h" +#import "MPWelcomeViewController.h" #import "NSApplication+MPAdditions.h" @@ -55,6 +56,8 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi BOOL _shouldOpenFile; // YES if app was started to open a } +@property (strong) NSWindow *welcomeWindow; +@property (strong) IBOutlet NSWindow *passwordCreatorWindow; @property (strong, nonatomic) MPSettingsWindowController *settingsController; @property (strong, nonatomic) MPPasswordCreatorViewController *passwordCreatorController; @@ -249,10 +252,25 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi } - (void)showWelcomeWindow { - [self _loadWelcomeWindow]; + if(!self.welcomeWindow) { + self.welcomeWindow = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 100, 100) + styleMask:NSWindowStyleMaskTitled|NSWindowStyleMaskClosable|NSWindowStyleMaskResizable + backing:NSBackingStoreBuffered + defer:NO]; + self.welcomeWindow.releasedWhenClosed = NO; + } + if(!self.welcomeWindow.contentViewController) { + self.welcomeWindow.contentViewController = [[MPWelcomeViewController alloc] init]; + } + + [self.welcomeWindow center]; [self.welcomeWindow makeKeyAndOrderFront:nil]; } +- (void)hideWelcomeWindow { + [self.welcomeWindow orderOut:nil]; +} + - (void)clearRememberdKeyFiles:(id)sender { [NSUserDefaults.standardUserDefaults removeObjectForKey:kMPSettingsKeyRememeberdKeysForDatabases]; } @@ -296,11 +314,4 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi } } -- (void)_loadWelcomeWindow { - if(!_welcomeWindow) { - NSArray *topLevelObject; - [NSBundle.mainBundle loadNibNamed:@"WelcomeWindow" owner:self topLevelObjects:&topLevelObject]; - } -} - @end diff --git a/MacPass/MPDocumentController.m b/MacPass/MPDocumentController.m index 7144c203..59731ee8 100644 --- a/MacPass/MPDocumentController.m +++ b/MacPass/MPDocumentController.m @@ -78,6 +78,11 @@ return [super typeForContentsOfURL:url error:outError]; } +- (void)addDocument:(NSDocument *)document { + [((MPAppDelegate *)NSApp.delegate) hideWelcomeWindow]; + [super addDocument:document]; +} + - (BOOL)reopenLastDocument { if(self.documents.count > 0) { return YES; // The document is already open diff --git a/MacPass/MPWelcomeViewController.h b/MacPass/MPWelcomeViewController.h new file mode 100644 index 00000000..a1c3dc63 --- /dev/null +++ b/MacPass/MPWelcomeViewController.h @@ -0,0 +1,17 @@ +// +// MPWelcomeWindowViewController.h +// MacPass +// +// Created by Michael Starke on 28.09.18. +// Copyright © 2018 HicknHack Software GmbH. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface MPWelcomeViewController : NSViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/MacPass/MPWelcomeViewController.m b/MacPass/MPWelcomeViewController.m new file mode 100644 index 00000000..110767f4 --- /dev/null +++ b/MacPass/MPWelcomeViewController.m @@ -0,0 +1,50 @@ +// +// MPWelcomeWindowViewController.m +// MacPass +// +// Created by Michael Starke on 28.09.18. +// Copyright © 2018 HicknHack Software GmbH. All rights reserved. +// + +#import "MPWelcomeViewController.h" + +@interface MPWelcomeViewController () + +@property (strong) IBOutlet NSTableView *tableView; + +@end + +@implementation MPWelcomeViewController + +- (NSNibName)nibName { + return @"WelcomeView"; +} + +- (void)viewWillAppear { + [super viewWillAppear]; + [self.tableView reloadData]; +} + +- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView { + return NSDocumentController.sharedDocumentController.recentDocumentURLs.count; +} + +- (nullable NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(nullable NSTableColumn *)tableColumn row:(NSInteger)row { + NSTableCellView *view = [tableView makeViewWithIdentifier:tableColumn.identifier owner:self]; + NSURL *url = NSDocumentController.sharedDocumentController.recentDocumentURLs[row]; + view.textField.stringValue = url.lastPathComponent; + view.imageView.image = [NSWorkspace.sharedWorkspace iconForFile:url.path]; + return view; +} + +- (IBAction)openRecentURL:(id)sender { + NSInteger clicked = self.tableView.clickedRow; + NSArray *recentURLS = NSDocumentController.sharedDocumentController.recentDocumentURLs; + if(clicked > 0 && clicked < recentURLS.count) { + [NSDocumentController.sharedDocumentController openDocumentWithContentsOfURL:recentURLS[clicked] + display:YES + completionHandler:^(NSDocument * _Nullable document, BOOL documentWasAlreadyOpen, NSError * _Nullable error) {}]; + } +} + +@end diff --git a/MacPass/PasswordCreatorWindow.xib b/MacPass/PasswordCreatorWindow.xib index 55c5acf9..c2c3d712 100644 --- a/MacPass/PasswordCreatorWindow.xib +++ b/MacPass/PasswordCreatorWindow.xib @@ -1,8 +1,8 @@ - + - + @@ -13,7 +13,7 @@ - + @@ -21,7 +21,7 @@ - + diff --git a/MacPass/de.lproj/WelcomeWindow.strings b/MacPass/de.lproj/WelcomeView.strings similarity index 83% rename from MacPass/de.lproj/WelcomeWindow.strings rename to MacPass/de.lproj/WelcomeView.strings index 1d4a738c..9f0b6a72 100644 --- a/MacPass/de.lproj/WelcomeWindow.strings +++ b/MacPass/de.lproj/WelcomeView.strings @@ -1,6 +1,3 @@ -/* Class = "NSWindow"; title = "Welcome"; ObjectID = "1"; */ -"1.title" = "Willkommen"; - /* Class = "NSTextFieldCell"; title = "Welcome to MacPass"; ObjectID = "24"; */ "24.title" = "Willkommen zu MacPass"; diff --git a/MacPass/en.lproj/WelcomeWindow.strings b/MacPass/en.lproj/WelcomeView.strings similarity index 83% rename from MacPass/en.lproj/WelcomeWindow.strings rename to MacPass/en.lproj/WelcomeView.strings index ccf81011..92e48994 100644 --- a/MacPass/en.lproj/WelcomeWindow.strings +++ b/MacPass/en.lproj/WelcomeView.strings @@ -1,6 +1,3 @@ -/* Class = "NSWindow"; title = "Welcome"; ObjectID = "1"; */ -"1.title" = "Welcome"; - /* Class = "NSTextFieldCell"; title = "Welcome to MacPass"; ObjectID = "24"; */ "24.title" = "Welcome to MacPass"; diff --git a/MacPass/es.lproj/WelcomeWindow.strings b/MacPass/es.lproj/WelcomeView.strings similarity index 83% rename from MacPass/es.lproj/WelcomeWindow.strings rename to MacPass/es.lproj/WelcomeView.strings index 810383f0..1138d836 100644 --- a/MacPass/es.lproj/WelcomeWindow.strings +++ b/MacPass/es.lproj/WelcomeView.strings @@ -1,7 +1,3 @@ - -/* Class = "NSWindow"; title = "Welcome"; ObjectID = "1"; */ -"1.title" = "Bienvenido"; - /* Class = "NSTextFieldCell"; title = "Welcome to MacPass"; ObjectID = "24"; */ "24.title" = "Bienvenido a MacPass"; diff --git a/MacPass/fr.lproj/WelcomeWindow.strings b/MacPass/fr.lproj/WelcomeView.strings similarity index 84% rename from MacPass/fr.lproj/WelcomeWindow.strings rename to MacPass/fr.lproj/WelcomeView.strings index 01d9171c..569649be 100644 --- a/MacPass/fr.lproj/WelcomeWindow.strings +++ b/MacPass/fr.lproj/WelcomeView.strings @@ -1,7 +1,3 @@ - -/* Class = "NSWindow"; title = "Welcome"; ObjectID = "1"; */ -"1.title" = "Bienvenue"; - /* Class = "NSTextFieldCell"; title = "Welcome to MacPass"; ObjectID = "24"; */ "24.title" = "Bienvenue dans MacPass"; diff --git a/MacPass/it.lproj/WelcomeWindow.strings b/MacPass/it.lproj/WelcomeView.strings similarity index 83% rename from MacPass/it.lproj/WelcomeWindow.strings rename to MacPass/it.lproj/WelcomeView.strings index d93dcf18..38bff468 100644 --- a/MacPass/it.lproj/WelcomeWindow.strings +++ b/MacPass/it.lproj/WelcomeView.strings @@ -1,7 +1,3 @@ - -/* Class = "NSWindow"; title = "Welcome"; ObjectID = "1"; */ -"1.title" = "Benvenuto"; - /* Class = "NSTextFieldCell"; title = "Welcome to MacPass"; ObjectID = "24"; */ "24.title" = "Benvenuto a MacPass"; diff --git a/MacPass/nl.lproj/WelcomeWindow.strings b/MacPass/nl.lproj/WelcomeView.strings similarity index 84% rename from MacPass/nl.lproj/WelcomeWindow.strings rename to MacPass/nl.lproj/WelcomeView.strings index 68d36d6c..f8d5bd36 100644 --- a/MacPass/nl.lproj/WelcomeWindow.strings +++ b/MacPass/nl.lproj/WelcomeView.strings @@ -1,6 +1,3 @@ -/* Class = "NSWindow"; title = "Welcome"; ObjectID = "1"; */ -"1.title" = "Welkom"; - /* Class = "NSTextFieldCell"; title = "Welcome to MacPass"; ObjectID = "24"; */ "24.title" = "Welkom bij MacPass"; diff --git a/MacPass/pl.lproj/WelcomeWindow.strings b/MacPass/pl.lproj/WelcomeView.strings similarity index 84% rename from MacPass/pl.lproj/WelcomeWindow.strings rename to MacPass/pl.lproj/WelcomeView.strings index 4cc756e8..0a471a2f 100644 --- a/MacPass/pl.lproj/WelcomeWindow.strings +++ b/MacPass/pl.lproj/WelcomeView.strings @@ -1,6 +1,3 @@ -/* Class = "NSWindow"; title = "Welcome"; ObjectID = "1"; */ -"1.title" = "Witaj"; - /* Class = "NSTextFieldCell"; title = "Welcome to MacPass"; ObjectID = "24"; */ "24.title" = "Witaj w MacPass"; diff --git a/MacPass/ru.lproj/WelcomeWindow.strings b/MacPass/ru.lproj/WelcomeView.strings similarity index 82% rename from MacPass/ru.lproj/WelcomeWindow.strings rename to MacPass/ru.lproj/WelcomeView.strings index c8c9799e..6e46e81b 100644 --- a/MacPass/ru.lproj/WelcomeWindow.strings +++ b/MacPass/ru.lproj/WelcomeView.strings @@ -1,7 +1,3 @@ - -/* Class = "NSWindow"; title = "Welcome"; ObjectID = "1"; */ -"1.title" = "Добро пожаловать"; - /* Class = "NSTextFieldCell"; title = "Welcome to MacPass"; ObjectID = "24"; */ "24.title" = "Добро пожаловать в MacPass"; diff --git a/MacPass/sv-SE.lproj/WelcomeWindow.strings b/MacPass/sv-SE.lproj/WelcomeView.strings similarity index 82% rename from MacPass/sv-SE.lproj/WelcomeWindow.strings rename to MacPass/sv-SE.lproj/WelcomeView.strings index bcb51806..e38c790a 100644 --- a/MacPass/sv-SE.lproj/WelcomeWindow.strings +++ b/MacPass/sv-SE.lproj/WelcomeView.strings @@ -1,7 +1,3 @@ - -/* Class = "NSWindow"; title = "Welcome"; ObjectID = "1"; */ -"1.title" = "Välkommen"; - /* Class = "NSTextFieldCell"; title = "Welcome to MacPass"; ObjectID = "24"; */ "24.title" = "Välkommen till MacPass"; diff --git a/MacPass/zh-Hans.lproj/WelcomeWindow.strings b/MacPass/zh-Hans.lproj/WelcomeView.strings similarity index 83% rename from MacPass/zh-Hans.lproj/WelcomeWindow.strings rename to MacPass/zh-Hans.lproj/WelcomeView.strings index 28c66ef6..c221a5d5 100644 --- a/MacPass/zh-Hans.lproj/WelcomeWindow.strings +++ b/MacPass/zh-Hans.lproj/WelcomeView.strings @@ -1,7 +1,3 @@ - -/* Class = "NSWindow"; title = "Welcome"; ObjectID = "1"; */ -"1.title" = "Welcome"; - /* Class = "NSTextFieldCell"; title = "Welcome to MacPass"; ObjectID = "24"; */ "24.title" = "欢迎使用 MacPass";