From 86e97ad76728ff7df9681c29d32a329bab37f5ac Mon Sep 17 00:00:00 2001 From: michael starke Date: Sun, 11 Aug 2013 17:58:39 +0200 Subject: [PATCH] Restrucutred Settings and extracts Password edit Introduced custom save palen accessory view to enable save in different formats (unfunctional for now) Started reworking drag and drop of entries and groups --- MacPass.xcodeproj/project.pbxproj | 32 +- MacPass/DatabaseSettingsWindow.xib | 1315 +------------- MacPass/MPDatabaseSettingsDelegate.h | 17 - MacPass/MPDatabaseSettingsWindowController.h | 24 +- MacPass/MPDatabaseSettingsWindowController.m | 144 +- MacPass/MPDocument.h | 7 - MacPass/MPDocument.m | 79 +- MacPass/MPDocumentWindowController.h | 5 +- MacPass/MPDocumentWindowController.m | 37 +- MacPass/MPOutlineDataSource.m | 137 +- MacPass/MPPasswordEditWindowController.h | 34 + MacPass/MPPasswordEditWindowController.m | 141 ++ MacPass/MPSavePanelAccessoryViewController.h | 20 + MacPass/MPSavePanelAccessoryViewController.m | 68 + MacPass/MPSheetWindowController.h | 33 + MacPass/MPSheetWindowController.m | 36 + MacPass/MacPass-Info.plist | 49 +- MacPass/PasswordEditWindow.xib | 1618 ++++++++++++++++++ MacPass/SavePanelAccessoryView.xib | 630 +++++++ MacPass/UnprotectedWarningView.xib | 52 +- MacPass/de.lproj/Localizable.strings | Bin 9198 -> 9226 bytes MacPass/en.lproj/Localizable.strings | Bin 8904 -> 8932 bytes 22 files changed, 2919 insertions(+), 1559 deletions(-) delete mode 100644 MacPass/MPDatabaseSettingsDelegate.h create mode 100644 MacPass/MPPasswordEditWindowController.h create mode 100644 MacPass/MPPasswordEditWindowController.m create mode 100644 MacPass/MPSavePanelAccessoryViewController.h create mode 100644 MacPass/MPSavePanelAccessoryViewController.m create mode 100644 MacPass/MPSheetWindowController.h create mode 100644 MacPass/MPSheetWindowController.m create mode 100644 MacPass/PasswordEditWindow.xib create mode 100644 MacPass/SavePanelAccessoryView.xib diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index ecd96c6f..81156160 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -11,7 +11,12 @@ 4C01C2421764D8980016D5D0 /* MPContextMenuHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C01C2411764D8980016D5D0 /* MPContextMenuHelper.m */; }; 4C01C245176500C40016D5D0 /* HNHLevelIndicatorCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C01C244176500C40016D5D0 /* HNHLevelIndicatorCell.m */; }; 4C055E74179620BF00BD2BAB /* NSString+CommandString.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C055E73179620BF00BD2BAB /* NSString+CommandString.m */; }; + 4C0728BA17B5B7A4005A7DD9 /* PasswordEditWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C0728B917B5B7A4005A7DD9 /* PasswordEditWindow.xib */; }; + 4C0728BD17B5B7F7005A7DD9 /* MPPasswordEditWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C0728BC17B5B7F7005A7DD9 /* MPPasswordEditWindowController.m */; }; + 4C0728BF17B68ED0005A7DD9 /* SavePanelAccessoryView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C0728BE17B68ED0005A7DD9 /* SavePanelAccessoryView.xib */; }; 4C08C3AE17B3022400BBBC95 /* KPKLegacyHeaderWriter.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C08C3AD17B3022400BBBC95 /* KPKLegacyHeaderWriter.m */; }; + 4C0F647817B6B65E00D9522A /* MPSheetWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C0F647717B6B65E00D9522A /* MPSheetWindowController.m */; }; + 4C0F647B17B6BC9C00D9522A /* MPSavePanelAccessoryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C0F647A17B6BC9C00D9522A /* MPSavePanelAccessoryViewController.m */; }; 4C10412C178CDD44001B5239 /* NSDate+Humanized.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C10412B178CDD44001B5239 /* NSDate+Humanized.m */; }; 4C17D8E517A1C780006C8C1E /* MPDocumentWindowDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C17D8E417A1C780006C8C1E /* MPDocumentWindowDelegate.m */; }; 4C1842AB179B027800E2F5BC /* KPKDeletedNode.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C1842AA179B027800E2F5BC /* KPKDeletedNode.m */; }; @@ -292,9 +297,17 @@ 4C01C244176500C40016D5D0 /* HNHLevelIndicatorCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HNHLevelIndicatorCell.m; sourceTree = ""; }; 4C055E72179620BF00BD2BAB /* NSString+CommandString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+CommandString.h"; sourceTree = ""; }; 4C055E73179620BF00BD2BAB /* NSString+CommandString.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+CommandString.m"; sourceTree = ""; }; + 4C0728B917B5B7A4005A7DD9 /* PasswordEditWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PasswordEditWindow.xib; sourceTree = ""; }; + 4C0728BB17B5B7F7005A7DD9 /* MPPasswordEditWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPasswordEditWindowController.h; sourceTree = ""; }; + 4C0728BC17B5B7F7005A7DD9 /* MPPasswordEditWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPPasswordEditWindowController.m; sourceTree = ""; }; + 4C0728BE17B68ED0005A7DD9 /* SavePanelAccessoryView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SavePanelAccessoryView.xib; sourceTree = ""; }; 4C08C3AC17B3022400BBBC95 /* KPKLegacyHeaderWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KPKLegacyHeaderWriter.h; sourceTree = ""; }; 4C08C3AD17B3022400BBBC95 /* KPKLegacyHeaderWriter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KPKLegacyHeaderWriter.m; sourceTree = ""; }; 4C08C3AF17B3036500BBBC95 /* KPKLegacyFormat.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = KPKLegacyFormat.h; path = Format/KPKLegacyFormat.h; sourceTree = ""; }; + 4C0F647617B6B65E00D9522A /* MPSheetWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPSheetWindowController.h; sourceTree = ""; }; + 4C0F647717B6B65E00D9522A /* MPSheetWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPSheetWindowController.m; sourceTree = ""; }; + 4C0F647917B6BC9C00D9522A /* MPSavePanelAccessoryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPSavePanelAccessoryViewController.h; sourceTree = ""; }; + 4C0F647A17B6BC9C00D9522A /* MPSavePanelAccessoryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPSavePanelAccessoryViewController.m; sourceTree = ""; }; 4C10412A178CDD44001B5239 /* NSDate+Humanized.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDate+Humanized.h"; sourceTree = ""; }; 4C10412B178CDD44001B5239 /* NSDate+Humanized.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDate+Humanized.m"; sourceTree = ""; }; 4C13904C17ADD1A300A62934 /* KPKTreeCrypting.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KPKTreeCrypting.h; sourceTree = ""; }; @@ -750,7 +763,6 @@ 4CD884B615BD47080042BBF8 /* DocumentWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DocumentWindow.xib; sourceTree = ""; }; 4CDB5C401794AA4F0017667E /* KPKTree+Serializing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "KPKTree+Serializing.h"; sourceTree = ""; }; 4CDB5C411794AA4F0017667E /* KPKTree+Serializing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = "KPKTree+Serializing.m"; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; - 4CDE28D0179C8E010036C771 /* MPDatabaseSettingsDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPDatabaseSettingsDelegate.h; sourceTree = ""; }; 4CDF01A116D1B76700D0AC08 /* MPEntryViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPEntryViewController.h; sourceTree = ""; }; 4CDF01A216D1B76700D0AC08 /* MPEntryViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPEntryViewController.m; sourceTree = ""; }; 4CE298E91795FC2A00DF7BDB /* MPEntryContextMenuDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPEntryContextMenuDelegate.h; sourceTree = ""; }; @@ -848,6 +860,7 @@ 4CE39AC016ECE359000FE29D /* IconSelection.xib */, 4C2C8B331787500E009649F3 /* UnprotectedWarningView.xib */, 4C4B7EE817A45EC5000234C7 /* DatePickingView.xib */, + 4C0728BE17B68ED0005A7DD9 /* SavePanelAccessoryView.xib */, 4C74DD05177BD1640034A9DB /* MPCustomFieldView.h */, 4C74DD06177BD1640034A9DB /* MPCustomFieldView.m */, 4CE8247316E2F2B900573141 /* MPOverlayView.h */, @@ -1458,14 +1471,14 @@ 4CA0B2F115BCAEE600654E32 /* View Controller */ = { isa = PBXGroup; children = ( + 4C2E382416D1470200037A9D /* MPViewController.h */, + 4C2E382516D1470200037A9D /* MPViewController.m */, 4CA0B2F715BCAF6700654E32 /* MPGeneralSettingsController.h */, 4CA0B2F815BCAF6700654E32 /* MPGeneralSettingsController.m */, 4CF78062176E75AD0032EE71 /* MPServerSettingsController.h */, 4CF78063176E75AD0032EE71 /* MPServerSettingsController.m */, 4CD7223917A7CB0700F5A1E1 /* MPWorkflowSettingsController.h */, 4CD7223A17A7CB0700F5A1E1 /* MPWorkflowSettingsController.m */, - 4C2E382416D1470200037A9D /* MPViewController.h */, - 4C2E382516D1470200037A9D /* MPViewController.m */, 4C65FAE616D16DDB006E0577 /* MPPasswordInputController.h */, 4C65FAE716D16DDB006E0577 /* MPPasswordInputController.m */, 4C5A11FB1708DE8700223D8A /* MPPasswordCreatorViewController.h */, @@ -1484,6 +1497,8 @@ 4C4B7EEC17A467E1000234C7 /* MPGroupInspectorViewController.m */, 4C4B7EF017A467FC000234C7 /* MPEntryInspectorViewController.h */, 4C4B7EF117A467FC000234C7 /* MPEntryInspectorViewController.m */, + 4C0F647917B6BC9C00D9522A /* MPSavePanelAccessoryViewController.h */, + 4C0F647A17B6BC9C00D9522A /* MPSavePanelAccessoryViewController.m */, ); name = "View Controller"; sourceTree = ""; @@ -1493,7 +1508,6 @@ children = ( 4CF6C715176F5183007A811D /* MPServerRequestHandler.h */, 4CA0B30D15BCB6FD00654E32 /* MPSettingsTab.h */, - 4CDE28D0179C8E010036C771 /* MPDatabaseSettingsDelegate.h */, ); name = Protocolls; sourceTree = ""; @@ -1702,6 +1716,8 @@ 4CE8247016E2E96500573141 /* Window Controller */ = { isa = PBXGroup; children = ( + 4C0F647617B6B65E00D9522A /* MPSheetWindowController.h */, + 4C0F647717B6B65E00D9522A /* MPSheetWindowController.m */, 4CA0B2FA15BCAF8600654E32 /* MPSettingsWindowController.h */, 4CA0B2FB15BCAF8600654E32 /* MPSettingsWindowController.m */, 4C83814015BF4677001AE468 /* MPDocumentWindowController.h */, @@ -1710,6 +1726,8 @@ 4CE8246E16E2E93400573141 /* MPOverlayWindowController.m */, 4CD5D703177A5F3300100649 /* MPDatabaseSettingsWindowController.h */, 4CD5D704177A5F3300100649 /* MPDatabaseSettingsWindowController.m */, + 4C0728BB17B5B7F7005A7DD9 /* MPPasswordEditWindowController.h */, + 4C0728BC17B5B7F7005A7DD9 /* MPPasswordEditWindowController.m */, ); name = "Window Controller"; sourceTree = ""; @@ -1731,6 +1749,7 @@ 4C431BCE16E2BAB000700A81 /* OverlayWindow.xib */, 4C1DDCDC1711ECEB00C98DA3 /* PasswordCreatorWindow.xib */, 4CD5D701177A5EE400100649 /* DatabaseSettingsWindow.xib */, + 4C0728B917B5B7A4005A7DD9 /* PasswordEditWindow.xib */, ); name = Windows; sourceTree = ""; @@ -1891,6 +1910,8 @@ 4C4B7EEF17A467E1000234C7 /* GroupInspectorView.xib in Resources */, 4C4B7EF417A467FC000234C7 /* EntryInspectorView.xib in Resources */, 4CD7223817A7C9EA00F5A1E1 /* WorkflowSettings.xib in Resources */, + 4C0728BA17B5B7A4005A7DD9 /* PasswordEditWindow.xib in Resources */, + 4C0728BF17B68ED0005A7DD9 /* SavePanelAccessoryView.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2136,6 +2157,9 @@ 4CF4FEE017AEA4A400712774 /* UUID+Pasterboard.m in Sources */, 4C6366AC17AF1E0100AAF17D /* NSColor+KeePassKit.m in Sources */, 4C08C3AE17B3022400BBBC95 /* KPKLegacyHeaderWriter.m in Sources */, + 4C0728BD17B5B7F7005A7DD9 /* MPPasswordEditWindowController.m in Sources */, + 4C0F647817B6B65E00D9522A /* MPSheetWindowController.m in Sources */, + 4C0F647B17B6BC9C00D9522A /* MPSavePanelAccessoryViewController.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/MacPass/DatabaseSettingsWindow.xib b/MacPass/DatabaseSettingsWindow.xib index 4b385cc2..1260411b 100644 --- a/MacPass/DatabaseSettingsWindow.xib +++ b/MacPass/DatabaseSettingsWindow.xib @@ -18,14 +18,10 @@ NSCustomObject NSMenu NSMenuItem - NSPathCell - NSPathControl NSPopUpButton NSPopUpButtonCell NSScrollView NSScroller - NSSecureTextField - NSSecureTextFieldCell NSStepper NSStepperCell NSTabView @@ -72,7 +68,6 @@ {{473, 13}, {59, 32}} - _NS:9 YES @@ -101,13 +96,13 @@ {{13, 41}, {520, 318}} - + _NS:9 1 - + 256 @@ -115,6 +110,7 @@ 268 {{136, 220}, {280, 22}} + _NS:9 YES @@ -152,6 +148,7 @@ 268 {{50, 195}, {81, 17}} + _NS:1535 YES @@ -185,6 +182,7 @@ 268 {{25, 223}, {106, 17}} + _NS:1535 YES @@ -211,8 +209,28 @@ 2322 + + Apple HTML pasteboard type + Apple PDF pasteboard type + Apple PICT pasteboard type + Apple PNG pasteboard type + Apple URL pasteboard type + CorePasteboardFlavorType 0x6D6F6F76 + NSColor pasteboard type + NSFilenamesPboardType + NSStringPboardType + NeXT Encapsulated PostScript v1.2 pasteboard type + NeXT RTFD pasteboard type + NeXT Rich Text Format v1.0 pasteboard type + NeXT TIFF v4.0 pasteboard type + NeXT font pasteboard type + NeXT ruler pasteboard type + WebURLsWithTitlesPboardType + public.url + {278, 98} + _NS:13 @@ -275,6 +293,7 @@ {{1, 1}, {278, 98}} + _NS:11 @@ -305,6 +324,7 @@ 256 {{263, 1}, {16, 98}} + _NS:83 NO @@ -317,6 +337,7 @@ -2147483392 {{-100, -100}, {87, 18}} + _NS:33 NO @@ -329,6 +350,7 @@ {{136, 112}, {280, 100}} + _NS:9 133138 @@ -344,6 +366,7 @@ 268 {{134, 68}, {120, 26}} + _NS:9 YES @@ -359,28 +382,29 @@ 400 75 - + + + None + + 1048576 + 2147483647 + 1 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + _popUpItemAction: + + YES OtherViews - - - None - - 1048576 - 2147483647 - - NSImage - NSMenuCheckmark - - - NSImage - NSMenuMixedState - - _popUpItemAction: - - + GZip @@ -409,6 +433,7 @@ 268 {{39, 73}, {92, 17}} + _NS:1535 YES @@ -429,6 +454,7 @@ 268 {{88, 31}, {43, 17}} + _NS:1535 YES @@ -452,7 +478,8 @@ {{136, 28}, {44, 23}} - + + _NS:1116 YES NO @@ -464,6 +491,8 @@ {{10, 33}, {500, 272}} + + _NS:11 @@ -471,269 +500,9 @@ - - - - 256 - - - - 268 - {{111, 212}, {68, 17}} - - - _NS:1535 - YES - - 68157504 - 272630784 - Password: - - _NS:1535 - - - - - NO - - - - 268 - - Apple URL pasteboard type - NSFilenamesPboardType - - {{181, 146}, {170, 26}} - - - _NS:9 - YES - - 337641473 - 0 - - _NS:9 - - - 2 - - - xml - key - - - NO - - - - 268 - {{128, 150}, {51, 17}} - - - _NS:1535 - YES - - 68157504 - 272630784 - Keyfile: - - _NS:1535 - - - - - NO - - - - 268 - {{184, 123}, {164, 19}} - - - _NS:9 - YES - - -1543503872 - 134217728 - Generate Keyfile - - LucidaGrande - 12 - 16 - - _NS:9 - - -2038153216 - 164 - - - 400 - 75 - - NO - - - - 268 - {{356, 208}, {31, 25}} - - - _NS:22 - YES - - 67108864 - 134217728 - - - _NS:22 - - -926662656 - 163 - - NSImage - NSQuickLookTemplate - - - - 400 - 75 - - NO - - - - 268 - {{356, 147}, {31, 25}} - - - _NS:22 - YES - - -2080374784 - 134217728 - - - _NS:22 - - -2033958912 - 163 - - NSImage - NSStopProgressTemplate - - - - 400 - 75 - - NO - - - - 268 - {{184, 210}, {164, 22}} - - - _NS:9 - YES - - 342884416 - 272630848 - - - _NS:9 - - YES - - - - NSAllRomanInputSourcesLocaleIdentifier - - - NO - - - - 268 - {{127, 180}, {52, 17}} - - - _NS:1535 - YES - - 68157504 - 272630784 - Repeat: - - _NS:1535 - - - - - NO - - - - 268 - {{184, 178}, {164, 22}} - - - _NS:9 - YES - - 342884416 - 272630848 - - - _NS:9 - - YES - - - - NSAllRomanInputSourcesLocaleIdentifier - - - NO - - - - 268 - {{198, 240}, {137, 17}} - - - _NS:1535 - YES - - 68157504 - 272630784 - Missmatching Passwords - - LucidaGrande - 11 - 3100 - - _NS:1535 - - - - 1 - MSAwIDAAA - - - NO - - - {{10, 33}, {500, 272}} - - - Password - - - - + 256 @@ -741,7 +510,6 @@ 268 {{184, 228}, {98, 18}} - _NS:9 YES @@ -773,7 +541,6 @@ 268 {{184, 199}, {133, 18}} - _NS:9 YES @@ -800,7 +567,6 @@ 268 {{184, 170}, {130, 18}} - _NS:9 YES @@ -827,7 +593,6 @@ 268 {{184, 141}, {95, 18}} - _NS:9 YES @@ -854,8 +619,7 @@ 268 {{184, 112}, {107, 18}} - - + _NS:9 YES @@ -878,8 +642,6 @@ {{10, 33}, {500, 272}} - - Protection @@ -948,7 +710,7 @@ 268 {{112, 109}, {187, 18}} - + _NS:9 YES @@ -1184,7 +946,7 @@ 268 {{220, 151}, {184, 26}} - + _NS:9 YES @@ -1243,13 +1005,13 @@ - + 0 YES YES - + @@ -1283,7 +1045,7 @@ - {{0, 0}, {1680, 1028}} + {{0, 0}, {1920, 1058}} {10000000000000, 10000000000000} YES @@ -1306,14 +1068,6 @@ 655 - - - keyfilePathControl - - - - 659 - protectTitleCheckButton @@ -1394,14 +1148,6 @@ 815 - - - generateKey: - - - - 955 - save: @@ -1410,38 +1156,6 @@ 962 - - - passwordTextField - - - - 1048 - - - - clearKey: - - - - 1049 - - - - togglePasswordButton - - - - 1050 - - - - passwordRepeatTextField - - - - 1152 - saveButton @@ -1450,22 +1164,6 @@ 1183 - - - cancelButton - - - - 1201 - - - - errorTextField - - - - 1202 - defaultUsernameTextField @@ -1484,11 +1182,11 @@ - cancel: + close: - 1264 + 1454 @@ -1688,7 +1386,6 @@ - @@ -2841,454 +2538,6 @@ - - 619 - - - - - - - - 620 - - - - - 10 - 0 - - 10 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 6 - 0 - - 6 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 5 - 0 - - 6 - 1 - - 8 - - 1000 - - 6 - 24 - 3 - - - - 5 - 0 - - 5 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 5 - 0 - - 6 - 1 - - 8 - - 1000 - - 6 - 24 - 3 - - - - 3 - 0 - - 4 - 1 - - 8 - - 1000 - - 6 - 24 - 3 - - - - 6 - 0 - - 6 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 5 - 0 - - 5 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 6 - 0 - - 6 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 3 - 0 - - 4 - 1 - - 8 - - 1000 - - 6 - 24 - 3 - - - - 5 - 0 - - 6 - 1 - - 8 - - 1000 - - 6 - 24 - 3 - - - - 9 - 0 - - 9 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 3 - 0 - - 3 - 1 - - 15 - - 1000 - - 3 - 9 - 3 - - - - 5 - 0 - - 6 - 1 - - 8 - - 1000 - - 6 - 24 - 3 - - - - 3 - 0 - - 4 - 1 - - 10 - - 1000 - - 6 - 24 - 3 - - - - 5 - 0 - - 5 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 5 - 0 - - 5 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 3 - 0 - - 4 - 1 - - 8 - - 1000 - - 6 - 24 - 3 - - - - 5 - 0 - - 6 - 1 - - 8 - - 1000 - - 6 - 24 - 3 - - - - 3 - 0 - - 3 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 11 - 0 - - 11 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 4 - 0 - - 4 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 11 - 0 - - 11 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 5 - 0 - - 5 - 1 - - 114 - - 1000 - - 3 - 9 - 3 - - - - - - - - - - - - - - - - 621 - - - - - - - - 622 - - - - - 638 - - - - - - - - 639 - - - - - 650 - - - - - - - - 651 - - - 678 @@ -3357,19 +2606,6 @@ - - 731 - - - - - - - - 732 - - - 374 @@ -3413,106 +2649,6 @@ - - 967 - - - - - - - - 968 - - - - - 1003 - - - - - - - - 1004 - - - - - 1015 - - - - - 1023 - - - - - 1027 - - - - - 1029 - - - - - 1037 - - - - - - 7 - 0 - - 0 - 1 - - 164 - - 1000 - - 3 - 9 - 1 - - - - - - 1038 - - - - - 1040 - - - - - 1041 - - - - - 1044 - - - - - 1046 - - - - - 1047 - - - 1055 @@ -3553,141 +2689,6 @@ - - 1120 - - - - - - - - 1121 - - - - - 1124 - - - - - - - - 1126 - - - - - 1128 - - - - - 1129 - - - - - 1130 - - - - - 1133 - - - - - 1134 - - - - - 1135 - - - - - 1146 - - - - - 1149 - - - - - 1150 - - - - - 1151 - - - - - 1177 - - - - - 1179 - - - - - 1187 - - - - - - 8 - 0 - - 0 - 1 - - 17 - - 1000 - - 3 - 9 - 1 - - - - - - 1188 - - - - - 1194 - - - - - 1195 - - - - - 1197 - - - - - 1199 - - - 1210 @@ -4092,11 +3093,6 @@ - - 1371 - - - 1374 @@ -4321,25 +3317,6 @@ 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 - HNHRoundedSecureTextField - - - - - 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 @@ -4348,35 +3325,6 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - HNHRoundedSecureTextField - - 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 @@ -4443,7 +3391,6 @@ 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 @@ -4629,44 +3576,6 @@ 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 @@ -4681,46 +3590,21 @@ 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 - 1453 + 1454 - - HNHRoundedSecureTextField - NSSecureTextField - - toggleDisplay: - id - - - toggleDisplay: - - toggleDisplay: - id - - - - IBProjectSource - ./Classes/HNHRoundedSecureTextField.h - - HNHRoundedTextField NSTextField @@ -4732,47 +3616,22 @@ MPDatabaseSettingsWindowController NSWindowController - - id - id - - - - clearKey: - id - - - generateKey: - id - - - NSButton NSTextView NSTextField HNHRoundedTextField NSButton NSButton - NSTextField - NSPathControl - HNHRoundedSecureTextField - HNHRoundedSecureTextField NSButton NSButton NSButton NSButton NSButton - NSButton NSTabView NSPopUpButton NSPopUpButton - NSButton - - cancelButton - NSButton - databaseDescriptionTextView NSTextView @@ -4793,22 +3652,6 @@ enableRecycleBinCheckButton NSButton - - errorTextField - NSTextField - - - keyfilePathControl - NSPathControl - - - passwordRepeatTextField - HNHRoundedSecureTextField - - - passwordTextField - HNHRoundedSecureTextField - protectNotesCheckButton NSButton @@ -4829,10 +3672,6 @@ protectUserNameCheckButton NSButton - - saveButton - NSButton - sectionTabView NSTabView @@ -4845,10 +3684,6 @@ templateGroupPopUpButton NSPopUpButton - - togglePasswordButton - NSButton - IBProjectSource @@ -4863,24 +3698,6 @@ ./Classes/NSLayoutConstraint.h - - NSTextView - - orderFrontSharingServicePicker: - id - - - orderFrontSharingServicePicker: - - orderFrontSharingServicePicker: - id - - - - IBProjectSource - ./Classes/NSTextView.h - - 0 @@ -4890,8 +3707,6 @@ {11, 11} {10, 3} - {21, 16} - {11, 11} {15, 15} YES diff --git a/MacPass/MPDatabaseSettingsDelegate.h b/MacPass/MPDatabaseSettingsDelegate.h deleted file mode 100644 index 9c917dce..00000000 --- a/MacPass/MPDatabaseSettingsDelegate.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// MPDatabaseSettingsDelegate.h -// MacPass -// -// Created by Michael Starke on 21.07.13. -// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. -// - -#import - -@protocol MPDatabaseSettingsDelegate - -@optional -- (void)didCancelDatabaseSettings; -- (void)didSaveDatabaseSettings; - -@end diff --git a/MacPass/MPDatabaseSettingsWindowController.h b/MacPass/MPDatabaseSettingsWindowController.h index f379672e..015424e5 100644 --- a/MacPass/MPDatabaseSettingsWindowController.h +++ b/MacPass/MPDatabaseSettingsWindowController.h @@ -7,11 +7,10 @@ // #import -#import "MPDatabaseSettingsDelegate.h" +#import "MPSheetWindowController.h" typedef NS_ENUM(NSUInteger, MPDatabaseSettingsTab) { MPDatabaseSettingsTabGeneral, - MPDatabaseSettingsTabPassword, MPDatabaseSettingsTabDisplay, MPDatabaseSettingsTabAdvanced, MPDatabaseSettingsTabTemplates, @@ -19,31 +18,15 @@ typedef NS_ENUM(NSUInteger, MPDatabaseSettingsTab) { @class MPDocument; @class HNHRoundedTextField; -@class HNHRoundedSecureTextField; -@interface MPDatabaseSettingsWindowController : NSWindowController - -@property (nonatomic,weak) id delegate; +@interface MPDatabaseSettingsWindowController : MPSheetWindowController @property (weak) IBOutlet NSTabView *sectionTabView; -@property (weak) IBOutlet NSButton *saveButton; -@property (weak) IBOutlet NSButton *cancelButton; /* General Tab */ @property (weak) IBOutlet NSTextField *databaseNameTextField; @property (unsafe_unretained) IBOutlet NSTextView *databaseDescriptionTextView; -/* Protection */ -@property (weak) IBOutlet HNHRoundedSecureTextField *passwordTextField; -@property (weak) IBOutlet HNHRoundedSecureTextField *passwordRepeatTextField; -@property (weak) IBOutlet NSPathControl *keyfilePathControl; -@property (weak) IBOutlet NSButton *togglePasswordButton; -@property (weak) IBOutlet NSTextField *errorTextField; - - -- (IBAction)clearKey:(id)sender; -- (IBAction)generateKey:(id)sender; - /* Display Tab */ @property (weak) IBOutlet NSButton *protectTitleCheckButton; @property (weak) IBOutlet NSButton *protectUserNameCheckButton; @@ -66,9 +49,6 @@ typedef NS_ENUM(NSUInteger, MPDatabaseSettingsTab) { - (void)showSettingsTab:(MPDatabaseSettingsTab)tab; -- (void)update; - - @end diff --git a/MacPass/MPDatabaseSettingsWindowController.m b/MacPass/MPDatabaseSettingsWindowController.m index 9f3a9e04..fead83d0 100644 --- a/MacPass/MPDatabaseSettingsWindowController.m +++ b/MacPass/MPDatabaseSettingsWindowController.m @@ -26,26 +26,21 @@ MPDocument *_document; NSString *_missingFeature; } - @property (nonatomic,assign) BOOL trashEnabled; -@property (nonatomic,assign) BOOL showPassword; -@property (nonatomic,assign) BOOL hasValidPasswordOrKey; -@property (nonatomic,weak) NSURL *keyURL; @end @implementation MPDatabaseSettingsWindowController - (id)init { - return [self initWithDocument:nil]; + self = [self initWithDocument:nil]; + return self; } - (id)initWithDocument:(MPDocument *)document { self = [super initWithWindowNibName:@"DatabaseSettingsWindow"]; if(self) { _document = document; - _showPassword = NO; - _hasValidPasswordOrKey = NO; _missingFeature = NSLocalizedString(@"KDBX_ONLY_FEATURE", "Feature only available in kdbx databases"); } return self; @@ -55,32 +50,11 @@ [super windowDidLoad]; NSAssert(_document != nil, @"Document needs to be present"); - - [self.saveButton bind:NSEnabledBinding toObject:self withKeyPath:@"hasValidPasswordOrKey" options:nil]; [self.sectionTabView setDelegate:self]; - - - [self update]; -} - -- (void)setDelegate:(id)delegate { - if(_delegate != delegate) { - if([delegate conformsToProtocol:@protocol(MPDatabaseSettingsDelegate)]) { - _delegate = delegate; - } - else{ - NSAssert(NO, @"Delegate needs to conform to MPDatabaseSettingsDelegate protocoll"); - } - } } - (IBAction)save:(id)sender { - - /* Protection */ - _document.password = [self.passwordTextField stringValue]; - _document.key = [self.keyfilePathControl URL]; - /* General */ _document.treeV4.databaseDescription = [self.databaseDescriptionTextView string]; _document.treeV4.databaseName = [self.databaseNameTextField stringValue]; @@ -121,37 +95,25 @@ [defaults setBool:protectUsername forKey:kMPSettingsKeyLegacyHideUsername]; [defaults synchronize]; } - [self closeDidSave:YES]; + [self close:nil]; } -- (IBAction)cancel:(id)sender { - [self closeDidSave:NO]; -} -- (void)closeDidSave:(BOOL)didSave { - /* Remove the window first */ +- (IBAction)close:(id)sender { [NSApp endSheet:[self window]]; [[self window] orderOut:nil]; - - /* Then notify the delegate */ - if(self.delegate) { - if(didSave && [self.delegate respondsToSelector:@selector(didSaveDatabaseSettings)]) { - [self.delegate didSaveDatabaseSettings]; - } - else if(!didSave && [self.delegate respondsToSelector:@selector(didCancelDatabaseSettings)]) { - [self.delegate didCancelDatabaseSettings]; - } - } } - -- (void)update { +- (void)updateView { + if(!self.isDirty) { + return; + } /* Update all stuff that might have changed */ Kdb4Tree *tree = _document.treeV4; - [self _setupPasswordTab:tree]; [self _setupDatabase:tree]; [self _setupProtectionTab:tree]; [self _setupAdvancedTab:tree]; [self _setupTemplatesTab:tree]; + self.isDirty = NO; } - (void)showSettingsTab:(MPDatabaseSettingsTab)tab { @@ -162,47 +124,18 @@ if(![self window]) { return; } - self.showPassword = NO; NSTabViewItem *tabViewItem = [self.sectionTabView tabViewItemAtIndex:tab]; BOOL canSelectTab = [self tabView:self.sectionTabView shouldSelectTabViewItem:tabViewItem]; if(!canSelectTab) { - [self.sectionTabView selectTabViewItemAtIndex:MPDatabaseSettingsTabPassword]; + [self.sectionTabView selectTabViewItemAtIndex:MPDatabaseSettingsTabTemplates]; } [self.sectionTabView selectTabViewItemAtIndex:tab]; } -- (void)setShowPassword:(BOOL)showPassword { - if(_showPassword != showPassword) { - _showPassword = showPassword; - - [self.passwordRepeatTextField setStringValue:@""]; - [self _verifyPasswordAndKey]; - } -} - -- (void)setKeyURL:(NSURL *)keyURL { - _keyURL = keyURL; - [self _verifyPasswordAndKey]; -} - -#pragma mark Actions -- (IBAction)clearKey:(id)sender { - self.keyURL = nil; -} - -- (IBAction)generateKey:(id)sender { -} - -#pragma mark NSTextFieldDelegate -- (void)controlTextDidChange:(NSNotification *)obj { - [self _verifyPasswordAndKey]; -} - #pragma mark NSTableViewDelegate - (BOOL)tabView:(NSTabView *)tabView shouldSelectTabViewItem:(NSTabViewItem *)tabViewItem { NSUInteger index = [tabView indexOfTabViewItem:tabViewItem]; switch ((MPDatabaseSettingsTab)index) { - case MPDatabaseSettingsTabPassword: case MPDatabaseSettingsTabDisplay: return YES; @@ -217,40 +150,6 @@ } #pragma mark Private Helper -- (void)_verifyPasswordAndKey { - NSString *password = [self.passwordTextField stringValue]; - NSString *repeat = [self.passwordRepeatTextField stringValue]; - BOOL hasKey = (self.keyURL != nil); - BOOL keyOk = YES; - if(hasKey) { - keyOk = [self.keyURL checkResourceIsReachableAndReturnError:nil]; - } - BOOL hasPassword = ![NSString isEmptyString:password]; - BOOL passwordOk = YES; - if(hasPassword ) { - passwordOk = [password isEqualToString:repeat] || self.showPassword; - } - BOOL hasPasswordOrKey = (hasKey || hasPassword); - keyOk = hasKey ? keyOk : YES; - passwordOk = hasPassword ? passwordOk : YES; - self.hasValidPasswordOrKey = hasPasswordOrKey && passwordOk && keyOk; - - if(!hasPasswordOrKey) { - [self.errorTextField setStringValue:NSLocalizedString(@"ERROR_NO_PASSWORD_OR_KEYFILE", "Missing Key or Password")]; - return; // alldone - } - if(!passwordOk && !keyOk ) { - [self.errorTextField setStringValue:NSLocalizedString(@"ERROR_PASSWORD_MISSMATCH_INVALID_KEYFILE", "Passwords do not match, keyfile is invalid")]; - } - else if(!passwordOk) { - [self.errorTextField setStringValue:NSLocalizedString(@"ERROR_PASSWORD_MISSMATCH", "Passwords do not match")]; - } - else { - [self.errorTextField setStringValue:NSLocalizedString(@"ERROR_INVALID_KEYFILE", "Keyfile not valid")]; - } - -} - - (void)_setupDatabase:(Kdb4Tree *)tree { BOOL isKdbx = (nil != tree); [self.databaseDescriptionTextView setEditable:isKdbx]; @@ -296,25 +195,6 @@ } } -- (void)_setupPasswordTab:(Kdb4Tree *)tree { - [self.passwordTextField setStringValue:_document.password ? _document.password : @""]; - [self.passwordRepeatTextField setStringValue:[self.passwordTextField stringValue]]; - self.keyURL = _document.key; - - NSDictionary *negateOption = @{ NSValueTransformerNameBindingOption : NSNegateBooleanTransformerName }; - [self.passwordTextField bind:@"showPassword" toObject:self withKeyPath:@"showPassword" options:nil]; - [self.togglePasswordButton bind:NSValueBinding toObject:self withKeyPath:@"showPassword" options:nil]; - [self.passwordRepeatTextField bind:NSEnabledBinding toObject:self withKeyPath:@"showPassword" options:negateOption]; - [self.errorTextField bind:NSHiddenBinding toObject:self withKeyPath:@"hasValidPasswordOrKey" options:nil]; - [self.keyfilePathControl bind:NSValueBinding toObject:self withKeyPath:@"keyURL" options:nil]; - - [self.passwordRepeatTextField setDelegate:self]; - [self.passwordTextField setDelegate:self]; - - /* Manually initate the first check */ - [self _verifyPasswordAndKey]; -} - - (void)_setupTemplatesTab:(Kdb4Tree *)tree { if(tree) { [self.defaultUsernameTextField setStringValue:tree.defaultUserName]; @@ -344,10 +224,6 @@ [[self window] makeFirstResponder:self.databaseNameTextField]; break; - case MPDatabaseSettingsTabPassword: - [[self window] makeFirstResponder:self.passwordTextField]; - break; - case MPDatabaseSettingsTabTemplates: break; } diff --git a/MacPass/MPDocument.h b/MacPass/MPDocument.h index 3a64ea2f..ba7f8893 100644 --- a/MacPass/MPDocument.h +++ b/MacPass/MPDocument.h @@ -11,14 +11,11 @@ APPKIT_EXTERN NSString *const MPDocumentDidAddGroupNotification; -APPKIT_EXTERN NSString *const MPDocumentDidAddEntryNotification; APPKIT_EXTERN NSString *const MPDocumentDidRevertNotifiation; APPKIT_EXTERN NSString *const MPDocumentEntryKey; APPKIT_EXTERN NSString *const MPDocumentGroupKey; -APPKIT_EXTERN NSString *const MPDocumentRequestPasswordSaveNotification; - /* APPKIT_EXTERN NSString *const MPDocumentDidChangeCurrentItemNotification; APPKIT_EXTERN NSString *const MPDocumentDidChangeCurrentGroupNotication; @@ -96,10 +93,6 @@ APPKIT_EXTERN NSString *const MPDocumnetDidChangeCurrentEntryNotification; - (KdbEntry *)createEntry:(KdbGroup *)parent; - (StringField *)createStringField:(KdbEntry *)entry; -/* - All non-setter undoable actions -*/ - /* TODO in UNDO auslagen */ - (void)addStringField:(StringField *)field toEntry:(Kdb4Entry *)entry atIndex:(NSUInteger)index; - (void)removeStringField:(StringField *)field formEntry:(Kdb4Entry *)entry; diff --git a/MacPass/MPDocument.m b/MacPass/MPDocument.m index 04d5c1bf..8a08b64e 100644 --- a/MacPass/MPDocument.m +++ b/MacPass/MPDocument.m @@ -8,13 +8,13 @@ #import "MPDocument.h" #import "MPDocumentWindowController.h" - #import "MPDatabaseVersion.h" #import "MPRootAdapter.h" #import "MPIconHelper.h" #import "MPActionHelper.h" #import "MPSettingsHelper.h" #import "MPNotifications.h" +#import "MPSavePanelAccessoryViewController.h" #import "KdbLib.h" #import "Kdb3Node.h" @@ -35,14 +35,13 @@ #import "KdbGroup+MPAdditions.h" #import "DataOutputStream.h" - #import "DDXMLNode.h" -NSString *const MPDocumentDidAddGroupNotification = @"com.hicknhack.macpass.MPDocumentDidAddGroupNotification"; -NSString *const MPDocumentDidAddEntryNotification = @"com.hicknhack.macpass.MPDocumentDidAddEntryNotification"; -NSString *const MPDocumentDidRevertNotifiation = @"com.hicknhack.macpass.MPDocumentDidRevertNotifiation"; -NSString *const MPDocumentRequestPasswordSaveNotification = @"com.hicknhack.macpass.MPDocumentRequestPasswordSaveNotification"; +#import "KPKTree+Serializing.h" +#import "KPKPassword.h" +NSString *const MPDocumentDidAddGroupNotification = @"com.hicknhack.macpass.MPDocumentDidAddGroupNotification"; +NSString *const MPDocumentDidRevertNotifiation = @"com.hicknhack.macpass.MPDocumentDidRevertNotifiation"; NSString *const MPDocumentEntryKey = @"MPDocumentEntryKey"; NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey"; @@ -58,6 +57,7 @@ typedef NS_ENUM(NSUInteger, MPAlertType) { NSData *_fileData; } +@property (strong, nonatomic) MPSavePanelAccessoryViewController *savePanelViewController; @property (strong, nonatomic) KdbTree *tree; @property (weak, nonatomic) KdbGroup *root; @@ -79,8 +79,11 @@ typedef NS_ENUM(NSUInteger, MPAlertType) { @implementation MPDocument -- (id)init -{ ++ (BOOL)autosavesInPlace { + return NO; +} + +- (id)init { return [self initWithVersion:MPDatabaseVersion4]; } #pragma mark NSDocument essentials @@ -127,6 +130,9 @@ typedef NS_ENUM(NSUInteger, MPAlertType) { } - (BOOL)writeToURL:(NSURL *)url ofType:(NSString *)typeName error:(NSError **)outError { + /* + Move this to data:ofType: method with KeePassKit + */ NSError *error = nil; [KdbWriterFactory persist:self.tree fileURL:url withPassword:self.passwordHash error:&error]; if(error) { @@ -137,7 +143,7 @@ typedef NS_ENUM(NSUInteger, MPAlertType) { } - (BOOL)readFromURL:(NSURL *)url ofType:(NSString *)typeName error:(NSError **)outError { - /* FIXME: Logfile handling + /* FIXME: Lockfile handling self.lockFileURL = [url URLByAppendingPathExtension:@"lock"]; if([[NSFileManager defaultManager] fileExistsAtPath:[_lockFileURL path]]) { self.readOnly = YES; @@ -182,6 +188,26 @@ typedef NS_ENUM(NSUInteger, MPAlertType) { [super close]; } +- (BOOL)shouldRunSavePanelWithAccessoryView { + return NO; +} + +- (BOOL)prepareSavePanel:(NSSavePanel *)savePanel { + /* + + Save as different format doesn work with out KeePassKit + hence disabled for now + + if(!self.savePanelViewController) { + self.savePanelViewController = [[MPSavePanelAccessoryViewController alloc] init]; + } + self.savePanelViewController.savePanel = savePanel; + self.savePanelViewController.document = self; + [savePanel setAccessoryView:[self.savePanelViewController view]]; + */ + return YES; +} + - (void)writeXMLToURL:(NSURL *)url { DataOutputStream *outputStream = [[DataOutputStream alloc] init]; Kdb4Persist *persist = [[Kdb4Persist alloc] initWithTree:self.treeV4 outputStream:outputStream randomStream:nil]; @@ -192,7 +218,11 @@ typedef NS_ENUM(NSUInteger, MPAlertType) { #pragma mark Lock/Unlock/Decrypt - (BOOL)unlockWithPassword:(NSString *)password keyFileURL:(NSURL *)keyFileURL { - + /* + KPKPassword *passwordData = [[KPKPassword alloc] initWithPassword:password key:keyFileURL]; + KPKTree *tree = [[KPKTree alloc] initWithData:_fileData password:passwordData error:NULL]; + */ + self.key = keyFileURL; self.password = [password length] > 0 ? password : nil; @try { @@ -218,9 +248,7 @@ typedef NS_ENUM(NSUInteger, MPAlertType) { self.locked = YES; } - #pragma mark Custom Setter - - (void)setPassword:(NSString *)password { if(![_password isEqualToString:password]) { _password = [password copy]; @@ -236,32 +264,9 @@ typedef NS_ENUM(NSUInteger, MPAlertType) { } - (KdbPassword *)passwordHash { - return [[KdbPassword alloc] initWithPassword:self.password passwordEncoding:NSUTF8StringEncoding keyFileURL:self.key]; } -+ (BOOL)autosavesInPlace -{ - return NO; -} - -- (void)saveDocument:(id)sender { - if(self.hasPasswordOrKey) { - [super saveDocument:sender]; - } - else { - [[NSNotificationCenter defaultCenter] postNotificationName:MPDocumentRequestPasswordSaveNotification object:self userInfo:nil]; - } -} - -- (BOOL)prepareSavePanel:(NSSavePanel *)savePanel { - if(self.hasPasswordOrKey) { - [savePanel setAccessoryView:nil]; - return YES; - } - return NO; -} - - (void)setSelectedGroup:(KdbGroup *)selectedGroup { if(_selectedGroup != selectedGroup) { _selectedGroup = selectedGroup; @@ -417,8 +422,6 @@ typedef NS_ENUM(NSUInteger, MPAlertType) { newEntry.title = self.treeV4.defaultUserName; } [parent addEntryUndoable:newEntry atIndex:[parent.entries count]]; - NSDictionary *userInfo = @{ MPDocumentEntryKey : newEntry }; - [[NSNotificationCenter defaultCenter] postNotificationName:MPDocumentDidAddEntryNotification object:self userInfo:userInfo]; return newEntry; } @@ -442,7 +445,6 @@ typedef NS_ENUM(NSUInteger, MPAlertType) { } - (StringField *)createStringField:(KdbEntry *)entry { - // TODO: Localize! if(![entry isKindOfClass:[Kdb4Entry class]]) { return nil; } @@ -487,7 +489,6 @@ typedef NS_ENUM(NSUInteger, MPAlertType) { } #pragma mark CustomFields - - (void)addStringField:(StringField *)field toEntry:(Kdb4Entry *)entry atIndex:(NSUInteger)index { [[[self undoManager] prepareWithInvocationTarget:self] removeStringField:field formEntry:entry]; [[self undoManager] setActionName:NSLocalizedString(@"UNDO_ADD_STRING_FIELD", @"Add Stringfield Undo")]; diff --git a/MacPass/MPDocumentWindowController.h b/MacPass/MPDocumentWindowController.h index c5a7ef8e..45a6fc29 100644 --- a/MacPass/MPDocumentWindowController.h +++ b/MacPass/MPDocumentWindowController.h @@ -7,7 +7,6 @@ // #import -#import "MPDatabaseSettingsDelegate.h" @class MPViewController; @class MPEntryViewController; @@ -18,7 +17,7 @@ @class KdbGroup; @class KdbEntry; -@interface MPDocumentWindowController : NSWindowController +@interface MPDocumentWindowController : NSWindowController @property (readonly, strong) MPPasswordInputController *passwordInputController; @property (readonly, strong) MPEntryViewController *entryViewController; @@ -36,6 +35,8 @@ - (void)showPasswordInput; - (void)performFindPanelAction:(id)sender; +- (IBAction)saveDocument:(id)sender; + - (IBAction)editPassword:(id)sender; - (IBAction)showDatabaseSettings:(id)sender; - (IBAction)editTemplateGroup:(id)sender; diff --git a/MacPass/MPDocumentWindowController.m b/MacPass/MPDocumentWindowController.m index ec9a74c6..e28733f3 100644 --- a/MacPass/MPDocumentWindowController.m +++ b/MacPass/MPDocumentWindowController.m @@ -16,6 +16,7 @@ #import "MPAppDelegate.h" #import "MPActionHelper.h" #import "MPDatabaseSettingsWindowController.h" +#import "MPPasswordEditWindowController.h" #import "MPConstants.h" #import "MPSettingsHelper.h" #import "MPDocumentWindowDelegate.h" @@ -25,7 +26,6 @@ @interface MPDocumentWindowController () { @private id _firstResponder; - BOOL _saveAfterPasswordEdit; // Flag to indicat that the document needs to be saved after password edit did finish } @property (strong) IBOutlet NSSplitView *splitView; @@ -38,6 +38,7 @@ @property (strong) MPInspectorViewController *inspectorViewController; @property (strong) MPDatabaseSettingsWindowController *documentSettingsWindowController; @property (strong) MPDocumentWindowDelegate *documentWindowDelegate; +@property (strong) MPPasswordEditWindowController *passwordEditWindowController; @property (strong) MPToolbarDelegate *toolbarDelegate; @@ -54,7 +55,6 @@ _entryViewController = [[MPEntryViewController alloc] init]; _inspectorViewController = [[MPInspectorViewController alloc] init]; _documentWindowDelegate = [[MPDocumentWindowDelegate alloc] init]; - _saveAfterPasswordEdit = NO; } return self; } @@ -76,7 +76,6 @@ */ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didRevertDocument:) name:MPDocumentDidRevertNotifiation object:[self document]]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_setPasswordAndSave) name:MPDocumentRequestPasswordSaveNotification object:[self document]]; [_entryViewController setupNotifications:self]; [_inspectorViewController setupNotifications:self]; @@ -156,6 +155,13 @@ } #pragma mark Actions +- (void)saveDocument:(id)sender { + MPDocument *document = [self document]; + if(!document.hasPasswordOrKey) { + // warning if no password ist set! + } + [[self document] saveDocument:sender]; +} - (void)exportDatabase:(id)sender { NSSavePanel *savePanel = [NSSavePanel savePanel]; [savePanel setAllowsOtherFileTypes:YES]; @@ -255,7 +261,10 @@ } - (void)editPassword:(id)sender { - [self _showDatabaseSetting:MPDatabaseSettingsTabPassword]; + if(!self.passwordEditWindowController) { + self.passwordEditWindowController = [[MPPasswordEditWindowController alloc] initWithDocument:[self document]]; + } + [NSApp beginSheet:[self.passwordEditWindowController window] modalForWindow:[self window] modalDelegate:nil didEndSelector:NULL contextInfo:NULL]; } - (void)showDatabaseSettings:(id)sender { @@ -375,31 +384,11 @@ [_outlineViewController showOutline]; } -#pragma mark MPDatabaseSettingsDelegate -- (void)didCancelDatabaseSettings { - _saveAfterPasswordEdit = NO; // Just Reset the flag -} - -- (void)didSaveDatabaseSettings { - if (_saveAfterPasswordEdit) { - _saveAfterPasswordEdit = NO; - [[self document] saveDocument:nil]; - } -} - #pragma mark Helper - -- (void)_setPasswordAndSave { - _saveAfterPasswordEdit = YES; - [self editPassword:nil]; -} - - (void)_showDatabaseSetting:(MPDatabaseSettingsTab)tab { if(!self.documentSettingsWindowController) { _documentSettingsWindowController = [[MPDatabaseSettingsWindowController alloc] initWithDocument:[self document]]; - [_documentSettingsWindowController setDelegate:self]; } - [self.documentSettingsWindowController update]; [self.documentSettingsWindowController showSettingsTab:tab]; [[NSApplication sharedApplication] beginSheet:[self.documentSettingsWindowController window] modalForWindow:[self window] diff --git a/MacPass/MPOutlineDataSource.m b/MacPass/MPOutlineDataSource.m index 4440fe89..b5c5e15c 100644 --- a/MacPass/MPOutlineDataSource.m +++ b/MacPass/MPOutlineDataSource.m @@ -23,6 +23,7 @@ @interface MPOutlineDataSource () @property (weak) KdbGroup *draggedGroup; +@property (weak) KdbEntry *draggedEntry; @end @@ -40,75 +41,97 @@ } - (NSDragOperation)outlineView:(NSOutlineView *)outlineView validateDrop:(id)info proposedItem:(id)item proposedChildIndex:(NSInteger)index { - /* info.animatesToDestination = YES; - NSDragOperation oprationMask = NSDragOperationMove; - if([info draggingSourceOperationMask] == NSDragOperationCopy) { - oprationMask = NSDragOperationCopy; + info.animatesToDestination = YES; + NSDragOperation oprationMask = NSDragOperationMove; + /* + If we can support copy on drag, this can be used + to optain the dragging modifier mask the user presses + if([info draggingSourceOperationMask] == NSDragOperationCopy) { + oprationMask = NSDragOperationCopy; + } + */ + id targetItem = [item representedObject]; + if(targetItem == nil) { + return NSDragOperationNone; // no Target + } + + NSPasteboard *pasteBoard = [info draggingPasteboard]; + NSArray *types = [pasteBoard types]; + if([types count] > 1 || [types count] == 0) { + return NSDragOperationNone; // We cannot work with more than one type + } + + MPDocument *document = [[[outlineView window] windowController] document]; + NSString *draggedType = [types lastObject]; + if([draggedType isEqualToString:MPGroupUTI]) { + // dragging group + self.draggedEntry = nil; + } + else if([draggedType isEqualToString:MPUUIDUTI]) { + NSArray *uuids = [pasteBoard readObjectsForClasses:@[[UUID class]] options:nil]; + if([uuids count] != 1) { + return NSDragOperationNone; // NO entry readable } - - id targetItem = [item representedObject]; - if(targetItem == nil) { - return NSDragOperationNone; // no Target - } - if([targetItem isKindOfClass:[MPRootAdapter class]]) { - return NSDragOperationNone; // Drag over group header - } - KdbGroup *targetGroup = targetItem; - BOOL validTarget = YES; + self.draggedEntry = [document findEntry:[uuids lastObject]]; + } + else { + return NSDragOperationNone; // unkonw type + } + + if(self.draggedGroup && [targetItem isKindOfClass:[MPRootAdapter class]]) { + return NSDragOperationNone; // Drag over group header + } + + KdbGroup *targetGroup = targetItem; + BOOL validTarget = YES; + if(self.draggedGroup) { + NSLog(@"draggin Group %@", self.draggedGroup.name); if( self.draggedGroup.parent == targetGroup ) { validTarget &= index != NSOutlineViewDropOnItemIndex; validTarget &= index != [self.draggedGroup.parent.groups indexOfObject:self.draggedGroup]; } - if( validTarget ) { - return oprationMask; - } } - NSPasteboard *pasteBoard = [info draggingPasteboard]; - NSArray *items = [pasteBoard pasteboardItems]; - if([items count] > 0) { - if( index != NSOutlineViewDropOnItemIndex ) { - [outlineView setDropItem:item dropChildIndex:NSOutlineViewDropOnItemIndex]; - } - return NSDragOperationMove; - }*/ - self.draggedGroup = nil; - return NSDragOperationNone; + else if(self.draggedEntry) { + NSLog(@"draggin Entry %@", self.draggedEntry.title); + validTarget = self.draggedEntry.parent != targetGroup; + } + return validTarget ? oprationMask : NSDragOperationNone; } - (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id)info item:(id)item childIndex:(NSInteger)index { self.draggedGroup = nil; /* KdbGroup *target = [item representedObject]; - if(self.draggedGroup) { - BOOL accepted = YES; - if( self.draggedGroup.parent == target ) { - accepted &= index != NSOutlineViewDropOnItemIndex; - accepted &= index != [self.draggedGroup.parent.groups indexOfObject:self.draggedGroup]; - } - accepted = ![self.draggedGroup isAnchestorOfGroup:target]; - if( accepted ) { - [self.draggedGroup moveToGroupUndoable:target atIndex:index]; - } - info.animatesToDestination = !accepted; - self.draggedGroup = nil; - return accepted; - } - NSPasteboard *pasteBoard = [info draggingPasteboard]; - NSArray *items = [pasteBoard pasteboardItems]; - if([items count] > 0) { - NSPasteboardItem *item = items[0]; - UUID *uuid = [[UUID alloc] initWithString:[item stringForType:MPPasteBoardType]]; - MPDocument *document = [[[outlineView window] windowController] document]; - KdbGroup *rootGroup = [document root]; - KdbEntry *draggedEntry = [rootGroup entryForUUID:uuid]; - if(draggedEntry) { - if(draggedEntry.parent != target && index == NSOutlineViewDropOnItemIndex) { - [draggedEntry moveToGroupUndoable:target atIndex:index]; - return YES; - } - } - } - */ + if(self.draggedGroup) { + BOOL accepted = YES; + if( self.draggedGroup.parent == target ) { + accepted &= index != NSOutlineViewDropOnItemIndex; + accepted &= index != [self.draggedGroup.parent.groups indexOfObject:self.draggedGroup]; + } + accepted = ![self.draggedGroup isAnchestorOfGroup:target]; + if( accepted ) { + [self.draggedGroup moveToGroupUndoable:target atIndex:index]; + } + info.animatesToDestination = !accepted; + self.draggedGroup = nil; + return accepted; + } + NSPasteboard *pasteBoard = [info draggingPasteboard]; + NSArray *items = [pasteBoard pasteboardItems]; + if([items count] > 0) { + NSPasteboardItem *item = items[0]; + UUID *uuid = [[UUID alloc] initWithString:[item stringForType:MPPasteBoardType]]; + MPDocument *document = [[[outlineView window] windowController] document]; + KdbGroup *rootGroup = [document root]; + KdbEntry *draggedEntry = [rootGroup entryForUUID:uuid]; + if(draggedEntry) { + if(draggedEntry.parent != target && index == NSOutlineViewDropOnItemIndex) { + [draggedEntry moveToGroupUndoable:target atIndex:index]; + return YES; + } + } + } + */ return NO; } @end diff --git a/MacPass/MPPasswordEditWindowController.h b/MacPass/MPPasswordEditWindowController.h new file mode 100644 index 00000000..c197b057 --- /dev/null +++ b/MacPass/MPPasswordEditWindowController.h @@ -0,0 +1,34 @@ +// +// MPPasswordEditWindowController.h +// MacPass +// +// Created by Michael Starke on 10.08.13. +// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. +// + +#import +#import "MPSheetWindowController.h" +@class MPDocument; +@class HNHRoundedSecureTextField; + +@interface MPPasswordEditWindowController : MPSheetWindowController + +@property (weak) IBOutlet HNHRoundedSecureTextField *passwordTextField; +@property (weak) IBOutlet HNHRoundedSecureTextField *passwordRepeatTextField; +@property (weak) IBOutlet NSPathControl *keyfilePathControl; +@property (weak) IBOutlet NSButton *togglePasswordButton; +@property (weak) IBOutlet NSTextField *errorTextField; +@property (weak) IBOutlet NSButton *changePasswordButton; + +/** + * Dedicated initializer for the Windowcontroller + * @param document The Database document that is currently active + * @return initalized windowcontroller + */ +- (id)initWithDocument:(MPDocument *)document; + +- (IBAction)clearKey:(id)sender; +- (IBAction)generateKey:(id)sender; + + +@end diff --git a/MacPass/MPPasswordEditWindowController.m b/MacPass/MPPasswordEditWindowController.m new file mode 100644 index 00000000..c7db0412 --- /dev/null +++ b/MacPass/MPPasswordEditWindowController.m @@ -0,0 +1,141 @@ +// +// MPPasswordEditWindowController.m +// MacPass +// +// Created by Michael Starke on 10.08.13. +// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. +// + +#import "MPPasswordEditWindowController.h" +#import "MPDocument.h" + +#import "HNHRoundedSecureTextField.h" +#import "NSString+Empty.h" + +@interface MPPasswordEditWindowController () { + MPDocument * __unsafe_unretained _document; +} +@property (nonatomic,assign) BOOL showPassword; +@property (nonatomic,assign) BOOL hasValidPasswordOrKey; +@property (nonatomic,weak) NSURL *keyURL; + +@end + +@implementation MPPasswordEditWindowController + +- (id)initWithDocument:(MPDocument *)document { + self = [super initWithWindowNibName:@"PasswordEditWindow"]; + if(self){ + _showPassword = NO; + _hasValidPasswordOrKey = NO; + _document = document; + } + return self; +} + +- (void)windowDidLoad { + [super windowDidLoad]; + [self.togglePasswordButton bind:NSValueBinding toObject:self withKeyPath:@"showPassword" options:nil]; +} + +- (void)updateView { + if(!self.isDirty) { + return; + } + self.showPassword = NO; + [self.passwordTextField setStringValue:_document.password ? _document.password : @""]; + [self.passwordRepeatTextField setStringValue:[self.passwordTextField stringValue]]; + self.keyURL = _document.key; + + NSDictionary *negateOption = @{ NSValueTransformerNameBindingOption : NSNegateBooleanTransformerName }; + [self.passwordTextField bind:@"showPassword" toObject:self withKeyPath:@"showPassword" options:nil]; + [self.togglePasswordButton bind:NSValueBinding toObject:self withKeyPath:@"showPassword" options:nil]; + [self.passwordRepeatTextField bind:NSEnabledBinding toObject:self withKeyPath:@"showPassword" options:negateOption]; + [self.errorTextField bind:NSHiddenBinding toObject:self withKeyPath:@"hasValidPasswordOrKey" options:nil]; + [self.changePasswordButton bind:NSEnabledBinding toObject:self withKeyPath:@"hasValidPasswordOrKey" options:nil]; + [self.keyfilePathControl bind:NSValueBinding toObject:self withKeyPath:@"keyURL" options:nil]; + + [self.passwordRepeatTextField setDelegate:self]; + [self.passwordTextField setDelegate:self]; + + /* Manually initate the first check */ + [self _verifyPasswordAndKey]; + self.isDirty = NO; +} + +- (void)setShowPassword:(BOOL)showPassword { + if(_showPassword != showPassword) { + _showPassword = showPassword; + + [self.passwordRepeatTextField setStringValue:@""]; + [self _verifyPasswordAndKey]; + } +} +- (void)setKeyURL:(NSURL *)keyURL { + _keyURL = keyURL; + [self _verifyPasswordAndKey]; +} + +#pragma mark Actions +- (IBAction)save:(id)sender { + _document.password = [self.passwordTextField stringValue]; + _document.key = [self.keyfilePathControl URL]; + [self dismissSheet:NSRunStoppedResponse]; +} + +- (IBAction)cancel:(id)sender { + [self dismissSheet:NSRunAbortedResponse]; +} + +- (IBAction)clearKey:(id)sender { + self.keyURL = nil; +} + +- (IBAction)generateKey:(id)sender { +} + +#pragma mark NSTextFieldDelegate +- (void)controlTextDidChange:(NSNotification *)obj { + [self _verifyPasswordAndKey]; +} + +- (void)_verifyPasswordAndKey { + NSString *password = [self.passwordTextField stringValue]; + NSString *repeat = [self.passwordRepeatTextField stringValue]; + BOOL hasKey = (self.keyURL != nil); + BOOL keyOk = YES; + if(hasKey) { + keyOk = [self.keyURL checkResourceIsReachableAndReturnError:nil]; + } + BOOL hasPassword = ![NSString isEmptyString:password]; + if(!self.showPassword) { + hasPassword |= ![NSString isEmptyString:repeat]; + } + BOOL passwordOk = YES; + if(hasPassword ) { + passwordOk = [password isEqualToString:repeat] || self.showPassword; + } + BOOL hasPasswordOrKey = (hasKey || hasPassword); + keyOk = hasKey ? keyOk : YES; + passwordOk = hasPassword ? passwordOk : YES; + self.hasValidPasswordOrKey = passwordOk && keyOk; + + if(!hasPasswordOrKey) { + [self.errorTextField setTextColor:[NSColor controlTextColor]]; + [self.errorTextField setStringValue:NSLocalizedString(@"WARNING_NO_PASSWORD_OR_KEYFILE", "No Key or Password")]; + return; // alldone + } + [self.errorTextField setTextColor:[NSColor redColor]]; + if(!passwordOk && !keyOk ) { + [self.errorTextField setStringValue:NSLocalizedString(@"ERROR_PASSWORD_MISSMATCH_INVALID_KEYFILE", "Passwords do not match, keyfile is invalid")]; + } + else if(!passwordOk) { + [self.errorTextField setStringValue:NSLocalizedString(@"ERROR_PASSWORD_MISSMATCH", "Passwords do not match")]; + } + else { + [self.errorTextField setStringValue:NSLocalizedString(@"ERROR_INVALID_KEYFILE", "Keyfile not valid")]; + } +} + + +@end diff --git a/MacPass/MPSavePanelAccessoryViewController.h b/MacPass/MPSavePanelAccessoryViewController.h new file mode 100644 index 00000000..61a9331b --- /dev/null +++ b/MacPass/MPSavePanelAccessoryViewController.h @@ -0,0 +1,20 @@ +// +// MPSavePanelAccessoryViewController.h +// MacPass +// +// Created by Michael Starke on 10.08.13. +// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. +// + +#import "MPViewController.h" +@class MPDocument; + +@interface MPSavePanelAccessoryViewController : MPViewController + +@property (nonatomic, assign) NSSavePanel *savePanel; +@property (nonatomic, assign) MPDocument *document; + +@property (nonatomic, weak) IBOutlet NSPopUpButton *fileTypePopupButton; +@property (nonatomic, weak) IBOutlet NSTextField *infoTextField; + +@end diff --git a/MacPass/MPSavePanelAccessoryViewController.m b/MacPass/MPSavePanelAccessoryViewController.m new file mode 100644 index 00000000..742437b2 --- /dev/null +++ b/MacPass/MPSavePanelAccessoryViewController.m @@ -0,0 +1,68 @@ +// +// MPSavePanelAccessoryViewController.m +// MacPass +// +// Created by Michael Starke on 10.08.13. +// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. +// + +#import "MPSavePanelAccessoryViewController.h" +#import "MPDocument.h" + +@interface MPSavePanelAccessoryViewController () + +@end + +@implementation MPSavePanelAccessoryViewController + +- (id)init { + self = [super initWithNibName:@"SavePanelAccessoryView" bundle:nil]; + if(self) { + } + return self; +} + +- (void)didLoadView { + NSArray *types = [self.document writableTypesForSaveOperation:NSSaveOperation]; + NSMenu *menu = [[NSMenu alloc] init]; + for (NSString *uti in types ) { + NSString *description = CFBridgingRelease(UTTypeCopyDescription((__bridge CFStringRef)(uti))); + NSString *extension = [self.document fileNameExtensionForType:uti saveOperation:NSSaveOperation]; + NSString *title = [NSString stringWithFormat:@"%@ (%@)", description, extension]; + [menu addItemWithTitle:title action:@selector(setFileType:) keyEquivalent:@""]; + NSMenuItem *item = [[menu itemArray] lastObject]; + [item setTarget:self]; + [item setRepresentedObject:uti]; + + } + [self.fileTypePopupButton setMenu:menu]; + [self.infoTextField setHidden:YES]; + [self _updateView]; +} + +- (IBAction)setFileType:(id)sender { + NSString *uti = [[self.fileTypePopupButton selectedItem] representedObject]; + BOOL showInfoText = (self.document.version == MPDatabaseVersion4) && [uti isEqualToString:@"com.hicknhack.macpass.kdb"]; + [self.infoTextField setHidden:!showInfoText]; + [self.savePanel setAllowedFileTypes:@[uti]]; +} + +- (void)setDocument:(MPDocument *)document { + if(_document != document) { + _document = document; + [self _updateView]; + } +} + +- (void)_updateView { + switch(self.document.version) { + case MPDatabaseVersion3: + [self.fileTypePopupButton selectItemAtIndex:1]; + break; + case MPDatabaseVersion4: + [self.fileTypePopupButton selectItemAtIndex:0]; + break; + } +} + +@end diff --git a/MacPass/MPSheetWindowController.h b/MacPass/MPSheetWindowController.h new file mode 100644 index 00000000..da91759c --- /dev/null +++ b/MacPass/MPSheetWindowController.h @@ -0,0 +1,33 @@ +// +// MPSheetWindowController.h +// MacPass +// +// Created by Michael Starke on 10.08.13. +// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. +// +// Based on +// DESSheetController by Peter Nix (pnix@digitalenginesoftware.com) +// + +#import +/** + * Generic Windowcontroller to be used for sheets + * Subclasses are ablte to initalize their views within updateView + * and thus are able to reset themself befor being displayed as sheets + */ +@interface MPSheetWindowController : NSWindowController +/** + * Flag to indicate that the view might need resetting. + * The default implementation of dismissi sheet and the + * designate initalizer both set the value to YES + */ +@property (nonatomic, assign) BOOL isDirty; +/** + * This method is a entry point to ensure updated ui befor being presented + * The method is called every time the window message is sent to the controller + */ +- (void)updateView; + +- (void)dismissSheet:(NSInteger)returnCode; + +@end diff --git a/MacPass/MPSheetWindowController.m b/MacPass/MPSheetWindowController.m new file mode 100644 index 00000000..c4bb8ea1 --- /dev/null +++ b/MacPass/MPSheetWindowController.m @@ -0,0 +1,36 @@ +// +// MPSheetWindowController.m +// MacPass +// +// Created by Michael Starke on 10.08.13. +// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved. +// + +#import "MPSheetWindowController.h" + +@implementation MPSheetWindowController + +- (id)initWithWindow:(NSWindow *)window { + self = [super initWithWindow:window]; + if(self) { + _isDirty = YES; + } + return self; +} + +- (NSWindow *)window { + NSWindow *window = [super window]; + [self updateView]; + return window; +} + +- (void)updateView { + // do nothing +} + +- (void)dismissSheet:(NSInteger)returnCode { + self.isDirty = YES; + [NSApp endSheet:[super window] returnCode:returnCode]; + [[super window] orderOut:self]; +} +@end diff --git a/MacPass/MacPass-Info.plist b/MacPass/MacPass-Info.plist index 4dfa2d40..366de210 100644 --- a/MacPass/MacPass-Info.plist +++ b/MacPass/MacPass-Info.plist @@ -12,9 +12,13 @@ kdbx CFBundleTypeName - KeePass2 Database + CFBundleTypeRole Editor + LSItemContentTypes + + com.hicknhack.macpass.kdbx + NSDocumentClass MPDocument @@ -24,9 +28,13 @@ kdb CFBundleTypeName - KeePass Database + CFBundleTypeRole Editor + LSItemContentTypes + + com.hicknhack.macpass.kdb + NSDocumentClass MPDocument @@ -59,5 +67,42 @@ NSApplication NSSupportsAutomaticGraphicsSwitching + UTExportedTypeDeclarations + + + UTTypeConformsTo + + public.data + + UTTypeDescription + Keepass 2 Database + UTTypeIdentifier + com.hicknhack.macpass.kdbx + UTTypeTagSpecification + + public.filename-extension + + kdbx + + + + + UTTypeConformsTo + + public.data + + UTTypeDescription + Keepass Database + UTTypeIdentifier + com.hicknhack.macpass.kdb + UTTypeTagSpecification + + public.filename-extension + + kdb + + + + diff --git a/MacPass/PasswordEditWindow.xib b/MacPass/PasswordEditWindow.xib new file mode 100644 index 00000000..3837ff8d --- /dev/null +++ b/MacPass/PasswordEditWindow.xib @@ -0,0 +1,1618 @@ + + + + 1080 + 12E55 + 3084 + 1187.39 + 626.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 3084 + + + IBNSLayoutConstraint + NSButton + NSButtonCell + NSCustomObject + NSPathCell + NSPathControl + NSSecureTextField + NSSecureTextFieldCell + NSTextField + NSTextFieldCell + NSView + NSWindowTemplate + + + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + + MPPasswordEditWindowController + + + FirstResponder + + + NSApplication + + + 3 + 2 + {{196, 240}, {349, 212}} + 1618477056 + Window + NSWindow + + + + + 256 + + + + 268 + {{17, 147}, {68, 17}} + + + + _NS:1535 + YES + + 68157504 + 272630784 + Password: + + LucidaGrande + 13 + 1044 + + _NS:1535 + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + NO + + + + 268 + + Apple URL pasteboard type + NSFilenamesPboardType + + {{87, 83}, {206, 26}} + + + + _NS:9 + YES + + 337641473 + 0 + + _NS:9 + + + 2 + + + xml + key + + + NO + + + + 268 + {{34, 87}, {51, 17}} + + + + _NS:1535 + YES + + 68157504 + 272630784 + Keyfile: + + _NS:1535 + + + + + NO + + + + 268 + {{90, 60}, {200, 19}} + + + + _NS:9 + YES + + -1543503872 + 134217728 + Generate Keyfile + + LucidaGrande + 12 + 16 + + _NS:9 + + -2038153216 + 164 + + + 400 + 75 + + NO + + + + 268 + {{298, 143}, {31, 25}} + + + + _NS:22 + YES + + 67108864 + 134217728 + + + _NS:22 + + -926662656 + 163 + + NSImage + NSQuickLookTemplate + + + + 400 + 75 + + NO + + + + 268 + {{298, 84}, {31, 25}} + + + + _NS:22 + YES + + -2080374784 + 134217728 + + + _NS:22 + + -2033958912 + 163 + + NSImage + NSStopProgressTemplate + + + + 400 + 75 + + NO + + + + 268 + {{90, 145}, {200, 22}} + + + + _NS:9 + YES + + 342884416 + 272630848 + + + _NS:9 + + YES + + 6 + System + textBackgroundColor + + 3 + MQA + + + + 6 + System + textColor + + + + NSAllRomanInputSourcesLocaleIdentifier + + + NO + + + + 268 + {{33, 117}, {52, 17}} + + + + _NS:1535 + YES + + 68157504 + 272630784 + Repeat: + + _NS:1535 + + + + + NO + + + + 268 + {{90, 115}, {200, 22}} + + + + _NS:9 + YES + + 342884416 + 272630848 + + + _NS:9 + + YES + + + + NSAllRomanInputSourcesLocaleIdentifier + + + NO + + + + 268 + {{122, 175}, {137, 17}} + + + + _NS:1535 + YES + + 68157504 + 272630784 + Missmatching Passwords + + LucidaGrande + 11 + 3100 + + _NS:1535 + + + + 1 + MSAwIDAAA + + + NO + + + + 268 + {{184, 13}, {151, 32}} + + + + _NS:9 + YES + + 67108864 + 134217728 + Change Password + + _NS:9 + + -2038284288 + 129 + + + 200 + 25 + + NO + + + + 268 + {{102, 13}, {82, 32}} + + + + _NS:9 + YES + + 67108864 + 134217728 + Cancel + + _NS:9 + + -2038284288 + 129 + + Gw + 200 + 25 + + NO + + + {349, 212} + + + + + {{0, 0}, {1920, 1058}} + {10000000000000, 10000000000000} + YES + + + + + + + passwordTextField + + + + 61 + + + + passwordRepeatTextField + + + + 62 + + + + keyfilePathControl + + + + 63 + + + + togglePasswordButton + + + + 64 + + + + clearKey: + + + + 65 + + + + generateKey: + + + + 66 + + + + errorTextField + + + + 79 + + + + window + + + + 80 + + + + save: + + + + 81 + + + + cancel: + + + + 84 + + + + changePasswordButton + + + + 85 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + + + + + + 2 + + + + + 6 + 0 + + 6 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 10 + 0 + + 10 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 6 + 0 + + 6 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 3 + 0 + + 3 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 5 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 4 + 0 + + 4 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 5 + 0 + + 6 + 1 + + 12 + + 1000 + + 6 + 24 + 3 + + + + 6 + 0 + + 6 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 4 + 0 + + 4 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 3 + 0 + + 4 + 1 + + 20 + + 1000 + + 6 + 24 + 3 + + + + 3 + 0 + + 4 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 4 + 0 + + 4 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 3 + 0 + + 4 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 6 + 0 + + 6 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 5 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 5 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 6 + 0 + + 6 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 3 + 0 + + 3 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 9 + 0 + + 9 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 5 + 0 + + 5 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 3 + 0 + + 4 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 11 + 0 + + 11 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 5 + 0 + + 5 + 1 + + 20 + + 1000 + + 8 + 29 + 3 + + + + 11 + 0 + + 11 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + + + + + + + + + + + + + + + 3 + + + + + + 7 + 0 + + 0 + 1 + + 62 + + 1000 + + 3 + 9 + 1 + + + + + + 4 + + + + + + + + 5 + + + + + + + + 6 + + + + + + + + 7 + + + + + + 7 + 0 + + 0 + 1 + + 31 + + 1000 + + 3 + 9 + 1 + + + + + + 8 + + + + + + + + 9 + + + + + + + + 10 + + + + + + + + 11 + + + + + + + + 12 + + + + + 8 + 0 + + 0 + 1 + + 17 + + 1000 + + 3 + 9 + 1 + + + + + + + 13 + + + + + 14 + + + + + 15 + + + + + 16 + + + + + 18 + + + + + 19 + + + + + 20 + + + + + 21 + + + + + 22 + + + + + 23 + + + + + 24 + + + + + 25 + + + + + 26 + + + + + 27 + + + + + 28 + + + + + 29 + + + + + 30 + + + + + 31 + + + + + 32 + + + + + 33 + + + + + 34 + + + + + 35 + + + + + 36 + + + + + 37 + + + + + 39 + + + + + 40 + + + + + 41 + + + + + 43 + + + + + 46 + + + + + 47 + + + + + 48 + + + + + 53 + + + + + 56 + + + + + 57 + + + + + 58 + + + + + 59 + + + + + 60 + + + + + 68 + + + + + + + + 69 + + + + + 71 + + + + + 72 + + + + + + + + 73 + + + + + 75 + + + + + 76 + + + + + 77 + + + + + 78 + + + + + + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + {{357, 418}, {480, 270}} + + + com.apple.InterfaceBuilder.CocoaPlugin + HNHRoundedSecureTextField + + 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 + + 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 + HNHRoundedSecureTextField + + com.apple.InterfaceBuilder.CocoaPlugin + + + + + + 85 + + + + + HNHRoundedSecureTextField + NSSecureTextField + + toggleDisplay: + id + + + toggleDisplay: + + toggleDisplay: + id + + + + IBProjectSource + ./Classes/HNHRoundedSecureTextField.h + + + + MPPasswordEditWindowController + MPSheetWindowController + + id + id + id + id + + + + cancel: + id + + + clearKey: + id + + + generateKey: + id + + + save: + id + + + + NSTextField + NSPathControl + HNHRoundedSecureTextField + HNHRoundedSecureTextField + NSButton + + + + errorTextField + NSTextField + + + keyfilePathControl + NSPathControl + + + passwordRepeatTextField + HNHRoundedSecureTextField + + + passwordTextField + HNHRoundedSecureTextField + + + togglePasswordButton + NSButton + + + + IBProjectSource + ./Classes/MPPasswordEditWindowController.h + + + + MPSheetWindowController + NSWindowController + + IBProjectSource + ./Classes/MPSheetWindowController.h + + + + NSLayoutConstraint + NSObject + + IBProjectSource + ./Classes/NSLayoutConstraint.h + + + + + 0 + IBCocoaFramework + YES + 3 + + {21, 16} + {11, 11} + + YES + + diff --git a/MacPass/SavePanelAccessoryView.xib b/MacPass/SavePanelAccessoryView.xib new file mode 100644 index 00000000..ddbcc1d7 --- /dev/null +++ b/MacPass/SavePanelAccessoryView.xib @@ -0,0 +1,630 @@ + + + + 1080 + 12E55 + 3084 + 1187.39 + 626.00 + + com.apple.InterfaceBuilder.CocoaPlugin + 3084 + + + IBNSLayoutConstraint + NSCustomObject + NSCustomView + NSMenu + NSMenuItem + NSPopUpButton + NSPopUpButtonCell + NSTextField + NSTextFieldCell + + + com.apple.InterfaceBuilder.CocoaPlugin + + + PluginDependencyRecalculationVersion + + + + + MPSavePanelAccessoryViewController + + + FirstResponder + + + NSApplication + + + + 268 + + + + 268 + {{126, 20}, {363, 28}} + + + _NS:1535 + {249, 750} + YES + + 67108864 + 272629760 + Not all Information inside your current database can be stored with this format. + + LucidaGrande + 11 + 3100 + + _NS:1535 + + + 6 + System + controlColor + + 3 + MC42NjY2NjY2NjY3AA + + + + 6 + System + controlTextColor + + 3 + MAA + + + + NO + + + + 268 + {{126, 58}, {53, 17}} + + + + _NS:1535 + YES + + 68157504 + 272630784 + Format: + + LucidaGrande + 13 + 1044 + + _NS:1535 + + + + + NO + + + + 268 + {{182, 53}, {144, 26}} + + + + _NS:9 + YES + + -2076180416 + 2048 + + _NS:9 + + 109199360 + 129 + + + 400 + 75 + + + KeePass 1 (KDB) + + 1048576 + 2147483647 + 1 + + NSImage + NSMenuCheckmark + + + NSImage + NSMenuMixedState + + _popUpItemAction: + + + YES + + OtherViews + + + + + KeePass 2 (KDBX) + + 1048576 + 2147483647 + + + _popUpItemAction: + + + + + + -1 + 1 + YES + YES + 2 + + NO + + + {506, 95} + + + + NSView + + + + + + + view + + + + 106 + + + + fileTypePopupButton + + + + 107 + + + + infoTextField + + + + 108 + + + + + + 0 + + + + + + -2 + + + File's Owner + + + -1 + + + First Responder + + + -3 + + + Application + + + 1 + + + + + 5 + 0 + + 6 + 1 + + 8 + + 1000 + + 6 + 24 + 3 + + + + 9 + 0 + + 9 + 1 + + 0.0 + + 1000 + + 9 + 40 + 2 + + + + 10 + 0 + + 10 + 1 + + 0.0 + + 1000 + + 9 + 40 + 2 + + + + 6 + 1 + + 6 + 1 + + 20 + + 1000 + + 9 + 40 + 3 + + + + 4 + 1 + + 4 + 1 + + 20 + + 1000 + + 9 + 40 + 3 + + + + 3 + 0 + + 4 + 1 + + 8 + + 1000 + + 9 + 40 + 3 + + + + 5 + 0 + + 5 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + + + + 6 + 0 + + 6 + 1 + + 20 + + 1000 + + 9 + 40 + 3 + + + + 3 + 0 + + 3 + 1 + + 20 + + 1000 + + 9 + 40 + 3 + + + + 5 + 1 + + 5 + 1 + + 20 + + 1000 + + 9 + 40 + 3 + + + + + + + + + 2 + + + + + + + + 3 + + + + + + + + 4 + + + + + + + + + 5 + + + + + 6 + + + + + 11 + + + + + + + + 12 + + + + + 51 + + + + + + + + 52 + + + + + 80 + + + + + 81 + + + + + 86 + + + + + 91 + + + + + 78 + + + + + 101 + + + + + 89 + + + + + 103 + + + + + 92 + + + + + 95 + + + + + + + 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 + + + + + + 108 + + + + + MPSavePanelAccessoryViewController + MPViewController + + setFileType: + id + + + setFileType: + + setFileType: + id + + + + NSPopUpButton + NSTextField + + + + fileTypePopupButton + NSPopUpButton + + + infoTextField + NSTextField + + + + IBProjectSource + ./Classes/MPSavePanelAccessoryViewController.h + + + + MPViewController + NSViewController + + IBProjectSource + ./Classes/MPViewController.h + + + + NSLayoutConstraint + NSObject + + IBProjectSource + ./Classes/NSLayoutConstraint.h + + + + + 0 + IBCocoaFramework + YES + 3 + + {11, 11} + {10, 3} + + YES + + diff --git a/MacPass/UnprotectedWarningView.xib b/MacPass/UnprotectedWarningView.xib index 8b5ab359..2fe98d05 100644 --- a/MacPass/UnprotectedWarningView.xib +++ b/MacPass/UnprotectedWarningView.xib @@ -53,6 +53,7 @@ {{36, 19}, {32, 32}} + _NS:9 YES @@ -77,6 +78,7 @@ 268 {{73, 27}, {162, 17}} + _NS:1535 YES @@ -114,6 +116,7 @@ {307, 71} + NSView @@ -383,7 +386,54 @@ 43 - + + + + MPDocument + NSDocument + + id + id + + + + createEntryFromTemplate: + id + + + emptyTrash: + id + + + + NSView + NSImageView + + + + warningView + NSView + + + warningViewImage + NSImageView + + + + IBProjectSource + ./Classes/MPDocument.h + + + + NSLayoutConstraint + NSObject + + IBProjectSource + ./Classes/NSLayoutConstraint.h + + + + 0 IBCocoaFramework YES diff --git a/MacPass/de.lproj/Localizable.strings b/MacPass/de.lproj/Localizable.strings index 2fb634ba38260d8f1d545c2e3be3d3c4c6b83ebd..9b475e6da8192f65a2d5d21c9ea136280f88e48a 100644 GIT binary patch delta 42 tcmaFo-sQ2uOG;9KA(0`EA%#JKAsomm0