7 Commits

Author SHA1 Message Date
michael starke
628fbbfeda Removal off attachments included 2013-07-05 20:50:38 +02:00
michael starke
9c3a62bef6 Added support to save and load Attachemnts on KeePass2 Databases.
Support for Keepass1 DBs is still missing
2013-07-05 20:09:17 +02:00
michael starke
7feb2517dd Added a default Database name
Minor changes
Updtaed KeePassLib
2013-07-05 16:37:35 +02:00
michael starke
59db224a35 OutlineView group now displays the database name if a KeePass 2 database is used 2013-07-05 01:06:02 +02:00
michael starke
c32003d7c6 Merge branch 'master' of https://github.com/mstarke/MacPass 2013-07-04 23:55:21 +02:00
michael starke
1a095ce1d7 Added Icon supplied by Iiro Jäppinen
Added more KeePass Icon replacements
2013-07-04 23:54:45 +02:00
Michael Starke
7b8ce088fe Updated releases 2013-07-04 00:09:07 +02:00
57 changed files with 1026 additions and 315 deletions

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 KiB

BIN
Assets/App icon/PSD.zip Normal file

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@@ -52,6 +52,8 @@
4C2E381F16D11FF900037A9D /* 05_LanguagesTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C2E381C16D11FF900037A9D /* 05_LanguagesTemplate.pdf */; };
4C2E382316D1421B00037A9D /* MPIconHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C2E382216D1421B00037A9D /* MPIconHelper.m */; };
4C2E382616D1470200037A9D /* MPViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C2E382516D1470200037A9D /* MPViewController.m */; };
4C3666411787327E00B249F1 /* MPDocument+Attachments.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C3666401787327E00B249F1 /* MPDocument+Attachments.m */; };
4C366643178748F500B249F1 /* 99_HarddiskTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C366642178748F500B249F1 /* 99_HarddiskTemplate.pdf */; };
4C36E5B4177CD4FB00152132 /* Kdb4Tree+KVOAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C36E5B3177CD4FB00152132 /* Kdb4Tree+KVOAdditions.m */; };
4C37A6731769393300AD0A40 /* HNHTableHeaderCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C37A6721769393300AD0A40 /* HNHTableHeaderCell.m */; };
4C37A84015B8B474005EF8EE /* MPOutlineDataSource.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C37A83F15B8B474005EF8EE /* MPOutlineDataSource.m */; };
@@ -117,6 +119,10 @@
4C669BA016760ED100DD0774 /* Salsa20RandomStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C669B7716760ED100DD0774 /* Salsa20RandomStream.m */; };
4C669BA216760ED100DD0774 /* UUID.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C669B7B16760ED100DD0774 /* UUID.m */; };
4C69A73A16D589DF00EC1B1A /* HNHGradientView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C69A73916D589DF00EC1B1A /* HNHGradientView.m */; };
4C6D1D25178579570014C5A5 /* 48_FolderTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C6D1D24178579570014C5A5 /* 48_FolderTemplate.pdf */; };
4C6D1D27178586CA0014C5A5 /* 99_AddFolderTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C6D1D26178586CA0014C5A5 /* 99_AddFolderTemplate.pdf */; };
4C6D1D2B17858A250014C5A5 /* MacPass.icns in Resources */ = {isa = PBXBuildFile; fileRef = 4C6D1D2A17858A250014C5A5 /* MacPass.icns */; };
4C701CBC178618A000581B88 /* 12_RemoteTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C701CBB178618A000581B88 /* 12_RemoteTemplate.pdf */; };
4C74DD07177BD1640034A9DB /* MPCustomFieldView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C74DD06177BD1640034A9DB /* MPCustomFieldView.m */; };
4C76155C1764C04C0015A1A6 /* GeneralSettings.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C76155E1764C04C0015A1A6 /* GeneralSettings.xib */; };
4C7615631764C08C0015A1A6 /* PasswordEditView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C7615651764C08C0015A1A6 /* PasswordEditView.xib */; };
@@ -181,6 +187,7 @@
4CE5B54B173AFBA700207B39 /* MPDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CE5B549173AFBA700207B39 /* MPDocument.m */; };
4CE8246F16E2E93400573141 /* MPOverlayWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CE8246E16E2E93400573141 /* MPOverlayWindowController.m */; };
4CE8247516E2F2B900573141 /* MPOverlayView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CE8247416E2F2B900573141 /* MPOverlayView.m */; };
4CF1F0CA1786B37900CD920E /* NSData+Gzip.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CF1F0C81786B37900CD920E /* NSData+Gzip.m */; };
4CF6C711176F4533007A811D /* MPStringLengthValueTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CF6C710176F4533007A811D /* MPStringLengthValueTransformer.m */; };
4CF6C718176F5234007A811D /* MPAssociateRequestHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CF6C717176F5234007A811D /* MPAssociateRequestHandler.m */; };
4CF78057176E5CFD0032EE71 /* MPConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CF78056176E5CFD0032EE71 /* MPConnection.m */; };
@@ -279,6 +286,8 @@
4C2E382216D1421B00037A9D /* MPIconHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPIconHelper.m; sourceTree = "<group>"; };
4C2E382416D1470200037A9D /* MPViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPViewController.h; sourceTree = "<group>"; };
4C2E382516D1470200037A9D /* MPViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPViewController.m; sourceTree = "<group>"; };
4C3666401787327E00B249F1 /* MPDocument+Attachments.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MPDocument+Attachments.m"; sourceTree = "<group>"; };
4C366642178748F500B249F1 /* 99_HarddiskTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 99_HarddiskTemplate.pdf; sourceTree = "<group>"; };
4C36E5B2177CD4FB00152132 /* Kdb4Tree+KVOAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Kdb4Tree+KVOAdditions.h"; sourceTree = "<group>"; };
4C36E5B3177CD4FB00152132 /* Kdb4Tree+KVOAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Kdb4Tree+KVOAdditions.m"; sourceTree = "<group>"; };
4C37A6711769393300AD0A40 /* HNHTableHeaderCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HNHTableHeaderCell.h; sourceTree = "<group>"; };
@@ -407,6 +416,10 @@
4C669B7B16760ED100DD0774 /* UUID.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UUID.m; sourceTree = "<group>"; };
4C69A73816D589DF00EC1B1A /* HNHGradientView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HNHGradientView.h; sourceTree = "<group>"; };
4C69A73916D589DF00EC1B1A /* HNHGradientView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HNHGradientView.m; sourceTree = "<group>"; };
4C6D1D24178579570014C5A5 /* 48_FolderTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 48_FolderTemplate.pdf; sourceTree = "<group>"; };
4C6D1D26178586CA0014C5A5 /* 99_AddFolderTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 99_AddFolderTemplate.pdf; sourceTree = "<group>"; };
4C6D1D2A17858A250014C5A5 /* MacPass.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = MacPass.icns; path = "../Assets/App icon/MacPass.icns"; sourceTree = "<group>"; };
4C701CBB178618A000581B88 /* 12_RemoteTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 12_RemoteTemplate.pdf; sourceTree = "<group>"; };
4C74DD05177BD1640034A9DB /* MPCustomFieldView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPCustomFieldView.h; sourceTree = "<group>"; };
4C74DD06177BD1640034A9DB /* MPCustomFieldView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPCustomFieldView.m; sourceTree = "<group>"; };
4C76155F1764C0590015A1A6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/GeneralSettings.xib; sourceTree = "<group>"; };
@@ -533,6 +546,8 @@
4CE8246E16E2E93400573141 /* MPOverlayWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPOverlayWindowController.m; sourceTree = "<group>"; };
4CE8247316E2F2B900573141 /* MPOverlayView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPOverlayView.h; sourceTree = "<group>"; };
4CE8247416E2F2B900573141 /* MPOverlayView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPOverlayView.m; sourceTree = "<group>"; };
4CF1F0C81786B37900CD920E /* NSData+Gzip.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+Gzip.m"; sourceTree = "<group>"; };
4CF1F0C91786B37900CD920E /* NSData+Gzip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+Gzip.h"; sourceTree = "<group>"; };
4CF6C70F176F4533007A811D /* MPStringLengthValueTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPStringLengthValueTransformer.h; sourceTree = "<group>"; };
4CF6C710176F4533007A811D /* MPStringLengthValueTransformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPStringLengthValueTransformer.m; sourceTree = "<group>"; };
4CF6C715176F5183007A811D /* MPServerRequestHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPServerRequestHandler.h; sourceTree = "<group>"; };
@@ -749,6 +764,8 @@
4C2724D01778EFE300FD8456 /* NSString+Empty.m */,
4C2724D21778FA0700FD8456 /* NSDate+Packed.h */,
4C2724D31778FA0700FD8456 /* NSDate+Packed.m */,
4CF1F0C81786B37900CD920E /* NSData+Gzip.m */,
4CF1F0C91786B37900CD920E /* NSData+Gzip.h */,
4C2724D51778FF1A00FD8456 /* NSUUID+KeePassLib.h */,
4C2724D61778FF1A00FD8456 /* NSUUID+KeePassLib.m */,
4C2724D817790E7C00FD8456 /* NSMutableData+Base64.h */,
@@ -838,6 +855,7 @@
4CE5B549173AFBA700207B39 /* MPDocument.m */,
4C5EC300177B700D00DA955B /* MPRootAdapter.h */,
4C5EC301177B700D00DA955B /* MPRootAdapter.m */,
4C3666401787327E00B249F1 /* MPDocument+Attachments.m */,
);
name = Model;
sourceTree = "<group>";
@@ -867,8 +885,12 @@
4CD78AB916D155FF00768A1D /* 09_IdentityTemplate.pdf */,
4CD78ABA16D155FF00768A1D /* 10_ContactTemplate.pdf */,
4CD78ABB16D155FF00768A1D /* 11_CameraTemplate.pdf */,
4C701CBB178618A000581B88 /* 12_RemoteTemplate.pdf */,
4C7714A9176C998F00549F2A /* 43_TrashTemplate.pdf */,
4C6D1D24178579570014C5A5 /* 48_FolderTemplate.pdf */,
4C7714AB176C9D4600549F2A /* 99_InfoTemplate.pdf */,
4C366642178748F500B249F1 /* 99_HarddiskTemplate.pdf */,
4C6D1D26178586CA0014C5A5 /* 99_AddFolderTemplate.pdf */,
);
path = Icons;
sourceTree = "<group>";
@@ -1031,6 +1053,7 @@
4C77E36D15B84A240093A587 /* Supporting Files */ = {
isa = PBXGroup;
children = (
4C6D1D2A17858A250014C5A5 /* MacPass.icns */,
4C888C8E16EB6C91003D34A1 /* Localizable.strings */,
4CB9339716D3A0DD00A13B5D /* Credits.rtf */,
4C77E36E15B84A240093A587 /* MacPass-Info.plist */,
@@ -1327,6 +1350,11 @@
4CF7805F176E75110032EE71 /* ServerSettings.xib in Resources */,
4C7F35681779DFFB00C57890 /* Errors.strings in Resources */,
4CD5D702177A5EE400100649 /* DocumentSettingsWindow.xib in Resources */,
4C6D1D25178579570014C5A5 /* 48_FolderTemplate.pdf in Resources */,
4C6D1D27178586CA0014C5A5 /* 99_AddFolderTemplate.pdf in Resources */,
4C6D1D2B17858A250014C5A5 /* MacPass.icns in Resources */,
4C701CBC178618A000581B88 /* 12_RemoteTemplate.pdf in Resources */,
4C366643178748F500B249F1 /* 99_HarddiskTemplate.pdf in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -1498,6 +1526,8 @@
4CC672791781D0C0006DEDCF /* KdbGroup+MPAdditions.m in Sources */,
4CC6727C1781D0D2006DEDCF /* KdbEntry+MPAdditions.m in Sources */,
4C5FE9AE17843CE20001D5A8 /* MPSelectedAttachmentTableCellView.m in Sources */,
4CF1F0CA1786B37900CD920E /* NSData+Gzip.m in Sources */,
4C3666411787327E00B249F1 /* MPDocument+Attachments.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View File

@@ -137,7 +137,6 @@
<string key="NSFrameSize">{293, 30}</string>
<reference key="NSSuperview" ref="87082330"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<string key="NSClassName">HNHGradientView</string>
</object>
@@ -499,7 +498,6 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{17, 16}, {259, 11}}</string>
<reference key="NSSuperview" ref="726109125"/>
<reference key="NSNextKeyView" ref="894571713"/>
<string key="NSReuseIdentifierKey">_NS:1535</string>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="72260846">
@@ -634,7 +632,6 @@
<int key="NSvFlags">256</int>
<string key="NSFrame">{{236, 1}, {16, 332}}</string>
<reference key="NSSuperview" ref="850153963"/>
<reference key="NSNextKeyView" ref="894571713"/>
<string key="NSReuseIdentifierKey">_NS:83</string>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
<reference key="NSTarget" ref="850153963"/>
@@ -1269,6 +1266,14 @@
</object>
<int key="connectionID">2068</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">addAttachment:</string>
<reference key="source" ref="1001"/>
<reference key="destination" ref="394980328"/>
</object>
<int key="connectionID">2244</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">imageView</string>
@@ -1413,7 +1418,7 @@
<reference key="NSControlView" ref="966655738"/>
<int key="NSButtonFlags">-2033434624</int>
<int key="NSButtonFlags2">164</int>
<object class="NSCustomResource" key="NSNormalImage">
<object class="NSCustomResource" key="NSNormalImage" id="222943187">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">NSRemoveTemplate</string>
</object>
@@ -1487,9 +1492,9 @@
<object class="NSTextField" id="388876279">
<reference key="NSNextResponder" ref="421971283"/>
<int key="NSvFlags">266</int>
<string key="NSFrame">{{40, 10}, {157, 17}}</string>
<string key="NSFrame">{{40, 10}, {128, 17}}</string>
<reference key="NSSuperview" ref="421971283"/>
<reference key="NSNextKeyView" ref="121170874"/>
<reference key="NSNextKeyView" ref="877766676"/>
<string key="NSReuseIdentifierKey">_NS:20</string>
<string key="NSAntiCompressionPriority">{250, 750}</string>
<bool key="NSEnabled">YES</bool>
@@ -1508,7 +1513,7 @@
<object class="NSButton" id="121170874">
<reference key="NSNextResponder" ref="421971283"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{202, 8}, {43, 19}}</string>
<string key="NSFrame">{{213, 8}, {32, 19}}</string>
<reference key="NSSuperview" ref="421971283"/>
<reference key="NSNextKeyView" ref="360758282"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
@@ -1516,12 +1521,41 @@
<object class="NSButtonCell" key="NSCell" id="535600323">
<int key="NSCellFlags">-2080374784</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents">Save</string>
<string key="NSContents"/>
<reference key="NSSupport" ref="323604925"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="121170874"/>
<int key="NSButtonFlags">-2038153216</int>
<int key="NSButtonFlags">-2033434624</int>
<int key="NSButtonFlags2">164</int>
<reference key="NSNormalImage" ref="222943187"/>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">400</int>
<int key="NSPeriodicInterval">75</int>
</object>
<bool key="NSAllowsLogicalLayoutDirection">NO</bool>
</object>
<object class="NSButton" id="877766676">
<reference key="NSNextResponder" ref="421971283"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{173, 8}, {32, 19}}</string>
<reference key="NSSuperview" ref="421971283"/>
<reference key="NSNextKeyView" ref="121170874"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="500217449">
<int key="NSCellFlags">-2080374784</int>
<int key="NSCellFlags2">134217728</int>
<string key="NSContents"/>
<reference key="NSSupport" ref="323604925"/>
<string key="NSCellIdentifier">_NS:9</string>
<reference key="NSControlView" ref="877766676"/>
<int key="NSButtonFlags">-2033958912</int>
<int key="NSButtonFlags2">164</int>
<object class="NSCustomResource" key="NSNormalImage">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">99_HarddiskTemplate</string>
</object>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">400</int>
@@ -1546,6 +1580,22 @@
</object>
<int key="connectionID">2215</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">saveButton</string>
<reference key="source" ref="421971283"/>
<reference key="destination" ref="877766676"/>
</object>
<int key="connectionID">2259</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">removeButton</string>
<reference key="source" ref="421971283"/>
<reference key="destination" ref="121170874"/>
</object>
<int key="connectionID">2260</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
@@ -4262,7 +4312,7 @@
<reference key="firstItem" ref="121170874"/>
<int key="firstAttribute">5</int>
<int key="relation">0</int>
<reference key="secondItem" ref="388876279"/>
<reference key="secondItem" ref="877766676"/>
<int key="secondAttribute">6</int>
<float key="multiplier">1</float>
<object class="IBNSLayoutSymbolicConstant" key="constant">
@@ -4290,8 +4340,24 @@
<float key="scoringTypeFloat">29</float>
<int key="contentType">3</int>
</object>
<object class="IBNSLayoutConstraint" id="334071022">
<reference key="firstItem" ref="877766676"/>
<int key="firstAttribute">5</int>
<int key="relation">0</int>
<reference key="secondItem" ref="388876279"/>
<int key="secondAttribute">6</int>
<float key="multiplier">1</float>
<object class="IBNSLayoutSymbolicConstant" key="constant">
<double key="value">8</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="421971283"/>
<int key="scoringType">6</int>
<float key="scoringTypeFloat">24</float>
<int key="contentType">3</int>
</object>
<object class="IBNSLayoutConstraint" id="555758646">
<reference key="firstItem" ref="121170874"/>
<reference key="firstItem" ref="877766676"/>
<int key="firstAttribute">3</int>
<int key="relation">0</int>
<reference key="secondItem" ref="388876279"/>
@@ -4306,20 +4372,20 @@
<float key="scoringTypeFloat">24</float>
<int key="contentType">2</int>
</object>
<object class="IBNSLayoutConstraint" id="924075646">
<reference key="firstItem" ref="388876279"/>
<int key="firstAttribute">10</int>
<object class="IBNSLayoutConstraint" id="972049638">
<reference key="firstItem" ref="877766676"/>
<int key="firstAttribute">11</int>
<int key="relation">0</int>
<reference key="secondItem" ref="421971283"/>
<int key="secondAttribute">10</int>
<reference key="secondItem" ref="121170874"/>
<int key="secondAttribute">11</int>
<float key="multiplier">1</float>
<object class="IBLayoutConstant" key="constant">
<double key="value">0.0</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="421971283"/>
<int key="scoringType">5</int>
<float key="scoringTypeFloat">22</float>
<int key="scoringType">6</int>
<float key="scoringTypeFloat">24</float>
<int key="contentType">2</int>
</object>
<object class="IBNSLayoutConstraint" id="526596272">
@@ -4338,6 +4404,22 @@
<float key="scoringTypeFloat">24</float>
<int key="contentType">3</int>
</object>
<object class="IBNSLayoutConstraint" id="924075646">
<reference key="firstItem" ref="667286275"/>
<int key="firstAttribute">10</int>
<int key="relation">0</int>
<reference key="secondItem" ref="421971283"/>
<int key="secondAttribute">10</int>
<float key="multiplier">1</float>
<object class="IBLayoutConstant" key="constant">
<double key="value">0.0</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="421971283"/>
<int key="scoringType">5</int>
<float key="scoringTypeFloat">22</float>
<int key="contentType">2</int>
</object>
<object class="IBNSLayoutConstraint" id="6696189">
<reference key="firstItem" ref="667286275"/>
<int key="firstAttribute">10</int>
@@ -4371,6 +4453,7 @@
<int key="contentType">3</int>
</object>
<reference ref="121170874"/>
<reference ref="877766676"/>
</array>
<reference key="parent" ref="361499112"/>
</object>
@@ -4462,7 +4545,7 @@
<reference key="object" ref="121170874"/>
<array class="NSMutableArray" key="children">
<reference ref="535600323"/>
<object class="IBNSLayoutConstraint" id="507093761">
<object class="IBNSLayoutConstraint" id="298252958">
<reference key="firstItem" ref="121170874"/>
<int key="firstAttribute">7</int>
<int key="relation">0</int>
@@ -4470,7 +4553,7 @@
<int key="secondAttribute">0</int>
<float key="multiplier">1</float>
<object class="IBLayoutConstant" key="constant">
<double key="value">43</double>
<double key="value">32</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="121170874"/>
@@ -4486,31 +4569,75 @@
<reference key="object" ref="535600323"/>
<reference key="parent" ref="121170874"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">2236</int>
<reference key="object" ref="555758646"/>
<reference key="parent" ref="421971283"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">2237</int>
<reference key="object" ref="25403768"/>
<reference key="parent" ref="421971283"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">2238</int>
<reference key="object" ref="507093761"/>
<int key="objectID">2246</int>
<reference key="object" ref="298252958"/>
<reference key="parent" ref="121170874"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">2240</int>
<int key="objectID">2249</int>
<reference key="object" ref="877766676"/>
<array class="NSMutableArray" key="children">
<reference ref="500217449"/>
<object class="IBNSLayoutConstraint" id="220755404">
<reference key="firstItem" ref="877766676"/>
<int key="firstAttribute">7</int>
<int key="relation">0</int>
<nil key="secondItem"/>
<int key="secondAttribute">0</int>
<float key="multiplier">1</float>
<object class="IBLayoutConstant" key="constant">
<double key="value">32</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="877766676"/>
<int key="scoringType">3</int>
<float key="scoringTypeFloat">9</float>
<int key="contentType">1</int>
</object>
</array>
<reference key="parent" ref="421971283"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">2250</int>
<reference key="object" ref="500217449"/>
<reference key="parent" ref="877766676"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">2251</int>
<reference key="object" ref="972049638"/>
<reference key="parent" ref="421971283"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">2252</int>
<reference key="object" ref="555758646"/>
<reference key="parent" ref="421971283"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">2253</int>
<reference key="object" ref="344424093"/>
<reference key="parent" ref="421971283"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">2241</int>
<int key="objectID">2255</int>
<reference key="object" ref="220755404"/>
<reference key="parent" ref="877766676"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">2256</int>
<reference key="object" ref="924075646"/>
<reference key="parent" ref="421971283"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">2258</int>
<reference key="object" ref="334071022"/>
<reference key="parent" ref="421971283"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
@@ -4851,12 +4978,14 @@
<string key="2200.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="2201.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="2202.CustomClassName">MPSelectedAttachmentTableCellView</string>
<array class="NSMutableArray" key="2202.IBNSViewMetadataConstraints">
<array key="2202.IBNSViewMetadataConstraints">
<reference ref="424584351"/>
<reference ref="6696189"/>
<reference ref="526596272"/>
<reference ref="924075646"/>
<reference ref="526596272"/>
<reference ref="972049638"/>
<reference ref="555758646"/>
<reference ref="334071022"/>
<reference ref="25403768"/>
<reference ref="344424093"/>
</array>
@@ -4877,17 +5006,26 @@
<string key="2211.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="2212.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="2213.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<array key="2234.IBNSViewMetadataConstraints">
<reference ref="507093761"/>
<array class="NSMutableArray" key="2234.IBNSViewMetadataConstraints">
<reference ref="298252958"/>
</array>
<boolean value="NO" key="2234.IBNSViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
<string key="2234.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="2235.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="2236.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="2237.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="2238.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="2240.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="2241.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="2246.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<array key="2249.IBNSViewMetadataConstraints">
<reference ref="220755404"/>
</array>
<boolean value="NO" key="2249.IBNSViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
<string key="2249.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="2250.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="2251.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="2252.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="2253.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="2255.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="2256.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="2258.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<array key="455.IBNSViewMetadataConstraints">
<reference ref="222939184"/>
<reference ref="1058743908"/>
@@ -4934,7 +5072,7 @@
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">2241</int>
<int key="maxID">2260</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -5017,18 +5155,33 @@
<string key="className">MPInspectorViewController</string>
<string key="superclassName">MPViewController</string>
<dictionary class="NSMutableDictionary" key="actions">
<string key="addAttachment:">id</string>
<string key="addCustomField:">id</string>
<string key="removeAttachment:">id</string>
<string key="removeCustomField:">id</string>
<string key="saveAttachment:">id</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="actionInfosByName">
<object class="IBActionInfo" key="addAttachment:">
<string key="name">addAttachment:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="addCustomField:">
<string key="name">addCustomField:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="removeAttachment:">
<string key="name">removeAttachment:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="removeCustomField:">
<string key="name">removeCustomField:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="saveAttachment:">
<string key="name">saveAttachment:</string>
<string key="candidateClassName">id</string>
</object>
</dictionary>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="URLTextField">NSTextField</string>
@@ -5135,17 +5288,20 @@
<object class="IBPartialClassDescription">
<string key="className">MPSelectedAttachmentTableCellView</string>
<string key="superclassName">NSTableCellView</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">saveButton</string>
<string key="NS.object.0">NSButton</string>
<dictionary class="NSMutableDictionary" key="outlets">
<string key="removeButton">NSButton</string>
<string key="saveButton">NSButton</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="removeButton">
<string key="name">removeButton</string>
<string key="candidateClassName">NSButton</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">saveButton</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<object class="IBToOneOutletInfo" key="saveButton">
<string key="name">saveButton</string>
<string key="candidateClassName">NSButton</string>
</object>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/MPSelectedAttachmentTableCellView.h</string>
@@ -5177,6 +5333,7 @@
<string key="00_PasswordTemplate">{128, 128}</string>
<string key="04_KlipperTemplate">{128, 128}</string>
<string key="07_NotepadTemplate">{128, 128}</string>
<string key="99_HarddiskTemplate">{128, 128}</string>
<string key="NSActionTemplate">{15, 15}</string>
<string key="NSAddTemplate">{8, 8}</string>
<string key="NSApplicationIcon">{128, 128}</string>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -15,5 +15,9 @@
- (void)removeObjectFromStringFieldsAtIndex:(NSUInteger)anIndex;
- (void)insertObject:(StringField *)stringfield inStringFieldsAtIndex:(NSUInteger)anIndex;
- (NSUInteger)countOfBinaries;
- (BinaryRef *)objectInBinariesAtIndex:(NSUInteger)index;
- (void)removeObjectFromBinariesAtIndex:(NSUInteger)index;
- (void)insertObject:(BinaryRef *)binary inBinariesAtIndex:(NSUInteger)index;
@end

View File

@@ -10,6 +10,7 @@
@implementation Kdb4Entry (KVOAdditions)
/* Entries */
- (NSUInteger)countOfStringFields {
return [self.stringFields count];
}
@@ -26,4 +27,21 @@
[self.stringFields removeObjectAtIndex:anIndex];
}
/* Binaries */
- (NSUInteger)countOfBinaries {
return [self.binaries count];
}
- (BinaryRef *)objectInBinariesAtIndex:(NSUInteger)index {
return (self.binaries)[index];
}
- (void)insertObject:(BinaryRef *)binary inBinariesAtIndex:(NSUInteger)index {
[self.binaries insertObject:binary atIndex:index];
}
- (void)removeObjectFromBinariesAtIndex:(NSUInteger)index {
[self.binaries removeObjectAtIndex:index];
}
@end

View File

@@ -11,5 +11,6 @@
@interface Kdb4Tree (NewTree)
+(Kdb4Tree *)templateTree;
+(Kdb4Tree *)demoTree;
@end

View File

@@ -15,7 +15,7 @@
Kdb4Tree *tree = [[Kdb4Tree alloc] init];
tree.generator = @"MacPass";
tree.databaseName = @"";
tree.databaseName = NSLocalizedString(@"NEW_DATABASE", "Name for a newly created Database");
tree.databaseNameChanged = currentTime;
tree.databaseDescription = @"";
tree.databaseDescriptionChanged = currentTime;
@@ -74,4 +74,50 @@
return tree;
}
+ (Kdb4Tree *)demoTree {
NSDate *currentTime = [NSDate date];
Kdb4Tree *tree = [[Kdb4Tree alloc] init];
tree.generator = @"MacPass";
tree.databaseName = @"Icon Demonstation";
tree.databaseNameChanged = currentTime;
tree.databaseDescription = @"This database just has all default icons as groups in the tree";
tree.databaseDescriptionChanged = currentTime;
tree.defaultUserName = @"";
tree.defaultUserNameChanged = currentTime;
tree.maintenanceHistoryDays = 365;
tree.color = @"";
tree.masterKeyChanged = currentTime;
tree.masterKeyChangeRec = -1;
tree.masterKeyChangeForce = -1;
tree.protectTitle = NO;
tree.protectUserName = NO;
tree.protectPassword = YES;
tree.protectUrl = NO;
tree.protectNotes = NO;
tree.recycleBinEnabled = YES;
tree.recycleBinUuid = [UUID nullUuid];
tree.recycleBinChanged = currentTime;
tree.entryTemplatesGroup = [UUID nullUuid];
tree.entryTemplatesGroupChanged = currentTime;
tree.historyMaxItems = 10;
tree.historyMaxSize = 6 * 1024 * 1024; // 6 MB
tree.lastSelectedGroup = [UUID nullUuid];
tree.lastTopVisibleGroup = [UUID nullUuid];
KdbGroup *parentGroup = [tree createGroup:nil];
parentGroup.name = @"General";
parentGroup.image = 48;
tree.root = parentGroup;
for(NSUInteger iImageIndex = 0; iImageIndex < 69; iImageIndex++) {
KdbGroup *group = [tree createGroup:parentGroup];
group.name = [NSString stringWithFormat:@"Group %ld", iImageIndex];
group.image = iImageIndex;
[parentGroup addGroup:group];
}
return tree;
}
@end

