diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index 6f574ba2..6245ccd1 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -19,7 +19,6 @@ 4C3BD51516D276F800389F1F /* MPToolbarDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C3BD51416D276F800389F1F /* MPToolbarDelegate.m */; }; 4C3FFD9E16DAF60600DF9186 /* FilterBar.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C3FFD9D16DAF60600DF9186 /* FilterBar.xib */; }; 4C40AC5C170782730073D1C3 /* MPAbstractSettingsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C40AC5B170782730073D1C3 /* MPAbstractSettingsViewController.m */; }; - 4C40AC5F170876D90073D1C3 /* Defaults.plist in Resources */ = {isa = PBXBuildFile; fileRef = 4C40AC5E170876D90073D1C3 /* Defaults.plist */; }; 4C431BCD16E2A82800700A81 /* MPPasteBoardController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C431BCC16E2A82700700A81 /* MPPasteBoardController.m */; }; 4C431BCF16E2BAB000700A81 /* OverlayWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C431BCE16E2BAB000700A81 /* OverlayWindow.xib */; }; 4C46B88517063A070046109A /* NSString+MPPasswordCreation.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C46B88417063A070046109A /* NSString+MPPasswordCreation.m */; }; @@ -28,6 +27,8 @@ 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 */; }; + 4C5A11FE1708DE8700223D8A /* MPPasswordCreatorViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C5A11FC1708DE8700223D8A /* MPPasswordCreatorViewController.m */; }; + 4C5A11FF1708DE8800223D8A /* PasswordCreatorView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C5A11FD1708DE8700223D8A /* PasswordCreatorView.xib */; }; 4C61EA0316D2FD0800AC519E /* MPOutlineViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C61EA0216D2FD0800AC519E /* MPOutlineViewController.m */; }; 4C61EA0516D2FFE200AC519E /* OutlineView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C61EA0416D2FFE200AC519E /* OutlineView.xib */; }; 4C65C79C16DD283900E32CFF /* MPToolbarButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C65C79B16DD283900E32CFF /* MPToolbarButton.m */; }; @@ -99,7 +100,7 @@ 4CAD748C15B889B700104512 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CAD748B15B889B700104512 /* Security.framework */; }; 4CAD748E15B88AC100104512 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CAD748D15B88AC100104512 /* libz.dylib */; }; 4CB9339916D3A0DD00A13B5D /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 4CB9339716D3A0DD00A13B5D /* Credits.rtf */; }; - 4CBA2ABA17074C07006D8139 /* MPSettingsKeys.m in Resources */ = {isa = PBXBuildFile; fileRef = 4CBA2AB917074C07006D8139 /* MPSettingsKeys.m */; }; + 4CBA2ABA17074C07006D8139 /* MPSettingsHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CBA2AB917074C07006D8139 /* MPSettingsHelper.m */; }; 4CBA981815BA0DB600721965 /* MPDatabaseDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CBA981715BA0DB600721965 /* MPDatabaseDocument.m */; }; 4CC1AEBE16D4467C006D2AAB /* KdbTree+MPAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CC1AEBD16D4467C006D2AAB /* KdbTree+MPAdditions.m */; }; 4CC6259115BA1C99002F5B11 /* MPOutlineViewDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CC6259015BA1C99002F5B11 /* MPOutlineViewDelegate.m */; }; @@ -137,7 +138,6 @@ 4C3FFD9D16DAF60600DF9186 /* FilterBar.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FilterBar.xib; sourceTree = ""; }; 4C40AC581707819A0073D1C3 /* MPAbstractSettingsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPAbstractSettingsViewController.h; sourceTree = ""; }; 4C40AC5B170782730073D1C3 /* MPAbstractSettingsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPAbstractSettingsViewController.m; sourceTree = ""; }; - 4C40AC5E170876D90073D1C3 /* Defaults.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Defaults.plist; sourceTree = ""; }; 4C431BCB16E2A82700700A81 /* MPPasteBoardController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPasteBoardController.h; sourceTree = ""; }; 4C431BCC16E2A82700700A81 /* MPPasteBoardController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPPasteBoardController.m; sourceTree = ""; }; 4C431BCE16E2BAB000700A81 /* OverlayWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = OverlayWindow.xib; sourceTree = ""; }; @@ -150,6 +150,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 = ""; }; + 4C5A11FB1708DE8700223D8A /* MPPasswordCreatorViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPasswordCreatorViewController.h; sourceTree = ""; }; + 4C5A11FC1708DE8700223D8A /* MPPasswordCreatorViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPPasswordCreatorViewController.m; sourceTree = ""; }; + 4C5A11FD1708DE8700223D8A /* PasswordCreatorView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PasswordCreatorView.xib; sourceTree = ""; }; 4C61EA0116D2FD0800AC519E /* MPOutlineViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPOutlineViewController.h; sourceTree = ""; }; 4C61EA0216D2FD0800AC519E /* MPOutlineViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPOutlineViewController.m; sourceTree = ""; }; 4C61EA0416D2FFE200AC519E /* OutlineView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = OutlineView.xib; sourceTree = ""; }; @@ -290,8 +293,8 @@ 4CAD748B15B889B700104512 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; 4CAD748D15B88AC100104512 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; 4CB9339816D3A0DD00A13B5D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; - 4CBA2AB617074B59006D8139 /* MPSettingsKeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPSettingsKeys.h; sourceTree = ""; }; - 4CBA2AB917074C07006D8139 /* MPSettingsKeys.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPSettingsKeys.m; sourceTree = ""; }; + 4CBA2AB617074B59006D8139 /* MPSettingsHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPSettingsHelper.h; sourceTree = ""; }; + 4CBA2AB917074C07006D8139 /* MPSettingsHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPSettingsHelper.m; sourceTree = ""; }; 4CBA981615BA0DB600721965 /* MPDatabaseDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPDatabaseDocument.h; sourceTree = ""; }; 4CBA981715BA0DB600721965 /* MPDatabaseDocument.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPDatabaseDocument.m; sourceTree = ""; }; 4CC1AEBC16D4467C006D2AAB /* KdbTree+MPAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "KdbTree+MPAdditions.h"; sourceTree = ""; }; @@ -343,6 +346,7 @@ 4C61EA0416D2FFE200AC519E /* OutlineView.xib */, 4CA0B2EC15BCADAC00654E32 /* SettingsWindow.xib */, 4C6B0E8B16C9B99B00A9ED23 /* PasswordInputView.xib */, + 4C5A11FD1708DE8700223D8A /* PasswordCreatorView.xib */, 4C25D58416CF0F8800F6806C /* WelcomeView.xib */, 4C3FFD9D16DAF60600DF9186 /* FilterBar.xib */, 4C77547616E55FFC00970E02 /* InspectorTabView.xib */, @@ -381,8 +385,8 @@ 4C2E382216D1421B00037A9D /* MPIconHelper.m */, 4C920E2816DCDFA00083839B /* MPLoggerProxy.h */, 4C920E2916DCDFA00083839B /* MPLoggerProxy.m */, - 4CBA2AB617074B59006D8139 /* MPSettingsKeys.h */, - 4CBA2AB917074C07006D8139 /* MPSettingsKeys.m */, + 4CBA2AB617074B59006D8139 /* MPSettingsHelper.h */, + 4CBA2AB917074C07006D8139 /* MPSettingsHelper.m */, ); name = Helper; sourceTree = ""; @@ -614,7 +618,6 @@ 4C77E36F15B84A240093A587 /* InfoPlist.strings */, 4C77E37215B84A240093A587 /* main.m */, 4C77E37415B84A240093A587 /* MacPass-Prefix.pch */, - 4C40AC5E170876D90073D1C3 /* Defaults.plist */, ); name = "Supporting Files"; sourceTree = ""; @@ -638,6 +641,8 @@ 4CE39ABE16ECE34A000FE29D /* MPIconSelectViewController.m */, 4C40AC581707819A0073D1C3 /* MPAbstractSettingsViewController.h */, 4C40AC5B170782730073D1C3 /* MPAbstractSettingsViewController.m */, + 4C5A11FB1708DE8700223D8A /* MPPasswordCreatorViewController.h */, + 4C5A11FC1708DE8700223D8A /* MPPasswordCreatorViewController.m */, ); name = "View Controller"; sourceTree = ""; @@ -835,8 +840,7 @@ 4C77547716E55FFC00970E02 /* InspectorTabView.xib in Resources */, 4C888C9016EB6C91003D34A1 /* Localizable.strings in Resources */, 4CE39AC116ECE359000FE29D /* IconSelection.xib in Resources */, - 4CBA2ABA17074C07006D8139 /* MPSettingsKeys.m in Resources */, - 4C40AC5F170876D90073D1C3 /* Defaults.plist in Resources */, + 4C5A11FF1708DE8800223D8A /* PasswordCreatorView.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -864,6 +868,7 @@ buildActionMask = 2147483647; files = ( 4C77E37315B84A240093A587 /* main.m in Sources */, + 4CBA2ABA17074C07006D8139 /* MPSettingsHelper.m in Sources */, 4C77E37A15B84A240093A587 /* MPAppDelegate.m in Sources */, 4CAD747B15B887FD00104512 /* DDXMLElementAdditions.m in Sources */, 4CAD747C15B887FD00104512 /* NSString+DDXML.m in Sources */, @@ -940,6 +945,7 @@ 4C46B88817063A170046109A /* NSString+MPPasswordAnalysis.m in Sources */, 4C46B88B1706D16E0046109A /* NSData+MPRandomBytes.m in Sources */, 4C40AC5C170782730073D1C3 /* MPAbstractSettingsViewController.m in Sources */, + 4C5A11FE1708DE8700223D8A /* MPPasswordCreatorViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/MacPass/Defaults.plist b/MacPass/Defaults.plist deleted file mode 100644 index d2874589..00000000 --- a/MacPass/Defaults.plist +++ /dev/null @@ -1,12 +0,0 @@ - - - - - PasswordEncoding - 0 - ClearClipboardOnQuit - - ClearClipboardIntervall - 10 - - diff --git a/MacPass/GeneralSettings.xib b/MacPass/GeneralSettings.xib index 11e8c7fa..66b284d7 100644 --- a/MacPass/GeneralSettings.xib +++ b/MacPass/GeneralSettings.xib @@ -42,7 +42,7 @@ NSApplication - + 268 @@ -56,9 +56,8 @@ 268 - {{10, 42}, {124, 17}} + {{15, 42}, {124, 17}} - _NS:1535 YES @@ -73,7 +72,7 @@ _NS:1535 - + 6 System controlColor @@ -82,7 +81,7 @@ MC42NjY2NjY2NjY3AA - + 6 System controlTextColor @@ -97,9 +96,8 @@ 268 - {{137, 37}, {112, 26}} + {{191, 36}, {112, 26}} - _NS:9 YES @@ -146,6 +144,7 @@ _popUpItemAction: + 10 @@ -157,6 +156,7 @@ _popUpItemAction: + 30 @@ -168,6 +168,7 @@ _popUpItemAction: + 60 @@ -184,10 +185,8 @@ 268 - {{11, 12}, {172, 18}} + {{16, 12}, {172, 18}} - - _NS:9 {250, 150} YES @@ -215,16 +214,14 @@ NO - {{1, 1}, {258, 68}} + {{1, 1}, {318, 70}} - _NS:11 - {{17, 16}, {260, 84}} + {{17, 121}, {320, 86}} - _NS:9 {0, 0} @@ -257,104 +254,9 @@ 2 NO - - - 268 - {{156, 102}, {75, 26}} - - - - _NS:9 - {750, 751} - YES - - -2076180416 - 2048 - - _NS:9 - - 109199360 - 65 - - - 400 - 75 - - - Item 1 - - 1048576 - 2147483647 - 1 - - - _popUpItemAction: - - - YES - - OtherViews - - - - - Item 2 - - 1048576 - 2147483647 - - - _popUpItemAction: - - - - - Item 3 - - 1048576 - 2147483647 - - - _popUpItemAction: - - - - - - -1 - 1 - YES - YES - 2 - - NO - - - - 268 - {{27, 108}, {126, 17}} - - - - _NS:1505 - YES - - 68157504 - 71304192 - Password Encoding - - _NS:1505 - - - - - NO - - {294, 146} - - - + {350, 227} + NSView @@ -370,11 +272,19 @@ - encodingPopup + clearPasteboardOnQuitCheckButton - + - 83 + 520 + + + + clearPasteboardTimeoutPopup + + + + 521 @@ -407,28 +317,26 @@ 1 - - - - - 11 + + + 3 0 - - 11 + + 3 1 - - 0.0 + + 20 1000 - 9 - 40 - 2 + 8 + 29 + 3 - - + + 3 - 0 + 1 3 1 @@ -441,54 +349,6 @@ 40 3 - - - 6 - 1 - - 6 - 1 - - 20 - - 1000 - - 9 - 40 - 3 - - - - 5 - 0 - - 6 - 1 - - 8 - - 1000 - - 9 - 40 - 3 - - - - 4 - 0 - - 4 - 1 - - 20 - - 1000 - - 8 - 29 - 3 - 4 @@ -505,22 +365,6 @@ 40 3 - - - 3 - 0 - - 4 - 1 - - 8 - - 1000 - - 9 - 40 - 3 - 5 @@ -537,142 +381,62 @@ 40 3 - - - 6 - 0 - - 6 - 1 - - 20 - - 1000 - - 9 - 40 - 3 - - - - 5 - 0 - - 5 - 1 - - 30 - - 1000 - - 3 - 9 - 3 - - - - 5 - 1 - - 5 - 1 - - 20 - - 1000 - - 9 - 40 - 3 - - - 8 - - - - - - - - 9 - - - - - 14 - - - - - - - - 15 - - - - - - - - 16 - - - - - - - - - - 17 - - - - - 18 - - - - - 19 - - - - - 59 - - - - - 66 - - - - - 68 - - - - - 124 - - - - - 131 - - - 465 - + + + 5 + 0 + + 6 + 1 + + 57 + + 1000 + + 9 + 40 + 3 + + + + 6 + 0 + + 6 + 1 + + 16 + + 1000 + + 9 + 40 + 3 + + + + 3 + 0 + + 3 + 1 + + 25 + + 1000 + + 8 + 29 + 3 + 6 @@ -689,36 +453,36 @@ 40 3 - - - 10 + + + 4 0 - - 10 + + 4 1 - 0.0 + 11 1000 - 9 - 40 - 2 + 8 + 29 + 3 - - + + 5 0 - - 6 + + 5 1 - - 8 + + 16 1000 - 9 - 40 + 8 + 29 3 @@ -737,28 +501,12 @@ 40 3 - - - 4 + + + 11 0 - - 4 - 1 - - 11 - - 1000 - - 9 - 40 - 3 - - - - 5 - 0 - - 5 + + 11 1 0.0 @@ -769,7 +517,7 @@ 24 2 - + 5 0 @@ -777,7 +525,7 @@ 5 1 - 11 + 16 1000 @@ -786,6 +534,7 @@ 3 + @@ -803,16 +552,6 @@ - - 471 - - - - - 473 - - - 475 @@ -886,16 +625,6 @@ - - 478 - - - - - 479 - - - 447 @@ -909,26 +638,6 @@ - - 481 - - - - - 482 - - - - - 485 - - - - - 486 - - - 487 @@ -940,13 +649,53 @@ - 492 - + 494 + + + + + 496 + - 494 - + 498 + + + + + 499 + + + + + 501 + + + + + 508 + + + + + 506 + + + + + 505 + + + + + 509 + + + + + 507 + @@ -955,29 +704,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 @@ -997,41 +730,37 @@ 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 - 494 + 521 @@ -1047,14 +776,19 @@ MPGeneralSettingsController MPAbstractSettingsViewController - NSPopUpButton + NSPopUpButton + NSButton NSImageView - - encodingPopup + + ClearClipboardTimeoutPopup NSPopUpButton + + clearClipboardOnQuitCheckButton + NSButton + imageView NSImageView diff --git a/MacPass/InspectorTabView.xib b/MacPass/InspectorTabView.xib index 0b0359ff..e0b5c3af 100644 --- a/MacPass/InspectorTabView.xib +++ b/MacPass/InspectorTabView.xib @@ -2,10 +2,10 @@ 1080 - 12C3103 + 12D78 3084 - 1187.34 - 625.00 + 1187.37 + 626.00 com.apple.InterfaceBuilder.CocoaPlugin 3084 @@ -167,7 +167,6 @@ {278, 513} - _NS:9 @@ -361,7 +360,7 @@ -2033958912 163 - + NSImage NSQuickLookTemplate @@ -399,7 +398,6 @@ {{227, 344}, {31, 25}} - _NS:22 YES @@ -411,7 +409,10 @@ -1228652544 163 - + + NSImage + NSRefreshTemplate + 400 @@ -540,14 +541,6 @@ 364 - - - togglePasswordDisplay: - - - - 369 - openURLButton @@ -1914,6 +1907,7 @@ {128, 128} {21, 16} + {10, 12} YES diff --git a/MacPass/MPAppDelegate.m b/MacPass/MPAppDelegate.m index 39c67edb..ff21ccc3 100644 --- a/MacPass/MPAppDelegate.m +++ b/MacPass/MPAppDelegate.m @@ -12,6 +12,7 @@ #import "MPSettingsController.h" #import "MPDatabaseController.h" #import "MPActionHelper.h" +#import "MPSettingsHelper.h" #import "NSString+MPPasswordCreation.h" @interface MPAppDelegate () @@ -26,13 +27,10 @@ @implementation MPAppDelegate + (void)initialize { - NSURL *defaultURL = [[NSBundle mainBundle] URLForResource:@"Defaults" withExtension:@"plst"]; - NSDictionary *defaultsDictionary = [NSDictionary dictionaryWithContentsOfURL:defaultURL]; - [[NSUserDefaults standardUserDefaults] registerDefaults:defaultsDictionary]; + [MPSettingsHelper setupDefaults]; } - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { - //NSString *string = [NSString passwordFromString:@"BOJA" length:10]; self.mainWindowController = [[[MPMainWindowController alloc] init] autorelease]; [self.mainWindowController showWindow:[self.mainWindowController window]]; diff --git a/MacPass/MPGeneralSettingsController.h b/MacPass/MPGeneralSettingsController.h index df39aeb0..6315a142 100644 --- a/MacPass/MPGeneralSettingsController.h +++ b/MacPass/MPGeneralSettingsController.h @@ -11,5 +11,7 @@ @interface MPGeneralSettingsController : MPAbstractSettingsViewController @property (assign) IBOutlet NSImageView *imageView; +@property (assign) IBOutlet NSButton *clearPasteboardOnQuitCheckButton; +@property (assign) IBOutlet NSPopUpButton *clearPasteboardTimeoutPopup; @end diff --git a/MacPass/MPGeneralSettingsController.m b/MacPass/MPGeneralSettingsController.m index 68b87de5..a06f80a3 100644 --- a/MacPass/MPGeneralSettingsController.m +++ b/MacPass/MPGeneralSettingsController.m @@ -7,12 +7,14 @@ // #import "MPGeneralSettingsController.h" +#import "MPSettingsHelper.h" NSString *const MPGeneralSetingsIdentifier = @"GeneralSettingsTab"; @interface MPGeneralSettingsController () -@property (assign) IBOutlet NSPopUpButton *encodingPopup; + - (void)didLoadView; + @end @implementation MPGeneralSettingsController @@ -39,21 +41,11 @@ NSString *const MPGeneralSetingsIdentifier = @"GeneralSettingsTab"; } - (void)didLoadView { - // setup connections - NSMenu *encodingMenu = [[NSMenu allocWithZone:[NSMenu menuZone]] init]; - NSMenuItem *item; + NSUserDefaultsController *defaultsController = [NSUserDefaultsController sharedUserDefaultsController]; + NSString *clearPasteboardKeyPath = [NSString stringWithFormat:@"values.%@", kMPSettingsKeyClearPasteboardOnQuit]; + NSString *clearPasteboardTimeOutKeyPath = [NSString stringWithFormat:@"values.%@", kMPSettingsKeyPasteboardClearTimeout]; + [self.clearPasteboardOnQuitCheckButton bind:NSValueBinding toObject:defaultsController withKeyPath:clearPasteboardKeyPath options:nil]; + [self.clearPasteboardTimeoutPopup bind:NSSelectedTagBinding toObject:defaultsController withKeyPath:clearPasteboardTimeOutKeyPath options:nil]; - item = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:@"UTF8 Encoding" action:NULL keyEquivalent:@""]; - [item setRepresentedObject:[NSNumber numberWithInt:NSUTF8StringEncoding]]; - [encodingMenu addItem:item]; - [item release]; - - item = [[NSMenuItem allocWithZone:[NSMenu menuZone]] initWithTitle:@"ASCII Encoding" action:NULL keyEquivalent:@""]; - [item setRepresentedObject:[NSNumber numberWithInt:NSASCIIStringEncoding]]; - [encodingMenu addItem:item]; - [item release]; - - [_encodingPopup setMenu:encodingMenu]; - [encodingMenu release]; } @end diff --git a/MacPass/MPInspectorTabViewController.h b/MacPass/MPInspectorTabViewController.h index 674fec22..058accf8 100644 --- a/MacPass/MPInspectorTabViewController.h +++ b/MacPass/MPInspectorTabViewController.h @@ -24,7 +24,7 @@ @property (assign) IBOutlet NSTextField *titleOrNameLabel; @property (assign) IBOutlet NSButton *openURLButton; -@property (assign) IBOutlet NSButton *togglePasswordDisplayButton; +@property (assign) IBOutlet NSButton *showPasswordCreator; - (IBAction)togglePasswordDisplay:(id)sender; - (void)hideImagePopup:(id)sender; diff --git a/MacPass/MPInspectorTabViewController.m b/MacPass/MPInspectorTabViewController.m index fed54c58..25c5e946 100644 --- a/MacPass/MPInspectorTabViewController.m +++ b/MacPass/MPInspectorTabViewController.m @@ -147,7 +147,6 @@ [self.usernameTextField setEnabled:enabled]; [self.URLTextField setEnabled:enabled]; - [self.togglePasswordDisplayButton setEnabled:enabled]; [self.openURLButton setEnabled:enabled]; } diff --git a/MacPass/MPPasswordCreatorViewController.h b/MacPass/MPPasswordCreatorViewController.h new file mode 100644 index 00000000..91f8589b --- /dev/null +++ b/MacPass/MPPasswordCreatorViewController.h @@ -0,0 +1,13 @@ +// +// PasswordCreatorView.h +// MacPass +// +// Created by Michael Starke on 31.03.13. +// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. +// + +#import "MPViewController.h" + +@interface MPPasswordCreatorViewController : MPViewController + +@end diff --git a/MacPass/MPPasswordCreatorViewController.m b/MacPass/MPPasswordCreatorViewController.m new file mode 100644 index 00000000..c6ad4ddc --- /dev/null +++ b/MacPass/MPPasswordCreatorViewController.m @@ -0,0 +1,26 @@ +// +// PasswordCreatorView.m +// MacPass +// +// Created by Michael Starke on 31.03.13. +// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. +// + +#import "MPPasswordCreatorViewController.h" + +@interface MPPasswordCreatorViewController () + +@end + +@implementation MPPasswordCreatorViewController + +- (id)init +{ + self = [super initWithNibName:@"PasswordCreatorView" bundle:nil]; + if (self) { + // setup + } + return self; +} + +@end diff --git a/MacPass/MPPasteBoardController.m b/MacPass/MPPasteBoardController.m index 456e32f7..c9adba9d 100644 --- a/MacPass/MPPasteBoardController.m +++ b/MacPass/MPPasteBoardController.m @@ -7,12 +7,14 @@ // #import "MPPasteBoardController.h" +#import "MPSettingsHelper.h" @interface MPPasteBoardController () @property (assign) BOOL isEmpty; - (void)_clearPasteboardContents; +- (void)_setupBindings; - (void)_updateNotifications; @end @@ -32,9 +34,7 @@ self = [super init]; if (self) { _isEmpty = YES; - /* User preferences and bindings */ - _clearTimeout = 30; - _clearPasteboardOnShutdown = YES; + [self _setupBindings]; [self _updateNotifications]; } return self; @@ -84,4 +84,13 @@ } self.isEmpty = YES; } + +- (void)_setupBindings { + NSUserDefaultsController *userDefaultsController = [NSUserDefaultsController sharedUserDefaultsController]; + NSString *clearOnShutdownKeyPath = [NSString stringWithFormat:@"values.%@", kMPSettingsKeyClearPasteboardOnQuit]; + NSString *clearTimoutKeyPath = [NSString stringWithFormat:@"value.%@", kMPSettingsKeyPasteboardClearTimeout]; + [self bind:@"clearPasteboardOnShutdown" toObject:userDefaultsController withKeyPath:clearOnShutdownKeyPath options:nil]; + [self bind:@"clearTimeout" toObject:userDefaultsController withKeyPath:clearTimoutKeyPath options:nil]; +} + @end diff --git a/MacPass/MPSettingsHelper.h b/MacPass/MPSettingsHelper.h new file mode 100644 index 00000000..6469fdd9 --- /dev/null +++ b/MacPass/MPSettingsHelper.h @@ -0,0 +1,24 @@ +// +// MPSettingsHelper.h +// MacPass +// +// Created by Michael Starke on 30.03.13. +// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. +// + +#import + +APPKIT_EXTERN NSString *const kMPSettingsKeyPasteboardClearTimeout; +APPKIT_EXTERN NSString *const kMPSettingsKeyClearPasteboardOnQuit; +APPKIT_EXTERN NSString *const kMPSettingsKeyPasswordEncoding; + +typedef enum { + MPPasswordEncodingUTF8, + MPPasswordEncodingASCII, +} MPPasswordEncoding; + +@interface MPSettingsHelper : NSObject + ++ (void)setupDefaults; + +@end \ No newline at end of file diff --git a/MacPass/MPSettingsHelper.m b/MacPass/MPSettingsHelper.m new file mode 100644 index 00000000..63cb1fa1 --- /dev/null +++ b/MacPass/MPSettingsHelper.m @@ -0,0 +1,33 @@ +// +// MPSettingsHelper.m +// MacPass +// +// Created by Michael Starke on 30.03.13. +// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. +// + +#import "MPSettingsHelper.h" + +NSString *const kMPSettingsKeyPasteboardClearTimeout = @"ClipboardClearTimeout"; +NSString *const kMPSettingsKeyClearPasteboardOnQuit = @"ClearClipboardOnQuit"; + +@interface MPSettingsHelper () + ++ (NSDictionary *)_standardDefaults; + +@end + +@implementation MPSettingsHelper + ++ (void)setupDefaults { + [[NSUserDefaults standardUserDefaults] registerDefaults:[self _standardDefaults]]; +} + ++ (NSDictionary *)_standardDefaults { + return @{ + kMPSettingsKeyPasteboardClearTimeout: @10, + kMPSettingsKeyClearPasteboardOnQuit: @YES, + }; +} + +@end \ No newline at end of file diff --git a/MacPass/MPSettingsKeys.h b/MacPass/MPSettingsKeys.h deleted file mode 100644 index c713cc9c..00000000 --- a/MacPass/MPSettingsKeys.h +++ /dev/null @@ -1,13 +0,0 @@ -// -// MPSettingsKeys.h -// MacPass -// -// Created by Michael Starke on 30.03.13. -// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. -// - -#import - -extern NSString *const kMPSettingsKeyClearClipboardIntervall; -extern NSString *const kMPSettingsKeyClearClipboardOnQuit; -extern NSString *const kMPSettingsKeyPasswordEncoding; \ No newline at end of file diff --git a/MacPass/MPSettingsKeys.m b/MacPass/MPSettingsKeys.m deleted file mode 100644 index b7ce751c..00000000 --- a/MacPass/MPSettingsKeys.m +++ /dev/null @@ -1,13 +0,0 @@ -// -// MPSettingsKeys.m -// MacPass -// -// Created by Michael Starke on 30.03.13. -// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. -// - -#import "MPSettingsKeys.h" - -NSString *const kMPSettingsKeyClearClipboardIntervall = @"ClearClipboardIntervall"; -NSString *const kMPSettingsKeyClearClipboardOnQuit = @"ClearClipboardOnQuit"; -NSString *const kMPSettingsKeyPasswordEncoding = @"PasswordEncoding"; \ No newline at end of file diff --git a/MacPass/MacPass-Info.plist b/MacPass/MacPass-Info.plist index 5a78e76d..a0413dc4 100644 --- a/MacPass/MacPass-Info.plist +++ b/MacPass/MacPass-Info.plist @@ -21,7 +21,7 @@ CFBundleSignature ???? CFBundleVersion - 5EA + 616 LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} NSHumanReadableCopyright diff --git a/MacPass/NSString+MPPasswordCreation.h b/MacPass/NSString+MPPasswordCreation.h index dc289604..0216599c 100644 --- a/MacPass/NSString+MPPasswordCreation.h +++ b/MacPass/NSString+MPPasswordCreation.h @@ -15,6 +15,11 @@ typedef enum { MPPasswordCharactersSymbols = (1<<3) // NSCharacterSet symbolCharacterSet } MPPasswordCharacterFlags; +/* + Generates a random integer in between (inkluding) minimum and maxium + */ +static NSUInteger randomInteger(NSUInteger minimum, NSUInteger maximum); + @interface NSString (MPPasswordCreation) /* diff --git a/MacPass/NSString+MPPasswordCreation.m b/MacPass/NSString+MPPasswordCreation.m index 2c0aed11..133667bb 100644 --- a/MacPass/NSString+MPPasswordCreation.m +++ b/MacPass/NSString+MPPasswordCreation.m @@ -9,6 +9,44 @@ #import "NSString+MPPasswordCreation.h" #import "NSData+MPRandomBytes.h" +NSString *const kMPLowercaseLetterCharacters = @"abcdefghijklmnopqrstuvw"; +NSString *const kMPNumberCharacters = @"1234567890"; +NSString *const kMPSymbolCharacters = @"!$%&\\|/<>(){}[]=?*'+#-_.:,;"; + + +static NSUInteger randomInteger(NSUInteger minimum, NSUInteger maximum) { + NSInteger delta = maximum - minimum; + if( delta == 0) { + return maximum; + } + if( delta < 0 ) { + maximum = minimum; + minimum -= delta; + delta = -delta; + } + NSUInteger randomByteSize = floor(log2(delta)); + NSData *randomData = [NSData dataWithRandomBytes:randomByteSize]; + NSNumber *number = [NSNumber numberWithUnsignedChar:(unsigned char)[randomData bytes]]; + NSUInteger randomNumber = [number integerValue]; + return minimum + (randomNumber % delta); +} + +static NSString *allowedCharactersString(MPPasswordCharacterFlags flags) { + NSMutableString *characterString = [NSMutableString stringWithCapacity:30]; + if( 0 != (flags & MPPasswordCharactersLowerCase) ) { + [characterString appendString:kMPLowercaseLetterCharacters]; + } + if( 0 != (flags & MPPasswordCharactersUpperCase) ) { + [characterString appendString:[kMPLowercaseLetterCharacters uppercaseString]]; + } + if(0 != (flags & MPPasswordCharactersNumbers) ) { + [characterString appendString:kMPNumberCharacters]; + } + if(0 != (flags & MPPasswordCharactersSymbols) ){ + [characterString appendString:kMPSymbolCharacters]; + } + return characterString; +} @implementation NSString (MPPasswordCreationTools) @@ -27,21 +65,15 @@ + (NSString *)passwordFromString:(NSString *)source length:(NSUInteger)length { NSMutableString *password = [[NSMutableString alloc] initWithCapacity:length]; while([password length] < length) { - NSData *randomData = [NSData dataWithRandomBytes:2]; - NSNumber *number = [NSNumber numberWithUnsignedChar:(unsigned char)[randomData bytes]]; - NSLog(@"Random number:%@", number); - [password appendString:@"U"]; + [password appendString:[source randomCharacter]]; } return [password autorelease]; } + (NSString *)passwordWithCharactersets:(MPPasswordCharacterFlags)allowedCharacters length:(NSUInteger)length { - NSDictionary *characterSet = [self _createPasswordSet:allowedCharacters]; NSMutableString *password = [NSMutableString stringWithCapacity:length]; + NSString *characters = allowedCharactersString(allowedCharacters); while([password length] < length) { - // decide what charactersupset to use - // gather random character of selected set - NSString *characters = characterSet[@(MPPasswordCharactersLowerCase)]; [password appendString:[characters randomCharacter]]; } return password; @@ -52,14 +84,11 @@ } - (NSString *)randomCharacter { - NSUInteger randomByteSize = floor(log2([self length])); - NSData *randomData = [NSData dataWithRandomBytes:randomByteSize]; - NSNumber *number = [NSNumber numberWithUnsignedChar:(unsigned char)[randomData bytes]]; - NSUInteger randomIndex = [number integerValue]; - if(randomIndex > 0 || randomIndex >= [self length]) { + NSUInteger randomIndex = randomInteger(0, [self length] - 1); + if(randomIndex >= [self length]) { return nil; } - return [self substringFromIndex:[number integerValue]]; + return [self substringWithRange:NSMakeRange(randomIndex, 1)]; } @end diff --git a/MacPass/PasswordCreatorView.xib b/MacPass/PasswordCreatorView.xib new file mode 100644 index 00000000..011194d5 --- /dev/null +++ b/MacPass/PasswordCreatorView.xib @@ -0,0 +1,661 @@ + + + + 1070 + 12D78 + 3084 + 1187.37 + 626.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 3084 + + + IBNSLayoutConstraint + NSButton + NSButtonCell + NSCustomObject + NSCustomView + NSSlider + NSSliderCell + NSTextField + NSTextFieldCell + + + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + + MPPasswordCreatorViewController + + + FirstResponder + + + NSApplication + + + + 268 + + + + 268 + {{17, 349}, {64, 17}} + + + + _NS:1535 + YES + + 68157504 + 272630784 + Password + + LucidaGrande + 13 + 1044 + + _NS:1535 + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + NO + + + + 268 + {{320, 252}, {29, 26}} + + + + _NS:1586 + YES + + -2080374784 + 134217728 + + + _NS:1586 + + 918831104 + 166 + + + 400 + 75 + + NO + + + + 268 + {{84, 319}, {263, 21}} + + + + _NS:9 + YES + + -2080374784 + 0 + + _NS:9 + + 32 + 1 + 16.5 + 0.0 + 0 + 1 + YES + NO + + NO + + + + 268 + {{33, 321}, {48, 17}} + + + + _NS:1535 + YES + + 68157504 + 272630784 + Length + + _NS:1535 + + + + + NO + + + + 268 + {{86, 346}, {259, 22}} + + + + _NS:9 + YES + + -1804599231 + 272630784 + + + _NS:9 + + YES + 1 + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + textColor + + + + NO + + + {365, 386} + + + + NSView + + + + + + + view + + + + 2 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + + + 6 + 0 + + 6 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 3 + 0 + + 3 + 1 + + 110 + + 1000 + + 3 + 9 + 3 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 6 + 0 + + 6 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 5 + 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 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 11 + 0 + + 11 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 11 + 0 + + 11 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 3 + 0 + + 3 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 5 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + + + + + + + + 3 + + + + + + + + 4 + + + + + 10 + + + + + + + + 11 + + + + + 14 + + + + + + + + 15 + + + + + 66 + + + + + + + + 67 + + + + + 68 + + + + + 69 + + + + + 70 + + + + + + + + 71 + + + + + 72 + + + + + 73 + + + + + 75 + + + + + 76 + + + + + 77 + + + + + 85 + + + + + 87 + + + + + 88 + + + + + 89 + + + + + 90 + + + + + + + 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 + + + + + + 90 + + + + + MPPasswordCreatorViewController + MPViewController + + IBProjectSource + ./Classes/MPPasswordCreatorViewController.h + + + + MPViewController + NSViewController + + IBProjectSource + ./Classes/MPViewController.h + + + + NSLayoutConstraint + NSObject + + IBProjectSource + ./Classes/NSLayoutConstraint.h + + + + + 0 + IBCocoaFramework + + com.apple.InterfaceBuilder.CocoaPlugin.macosx + + + YES + 3 + YES + + diff --git a/MacPass/PasswordInputView.xib b/MacPass/PasswordInputView.xib index 08eeb72c..e605de90 100644 --- a/MacPass/PasswordInputView.xib +++ b/MacPass/PasswordInputView.xib @@ -2,10 +2,10 @@ 1080 - 12C3103 + 12D78 3084 - 1187.34 - 625.00 + 1187.37 + 626.00 com.apple.InterfaceBuilder.CocoaPlugin 3084 diff --git a/MacPass/SettingsWindow.xib b/MacPass/SettingsWindow.xib index 23d4b0b9..497ba4ca 100644 --- a/MacPass/SettingsWindow.xib +++ b/MacPass/SettingsWindow.xib @@ -35,7 +35,7 @@ 7 2 - {{196, 240}, {223, 156}} + {{196, 240}, {350, 200}} 544735232 Window NSWindow @@ -45,7 +45,7 @@ 256 - {223, 156} + {350, 200}