From a136243bf622249326c856efa92a48dea859b51d Mon Sep 17 00:00:00 2001 From: michael starke Date: Tue, 25 Apr 2017 11:59:36 +0200 Subject: [PATCH] Added wrapping adapter for isHistory to ease binding --- MacPass.xcodeproj/project.pbxproj | 6 ++++++ MacPass/Base.lproj/InspectorView.xib | 12 ++++++++++++ MacPass/KPKNode+MPIsHistory.h | 15 +++++++++++++++ MacPass/KPKNode+MPIsHistory.m | 21 +++++++++++++++++++++ 4 files changed, 54 insertions(+) create mode 100644 MacPass/KPKNode+MPIsHistory.h create mode 100644 MacPass/KPKNode+MPIsHistory.m diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index d2a8ae02..3cc3a63c 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -199,6 +199,7 @@ 4CAAA8281D787B8B00CDE977 /* AutotypeBuilderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4CAAA8261D787B8B00CDE977 /* AutotypeBuilderView.xib */; }; 4CAD748C15B889B700104512 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CAD748B15B889B700104512 /* Security.framework */; }; 4CAD748E15B88AC100104512 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CAD748D15B88AC100104512 /* libz.dylib */; }; + 4CB33F861EAF54A000C9341E /* KPKNode+MPIsHistory.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CB33F851EAF54A000C9341E /* KPKNode+MPIsHistory.m */; }; 4CB915941A0159A20089CE5B /* DuplicateEntryOptionsWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4CB915931A0159A20089CE5B /* DuplicateEntryOptionsWindow.xib */; }; 4CB9339916D3A0DD00A13B5D /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 4CB9339716D3A0DD00A13B5D /* Credits.rtf */; }; 4CBA2ABA17074C07006D8139 /* MPSettingsHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CBA2AB917074C07006D8139 /* MPSettingsHelper.m */; }; @@ -619,6 +620,8 @@ 4CAAA8261D787B8B00CDE977 /* AutotypeBuilderView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = AutotypeBuilderView.xib; sourceTree = ""; }; 4CAD748B15B889B700104512 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; 4CAD748D15B88AC100104512 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; + 4CB33F841EAF54A000C9341E /* KPKNode+MPIsHistory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "KPKNode+MPIsHistory.h"; sourceTree = ""; }; + 4CB33F851EAF54A000C9341E /* KPKNode+MPIsHistory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "KPKNode+MPIsHistory.m"; sourceTree = ""; }; 4CB63A6018986530002DEC4C /* MPFlagsHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPFlagsHelper.h; sourceTree = ""; }; 4CB915931A0159A20089CE5B /* DuplicateEntryOptionsWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DuplicateEntryOptionsWindow.xib; sourceTree = ""; }; 4CB9339816D3A0DD00A13B5D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = en.lproj/Credits.rtf; sourceTree = ""; }; @@ -876,6 +879,8 @@ 4C10412B178CDD44001B5239 /* NSDate+Humanized.m */, 4CC6DB7817D23719002C6091 /* KPKNode+IconImage.h */, 4CC6DB7917D23719002C6091 /* KPKNode+IconImage.m */, + 4CB33F841EAF54A000C9341E /* KPKNode+MPIsHistory.h */, + 4CB33F851EAF54A000C9341E /* KPKNode+MPIsHistory.m */, 4C32B0E51A1D4436007E12F1 /* KPKFormat+MPUTIDetection.h */, 4C32B0E61A1D4436007E12F1 /* KPKFormat+MPUTIDetection.m */, 4CEED1C417D7BD0E007180F1 /* NSError+Messages.h */, @@ -1777,6 +1782,7 @@ 4CFB18E418A17FA20097A34B /* MPUpdateSettingsController.m in Sources */, 4C7B63771C0CB51F00D7038C /* TTTStringTransformers.m in Sources */, 4CCEDE2A179F203B008402BE /* MPOutlineView.m in Sources */, + 4CB33F861EAF54A000C9341E /* KPKNode+MPIsHistory.m in Sources */, 4CCEDE2E179F213B008402BE /* MPNotifications.m in Sources */, 4C17D8E517A1C780006C8C1E /* MPDocumentWindowDelegate.m in Sources */, 4C63B8FB17A3154D0091BD72 /* MPContextToolbarButton.m in Sources */, diff --git a/MacPass/Base.lproj/InspectorView.xib b/MacPass/Base.lproj/InspectorView.xib index 66d5c652..ae41f05c 100644 --- a/MacPass/Base.lproj/InspectorView.xib +++ b/MacPass/Base.lproj/InspectorView.xib @@ -31,6 +31,12 @@ + + + + NSNegateBoolean + + @@ -129,6 +135,12 @@ + + + + NSNegateBoolean + + diff --git a/MacPass/KPKNode+MPIsHistory.h b/MacPass/KPKNode+MPIsHistory.h new file mode 100644 index 00000000..a5a7a5e5 --- /dev/null +++ b/MacPass/KPKNode+MPIsHistory.h @@ -0,0 +1,15 @@ +// +// KPKNode+MPIsHistory.h +// MacPass +// +// Created by Michael Starke on 25.04.17. +// Copyright © 2017 HicknHack Software GmbH. All rights reserved. +// + +#import + +@interface KPKNode (MPIsHistory) + +@property (nonatomic, readonly) BOOL isHistory; + +@end diff --git a/MacPass/KPKNode+MPIsHistory.m b/MacPass/KPKNode+MPIsHistory.m new file mode 100644 index 00000000..a79f950d --- /dev/null +++ b/MacPass/KPKNode+MPIsHistory.m @@ -0,0 +1,21 @@ +// +// KPKNode+MPIsHistory.m +// MacPass +// +// Created by Michael Starke on 25.04.17. +// Copyright © 2017 HicknHack Software GmbH. All rights reserved. +// + +#import "KPKNode+MPIsHistory.h" + +@implementation KPKNode (MPIsHistory) + + +- (BOOL)isHistory { + if(self.asEntry) { + return self.asEntry.isHistory; + } + return NO; +} + +@end