diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index 344304ca..ad5051fb 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -18,6 +18,7 @@ 4C586F9E16D07ABD00E7DB57 /* 00_PasswordTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C586F9D16D07ABD00E7DB57 /* 00_PasswordTemplate.pdf */; }; 4C586FA016D07D7200E7DB57 /* 01_PackageNetworkTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C586F9F16D07D7200E7DB57 /* 01_PackageNetworkTemplate.pdf */; }; 4C586FA216D07F6A00E7DB57 /* 02_MessageBoxWarningTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C586FA116D07F6A00E7DB57 /* 02_MessageBoxWarningTemplate.pdf */; }; + 4C65FAE916D16DDB006E0577 /* MPPasswordInputController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C65FAE716D16DDB006E0577 /* MPPasswordInputController.m */; }; 4C669B7F16760ED100DD0774 /* AesInputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C669B3116760ED100DD0774 /* AesInputStream.m */; }; 4C669B8016760ED100DD0774 /* AesOutputStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C669B3316760ED100DD0774 /* AesOutputStream.m */; }; 4C669B8116760ED100DD0774 /* Arc4RandomStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C669B3516760ED100DD0774 /* Arc4RandomStream.m */; }; @@ -53,7 +54,7 @@ 4C669BA016760ED100DD0774 /* Salsa20RandomStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C669B7716760ED100DD0774 /* Salsa20RandomStream.m */; }; 4C669BA116760ED100DD0774 /* Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C669B7916760ED100DD0774 /* Utils.m */; }; 4C669BA216760ED100DD0774 /* UUID.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C669B7B16760ED100DD0774 /* UUID.m */; }; - 4C6B0E8C16C9B99B00A9ED23 /* PasswordView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C6B0E8B16C9B99B00A9ED23 /* PasswordView.xib */; }; + 4C6B0E8C16C9B99B00A9ED23 /* PasswordInputView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C6B0E8B16C9B99B00A9ED23 /* PasswordInputView.xib */; }; 4C75CE3C16CB128700F61A4D /* MPDatabaseController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C75CE3B16CB128700F61A4D /* MPDatabaseController.m */; }; 4C77E36715B84A240093A587 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C77E36615B84A240093A587 /* Cocoa.framework */; }; 4C77E37115B84A240093A587 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 4C77E36F15B84A240093A587 /* InfoPlist.strings */; }; @@ -99,6 +100,9 @@ 4C586F9D16D07ABD00E7DB57 /* 00_PasswordTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 00_PasswordTemplate.pdf; sourceTree = ""; }; 4C586F9F16D07D7200E7DB57 /* 01_PackageNetworkTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 01_PackageNetworkTemplate.pdf; sourceTree = ""; }; 4C586FA116D07F6A00E7DB57 /* 02_MessageBoxWarningTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 02_MessageBoxWarningTemplate.pdf; sourceTree = ""; }; + 4C65FAE616D16DDB006E0577 /* MPPasswordInputController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPasswordInputController.h; sourceTree = ""; }; + 4C65FAE716D16DDB006E0577 /* MPPasswordInputController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPPasswordInputController.m; sourceTree = ""; }; + 4C65FAEB16D16FB5006E0577 /* MPViewControllerProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPViewControllerProtocol.h; sourceTree = ""; }; 4C669B3016760ED100DD0774 /* AesInputStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AesInputStream.h; sourceTree = ""; }; 4C669B3116760ED100DD0774 /* AesInputStream.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AesInputStream.m; sourceTree = ""; }; 4C669B3216760ED100DD0774 /* AesOutputStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AesOutputStream.h; sourceTree = ""; }; @@ -172,7 +176,7 @@ 4C669B7916760ED100DD0774 /* Utils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Utils.m; sourceTree = ""; }; 4C669B7A16760ED100DD0774 /* UUID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UUID.h; sourceTree = ""; }; 4C669B7B16760ED100DD0774 /* UUID.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UUID.m; sourceTree = ""; }; - 4C6B0E8B16C9B99B00A9ED23 /* PasswordView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PasswordView.xib; sourceTree = ""; }; + 4C6B0E8B16C9B99B00A9ED23 /* PasswordInputView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PasswordInputView.xib; sourceTree = ""; }; 4C75CE3A16CB128700F61A4D /* MPDatabaseController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPDatabaseController.h; sourceTree = ""; }; 4C75CE3B16CB128700F61A4D /* MPDatabaseController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPDatabaseController.m; sourceTree = ""; }; 4C77E36215B84A240093A587 /* MacPass.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MacPass.app; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -246,7 +250,7 @@ 4CA0B2EC15BCADAC00654E32 /* SettingsWindow.xib */, 4CA0B2EF15BCADC800654E32 /* GeneralSettings.xib */, 4CD884B615BD47080042BBF8 /* MainWindow.xib */, - 4C6B0E8B16C9B99B00A9ED23 /* PasswordView.xib */, + 4C6B0E8B16C9B99B00A9ED23 /* PasswordInputView.xib */, 4C25D58416CF0F8800F6806C /* WelcomeView.xib */, 4C25D58616CF0FAA00F6806C /* EntryView.xib */, ); @@ -481,6 +485,8 @@ 4C75CE3B16CB128700F61A4D /* MPDatabaseController.m */, 4C2E382416D1470200037A9D /* MPViewController.h */, 4C2E382516D1470200037A9D /* MPViewController.m */, + 4C65FAE616D16DDB006E0577 /* MPPasswordInputController.h */, + 4C65FAE716D16DDB006E0577 /* MPPasswordInputController.m */, ); name = Controller; sourceTree = ""; @@ -489,6 +495,7 @@ isa = PBXGroup; children = ( 4CA0B30D15BCB6FD00654E32 /* MPSettingsTabProtocoll.h */, + 4C65FAEB16D16FB5006E0577 /* MPViewControllerProtocol.h */, ); name = Protocolls; sourceTree = ""; @@ -611,7 +618,7 @@ 4CA0B2ED15BCADAC00654E32 /* SettingsWindow.xib in Resources */, 4CA0B2F015BCADC800654E32 /* GeneralSettings.xib in Resources */, 4CD884B715BD47080042BBF8 /* MainWindow.xib in Resources */, - 4C6B0E8C16C9B99B00A9ED23 /* PasswordView.xib in Resources */, + 4C6B0E8C16C9B99B00A9ED23 /* PasswordInputView.xib in Resources */, 4C25D58516CF0F8800F6806C /* WelcomeView.xib in Resources */, 4C25D58716CF0FAA00F6806C /* EntryView.xib in Resources */, 4C586F9E16D07ABD00E7DB57 /* 00_PasswordTemplate.pdf in Resources */, @@ -687,6 +694,7 @@ 4C75CE3C16CB128700F61A4D /* MPDatabaseController.m in Sources */, 4C2E382316D1421B00037A9D /* MPIconHelper.m in Sources */, 4C2E382616D1470200037A9D /* MPViewController.m in Sources */, + 4C65FAE916D16DDB006E0577 /* MPPasswordInputController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/MacPass/MPMainWindowController.m b/MacPass/MPMainWindowController.m index 69f51bed..ec4ef0f4 100644 --- a/MacPass/MPMainWindowController.m +++ b/MacPass/MPMainWindowController.m @@ -23,10 +23,7 @@ NSString *const kOutlineViewIdentifier = @"OutlineView"; @interface MPMainWindowController () @property (assign) IBOutlet NSOutlineView *outlineView; -@property (retain) IBOutlet NSView *passwordView; -@property (assign) IBOutlet NSTextField *passwordTextField; -@property (assign) IBOutlet NSPathControl *keyPathControl; @property (assign) IBOutlet NSView *contentView; @property (retain) IBOutlet NSView *welcomeView; @@ -35,7 +32,6 @@ NSString *const kOutlineViewIdentifier = @"OutlineView"; @property (retain) MPOutlineViewDelegate *outlineDelegate; @property (retain) MPMainWindowDelegate *windowDelegate; -- (IBAction)usePassword:(id)sender; - (void)updateData; @end @@ -95,11 +91,4 @@ NSString *const kOutlineViewIdentifier = @"OutlineView"; [self.window makeFirstResponder:self.passwordView]; } -- (void)usePassword:(id)sender { - NSString *password = [self.passwordTextField stringValue]; - - [[MPDatabaseController defaultController] openDatabase:self.openFile password:password keyfile:nil]; - [self updateData]; -} - @end diff --git a/MacPass/MPPasswordInputController.h b/MacPass/MPPasswordInputController.h new file mode 100644 index 00000000..8b39bffc --- /dev/null +++ b/MacPass/MPPasswordInputController.h @@ -0,0 +1,14 @@ +// +// MPPasswordInputController.h +// MacPass +// +// Created by Michael Starke on 17.02.13. +// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. +// + +#import "MPViewController.h" +#import "MPViewControllerProtocol.h" + +@interface MPPasswordInputController : MPViewController + +@end diff --git a/MacPass/MPPasswordInputController.m b/MacPass/MPPasswordInputController.m new file mode 100644 index 00000000..d0545148 --- /dev/null +++ b/MacPass/MPPasswordInputController.m @@ -0,0 +1,41 @@ +// +// MPPasswordInputController.m +// MacPass +// +// Created by Michael Starke on 17.02.13. +// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. +// + +#import "MPPasswordInputController.h" +#import "MPDatabaseController.h" + +@interface MPPasswordInputController () + +@property (assign) IBOutlet NSSecureTextField *passwordTextField; + +- (IBAction)selectKeyFile:(id)sender; +- (IBAction)open:(id)sender; + +@end + +@implementation MPPasswordInputController + +- (id)init { + return [[MPPasswordInputController alloc] initWithNibName:@"PasswordView" bundle:nil]; +} + +- (NSResponder *)reconmendetFirstResponder { + return nil; +} + + +- (IBAction)selectKeyFile:(id)sender { + +} + +- (IBAction)open:(id)sender { + NSString *password = [self.passwordTextField stringValue]; + [[MPDatabaseController defaultController] openDatabase:self.openFile password:password keyfile:nil]; + } +} +@end diff --git a/MacPass/MPViewControllerProtocol.h b/MacPass/MPViewControllerProtocol.h new file mode 100644 index 00000000..3555458b --- /dev/null +++ b/MacPass/MPViewControllerProtocol.h @@ -0,0 +1,16 @@ +// +// MPViewControllerProtocol.h +// MacPass +// +// Created by Michael Starke on 17.02.13. +// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. +// + +#import + +@protocol MPViewControllerProtocol + +@required +- (NSResponder *)reconmendetFirstResponder; + +@end diff --git a/MacPass/PasswordView.xib b/MacPass/PasswordInputView.xib similarity index 94% rename from MacPass/PasswordView.xib rename to MacPass/PasswordInputView.xib index 5b3d9c9b..adea6105 100644 --- a/MacPass/PasswordView.xib +++ b/MacPass/PasswordInputView.xib @@ -30,7 +30,7 @@ - MPMainWindowController + MPPasswordInputController FirstResponder @@ -173,7 +173,6 @@ {{209, 13}, {74, 32}} - _NS:9 YES @@ -202,29 +201,37 @@ + + + view + + + + 143 + passwordTextField - 99 - - - - passwordView - - - - 101 + 151 - usePassword: + selectKeyFile: + + + + 152 + + + + open: - 102 + 154 @@ -541,11 +548,6 @@ - - 45 - - - 104 @@ -574,34 +576,24 @@ - - 123 - - - 124 - - 119 - - - 131 - 134 - + 132 + - 112 - + 142 + @@ -609,19 +601,34 @@ - - 132 - - - 107 - 142 - + 45 + + + + + 123 + + + + + 134 + + + + + 119 + + + + + 112 + @@ -683,61 +690,49 @@ - 142 + 154 - MPMainWindowController - NSWindowController + MPPasswordInputController + MPViewController - usePassword: + selectKeyFile: id - usePassword: + selectKeyFile: - usePassword: + selectKeyFile: id - NSView - NSPathControl - NSOutlineView - NSTextField - NSView - NSView + NSButton + NSSecureTextField - - contentView - NSView - - - keyPathControl - NSPathControl - - - outlineView - NSOutlineView + + openDocument + NSButton passwordTextField - NSTextField - - - passwordView - NSView - - - welcomeView - NSView + NSSecureTextField IBProjectSource - ./Classes/MPMainWindowController.h + ./Classes/MPPasswordInputController.h + + + + MPViewController + NSViewController + + IBProjectSource + ./Classes/MPViewController.h