View File

@@ -7,6 +7,8 @@
//
#import "KdbEntry+MPAdditions.h"
#import "Kdb3Node.h"
#import "Kdb4Node.h"
#import "MPIconHelper.h"

View File

@@ -17,4 +17,5 @@
return NSNotFound;
}
@end

View File

@@ -8,6 +8,9 @@
#import "Kdb.h"
@class BinaryRef;
@class Binary;
@interface KdbTree (MPAdditions)
- (NSArray *)allEntries;

View File

@@ -9,6 +9,10 @@
#import "KdbTree+MPAdditions.h"
#import "KdbGroup+MPTreeTools.h"
#import "NSMutableData+Base64.h"
#import "Kdb3Node.h"
#import "Kdb4Node.h"
@implementation KdbTree (MPAdditions)
- (NSArray *)allGroups {

View File

@@ -10,8 +10,8 @@
@interface MPCustomFieldTableCellView : NSTableCellView
@property (weak) IBOutlet NSTextField *labelTextField;
@property (weak) IBOutlet NSTextField *valueTextField;
@property (weak) IBOutlet NSButton *removeButton;
@property (nonatomic, weak) IBOutlet NSTextField *labelTextField;
@property (nonatomic, weak) IBOutlet NSTextField *valueTextField;
@property (nonatomic, weak) IBOutlet NSButton *removeButton;
@end

View File

@@ -0,0 +1,149 @@
//
// MPDocument+Attachments.m
// MacPass
//
// Created by Michael Starke on 05.07.13.
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
//
#import "MPDocument.h"
#import "NSMutableData+Base64.h"
#import "NSData+Gzip.h"
#import "Kdb3Node.h"
#import "Kdb4Node.h"
#import "Kdb4Entry+KVOAdditions.h"
@implementation MPDocument (Attachments)
- (void)addAttachment:(NSURL *)location toEntry:(KdbEntry *)anEntry {
NSError *error = nil;
NSString *fileName = [location lastPathComponent];
if([anEntry isKindOfClass:[Kdb3Entry class]]) {
Kdb3Entry *entry = (Kdb3Entry *)anEntry;
NSData *binaryData = [NSData dataWithContentsOfURL:location options:NSDataReadingUncached error:&error];
if(!binaryData) {
[NSApp presentError:error];
binaryData = nil;
error = nil;
return; // failed
}
entry.binary = binaryData;
entry.binaryDesc = fileName;
}
if( [anEntry isKindOfClass:[Kdb4Entry class]]) {
Kdb4Entry *entry = (Kdb4Entry *)anEntry;
NSStringEncoding encoding;
NSString *fileContents = [NSString stringWithContentsOfURL:location usedEncoding:&encoding error:&error];
if(!fileContents) {
[NSApp presentError:error];
fileContents = nil;
error = nil;
return; // failed
}
Binary *binary = [[Binary alloc] init];
NSUInteger nextId = [self nextBinaryId];
if(nextId == NSNotFound) {
binary = nil;
return; // No id found. Something went wrong
}
binary.binaryId = nextId;
binary.compressed = (self.treeV4.compressionAlgorithm != KPLCompressionNone);
NSData *encodedData;
NSData *fileData = [fileContents dataUsingEncoding:encoding];
if(binary.compressed) {
switch(self.treeV4.compressionAlgorithm) {
case KPLCompressionGzip: {
NSData *compressedData = [fileData gzipDeflate];
encodedData = [NSMutableData mutableDataWithBase64EncodedData:compressedData];
break;
}
default:
NSAssert(NO, @"Unsupported Compression Algorithm");
binary = nil;
encodedData = nil;
fileData = nil;
return;
}
}
else {
encodedData = fileData;
}
binary.data = [[NSString alloc] initWithData:encodedData encoding:NSASCIIStringEncoding];
[self.treeV4.binaries addObject:binary];
BinaryRef *ref = [[BinaryRef alloc] init];
ref.key = fileName;
ref.ref = binary.binaryId;
[entry insertObject:ref inBinariesAtIndex:[entry.binaries count]];
}
}
- (void)saveAttachmentFromEntry:(KdbEntry *)anEntry toLocation:(NSURL *)location {
if([anEntry isKindOfClass:[Kdb3Entry class]]) {
Kdb3Entry *entry = (Kdb3Entry *)anEntry;
NSError *error = nil;
if(! [entry.binary writeToURL:location options:NSDataWritingWithoutOverwriting error:&error] ) {
[NSApp presentError:error];
}
}
return; //
}
- (void)removeAttachment:(BinaryRef *)reference fromEntry:(KdbEntry *)anEntry {
if(self.version != MPDatabaseVersion4) {
return; // Wrong Database version;
}
Binary *binary = [self findBinary:reference];
Kdb4Entry *entry = (Kdb4Entry *)anEntry;
NSUInteger index = [entry.binaries indexOfObject:reference];
if(index == NSNotFound) {
return; // No Reference for this entry found
}
[entry removeObjectFromBinariesAtIndex:index];
[self.treeV4.binaries removeObject:binary];
}
- (Binary *)findBinary:(BinaryRef *)reference {
if(self.version != MPDatabaseVersion4) {
return nil;
}
NSPredicate *filterPredicate = [NSPredicate predicateWithBlock:^BOOL(id evaluatedObject, NSDictionary *bindings) {
Binary *binaryFile = evaluatedObject;
return (binaryFile.binaryId == reference.ref);
}];
NSArray *filteredBinary = [self.treeV4.binaries filteredArrayUsingPredicate:filterPredicate];
return [filteredBinary lastObject];
}
- (void)saveAttachment:(BinaryRef *)reference toLocation:(NSURL *)location {
Binary *binary = [self findBinary:reference];
NSData *rawData = nil;
if(binary) {
if(binary.compressed) {
rawData = [NSMutableData mutableDataWithBase64DecodedData:[binary.data dataUsingEncoding:NSASCIIStringEncoding]];
rawData = [rawData gzipInflate];
}
else {
rawData = [NSMutableData mutableDataWithBase64DecodedData:[binary.data dataUsingEncoding:NSASCIIStringEncoding]];
}
NSError *error = nil;
if( ![rawData writeToURL:location options:0 error:&error] ) {
[NSApp presentError:error];
}
}
}
- (NSUInteger)nextBinaryId {
if(self.version != MPDatabaseVersion4) {
return NSNotFound;
}
NSUInteger maxKey = 0;
for(Binary *binary in self.treeV4.binaries) {
maxKey = MAX(binary.binaryId, maxKey);
}
return (maxKey + 1);
}
@end

View File

@@ -57,10 +57,6 @@ APPKIT_EXTERN NSString *const MPDocumentGroupKey;
*/
- (KdbEntry *)findEntry:(UUID *)uuid;
- (KdbGroup *)findGroup:(UUID *)uuid;
/*
Return the Binary for the given BinaryRef. nil if none was found
*/
- (Binary *)binaryForRef:(BinaryRef *)binaryRef;
- (Kdb4Tree *)treeV4;
- (Kdb3Tree *)treeV3;
@@ -93,3 +89,14 @@ APPKIT_EXTERN NSString *const MPDocumentGroupKey;
- (void)emptyTrash:(id)sender;
@end
@interface MPDocument (Attachments)
- (void)addAttachment:(NSURL *)location toEntry:(KdbEntry *)anEntry;
- (void)saveAttachmentFromEntry:(KdbEntry *)anEntry toLocation:(NSURL *)location;
- (void)saveAttachment:(BinaryRef *)reference toLocation:(NSURL *)location;
- (void)removeAttachment:(BinaryRef *)reference fromEntry:(KdbEntry *)anEntry;
- (NSUInteger)nextBinaryId;
- (Binary *)findBinary:(BinaryRef *)reference;
@end

View File

@@ -83,6 +83,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey";
break;
case MPDatabaseVersion4:
self.tree = [Kdb4Tree templateTree];
//self.tree = [Kdb4Tree demoTree];
break;
default:
self = nil;
@@ -117,6 +118,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey";
}
- (BOOL)readFromURL:(NSURL *)url ofType:(NSString *)typeName error:(NSError **)outError {
/* FIXME: Logfile handling
self.lockFileURL = [url URLByAppendingPathExtension:@"lock"];
if([[NSFileManager defaultManager] fileExistsAtPath:[_lockFileURL path]]) {
self.readOnly = YES;
@@ -126,6 +128,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey";
_didLockFile = YES;
self.readOnly = NO;
}
*/
self.decrypted = NO;
return YES;
}
@@ -214,19 +217,6 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey";
return [self.root groupForUUID:uuid];
}
- (Binary *)binaryForRef:(BinaryRef *)binaryRef {
if(self.version != MPDatabaseVersion4) {
return nil;
}
NSPredicate *filterPredicate = [NSPredicate predicateWithBlock:^BOOL(id evaluatedObject, NSDictionary *bindings) {
Binary *binaryFile = evaluatedObject;
return (binaryFile.binaryId == binaryRef.ref);
}];
Kdb4Tree *tree = (Kdb4Tree *)self.tree;
NSArray *filteredBinary = [tree.binaries filteredArrayUsingPredicate:filterPredicate];
return [filteredBinary lastObject];
}
- (Kdb3Tree *)treeV3 {
switch (_version) {
case MPDatabaseVersion3:
@@ -301,6 +291,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey";
}
KdbGroup *newGroup = [self.tree createGroup:parent];
newGroup.name = NSLocalizedString(@"DEFAULT_GROUP_NAME", @"Title for a newly created group");
newGroup.image = MPIconFolder;
[self group:parent addGroup:newGroup atIndex:[parent.groups count]];
NSDictionary *userInfo = @{ MPDocumentGroupKey : newGroup };
[[NSNotificationCenter defaultCenter] postNotificationName:MPDocumentDidAddGroupNotification object:self userInfo:userInfo];

View File

@@ -20,8 +20,13 @@ typedef NS_ENUM(NSUInteger, MPIconType) {
MPIconIdentity,
MPIconContact,
MPIconCamera,
MPIconTrash,
MPIconInfo
MPIconRemote,
MPIconTrash = 43,
MPIconFolder = 48,
/* Custom Icons not used in Database */
MPIconInfo = 1000,
MPIconAddFolder,
MPIconHardDisk,
};
@interface MPIconHelper : NSObject

View File

@@ -10,14 +10,18 @@
@implementation MPIconHelper
static NSDictionary *icons;
+ (NSImage *)icon:(MPIconType)type {
NSDictionary *icons = [MPIconHelper availableIconNames];
if(type >= [icons count]) {
return [NSImage imageNamed:NSImageNameActionTemplate];
if(!icons) {
icons = [MPIconHelper availableIconNames];
}
if([[icons allKeys] containsObject:@(type)]) {
NSString *imageName = icons[@(type)];
return [[NSBundle mainBundle] imageForResource:imageName];
}
return [NSImage imageNamed:NSImageNameActionTemplate];
}
+ (NSArray *)availableIcons {
NSDictionary *imageNames = [MPIconHelper availableIconNames];
@@ -30,19 +34,26 @@
}
+ (NSDictionary *)availableIconNames {
NSDictionary *imageNames = @{ @(MPIconKlipper): @"04_KlipperTemplate",
@(MPIconLanguages): @"05_LanguagesTemplate",
@(MPIconPackageNetwork): @"01_PackageNetworkTemplate",
NSDictionary *imageNames = @{
@(MPIconPassword): @"00_PasswordTemplate",
@(MPIconServer): @"03_ServerTemplate",
@(MPIconPackageNetwork): @"01_PackageNetworkTemplate",
@(MPIconWarning): @"02_MessageBoxWarningTemplate",
@(MPIconCamera): @"11_CameraTemplate",
@(MPIconContact): @"10_ContactTemplate",
@(MPIconIdentity): @"09_IdentityTemplate",
@(MPIconServer): @"03_ServerTemplate",
@(MPIconKlipper): @"04_KlipperTemplate",
@(MPIconLanguages): @"05_LanguagesTemplate",
@(MPIconNotepad): @"07_NotepadTemplate",
@(MPIconSocket): @"08_SocketTemplate",
@(MPIconIdentity): @"09_IdentityTemplate",
@(MPIconContact): @"10_ContactTemplate",
@(MPIconCamera): @"11_CameraTemplate",
@(MPIconRemote): @"12_RemoteTemplate",
@(MPIconTrash): @"43_TrashTemplate",
@(MPIconInfo): @"99_InfoTemplate"
@(MPIconFolder): @"48_FolderTemplate",
@(MPIconInfo): @"99_InfoTemplate",
@(MPIconAddFolder): @"99_AddFolderTemplate",
@(MPIconHardDisk): @"99_HarddiskTemplate"
};
return imageNames;
}

View File

@@ -19,6 +19,7 @@
#import "MPCustomFieldView.h"
#import "MPDatabaseVersion.h"
#import "MPCustomFieldTableCellView.h"
#import "MPSelectedAttachmentTableCellView.h"
#import "KdbLib.h"
#import "Kdb4Node.h"
@@ -58,6 +59,9 @@ enum {
- (IBAction)addCustomField:(id)sender;
- (IBAction)removeCustomField:(id)sender;
- (IBAction)saveAttachment:(id)sender;
- (IBAction)addAttachment:(id)sender;
- (IBAction)removeAttachment:(id)sender;
@end
@@ -313,6 +317,50 @@ enum {
[document entry:entry removeStringField:(entry.stringFields)[index]];
}
- (IBAction)saveAttachment:(id)sender {
Kdb4Entry *entry = (Kdb4Entry *)self.selectedEntry;
BinaryRef *reference = entry.binaries[[sender tag]];
NSSavePanel *savePanel = [NSSavePanel savePanel];
[savePanel setCanCreateDirectories:YES];
[savePanel setNameFieldStringValue:reference.key];
[savePanel beginSheetModalForWindow:[[self windowController] window] completionHandler:^(NSInteger result) {
if(result == NSFileHandlingPanelOKButton) {
MPDocument *document = [[self windowController] document];
[document saveAttachment:reference toLocation:[savePanel URL]];
}
}];
}
- (IBAction)addAttachment:(id)sender {
NSOpenPanel *openPanel = [NSOpenPanel openPanel];
[openPanel setCanChooseDirectories:NO];
[openPanel setCanChooseFiles:YES];
[openPanel setAllowsMultipleSelection:YES];
[openPanel beginSheetModalForWindow:[[self windowController] window] completionHandler:^(NSInteger result) {
if(result == NSFileHandlingPanelOKButton) {
MPDocument *document = [[self windowController] document];
for (NSURL *attachmentURL in [openPanel URLs]) {
[document addAttachment:attachmentURL toEntry:self.selectedEntry];
}
}
}];
}
- (IBAction)removeAttachment:(id)sender {
MPDocument *document = [[self windowController] document];
if(document.version == MPDatabaseVersion3) {
// Uhhhh :D
}
if(document.version == MPDatabaseVersion4) {
Kdb4Entry *entry = (Kdb4Entry *)self.selectedEntry;
BinaryRef *reference = entry.binaries[[sender tag]];
[document removeAttachment:reference fromEntry:self.selectedEntry];
}
}
#pragma mark Notificiations
- (void)_didChangeCurrentItem:(NSNotification *)notification {
MPDocumentWindowController *sender = [notification object];
@@ -354,8 +402,20 @@ enum {
- (NSView *)_viewForAttachmentTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
/* Decide what view to use */
NSIndexSet *selectedIndexes = [self.attachmentTableView selectedRowIndexes];
NSString *viewIdentifyer = [selectedIndexes containsIndex:row] ? @"SelectedCell" : @"NormalCell";
NSTableCellView *view = [_attachmentTableView makeViewWithIdentifier:viewIdentifyer owner:_attachmentTableView];
NSTableCellView *view;
if([selectedIndexes containsIndex:row]) {
MPSelectedAttachmentTableCellView *cellView = [_attachmentTableView makeViewWithIdentifier:@"SelectedCell" owner:_attachmentTableView];
[cellView.saveButton setTag:row];
[cellView.saveButton setAction:@selector(saveAttachment:)];
[cellView.saveButton setTarget:self];
[cellView.removeButton setTag:row];
[cellView.removeButton setAction:@selector(removeAttachment:)];
[cellView.removeButton setTarget:self];
view = cellView;
}
else {
view = [_attachmentTableView makeViewWithIdentifier:@"NormalCell" owner:_attachmentTableView];
}
/* Bind view */
if([self.selectedEntry isKindOfClass:[Kdb4Entry class]]) {
Kdb4Entry *entry = (Kdb4Entry *)self.selectedEntry;

View File

@@ -141,14 +141,20 @@ NSString *const _MPOutlinveViewHeaderViewIdentifier = @"HeaderCell";
if( [self _itemIsRootNodeAdapter:item] ) {
//NSDictionary *options = @{ NSValueTransformerBindingOption : [NSValueTransformer valueTransformerForName:MPUppsercaseStringValueTransformerName] };
view = [outlineView makeViewWithIdentifier:_MPOutlinveViewHeaderViewIdentifier owner:self];
MPRootAdapter *rootNode = [item representedObject];
if([rootNode.tree respondsToSelector:@selector(databaseName)]) {
[view.textField bind:NSValueBinding toObject:rootNode.tree withKeyPath:@"databaseName" options:nil];
}
else {
[view.textField setStringValue:NSLocalizedString(@"GROUPS", @"")];
}
}
else {
KdbGroup *group = [item representedObject];
view = [outlineView makeViewWithIdentifier:_MPOutlineViewDataViewIdentifier owner:self];
NSImage *icon = [MPIconHelper icon:(MPIconType)[group image]];
[view.imageView setImage:icon];
[view.textField bind:NSValueBinding toObject:group withKeyPath:@"name" options:nil];
[view.textField bind:NSValueBinding toObject:group withKeyPath:MPGroupNameUndoableKey options:nil];
[view.textField bind:@"count" toObject:group withKeyPath:@"entries.@count" options:nil];
}

View File

@@ -12,5 +12,6 @@
@interface MPSelectedAttachmentTableCellView : NSTableCellView
@property (nonatomic, weak) IBOutlet NSButton *saveButton;
@property (nonatomic, weak) IBOutlet NSButton *removeButton;
@end

View File

@@ -121,7 +121,7 @@ NSString *const MPToolbarItemInspector = @"TOOLBAR_INSPECTOR";
- (NSDictionary *)createToolbarImages{
NSDictionary *imageDict = @{ MPToolbarItemLock: [NSImage imageNamed:NSImageNameLockUnlockedTemplate],
MPToolbarItemAddEntry: [MPIconHelper icon:MPIconPassword],
MPToolbarItemAddGroup: [MPIconHelper icon:MPIconPassword],
MPToolbarItemAddGroup: [MPIconHelper icon:MPIconAddFolder],
MPToolbarItemDelete: [MPIconHelper icon:MPIconTrash],
MPToolbarItemAction: [NSImage imageNamed:NSImageNameActionTemplate],
MPToolbarItemInspector: [MPIconHelper icon:MPIconInfo],

View File

@@ -34,7 +34,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<string>MacPass</string>
<key>CFBundleIdentifier</key>
<string>com.hicknhacksoftware.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
@@ -44,11 +44,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.2</string>
<string>0.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1883</string>
<string>1960</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>

View File

@@ -57,6 +57,7 @@
<string key="NSFrame">{{7, 5}, {32, 19}}</string>
<reference key="NSSuperview" ref="789399035"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="573415016">
@@ -156,7 +157,7 @@
<int key="NSfFlags">1044</int>
</object>
<reference key="NSControlView" ref="920491699"/>
<object class="NSColor" key="NSBackgroundColor" id="501306061">
<object class="NSColor" key="NSBackgroundColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlBackgroundColor</string>
@@ -224,7 +225,6 @@
<reference key="NSNextKeyView" ref="920491699"/>
<string key="NSReuseIdentifierKey">_NS:11</string>
<reference key="NSDocView" ref="920491699"/>
<reference key="NSBGColor" ref="501306061"/>
<int key="NScvFlags">4</int>
</object>
<object class="NSScroller" id="1009004098">
@@ -370,6 +370,7 @@
<object class="NSImageView" id="273100869">
<reference key="NSNextResponder" ref="980203382"/>
<int key="NSvFlags">268</int>
<array class="NSMutableArray" key="NSSubviews"/>
<set class="NSMutableSet" key="NSDragTypes">
<string>Apple PDF pasteboard type</string>
<string>Apple PICT pasteboard type</string>
@@ -392,7 +393,7 @@
</object>
<string key="NSCellIdentifier">_NS:71</string>
<int key="NSAlign">0</int>
<int key="NSScale">0</int>
<int key="NSScale">2</int>
<int key="NSStyle">0</int>
<bool key="NSAnimates">NO</bool>
</object>

View File

@@ -26,6 +26,12 @@ You should have received a copy of the GNU General Public License along with thi
\
\b Credits:\
\
\b0 MacPass Icon von {\field{\*\fldinst{HYPERLINK "http://iiro.jappinen.me"}}{\fldrslt Iiro J\'e4ppinen}}
\b \
\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
{\field{\*\fldinst{HYPERLINK "https://github.com/robbiehanson/KissXML"}}{\fldrslt
\b0 \cf2 KissXML}}
\b0 \cf3 \
@@ -44,4 +50,9 @@ Copyright \'a9 2011, Alex Rozanski. Alle Rechte vorbehalten.\
\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
{\field{\*\fldinst{HYPERLINK "http://stackoverflow.com/questions/11386876/how-to-encode-and-decode-files-as-base64-in-cocoa-objective-c"}}{\fldrslt \cf3 Base64 Encoding Category}}\
Copyright @2013, {\field{\*\fldinst{HYPERLINK "http://stackoverflow.com/users/200321/denis2342"}}{\fldrslt \cf3 denis2342}}}
Copyright @2013, {\field{\*\fldinst{HYPERLINK "http://stackoverflow.com/users/200321/denis2342"}}{\fldrslt denis2342}}\
\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
{\field{\*\fldinst{HYPERLINK "http://www.cocoadev.com/index.pl?NSDataCategory"}}{\fldrslt \cf3 NSData+Gzip}}\
Basierend auf dem Code im CocoaDev Wiki\
}

View File

@@ -1,7 +1,7 @@
{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf390
{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;\red52\green110\blue183;\red38\green38\blue38;}
\paperw11900\paperh16840\vieww27740\viewh14060\viewkind0
\paperw11900\paperh16840\vieww25780\viewh19380\viewkind0
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
\f0\b\fs24 \cf0 Project Website:\
@@ -23,12 +23,21 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\
\
You should have received a copy of the GNU General Public License along with this program. If not, see {\field{\*\fldinst{HYPERLINK "http://www.gnu.org/licenses/"}}{\fldrslt http://www.gnu.org/licenses/}}.\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
\cf0 \kerning1\expnd0\expndtw3
\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
\b Credits:\
{\field{\*\fldinst{HYPERLINK "https://github.com/robbiehanson/KissXML"}}{\fldrslt
\b0 \cf2 KissXML}}
\b0 \cf3 \
\b \cf0 \kerning1\expnd0\expndtw0 Credits:\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
\b0 \cf2 \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
\cf0 MacPass\kerning1\expnd0\expndtw3
\kerning1\expnd0\expndtw0 Icon by {\field{\*\fldinst{HYPERLINK "http://iiro.jappinen.me"}}{\fldrslt Iiro J\'e4ppinen}}\cf2 \
\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
{\field{\*\fldinst{HYPERLINK "https://github.com/robbiehanson/KissXML"}}{\fldrslt \cf2 KissXML}}\cf3 \
Copyright \'a9 2012 Robbie Hanson. All rights reserved.\
\
{\field{\*\fldinst{HYPERLINK "https://github.com/MiniKeePass/MiniKeePass"}}{\fldrslt \cf2 MiniKeePass}}\
@@ -43,5 +52,10 @@ Copyright \'a9 2010 Qiang Yu. All rights reserved.\
Copyright \'a9 2011, Alex Rozanski. All rights reserved.\
\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
{\field{\*\fldinst{HYPERLINK "http://stackoverflow.com/questions/11386876/how-to-encode-and-decode-files-as-base64-in-cocoa-objective-c"}}{\fldrslt \cf3 Base64 Encoding Category}}\
Copyright @2013, {\field{\*\fldinst{HYPERLINK "http://stackoverflow.com/users/200321/denis2342"}}{\fldrslt \cf3 denis2342}}}
{\field{\*\fldinst{HYPERLINK "http://stackoverflow.com/questions/11386876/how-to-encode-and-decode-files-as-base64-in-cocoa-objective-c"}}{\fldrslt \cf3 NSData+Base64}}\
Copyright @2013, {\field{\*\fldinst{HYPERLINK "http://stackoverflow.com/users/200321/denis2342"}}{\fldrslt denis2342}}\
\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720
{\field{\*\fldinst{HYPERLINK "http://www.cocoadev.com/index.pl?NSDataCategory"}}{\fldrslt \cf3 NSData+Gzip}}\
Extracted from code on the CocoaDev Wiki\
}

Binary file not shown.

View File

@@ -16,7 +16,9 @@ I'm trying to upload new builds along the way for all of you that just want to t
As stated in the disclaimer, this software cannot be considered safe for work in it's current development status.
Use it with caution! Since I did start refactoring the KeePassLib there is even more potential broken code!
[Download MacPass at Dropbox](https://www.dropbox.com/sh/yqgfwi7f8mnd747/NCQlJmg0f0) (build 1419 06/28/2013)
[Older Version of MacPass at Dropbox](https://www.dropbox.com/sh/yqgfwi7f8mnd747/NCQlJmg0f0) (build 1882 07/04/2013)
All [new Release](https://github.com/mstarke/MacPass/releases) are server from Github.
##Known Issues