diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index 4401adeb..2ab6a617 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -177,6 +177,9 @@ 4C669BA216760ED100DD0774 /* UUID.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C669B7B16760ED100DD0774 /* UUID.m */; }; 4C67D33017981A2B00A7BDFC /* HNHTokenField.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C67D32F17981A2B00A7BDFC /* HNHTokenField.m */; }; 4C67D33317981ABA00A7BDFC /* HNHTokenFieldCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C67D33217981ABA00A7BDFC /* HNHTokenFieldCell.m */; }; + 4C68456A17BC21DD00FCDBFC /* KPKAutotype.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C68456917BC21DD00FCDBFC /* KPKAutotype.m */; }; + 4C68456D17BC227B00FCDBFC /* KPKWindowAssociation.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C68456C17BC227B00FCDBFC /* KPKWindowAssociation.m */; }; + 4C68456F17BC2A0700FCDBFC /* WelcomeWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C68456E17BC2A0700FCDBFC /* WelcomeWindow.xib */; }; 4C69A73A16D589DF00EC1B1A /* HNHGradientView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C69A73916D589DF00EC1B1A /* HNHGradientView.m */; }; 4C6BEA3117A88E6C00CF69A8 /* MPStripLineBreaksTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C6BEA3017A88E6C00CF69A8 /* MPStripLineBreaksTransformer.m */; }; 4C6D1D25178579570014C5A5 /* 48_FolderTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C6D1D24178579570014C5A5 /* 48_FolderTemplate.pdf */; }; @@ -620,6 +623,11 @@ 4C67D32F17981A2B00A7BDFC /* HNHTokenField.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HNHTokenField.m; sourceTree = ""; }; 4C67D33117981ABA00A7BDFC /* HNHTokenFieldCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HNHTokenFieldCell.h; sourceTree = ""; }; 4C67D33217981ABA00A7BDFC /* HNHTokenFieldCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HNHTokenFieldCell.m; sourceTree = ""; }; + 4C68456817BC21DD00FCDBFC /* KPKAutotype.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKAutotype.h; sourceTree = ""; }; + 4C68456917BC21DD00FCDBFC /* KPKAutotype.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPKAutotype.m; sourceTree = ""; }; + 4C68456B17BC227B00FCDBFC /* KPKWindowAssociation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKWindowAssociation.h; sourceTree = ""; }; + 4C68456C17BC227B00FCDBFC /* KPKWindowAssociation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPKWindowAssociation.m; sourceTree = ""; }; + 4C68456E17BC2A0700FCDBFC /* WelcomeWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = WelcomeWindow.xib; sourceTree = ""; }; 4C69A73816D589DF00EC1B1A /* HNHGradientView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HNHGradientView.h; sourceTree = ""; }; 4C69A73916D589DF00EC1B1A /* HNHGradientView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HNHGradientView.m; sourceTree = ""; }; 4C6BEA2F17A88E6C00CF69A8 /* MPStripLineBreaksTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPStripLineBreaksTransformer.h; sourceTree = ""; }; @@ -1686,6 +1694,10 @@ 4CFC873D179DF200000DFC03 /* KPKTimeInfo.m */, 4CFC873F179DF295000DFC03 /* KPKTimerecording.h */, 4CFC8740179DF7A3000DFC03 /* KPKUndoing.h */, + 4C68456817BC21DD00FCDBFC /* KPKAutotype.h */, + 4C68456917BC21DD00FCDBFC /* KPKAutotype.m */, + 4C68456B17BC227B00FCDBFC /* KPKWindowAssociation.h */, + 4C68456C17BC227B00FCDBFC /* KPKWindowAssociation.m */, ); path = Core; sourceTree = ""; @@ -1780,6 +1792,7 @@ 4C1DDCDC1711ECEB00C98DA3 /* PasswordCreatorWindow.xib */, 4CD5D701177A5EE400100649 /* DatabaseSettingsWindow.xib */, 4C0728B917B5B7A4005A7DD9 /* PasswordEditWindow.xib */, + 4C68456E17BC2A0700FCDBFC /* WelcomeWindow.xib */, ); name = Windows; sourceTree = ""; @@ -1971,6 +1984,7 @@ 4C7ABA4B17BAEC6700FF5799 /* 19_EmailTemplate.pdf in Resources */, 4C7ABA4C17BAEC6700FF5799 /* 20_MiscTemplate.pdf in Resources */, 4C7ABA4E17BAEC7000FF5799 /* addEntryTemplate.pdf in Resources */, + 4C68456F17BC2A0700FCDBFC /* WelcomeWindow.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2221,6 +2235,8 @@ 4C0F647817B6B65E00D9522A /* MPSheetWindowController.m in Sources */, 4C0F647B17B6BC9C00D9522A /* MPSavePanelAccessoryViewController.m in Sources */, 4C57AE1417BA422B00CA4F34 /* MPSegmentedContextCell.m in Sources */, + 4C68456A17BC21DD00FCDBFC /* KPKAutotype.m in Sources */, + 4C68456D17BC227B00FCDBFC /* KPKWindowAssociation.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/MacPass/MPAppDelegate.h b/MacPass/MPAppDelegate.h index 5710e5a8..74a555e4 100644 --- a/MacPass/MPAppDelegate.h +++ b/MacPass/MPAppDelegate.h @@ -11,8 +11,11 @@ @interface MPAppDelegate : NSObject @property (strong) IBOutlet NSWindow *passwordCreatorWindow; +@property (strong) IBOutlet NSWindow *welcomeWindow; - (IBAction)showPasswordCreator:(id)sender; +- (IBAction)createNewDatabase:(id)sender; +- (IBAction)openDatabase:(id)sender; - (NSString *)applicationName; - (void)lockAllDocuments; diff --git a/MacPass/MPAppDelegate.m b/MacPass/MPAppDelegate.m index d7ed4113..c33bf586 100644 --- a/MacPass/MPAppDelegate.m +++ b/MacPass/MPAppDelegate.m @@ -88,6 +88,11 @@ completionHandler:^(NSDocument *document, BOOL documentWasAlreadyOpen, NSError *error) {}]; } + else { + NSArray *topLevelObject; + [[NSBundle mainBundle] loadNibNamed:@"WelcomeWindow" owner:self topLevelObjects:&topLevelObject]; + [self.welcomeWindow orderFront:self]; + } } } @@ -95,7 +100,8 @@ return [[NSBundle mainBundle] infoDictionary][@"CFBundleName"]; } -#pragma mark Menu Actions +#pragma mark - +#pragma mark Actions - (void)showPreferences:(id)sender { if(self.settingsController == nil) { self.settingsController = [[MPSettingsWindowController alloc] init]; @@ -110,23 +116,22 @@ if(!self.passwordCreatorController) { self.passwordCreatorController = [[MPPasswordCreatorViewController alloc] init]; NSView *creatorView = [_passwordCreatorController view]; - //NSView *contentView = [_passwordCreatorWindow contentView]; [self.passwordCreatorWindow setContentView:creatorView]; - //[contentView addSubview:creatorView]; -// [[_passwordCreatorWindow contentView] addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|[creatorView]|" -// options:0 -// metrics:nil -// views:NSDictionaryOfVariableBindings(creatorView)]]; -// [[_passwordCreatorWindow contentView] addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[creatorView]|" -// options:0 -// metrics:nil -// views:NSDictionaryOfVariableBindings(creatorView)]]; -// [contentView layoutSubtreeIfNeeded]; } [self.passwordCreatorWindow makeKeyAndOrderFront:self.passwordCreatorWindow]; } +- (void)createNewDatabase:(id)sender { + [self.welcomeWindow orderOut:sender]; + [[NSDocumentController sharedDocumentController] newDocument:sender]; +} + +- (void)openDatabase:(id)sender { + [self.welcomeWindow orderOut:sender]; + [[NSDocumentController sharedDocumentController] openDocument:sender]; +} + - (void)lockAllDocuments { for(NSDocument *document in [[NSDocumentController sharedDocumentController] documents]) { NSArray *windowControllers = [document windowControllers]; diff --git a/MacPass/WelcomeWindow.xib b/MacPass/WelcomeWindow.xib new file mode 100644 index 00000000..9de0f42f --- /dev/null +++ b/MacPass/WelcomeWindow.xib @@ -0,0 +1,793 @@ + + + + 1080 + 12E55 + 3084 + 1187.39 + 626.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 3084 + + + IBNSLayoutConstraint + NSButton + NSButtonCell + NSCustomObject + NSImageCell + NSImageView + NSTextField + NSTextFieldCell + NSView + NSWindowTemplate + + + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + + MPAppDelegate + + + FirstResponder + + + NSApplication + + + 7 + 2 + {{196, 240}, {448, 255}} + 544735232 + Welcome + NSWindow + + + + + 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 + + {{160, 107}, {128, 128}} + + + + _NS:9 + YES + + 134217728 + 33554432 + + NSImage + MacPass + + _NS:9 + 0 + 0 + 0 + NO + + NO + YES + + + + 268 + {{102, 70}, {244, 29}} + + + + _NS:1535 + YES + + 68157504 + 272630784 + Welcome to MacPass + + LucidaGrande + 24 + 16 + + _NS:1535 + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + NO + + + + 268 + {{175, 18}, {123, 25}} + + + + _NS:22 + YES + + -2080374784 + 134217728 + Open Database… + + LucidaGrande + 13 + 1044 + + _NS:22 + + -2038153216 + 163 + + + 400 + 75 + + NO + + + + 268 + {{20, 18}, {147, 25}} + + + + _NS:22 + YES + + -2080374784 + 134217728 + Create new Database + + _NS:22 + + -2038153216 + 163 + + + 400 + 75 + + NO + + + + 268 + {{372, 18}, {56, 25}} + + + + _NS:22 + YES + + -2080374784 + 134217728 + Cancel + + _NS:22 + + -2038153216 + 163 + + + 400 + 75 + + NO + + + {448, 255} + + + + + {{0, 0}, {1920, 1058}} + {10000000000000, 10000000000000} + YES + + + + + + + welcomeWindow + + + + 94 + + + + openDatabase: + + + + 101 + + + + createNewDatabase: + + + + 102 + + + + orderOut: + + + + 93 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + + + + + + 2 + + + + + 5 + 1 + + 6 + 1 + + 8 + + 1000 + + 9 + 40 + 3 + + + + 6 + 0 + + 6 + 1 + + 20 + + 1000 + + 9 + 40 + 3 + + + + 4 + 0 + + 4 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 3 + 1 + + 4 + 1 + + 8 + + 1000 + + 9 + 40 + 3 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 9 + 40 + 3 + + + + 4 + 0 + + 4 + 1 + + 20 + + 1000 + + 9 + 40 + 3 + + + + 5 + 0 + + 5 + 1 + + 20 + + 1000 + + 9 + 40 + 3 + + + + 4 + 0 + + 4 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 3 + 0 + + 4 + 1 + + 8 + + 1000 + + 9 + 40 + 3 + + + + 9 + 0 + + 9 + 1 + + 0.0 + + 1000 + + 5 + 22 + 2 + + + + 3 + 0 + + 3 + 1 + + 20 + + 1000 + + 9 + 40 + 3 + + + + 9 + 0 + + 9 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + + + + + + + + 3 + + + + + + 8 + 0 + + 0 + 1 + + 128 + + 1000 + + 3 + 9 + 1 + + + + 7 + 0 + + 0 + 1 + + 128 + + 1000 + + 3 + 9 + 1 + + + + + + 4 + + + + + 18 + + + + + 19 + + + + + 23 + + + + + + + + 24 + + + + + 43 + + + + + + + + 44 + + + + + 47 + + + + + + + + 48 + + + + + 63 + + + + + 65 + + + + + 66 + + + + + 68 + + + + + 69 + + + + + + + + 70 + + + + + 73 + + + + + 74 + + + + + 85 + + + + + 87 + + + + + 89 + + + + + 96 + + + + + 98 + + + + + 100 + + + + + + + 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 + + + + + + 102 + + + + + MPAppDelegate + NSObject + + id + id + id + id + + + + createNewDatabase: + id + + + openDatabase: + id + + + showPasswordCreator: + id + + + showPreferences: + id + + + + NSWindow + NSWindow + + + + passwordCreatorWindow + NSWindow + + + welcomeWindow + NSWindow + + + + IBProjectSource + ./Classes/MPAppDelegate.h + + + + NSLayoutConstraint + NSObject + + IBProjectSource + ./Classes/NSLayoutConstraint.h + + + + + 0 + IBCocoaFramework + YES + 3 + + MacPass + {512, 512} + + YES + +