Reference builder now works rudimentarily

This commit is contained in:
michael starke
2014-12-05 18:00:52 +01:00
parent 90f844f87e
commit 853f60efeb
5 changed files with 192 additions and 89 deletions

View File

@@ -223,7 +223,6 @@
4C96D15417A12E4F00D931FA /* 99_CreatedTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C96D15317A12E4F00D931FA /* 99_CreatedTemplate.pdf */; }; 4C96D15417A12E4F00D931FA /* 99_CreatedTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4C96D15317A12E4F00D931FA /* 99_CreatedTemplate.pdf */; };
4C978E0619AE53FE003067DF /* HNHCommon.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C978E0519AE53FE003067DF /* HNHCommon.m */; }; 4C978E0619AE53FE003067DF /* HNHCommon.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C978E0519AE53FE003067DF /* HNHCommon.m */; };
4C978E0D19AE54AB003067DF /* MPFlagsHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C978E0C19AE54AB003067DF /* MPFlagsHelper.m */; }; 4C978E0D19AE54AB003067DF /* MPFlagsHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C978E0C19AE54AB003067DF /* MPFlagsHelper.m */; };
4C99E6A51A30FDFD00E2BA8D /* ReferenceBuilderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C99E6A41A30FDFD00E2BA8D /* ReferenceBuilderView.xib */; };
4C9D6AA917615199001C660C /* HNHRoundedSecureTextFieldCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C9D6AA817615199001C660C /* HNHRoundedSecureTextFieldCell.m */; }; 4C9D6AA917615199001C660C /* HNHRoundedSecureTextFieldCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C9D6AA817615199001C660C /* HNHRoundedSecureTextFieldCell.m */; };
4CA08DA017A831B200A6544B /* MPAddEntryContextMenuDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA08D9F17A831B200A6544B /* MPAddEntryContextMenuDelegate.m */; }; 4CA08DA017A831B200A6544B /* MPAddEntryContextMenuDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CA08D9F17A831B200A6544B /* MPAddEntryContextMenuDelegate.m */; };
4CA0B2ED15BCADAC00654E32 /* SettingsWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4CA0B2EC15BCADAC00654E32 /* SettingsWindow.xib */; }; 4CA0B2ED15BCADAC00654E32 /* SettingsWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4CA0B2EC15BCADAC00654E32 /* SettingsWindow.xib */; };
@@ -277,6 +276,7 @@
4CD78ABE16D155FF00768A1D /* 09_IdentityTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4CD78AB916D155FF00768A1D /* 09_IdentityTemplate.pdf */; }; 4CD78ABE16D155FF00768A1D /* 09_IdentityTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4CD78AB916D155FF00768A1D /* 09_IdentityTemplate.pdf */; };
4CD78ABF16D155FF00768A1D /* 10_ContactTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4CD78ABA16D155FF00768A1D /* 10_ContactTemplate.pdf */; }; 4CD78ABF16D155FF00768A1D /* 10_ContactTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4CD78ABA16D155FF00768A1D /* 10_ContactTemplate.pdf */; };
4CD78AC016D155FF00768A1D /* 11_CameraTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4CD78ABB16D155FF00768A1D /* 11_CameraTemplate.pdf */; }; 4CD78AC016D155FF00768A1D /* 11_CameraTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4CD78ABB16D155FF00768A1D /* 11_CameraTemplate.pdf */; };
4CD820211A32173100399DBB /* ReferenceBuilderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4CD820231A32173100399DBB /* ReferenceBuilderView.xib */; };
4CD884B715BD47080042BBF8 /* DocumentWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4CD884B615BD47080042BBF8 /* DocumentWindow.xib */; }; 4CD884B715BD47080042BBF8 /* DocumentWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4CD884B615BD47080042BBF8 /* DocumentWindow.xib */; };
4CDB5C421794AA4F0017667E /* KPKTree+Serializing.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CDB5C411794AA4F0017667E /* KPKTree+Serializing.m */; }; 4CDB5C421794AA4F0017667E /* KPKTree+Serializing.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CDB5C411794AA4F0017667E /* KPKTree+Serializing.m */; };
4CDF01A316D1B76700D0AC08 /* MPEntryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CDF01A216D1B76700D0AC08 /* MPEntryViewController.m */; }; 4CDF01A316D1B76700D0AC08 /* MPEntryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CDF01A216D1B76700D0AC08 /* MPEntryViewController.m */; };
@@ -784,7 +784,6 @@
4C96D15317A12E4F00D931FA /* 99_CreatedTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = 99_CreatedTemplate.pdf; path = Icons/99_CreatedTemplate.pdf; sourceTree = "<group>"; }; 4C96D15317A12E4F00D931FA /* 99_CreatedTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; name = 99_CreatedTemplate.pdf; path = Icons/99_CreatedTemplate.pdf; sourceTree = "<group>"; };
4C978E0519AE53FE003067DF /* HNHCommon.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HNHCommon.m; sourceTree = "<group>"; }; 4C978E0519AE53FE003067DF /* HNHCommon.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HNHCommon.m; sourceTree = "<group>"; };
4C978E0C19AE54AB003067DF /* MPFlagsHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPFlagsHelper.m; sourceTree = "<group>"; }; 4C978E0C19AE54AB003067DF /* MPFlagsHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPFlagsHelper.m; sourceTree = "<group>"; };
4C99E6A41A30FDFD00E2BA8D /* ReferenceBuilderView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ReferenceBuilderView.xib; sourceTree = "<group>"; };
4C9D6AA717615199001C660C /* HNHRoundedSecureTextFieldCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HNHRoundedSecureTextFieldCell.h; sourceTree = "<group>"; }; 4C9D6AA717615199001C660C /* HNHRoundedSecureTextFieldCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HNHRoundedSecureTextFieldCell.h; sourceTree = "<group>"; };
4C9D6AA817615199001C660C /* HNHRoundedSecureTextFieldCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HNHRoundedSecureTextFieldCell.m; sourceTree = "<group>"; }; 4C9D6AA817615199001C660C /* HNHRoundedSecureTextFieldCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HNHRoundedSecureTextFieldCell.m; sourceTree = "<group>"; };
4CA08D9E17A831B200A6544B /* MPAddEntryContextMenuDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPAddEntryContextMenuDelegate.h; sourceTree = "<group>"; }; 4CA08D9E17A831B200A6544B /* MPAddEntryContextMenuDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPAddEntryContextMenuDelegate.h; sourceTree = "<group>"; };
@@ -881,6 +880,7 @@
4CD78AB916D155FF00768A1D /* 09_IdentityTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 09_IdentityTemplate.pdf; sourceTree = "<group>"; }; 4CD78AB916D155FF00768A1D /* 09_IdentityTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 09_IdentityTemplate.pdf; sourceTree = "<group>"; };
4CD78ABA16D155FF00768A1D /* 10_ContactTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 10_ContactTemplate.pdf; sourceTree = "<group>"; }; 4CD78ABA16D155FF00768A1D /* 10_ContactTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 10_ContactTemplate.pdf; sourceTree = "<group>"; };
4CD78ABB16D155FF00768A1D /* 11_CameraTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 11_CameraTemplate.pdf; sourceTree = "<group>"; }; 4CD78ABB16D155FF00768A1D /* 11_CameraTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 11_CameraTemplate.pdf; sourceTree = "<group>"; };
4CD820221A32173100399DBB /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/ReferenceBuilderView.xib; sourceTree = "<group>"; };
4CD884B615BD47080042BBF8 /* DocumentWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DocumentWindow.xib; sourceTree = "<group>"; }; 4CD884B615BD47080042BBF8 /* DocumentWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DocumentWindow.xib; sourceTree = "<group>"; };
4CDB5C401794AA4F0017667E /* KPKTree+Serializing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "KPKTree+Serializing.h"; sourceTree = "<group>"; }; 4CDB5C401794AA4F0017667E /* KPKTree+Serializing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "KPKTree+Serializing.h"; sourceTree = "<group>"; };
4CDB5C411794AA4F0017667E /* KPKTree+Serializing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = "KPKTree+Serializing.m"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 4CDB5C411794AA4F0017667E /* KPKTree+Serializing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = "KPKTree+Serializing.m"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
@@ -1093,7 +1093,7 @@
4C2C8B331787500E009649F3 /* UnprotectedWarningView.xib */, 4C2C8B331787500E009649F3 /* UnprotectedWarningView.xib */,
6021FE7918E15FF300C3BC51 /* DatePickingView.xib */, 6021FE7918E15FF300C3BC51 /* DatePickingView.xib */,
4C26C34A18D8D5A300CF1A1C /* PreviewView.xib */, 4C26C34A18D8D5A300CF1A1C /* PreviewView.xib */,
4C99E6A41A30FDFD00E2BA8D /* ReferenceBuilderView.xib */, 4CD820231A32173100399DBB /* ReferenceBuilderView.xib */,
4C74DD05177BD1640034A9DB /* MPCustomFieldView.h */, 4C74DD05177BD1640034A9DB /* MPCustomFieldView.h */,
4C74DD06177BD1640034A9DB /* MPCustomFieldView.m */, 4C74DD06177BD1640034A9DB /* MPCustomFieldView.m */,
4CE8247316E2F2B900573141 /* MPOverlayView.h */, 4CE8247316E2F2B900573141 /* MPOverlayView.h */,
@@ -2253,7 +2253,7 @@
6021FE8D18E1617300C3BC51 /* PasswordCreatorView.xib in Resources */, 6021FE8D18E1617300C3BC51 /* PasswordCreatorView.xib in Resources */,
4C1DDCDD1711ECEB00C98DA3 /* PasswordCreatorWindow.xib in Resources */, 4C1DDCDD1711ECEB00C98DA3 /* PasswordCreatorWindow.xib in Resources */,
4C7714AA176C998F00549F2A /* 43_TrashTemplate.pdf in Resources */, 4C7714AA176C998F00549F2A /* 43_TrashTemplate.pdf in Resources */,
4C99E6A51A30FDFD00E2BA8D /* ReferenceBuilderView.xib in Resources */, 4CD820211A32173100399DBB /* ReferenceBuilderView.xib in Resources */,
4C7714AC176C9D4600549F2A /* 99_InfoTemplate.pdf in Resources */, 4C7714AC176C9D4600549F2A /* 99_InfoTemplate.pdf in Resources */,
6021FE5618E1429500C3BC51 /* IntegrationSettings.xib in Resources */, 6021FE5618E1429500C3BC51 /* IntegrationSettings.xib in Resources */,
4CA3531218A5577300839B0F /* dsa_sparkle_pub.pem in Resources */, 4CA3531218A5577300839B0F /* dsa_sparkle_pub.pem in Resources */,
@@ -2691,6 +2691,14 @@
name = Credits.rtf; name = Credits.rtf;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
4CD820231A32173100399DBB /* ReferenceBuilderView.xib */ = {
isa = PBXVariantGroup;
children = (
4CD820221A32173100399DBB /* Base */,
);
name = ReferenceBuilderView.xib;
sourceTree = "<group>";
};
6021FE3D18E1341900C3BC51 /* EntryInspectorView.xib */ = { 6021FE3D18E1341900C3BC51 /* EntryInspectorView.xib */ = {
isa = PBXVariantGroup; isa = PBXVariantGroup;
children = ( children = (

View File

@@ -0,0 +1,143 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6254" systemVersion="13F34" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6254"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="MPReferenceBuilderViewController">
<connections>
<outlet property="referenceStringTextField" destination="b36-T7-1tO" id="pQE-9g-s6l"/>
<outlet property="searchKeyPopUpButton" destination="b4e-k2-WPS" id="6xo-a4-89X"/>
<outlet property="searchStringTextField" destination="IFf-vC-3vk" id="SEI-2b-OuL"/>
<outlet property="valuePopUpButton" destination="IZP-Gd-jdU" id="QVB-Tg-ccT"/>
<outlet property="view" destination="c22-O7-iKe" id="hQR-up-044"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView id="c22-O7-iKe">
<rect key="frame" x="0.0" y="0.0" width="200" height="211"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="IZP-Gd-jdU">
<rect key="frame" x="13" y="153" width="80" height="19"/>
<popUpButtonCell key="cell" type="roundRect" bezelStyle="roundedRect" alignment="center" lineBreakMode="truncatingTail" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="KPf-xE-gde">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="cellTitle"/>
<menu key="menu" id="Vxk-eO-bbf">
<items>
<menuItem title="Get" id="142-bE-IMZ"/>
</items>
</menu>
</popUpButtonCell>
<connections>
<action selector="updateReference:" target="-2" id="GzJ-Sy-IP4"/>
</connections>
</popUpButton>
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="IFf-vC-3vk" customClass="HNHRoundedTextField">
<rect key="frame" x="13" y="102" width="167" height="22"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="100" id="Seu-01-P53"/>
</constraints>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" placeholderString="Value" drawsBackground="YES" id="fNP-ye-2bD">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="T2o-aJ-JmD">
<rect key="frame" x="143" y="18" width="37" height="25"/>
<buttonCell key="cell" type="roundTextured" title="Use" bezelStyle="texturedRounded" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Kqx-qm-nMG">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="VR5-Rx-ueN">
<rect key="frame" x="99" y="180" width="23" height="14"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Key" id="K1t-OZ-ACe">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="sZo-ie-Asw">
<rect key="frame" x="11" y="180" width="57" height="14"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Reference" id="r1V-VE-ngy">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<popUpButton horizontalHuggingPriority="249" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="b4e-k2-WPS">
<rect key="frame" x="101" y="153" width="79" height="19"/>
<popUpButtonCell key="cell" type="roundRect" title="Matching" bezelStyle="roundedRect" alignment="center" lineBreakMode="truncatingTail" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" selectedItem="yT1-XL-k6a" id="Aob-tW-bUP">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="cellTitle"/>
<menu key="menu" id="j2A-qj-k7L">
<items>
<menuItem title="Matching" state="on" id="yT1-XL-k6a">
<modifierMask key="keyEquivalentModifierMask" shift="YES"/>
</menuItem>
</items>
</menu>
</popUpButtonCell>
<connections>
<action selector="updateKey:" target="-2" id="6LT-Kj-Cl4"/>
</connections>
</popUpButton>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="WTJ-he-uTu">
<rect key="frame" x="11" y="132" width="37" height="14"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Match" id="9ce-da-syF">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="mcC-bG-cCz">
<rect key="frame" x="11" y="80" width="92" height="14"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Reference String" id="gik-Ha-hRd">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="b36-T7-1tO" customClass="HNHRoundedTextField">
<rect key="frame" x="13" y="50" width="167" height="22"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" placeholderString="Reference" drawsBackground="YES" id="dr9-x8-kKk">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
<constraints>
<constraint firstItem="b4e-k2-WPS" firstAttribute="leading" secondItem="VR5-Rx-ueN" secondAttribute="leading" id="2Js-KC-XN2"/>
<constraint firstItem="T2o-aJ-JmD" firstAttribute="top" secondItem="b36-T7-1tO" secondAttribute="bottom" constant="8" symbolic="YES" id="49s-kD-acD"/>
<constraint firstItem="WTJ-he-uTu" firstAttribute="top" secondItem="IZP-Gd-jdU" secondAttribute="bottom" constant="8" symbolic="YES" id="4YJ-ID-xVe"/>
<constraint firstItem="IZP-Gd-jdU" firstAttribute="width" secondItem="b4e-k2-WPS" secondAttribute="width" id="5nM-1K-FHo"/>
<constraint firstItem="b36-T7-1tO" firstAttribute="leading" secondItem="mcC-bG-cCz" secondAttribute="leading" id="7RF-Ca-lgp"/>
<constraint firstItem="IZP-Gd-jdU" firstAttribute="leading" secondItem="sZo-ie-Asw" secondAttribute="leading" id="8fd-xS-yzD"/>
<constraint firstItem="IFf-vC-3vk" firstAttribute="trailing" secondItem="b36-T7-1tO" secondAttribute="trailing" id="A5u-Ke-7v2"/>
<constraint firstItem="b4e-k2-WPS" firstAttribute="leading" secondItem="IZP-Gd-jdU" secondAttribute="trailing" constant="8" id="FZh-nD-5FA"/>
<constraint firstItem="sZo-ie-Asw" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="13" id="IGM-B6-h77"/>
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="WTJ-he-uTu" secondAttribute="trailing" constant="20" symbolic="YES" id="KHp-go-bxN"/>
<constraint firstItem="sZo-ie-Asw" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" constant="17" id="MFw-nO-YjE"/>
<constraint firstItem="IFf-vC-3vk" firstAttribute="top" secondItem="WTJ-he-uTu" secondAttribute="bottom" constant="8" id="NAD-cd-qCS"/>
<constraint firstItem="IFf-vC-3vk" firstAttribute="leading" secondItem="mcC-bG-cCz" secondAttribute="leading" id="SdU-b0-En0"/>
<constraint firstAttribute="trailing" secondItem="b4e-k2-WPS" secondAttribute="trailing" constant="20" symbolic="YES" id="TY7-di-r3Z"/>
<constraint firstItem="IFf-vC-3vk" firstAttribute="leading" secondItem="WTJ-he-uTu" secondAttribute="leading" id="XIB-he-FfV"/>
<constraint firstItem="b36-T7-1tO" firstAttribute="top" secondItem="mcC-bG-cCz" secondAttribute="bottom" constant="8" symbolic="YES" id="Xka-0w-eDc"/>
<constraint firstAttribute="bottom" secondItem="T2o-aJ-JmD" secondAttribute="bottom" constant="20" symbolic="YES" id="bG1-hy-Rfa"/>
<constraint firstItem="IZP-Gd-jdU" firstAttribute="top" secondItem="sZo-ie-Asw" secondAttribute="bottom" constant="8" id="gK4-Td-hA9"/>
<constraint firstItem="sZo-ie-Asw" firstAttribute="centerY" secondItem="VR5-Rx-ueN" secondAttribute="centerY" id="gsh-ja-cXw"/>
<constraint firstAttribute="trailing" secondItem="IFf-vC-3vk" secondAttribute="trailing" constant="20" symbolic="YES" id="jYR-km-1Eh"/>
<constraint firstItem="b4e-k2-WPS" firstAttribute="centerY" secondItem="IZP-Gd-jdU" secondAttribute="centerY" id="pKr-Oo-UwF"/>
<constraint firstItem="WTJ-he-uTu" firstAttribute="leading" secondItem="IZP-Gd-jdU" secondAttribute="leading" id="qaF-8T-8XH"/>
<constraint firstItem="mcC-bG-cCz" firstAttribute="top" secondItem="IFf-vC-3vk" secondAttribute="bottom" constant="8" id="wNQ-xf-cQH"/>
<constraint firstItem="T2o-aJ-JmD" firstAttribute="trailing" secondItem="b36-T7-1tO" secondAttribute="trailing" id="yQJ-FX-1Xw"/>
</constraints>
<point key="canvasLocation" x="422" y="-100.5"/>
</customView>
</objects>
</document>

View File

@@ -12,5 +12,9 @@
@property (weak) IBOutlet NSPopUpButton *valuePopUpButton; @property (weak) IBOutlet NSPopUpButton *valuePopUpButton;
@property (weak) IBOutlet NSPopUpButton *searchKeyPopUpButton; @property (weak) IBOutlet NSPopUpButton *searchKeyPopUpButton;
@property (weak) IBOutlet NSTextField *searchStringTextField; @property (weak) IBOutlet NSTextField *searchStringTextField;
@property (weak) IBOutlet NSTextField *referenceStringTextField;
- (IBAction)updateReference:(id)sender;
- (IBAction)updateKey:(id)sender;
@end @end

View File

@@ -10,6 +10,8 @@
@interface MPReferenceBuilderViewController () @interface MPReferenceBuilderViewController ()
@property (nonatomic, copy) NSString *searchString;
@end @end
@implementation MPReferenceBuilderViewController @implementation MPReferenceBuilderViewController
@@ -28,12 +30,14 @@
- (void)didLoadView { - (void)didLoadView {
[self.searchKeyPopUpButton setMenu:[self _allocateAttributeItemMenu:YES withTitle:NSLocalizedString(@"SEARCH_VALUE", "")]]; [self.searchKeyPopUpButton setMenu:[self _allocateAttributeItemMenu:YES withTitle:NSLocalizedString(@"SEARCH_VALUE", "")]];
[self.valuePopUpButton setMenu:[self _allocateAttributeItemMenu:NO withTitle:NSLocalizedString(@"OUTPUT_VALUE", "")]]; [self.valuePopUpButton setMenu:[self _allocateAttributeItemMenu:NO withTitle:NSLocalizedString(@"OUTPUT_VALUE", "")]];
[self.searchStringTextField bind:NSValueBinding toObject:self withKeyPath:NSStringFromSelector(@selector(searchString)) options:nil];
[self _updateReferenceString];
} }
- (NSMenu *)_allocateAttributeItemMenu:(BOOL)allowCustomAttributes withTitle:(NSString *)title { - (NSMenu *)_allocateAttributeItemMenu:(BOOL)allowCustomAttributes withTitle:(NSString *)title {
NSMenu *menu = [[NSMenu alloc] init]; NSMenu *menu = [[NSMenu alloc] init];
/* first item is button label */ /* first item is button label */
[menu addItemWithTitle:title action:NULL keyEquivalent:@""]; //[menu addItemWithTitle:title action:NULL keyEquivalent:@""];
[menu addItemWithTitle:NSLocalizedString(@"UUID","") action:NULL keyEquivalent:@""]; [menu addItemWithTitle:NSLocalizedString(@"UUID","") action:NULL keyEquivalent:@""];
[menu addItemWithTitle:NSLocalizedString(@"TITLE","") action:NULL keyEquivalent:@""]; [menu addItemWithTitle:NSLocalizedString(@"TITLE","") action:NULL keyEquivalent:@""];
[menu addItemWithTitle:NSLocalizedString(@"USERNAME","") action:NULL keyEquivalent:@""]; [menu addItemWithTitle:NSLocalizedString(@"USERNAME","") action:NULL keyEquivalent:@""];
@@ -43,7 +47,34 @@
if(allowCustomAttributes) { if(allowCustomAttributes) {
[menu addItemWithTitle:NSLocalizedString(@"CUSTOM_ATTRIBUTE","") action:NULL keyEquivalent:@""]; [menu addItemWithTitle:NSLocalizedString(@"CUSTOM_ATTRIBUTE","") action:NULL keyEquivalent:@""];
} }
NSArray *keys = @[ @"I", @"T", @"U", @"P", @"A", @"N", @"S" ];
[menu.itemArray enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
NSMenuItem *item = (NSMenuItem *)obj;
NSAssert(keys.count > idx, @"");
item.representedObject = keys[idx];
}];
return menu; return menu;
} }
- (void)setSearchString:(NSString *)searchString {
if(![searchString isEqualToString:_searchString]) {
_searchString = [searchString copy];
[self _updateReferenceString];
}
}
- (IBAction)updateReference:(id)sender {
[self _updateReferenceString];
}
- (IBAction)updateKey:(id)sender {
[self _updateReferenceString];
}
- (void)_updateReferenceString {
NSString *key = self.searchKeyPopUpButton.selectedItem.representedObject;
NSString *value = self.valuePopUpButton.selectedItem.representedObject;
NSString *newValue = [[NSString alloc] initWithFormat:@"{REF:%@@%@:%@}", value, key, self.searchStringTextField.stringValue];
self.referenceStringTextField.stringValue = newValue;
}
@end @end

View File

@@ -1,83 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6254" systemVersion="13F34" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6254"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="MPReferenceBuilderViewController">
<connections>
<outlet property="searchKeyPopUpButton" destination="b4e-k2-WPS" id="6xo-a4-89X"/>
<outlet property="searchStringTextField" destination="IFf-vC-3vk" id="SEI-2b-OuL"/>
<outlet property="valuePopUpButton" destination="IZP-Gd-jdU" id="QVB-Tg-ccT"/>
<outlet property="view" destination="c22-O7-iKe" id="hQR-up-044"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView id="c22-O7-iKe">
<rect key="frame" x="0.0" y="0.0" width="553" height="62"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="IZP-Gd-jdU">
<rect key="frame" x="20" y="21" width="45" height="19"/>
<popUpButtonCell key="cell" type="roundRect" bezelStyle="roundedRect" alignment="center" lineBreakMode="truncatingTail" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="KPf-xE-gde">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="cellTitle"/>
<menu key="menu" id="Vxk-eO-bbf">
<items>
<menuItem title="Get" state="on" id="142-bE-IMZ"/>
</items>
</menu>
</popUpButtonCell>
</popUpButton>
<popUpButton horizontalHuggingPriority="249" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="b4e-k2-WPS">
<rect key="frame" x="73" y="21" width="85" height="19"/>
<popUpButtonCell key="cell" type="roundRect" title="Matching" bezelStyle="roundedRect" alignment="center" lineBreakMode="truncatingTail" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" selectedItem="yT1-XL-k6a" id="Aob-tW-bUP">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="cellTitle"/>
<menu key="menu" id="j2A-qj-k7L">
<items>
<menuItem title="Matching" state="on" id="yT1-XL-k6a">
<modifierMask key="keyEquivalentModifierMask" shift="YES"/>
</menuItem>
</items>
</menu>
</popUpButtonCell>
</popUpButton>
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="IFf-vC-3vk">
<rect key="frame" x="167" y="20" width="321" height="22"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" constant="100" id="Seu-01-P53"/>
</constraints>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" placeholderString="for value" drawsBackground="YES" id="fNP-ye-2bD">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="T2o-aJ-JmD">
<rect key="frame" x="496" y="18" width="37" height="25"/>
<buttonCell key="cell" type="roundTextured" title="Use" bezelStyle="texturedRounded" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Kqx-qm-nMG">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
</button>
</subviews>
<constraints>
<constraint firstItem="IFf-vC-3vk" firstAttribute="leading" secondItem="b4e-k2-WPS" secondAttribute="trailing" constant="9" id="9lR-zK-sJ9"/>
<constraint firstItem="b4e-k2-WPS" firstAttribute="centerY" secondItem="IZP-Gd-jdU" secondAttribute="centerY" id="9px-3a-ML8"/>
<constraint firstItem="T2o-aJ-JmD" firstAttribute="leading" secondItem="IFf-vC-3vk" secondAttribute="trailing" constant="8" id="KB2-TQ-vOj"/>
<constraint firstItem="IFf-vC-3vk" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="167" id="PiJ-8F-1y4"/>
<constraint firstAttribute="bottom" secondItem="IFf-vC-3vk" secondAttribute="bottom" constant="20" symbolic="YES" id="Rga-Nr-tJC"/>
<constraint firstItem="IZP-Gd-jdU" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="20" symbolic="YES" id="YZS-8V-uJC"/>
<constraint firstItem="IFf-vC-3vk" firstAttribute="centerY" secondItem="b4e-k2-WPS" secondAttribute="centerY" id="clf-Jb-991"/>
<constraint firstAttribute="trailing" secondItem="T2o-aJ-JmD" secondAttribute="trailing" constant="20" id="dMd-nR-6ud"/>
<constraint firstItem="IFf-vC-3vk" firstAttribute="centerY" secondItem="T2o-aJ-JmD" secondAttribute="centerY" id="dOS-yX-VrJ"/>
<constraint firstItem="IFf-vC-3vk" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" constant="20" symbolic="YES" id="oz5-jn-4bS"/>
<constraint firstItem="b4e-k2-WPS" firstAttribute="leading" secondItem="IZP-Gd-jdU" secondAttribute="trailing" constant="8" id="qDi-8f-siN"/>
</constraints>
<point key="canvasLocation" x="578.5" y="225"/>
</customView>
</objects>
</document>