From a54b2aae5a122209024b6d8d96040837db4eb31f Mon Sep 17 00:00:00 2001 From: michael starke Date: Wed, 12 Jun 2013 01:13:05 +0200 Subject: [PATCH] Ui for the password wizzard now works more or less. Password creation needs to be finalized --- HNHUi | 2 +- MacPass.xcodeproj/project.pbxproj | 6 + MacPass/Base.lproj/InspectorView.xib | 237 +++--- MacPass/Base.lproj/PasswordInputView.xib | 73 +- MacPass/MPAppDelegate.m | 15 +- MacPass/MPInspectorViewController.h | 2 +- MacPass/MPInspectorViewController.m | 27 +- MacPass/MPPasswordCreatorViewController.h | 2 + MacPass/MPPasswordCreatorViewController.m | 88 ++- MacPass/MacPass-Info.plist | 2 +- MacPass/NSString+MPPasswordCreation.h | 3 +- MacPass/PasswordCreatorView.xib | 898 +++++++++++++++------- MacPass/PasswordCreatorWindow.xib | 8 +- 13 files changed, 881 insertions(+), 482 deletions(-) diff --git a/HNHUi b/HNHUi index 23b62dd2..253f23e7 160000 --- a/HNHUi +++ b/HNHUi @@ -1 +1 @@ -Subproject commit 23b62dd2c53ea407d8c9fb0620bc0984a8a1c2a1 +Subproject commit 253f23e7c982f60ab5361b518582492bba1ad6a3 diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index 610d720e..e7976601 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -30,6 +30,7 @@ 4C46B88517063A070046109A /* NSString+MPPasswordCreation.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C46B88417063A070046109A /* NSString+MPPasswordCreation.m */; }; 4C46B88817063A170046109A /* NSString+MPPasswordAnalysis.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C46B88717063A170046109A /* NSString+MPPasswordAnalysis.m */; }; 4C46B88B1706D16E0046109A /* NSData+MPRandomBytes.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C46B88A1706D16E0046109A /* NSData+MPRandomBytes.m */; }; + 4C46E09E17673A0A00DA62E8 /* HNHShadowBox.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C46E09D17673A0A00DA62E8 /* HNHShadowBox.m */; }; 4C4A100F176286FD00BBF2CA /* MPTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C4A100E176286FD00BBF2CA /* MPTableView.m */; }; 4C4A101217629DA900BBF2CA /* KdbGroup+KVOAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C4A101117629DA900BBF2CA /* KdbGroup+KVOAdditions.m */; }; 4C569D9E17652B0600595B62 /* MPConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C569D9D17652B0600595B62 /* MPConstants.m */; }; @@ -174,6 +175,8 @@ 4C46B88717063A170046109A /* NSString+MPPasswordAnalysis.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+MPPasswordAnalysis.m"; sourceTree = ""; }; 4C46B8891706D16E0046109A /* NSData+MPRandomBytes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+MPRandomBytes.h"; sourceTree = ""; }; 4C46B88A1706D16E0046109A /* NSData+MPRandomBytes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+MPRandomBytes.m"; sourceTree = ""; }; + 4C46E09C17673A0A00DA62E8 /* HNHShadowBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HNHShadowBox.h; sourceTree = ""; }; + 4C46E09D17673A0A00DA62E8 /* HNHShadowBox.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HNHShadowBox.m; sourceTree = ""; }; 4C4A100D176286FD00BBF2CA /* MPTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPTableView.h; sourceTree = ""; }; 4C4A100E176286FD00BBF2CA /* MPTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPTableView.m; sourceTree = ""; }; 4C4A101017629DA900BBF2CA /* KdbGroup+KVOAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "KdbGroup+KVOAdditions.h"; sourceTree = ""; }; @@ -795,6 +798,8 @@ 4CC3AAB6175F4983003EF01B /* HNHUi */ = { isa = PBXGroup; children = ( + 4C46E09C17673A0A00DA62E8 /* HNHShadowBox.h */, + 4C46E09D17673A0A00DA62E8 /* HNHShadowBox.m */, 4CC3AAB8175F4983003EF01B /* HNHRoundedTextFieldCell.h */, 4CC3AAB9175F4983003EF01B /* HNHRoundedTextFieldCell.m */, 4C79DF28176685870083708F /* HNHRoundedTextField.h */, @@ -1062,6 +1067,7 @@ 4C569DA117652BFE00595B62 /* MPEntryTableDataSource.m in Sources */, 4C569DA417653F3500595B62 /* KdbEntry+MPTreeTools.m in Sources */, 4C79DF2A176685870083708F /* HNHRoundedTextField.m in Sources */, + 4C46E09E17673A0A00DA62E8 /* HNHShadowBox.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/MacPass/Base.lproj/InspectorView.xib b/MacPass/Base.lproj/InspectorView.xib index 1a1fbeb3..8a4780f3 100644 --- a/MacPass/Base.lproj/InspectorView.xib +++ b/MacPass/Base.lproj/InspectorView.xib @@ -12,12 +12,12 @@ IBNSLayoutConstraint + NSButton + NSButtonCell NSCustomObject NSCustomView NSImageCell NSImageView - NSLevelIndicator - NSLevelIndicatorCell NSTextField NSTextFieldCell NSView @@ -46,7 +46,7 @@ 268 - {{40, 372}, {35, 14}} + {{40, 350}, {35, 14}} @@ -87,7 +87,7 @@ 268 - {{80, 368}, {124, 22}} + {{80, 346}, {124, 22}} @@ -129,7 +129,7 @@ 268 - {{17, 340}, {58, 14}} + {{17, 318}, {58, 14}} @@ -150,7 +150,7 @@ 268 - {{80, 336}, {124, 22}} + {{80, 314}, {124, 22}} @@ -172,7 +172,7 @@ 268 - {{80, 304}, {124, 22}} + {{80, 282}, {124, 22}} @@ -194,7 +194,7 @@ 268 - {{50, 308}, {25, 14}} + {{50, 286}, {25, 14}} @@ -215,7 +215,7 @@ 268 - {{20, 247}, {55, 14}} + {{20, 225}, {55, 14}} @@ -244,7 +244,7 @@ NeXT Encapsulated PostScript v1.2 pasteboard type NeXT TIFF v4.0 pasteboard type - {{20, 419}, {48, 48}} + {{20, 397}, {48, 48}} @@ -269,7 +269,7 @@ 268 - {{73, 435}, {134, 17}} + {{73, 413}, {134, 17}} @@ -296,7 +296,7 @@ 268 - {{20, 409}, {184, 2}} + {{20, 387}, {184, 2}} @@ -306,10 +306,10 @@ 268 - {{80, 243}, {124, 22}} + {{80, 221}, {124, 22}} - + _NS:9 YES @@ -332,34 +332,40 @@ {224, 30} - _NS:9 HNHGradientView - + 268 - {{80, 217}, {124, 18}} + {{80, 194}, {124, 19}} _NS:9 YES - - 0 - 262144 + + -2080374784 + 134217728 + Generate + + LucidaGrande + 12 + 16 + _NS:9 - - 2 - 2 - 2 - 2 - 2 + + -2038153216 + 164 + + + 400 + 75 NO - {224, 487} + {224, 465} @@ -432,6 +438,14 @@ 644 + + + _popUpPasswordGenerator: + + + + 710 + @@ -511,24 +525,8 @@ 29 3 - - - 6 - 0 - - 6 - 1 - - 20 - - 1000 - - 8 - 29 - 3 - - + 5 0 @@ -543,8 +541,24 @@ 24 2 - - + + + 6 + 0 + + 6 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + 3 0 @@ -623,21 +637,21 @@ 24 2 - - - 3 + + + 10 0 - 3 + 10 1 - 222 + 0.0 1000 - 3 - 9 - 3 + 5 + 22 + 2 @@ -1019,7 +1033,7 @@ - + @@ -1144,6 +1158,22 @@ + + + 7 + 0 + + 0 + 1 + + 52 + + 1000 + + 3 + 9 + 1 + @@ -1297,11 +1327,6 @@ - - 638 - - - 636 @@ -1407,32 +1432,42 @@ - 684 - + 702 + + + + + 703 + - + - 685 - - + 704 + + - 686 - + 705 + - 687 + 706 + + + + + 707 - 689 - - + 708 + + @@ -1444,7 +1479,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + @@ -1468,14 +1503,14 @@ - + - + + - @@ -1489,6 +1524,9 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + + com.apple.InterfaceBuilder.CocoaPlugin HNHRoundedTextField @@ -1545,7 +1583,6 @@ com.apple.InterfaceBuilder.CocoaPlugin HNHRoundedSecureTextFieldCell com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1564,19 +1601,20 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - HNHLevelIndicatorCell - 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 - 694 + 710 @@ -1588,14 +1626,6 @@ ./Classes/HNHGradientView.h - - HNHLevelIndicatorCell - NSLevelIndicatorCell - - IBProjectSource - ./Classes/HNHLevelIndicatorCell.h - - HNHRoundedSecureTextFieldCell HNHRoundedTextFieldCell @@ -1631,13 +1661,22 @@ MPInspectorViewController MPViewController + + _popUpPasswordGenerator: + id + + + _popUpPasswordGenerator: + + _popUpPasswordGenerator: + id + + NSTextField MPPopupImageView NSTextField - NSButton NSTextField - NSButton NSTextField NSTextField NSTextField @@ -1655,18 +1694,10 @@ itemNameTextfield NSTextField - - openURLButton - NSButton - passwordTextField NSTextField - - showPasswordCreator - NSButton - titleOrNameLabel NSTextField diff --git a/MacPass/Base.lproj/PasswordInputView.xib b/MacPass/Base.lproj/PasswordInputView.xib index ca789932..36a34b1c 100644 --- a/MacPass/Base.lproj/PasswordInputView.xib +++ b/MacPass/Base.lproj/PasswordInputView.xib @@ -51,7 +51,6 @@ 268 {{125, 175}, {113, 17}} - _NS:1535 YES @@ -100,7 +99,6 @@ {{157, 200}, {48, 48}} - _NS:9 YES @@ -129,7 +127,6 @@ {{83, 94}, {197, 22}} - _NS:9 YES @@ -154,7 +151,6 @@ 268 {{86, 123}, {191, 22}} - _NS:9 YES @@ -192,7 +188,6 @@ 268 {{17, 126}, {64, 17}} - _NS:1535 YES @@ -213,7 +208,6 @@ 268 {{35, 99}, {46, 17}} - _NS:1535 YES @@ -234,8 +228,6 @@ 268 {{200, 50}, {83, 32}} - - _NS:9 {250, 250} YES @@ -258,7 +250,6 @@ {362, 268} - {751, 750} NSView @@ -1011,69 +1002,7 @@ 296 - - - - MPPasswordInputController - MPViewController - - _decrypt: - id - - - _decrypt: - - _decrypt: - id - - - - NSImageView - NSTextField - NSPathControl - NSSecureTextField - - - - errorImageView - NSImageView - - - errorInfoTextField - NSTextField - - - keyPathControl - NSPathControl - - - passwordTextField - NSSecureTextField - - - - IBProjectSource - ./Classes/MPPasswordInputController.h - - - - MPViewController - NSViewController - - IBProjectSource - ./Classes/MPViewController.h - - - - NSLayoutConstraint - NSObject - - IBProjectSource - ./Classes/NSLayoutConstraint.h - - - - + 0 IBCocoaFramework YES diff --git a/MacPass/MPAppDelegate.m b/MacPass/MPAppDelegate.m index 53f86d00..316c0ae6 100644 --- a/MacPass/MPAppDelegate.m +++ b/MacPass/MPAppDelegate.m @@ -57,8 +57,21 @@ } if(!self.passwordCreatorController) { self.passwordCreatorController = [[[MPPasswordCreatorViewController alloc] init] autorelease]; + 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 setContentView:[self.passwordCreatorController view]]; + [self.passwordCreatorWindow makeKeyAndOrderFront:self.passwordCreatorWindow]; } diff --git a/MacPass/MPInspectorViewController.h b/MacPass/MPInspectorViewController.h index ebbcc7d4..ab4895bb 100644 --- a/MacPass/MPInspectorViewController.h +++ b/MacPass/MPInspectorViewController.h @@ -23,6 +23,6 @@ @property (assign) IBOutlet NSTextField *passwordTextField; @property (assign) IBOutlet NSTextField *titleOrNameLabel; -- (void)hideImagePopup:(id)sender; +- (void)closeActivePopup:(id)sender; @end diff --git a/MacPass/MPInspectorViewController.m b/MacPass/MPInspectorViewController.m index 0070344e..278e5a04 100644 --- a/MacPass/MPInspectorViewController.m +++ b/MacPass/MPInspectorViewController.m @@ -9,6 +9,7 @@ #import "MPInspectorViewController.h" #import "MPEntryViewController.h" #import "MPOutlineViewDelegate.h" +#import "MPPasswordCreatorViewController.h" #import "MPShadowBox.h" #import "MPIconHelper.h" #import "MPPopupImageView.h" @@ -25,7 +26,7 @@ @property (assign, nonatomic) KdbGroup *selectedGroup; @property (assign, nonatomic) BOOL showsEntry; -@property (retain) NSPopover *iconPopup; +@property (retain) NSPopover *activePopover; @property (retain) NSLayoutConstraint *showConstraint; @property (retain) NSLayoutConstraint *hideConstraint; @@ -49,7 +50,7 @@ - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; - [_iconPopup release]; + [_activePopover release]; [super dealloc]; } @@ -153,20 +154,26 @@ #pragma mark Actions - (void)_showImagePopup:(id)sender { - _iconPopup = [[NSPopover alloc] init]; - self.iconPopup.behavior = NSPopoverBehaviorTransient; - self.iconPopup.contentViewController = [[[MPIconSelectViewController alloc] init] autorelease]; - [self.iconPopup showRelativeToRect:NSZeroRect ofView:self.itemImageView preferredEdge:NSMinYEdge]; - self.iconPopup = nil; + [self _showPopopver:[[[MPIconSelectViewController alloc] init] autorelease] atView:self.itemImageView onEdge:NSMinYEdge]; } -- (void)hideImagePopup:(id)sender { - [self.iconPopup close]; +- (void)closeActivePopup:(id)sender { + [_activePopover close]; } +- (IBAction)_popUpPasswordGenerator:(id)sender { + [self _showPopopver:[[[MPPasswordCreatorViewController alloc] init] autorelease] atView:self.passwordTextField onEdge:NSMinYEdge]; +} + +- (void)_showPopopver:(NSViewController *)viewController atView:(NSView *)view onEdge:(NSRectEdge)edge { + _activePopover = [[NSPopover alloc] init]; + _activePopover.behavior = NSPopoverBehaviorTransient; + _activePopover.contentViewController = viewController; + [_activePopover showRelativeToRect:NSZeroRect ofView:view preferredEdge:edge]; + _activePopover = nil; +} #pragma mark Notificiations - - (void)_didChangeSelectedEntry:(NSNotification *)notification { MPEntryViewController *entryViewController = [notification object]; if(entryViewController) { diff --git a/MacPass/MPPasswordCreatorViewController.h b/MacPass/MPPasswordCreatorViewController.h index 91f8589b..111513bf 100644 --- a/MacPass/MPPasswordCreatorViewController.h +++ b/MacPass/MPPasswordCreatorViewController.h @@ -10,4 +10,6 @@ @interface MPPasswordCreatorViewController : MPViewController +@property (retain) NSString *password; + @end diff --git a/MacPass/MPPasswordCreatorViewController.m b/MacPass/MPPasswordCreatorViewController.m index 10d29d1e..9f207ae8 100644 --- a/MacPass/MPPasswordCreatorViewController.m +++ b/MacPass/MPPasswordCreatorViewController.m @@ -7,20 +7,32 @@ // #import "MPPasswordCreatorViewController.h" +#import "NSString+MPPasswordCreation.h" #define MIN_PASSWORD_LENGTH 1 #define MAX_PASSWORD_LENGTH 64 -@interface MPPasswordCreatorViewController () + +@interface MPPasswordCreatorViewController () { + MPPasswordCharacterFlags _characterFlags; +} @property (assign) IBOutlet NSTextField *passwordTextField; @property (assign) IBOutlet NSTextField *passwordLengthTextField; @property (assign) IBOutlet NSTextField *customCharactersTextField; @property (assign) IBOutlet NSSlider *passwordLengthSlider; +@property (assign) IBOutlet NSButton *addPasswordToPasteboardButton; +@property (assign) IBOutlet NSButton *upperCaseButton; +@property (assign) IBOutlet NSButton *lowerCaseButton; +@property (assign) IBOutlet NSButton *numbersButton; +@property (assign) IBOutlet NSButton *symbolsButton; +@property (assign) IBOutlet NSButton *customButton; -@property (assign) NSUInteger passwordLength; +@property (assign, nonatomic) BOOL useCustomString; +@property (assign, nonatomic) NSUInteger passwordLength; -- (IBAction)_create:(id)sender; +- (IBAction)_generatePassword:(id)sender; - (IBAction)_toggleCharacters:(id)sender; +- (IBAction)_usePassword:(id)sender; @end @@ -29,7 +41,10 @@ - (id)init { self = [super initWithNibName:@"PasswordCreatorView" bundle:nil]; if (self) { + _password = @""; _passwordLength = 12; + _characterFlags = MPPasswordCharactersAll; + _useCustomString = NO; } return self; } @@ -41,12 +56,75 @@ /* Value Transformer */ [self.passwordLengthSlider bind:NSValueBinding toObject:self withKeyPath:@"passwordLength" options:nil]; [self.passwordLengthTextField bind:NSValueBinding toObject:self withKeyPath:@"passwordLength" options:nil]; + [self.passwordTextField bind:NSValueBinding toObject:self withKeyPath:@"password" options:nil]; + + [_customButton bind:NSValueBinding toObject:self withKeyPath:@"useCustomString" options:nil]; + [_numbersButton setTag:MPPasswordCharactersNumbers]; + [_upperCaseButton setTag:MPPasswordCharactersUpperCase]; + [_lowerCaseButton setTag:MPPasswordCharactersLowerCase]; + [_symbolsButton setTag:MPPasswordCharactersSymbols]; + + [self _resetCharacters]; } -- (IBAction)_create:(id)sender { - +- (IBAction)_generatePassword:(id)sender { + if(_useCustomString) { + if([[_customCharactersTextField stringValue] length] > 0) { + self.password = [[_customCharactersTextField stringValue] passwordWithLength:_passwordLength]; + } + } + else { + self.password = [NSString passwordWithCharactersets:_characterFlags length:_passwordLength]; + } } - (IBAction)_toggleCharacters:(id)sender { + _characterFlags ^= [sender tag]; + self.useCustomString = NO; + [self _resetCharacters]; +} + +- (IBAction)_usePassword:(id)sender { +} + +- (void)setUseCustomString:(BOOL)useCustomString { + if(_useCustomString != useCustomString) { + _useCustomString = useCustomString; + [self _resetCharacters]; + } +} + +- (void)setPasswordLength:(NSUInteger)passwordLength { + if(_passwordLength != passwordLength) { + _passwordLength = passwordLength; + [self _generatePassword:nil]; + } +} + +- (void)_resetCharacters { + if(_useCustomString) { + [_customButton setState:NSOnState]; + } + [_customCharactersTextField setEnabled:_useCustomString]; + [_upperCaseButton setEnabled:!_useCustomString]; + [_lowerCaseButton setEnabled:!_useCustomString]; + [_numbersButton setEnabled:!_useCustomString]; + [_symbolsButton setEnabled:!_useCustomString]; + + /* Set to defualts, if we got nothing */ + if(_characterFlags == 0) { + _characterFlags = MPPasswordCharactersAll; + } + + const BOOL userLowercase = ( 0 != (MPPasswordCharactersLowerCase & _characterFlags)); + const BOOL useUppercase = ( 0 != (MPPasswordCharactersUpperCase & _characterFlags) ); + const BOOL useNumbers = ( 0 != (MPPasswordCharactersNumbers & _characterFlags) ); + const BOOL useSymbols = ( 0 != (MPPasswordCharactersSymbols & _characterFlags) ); + + [_upperCaseButton setState:useUppercase ? NSOnState : NSOffState]; + [_lowerCaseButton setState:userLowercase ? NSOnState : NSOffState]; + [_numbersButton setState:useNumbers ? NSOnState : NSOffState]; + [_symbolsButton setState:useSymbols ? NSOnState : NSOffState]; + } @end diff --git a/MacPass/MacPass-Info.plist b/MacPass/MacPass-Info.plist index 7b4c0f8f..78011c31 100644 --- a/MacPass/MacPass-Info.plist +++ b/MacPass/MacPass-Info.plist @@ -48,7 +48,7 @@ CFBundleSignature ???? CFBundleVersion - C60 + CC5 LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} NSHumanReadableCopyright diff --git a/MacPass/NSString+MPPasswordCreation.h b/MacPass/NSString+MPPasswordCreation.h index 0216599c..ec4c6ffa 100644 --- a/MacPass/NSString+MPPasswordCreation.h +++ b/MacPass/NSString+MPPasswordCreation.h @@ -12,7 +12,8 @@ typedef enum { MPPasswordCharactersUpperCase = (1<<0), // NSCharacterset lowerCaseCharacterSet MPPasswordCharactersLowerCase = (1<<1), // NSCharacterSet upperCaseCharacterSet MPPasswordCharactersNumbers = (1<<2), // NSCharacterSet numberCharacterSet - MPPasswordCharactersSymbols = (1<<3) // NSCharacterSet symbolCharacterSet + MPPasswordCharactersSymbols = (1<<3), // NSCharacterSet symbolCharacterSet + MPPasswordCharactersAll = MPPasswordCharactersUpperCase | MPPasswordCharactersLowerCase | MPPasswordCharactersNumbers | MPPasswordCharactersSymbols } MPPasswordCharacterFlags; /* diff --git a/MacPass/PasswordCreatorView.xib b/MacPass/PasswordCreatorView.xib index aa5f6d2f..7caf40c3 100644 --- a/MacPass/PasswordCreatorView.xib +++ b/MacPass/PasswordCreatorView.xib @@ -43,6 +43,95 @@ 268 + + + 268 + {{254, 203}, {28, 25}} + + + + _NS:22 + YES + + -2080374784 + 134217728 + + + LucidaGrande + 13 + 1044 + + _NS:22 + + -2033958912 + 163 + + NSImage + NSRefreshTemplate + + + + 400 + 75 + + NO + + + + 268 + {{18, 56}, {211, 18}} + + + + _NS:9 + YES + + -2080374784 + 268435456 + Copy password to pasteboard + + _NS:9 + + 1211912448 + 2 + + NSImage + NSSwitch + + + NSSwitch + + + + 200 + 25 + + NO + + + + 268 + {{182, 18}, {100, 25}} + + + _NS:22 + YES + + -2080374784 + 134217728 + Use Password + + _NS:22 + + -2038153216 + 163 + + + 400 + 75 + + NO + 12 @@ -57,17 +146,14 @@ {{18, 19}, {230, 22}} + _NS:9 YES -1804599231 272630784 - - LucidaGrande - 13 - 1044 - + _NS:9 YES @@ -106,7 +192,7 @@ -2080374784 134217728 A-Z - + LucidaGrande 12 16 @@ -136,7 +222,7 @@ -2080374784 134217728 a-z - + _NS:9 -1232846848 @@ -162,7 +248,7 @@ -2080374784 134217728 0-9 - + _NS:9 -1232846848 @@ -188,7 +274,7 @@ -2080374784 134217728 #!? - + _NS:9 -1232846848 @@ -210,10 +296,10 @@ _NS:9 YES - -2080374784 + 67108864 134217728 Custom - + _NS:9 -1232846848 @@ -233,7 +319,7 @@ _NS:11 - {{17, 16}, {268, 94}} + {{17, 76}, {268, 94}} @@ -242,7 +328,7 @@ 67108864 0 - Character Settings + Allowed Characters LucidaGrande 11 @@ -263,7 +349,7 @@ 268 - {{254, 115}, {28, 22}} + {{254, 175}, {28, 22}} @@ -285,7 +371,7 @@ 268 - {{17, 118}, {48, 17}} + {{17, 178}, {48, 17}} @@ -319,7 +405,7 @@ 268 - {{84, 116}, {164, 21}} + {{68, 176}, {180, 21}} @@ -342,47 +428,18 @@ NO - - - 268 - {{248, 138}, {40, 32}} - - - - _NS:9 - YES - - 67108864 - 134217728 - - - _NS:9 - - -2033303552 - 129 - - NSImage - NSRefreshTemplate - - - - 200 - 25 - - NO - 268 - {{86, 145}, {160, 22}} + {{86, 205}, {160, 22}} - + _NS:9 YES - -1804599231 - 272630784 + -2074083263 + 272631808 _NS:9 @@ -397,7 +454,7 @@ 268 - {{17, 148}, {64, 17}} + {{17, 208}, {64, 17}} @@ -416,7 +473,7 @@ NO - {302, 187} + {302, 247} @@ -433,14 +490,6 @@ 2 - - - _create: - - - - 472 - passwordLengthTextFiedl @@ -481,14 +530,6 @@ 477 - - - _toggleCharacters: - - - - 478 - customCharactersTextField @@ -521,6 +562,78 @@ 483 + + + _usePassword: + + + + 561 + + + + _copyToPasswordCheckbutton + + + + 562 + + + + upperCaseButton + + + + 592 + + + + lowerCaseButton + + + + 593 + + + + symbolsButton + + + + 596 + + + + numbersButton + + + + 597 + + + + customButton + + + + 598 + + + + addPasswordToPasteboardButton + + + + 599 + + + + _generatePassword: + + + + 600 + @@ -552,6 +665,22 @@ 1 + + + 3 + 0 + + 4 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + 10 @@ -584,38 +713,6 @@ 24 3 - - - 3 - 0 - - 4 - 1 - - 8 - - 1000 - - 9 - 40 - 3 - - - - 5 - 0 - - 5 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - 6 @@ -632,8 +729,56 @@ 29 3 - - + + + 6 + 0 + + 6 + 1 + + 20 + + 1000 + + 9 + 40 + 3 + + + + 3 + 0 + + 3 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 5 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + 5 0 @@ -648,11 +793,27 @@ 40 3 - + + + 3 + 1 + + 4 + 1 + + 16 + + 1000 + + 9 + 40 + 3 + + 6 0 - + 6 1 @@ -660,41 +821,57 @@ 1000 + 8 + 29 + 3 + + + + 4 + 0 + + 4 + 1 + + 20 + + 1000 + 9 40 3 - - + + 5 0 - + 5 1 - - 0.0 + + 20 1000 - 6 - 24 - 2 + 8 + 29 + 3 - - - 11 + + + 3 0 - - 11 + + 4 1 - - 0.0 + + 8 1000 9 40 - 2 + 3 @@ -728,6 +905,22 @@ 40 3 + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + 6 @@ -744,22 +937,6 @@ 40 3 - - - 4 - 0 - - 4 - 1 - - 20 - - 1000 - - 9 - 40 - 3 - 3 @@ -858,11 +1035,13 @@ - + + + @@ -871,6 +1050,22 @@ + + + 7 + 0 + + 0 + 1 + + 58 + + 1000 + + 9 + 40 + 1 + @@ -913,24 +1108,6 @@ - - 163 - - - - - - - - 165 - - - - - 164 - - - 173 @@ -980,16 +1157,6 @@ - - 196 - - - - - 197 - - - 198 @@ -1014,6 +1181,22 @@ 332 + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + 6 @@ -1046,23 +1229,7 @@ 29 3 - - - 5 - 0 - - 6 - 1 - - 8 - - 1000 - - 9 - 40 - 3 - - + 5 0 @@ -1074,8 +1241,8 @@ 1000 - 9 - 40 + 6 + 24 3 @@ -1094,7 +1261,7 @@ 29 3 - + 5 0 @@ -1106,8 +1273,8 @@ 1000 - 9 - 40 + 6 + 24 3 @@ -1126,7 +1293,7 @@ 29 3 - + 5 0 @@ -1138,8 +1305,8 @@ 1000 - 9 - 40 + 6 + 24 3 @@ -1273,11 +1440,6 @@ - - 337 - - - 338 @@ -1296,11 +1458,6 @@ - - 414 - - - 416 @@ -1352,11 +1509,6 @@ - - 459 - - - 460 @@ -1375,11 +1527,6 @@ - - 463 - - - 464 @@ -1398,11 +1545,6 @@ - - 467 - - - 468 @@ -1416,36 +1558,6 @@ - - 470 - - - - - 471 - - - - - 201 - - - - - 162 - - - - - 188 - - - - - 169 - - - 191 @@ -1466,53 +1578,208 @@ + + 494 + + + + + + + + 495 + + + + + 496 + + + + + 497 + + + + + 500 + + + + + + + + 501 + + + + + 503 + + + + + 504 + + + + + 505 + + + + + 509 + + + + + + 7 + 0 + + 0 + 1 + + 28 + + 1000 + + 9 + 40 + 1 + + + + + + 510 + + + + + 517 + + + + + 518 + + + + + 519 + + + + + 520 + + + + + 521 + + + + + 522 + + + + + 576 + + + + + 579 + + + + + 582 + + + + + 471 + + + + + 585 + + + + + 414 + + + + + 602 + + + + + 605 + + + + + 606 + + + 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 @@ -1523,17 +1790,13 @@ 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 - + @@ -1541,23 +1804,23 @@ - + - + - - + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + HNHRoundedTextFieldCell com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -1571,61 +1834,122 @@ 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 - 492 + 607 + + HNHRoundedTextFieldCell + NSTextFieldCell + + IBProjectSource + ./Classes/HNHRoundedTextFieldCell.h + + MPPasswordCreatorViewController MPViewController - id + id id + id - - _create: + + _generatePassword: id _toggleCharacters: id + + _usePassword: + id + + NSButton + NSButton NSTextField + NSButton + NSButton NSSlider NSTextField NSTextField + NSButton + NSButton + + addPasswordToPasteboardButton + NSButton + + + customButton + NSButton + customCharactersTextField NSTextField + + lowerCaseButton + NSButton + + + numbersButton + NSButton + passwordLengthSlider NSSlider @@ -1638,6 +1962,14 @@ passwordTextField NSTextField + + symbolsButton + NSButton + + + upperCaseButton + NSButton + IBProjectSource @@ -1670,10 +2002,10 @@ YES 3 - - NSRefreshTemplate - {10, 12} - + + {10, 12} + {15, 15} + YES diff --git a/MacPass/PasswordCreatorWindow.xib b/MacPass/PasswordCreatorWindow.xib index 4849406b..b2651814 100644 --- a/MacPass/PasswordCreatorWindow.xib +++ b/MacPass/PasswordCreatorWindow.xib @@ -2,9 +2,9 @@ 1080 - 12D78 + 12E55 3084 - 1187.37 + 1187.39 626.00 com.apple.InterfaceBuilder.CocoaPlugin @@ -36,7 +36,7 @@ 15 2 {{196, 240}, {338, 216}} - 544735232 + 1618477056 Window NSWindow @@ -48,7 +48,7 @@ - {{0, 0}, {1680, 1028}} + {{0, 0}, {1920, 1058}} {10000000000000, 10000000000000} YES