mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 16:22:21 +00:00
Enhanced Autotype
Autotype now looks in all open documents for matches Autotype now uses the same matching as KeePass Settings for autotype are now enabled in the UI since they are used now Signed-off-by: michael starke <michael.starke@hicknhack-software.com>
This commit is contained in:
2
DDHotKey
2
DDHotKey
Submodule DDHotKey updated: e6846463e2...dfab50eb22
@@ -1,8 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6751" systemVersion="14C1510" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="8191" systemVersion="14F27" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<deployment identifier="macosx"/>
|
<deployment identifier="macosx"/>
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6751"/>
|
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="8191"/>
|
||||||
|
<capability name="box content view" minToolsVersion="7.0"/>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<objects>
|
<objects>
|
||||||
<customObject id="-2" userLabel="File's Owner" customClass="MPIntegrationSettingsController">
|
<customObject id="-2" userLabel="File's Owner" customClass="MPIntegrationSettingsController">
|
||||||
@@ -14,7 +15,8 @@
|
|||||||
<outlet property="hotkeyWarningTextField" destination="f5q-EW-RHf" id="Z2Q-Sb-HCS"/>
|
<outlet property="hotkeyWarningTextField" destination="f5q-EW-RHf" id="Z2Q-Sb-HCS"/>
|
||||||
<outlet property="matchHostCheckBox" destination="TiO-ah-BlR" id="MWr-Uh-TRB"/>
|
<outlet property="matchHostCheckBox" destination="TiO-ah-BlR" id="MWr-Uh-TRB"/>
|
||||||
<outlet property="matchTagsCheckBox" destination="9MH-jx-GpG" id="j1Y-BT-J81"/>
|
<outlet property="matchTagsCheckBox" destination="9MH-jx-GpG" id="j1Y-BT-J81"/>
|
||||||
<outlet property="matchURLCheckBox" destination="DAX-V8-Say" id="g4T-v4-NVe"/>
|
<outlet property="matchTitleCheckBox" destination="DAX-V8-Say" id="rbc-nA-1bQ"/>
|
||||||
|
<outlet property="matchURLCheckBox" destination="8Wz-lo-AXG" id="jTp-2n-oO7"/>
|
||||||
<outlet property="sendCommandForControlCheckBox" destination="VK8-z4-2ci" id="nIa-ap-QfD"/>
|
<outlet property="sendCommandForControlCheckBox" destination="VK8-z4-2ci" id="nIa-ap-QfD"/>
|
||||||
<outlet property="view" destination="1" id="18"/>
|
<outlet property="view" destination="1" id="18"/>
|
||||||
</connections>
|
</connections>
|
||||||
@@ -22,16 +24,16 @@
|
|||||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||||
<customView translatesAutoresizingMaskIntoConstraints="NO" id="1">
|
<customView translatesAutoresizingMaskIntoConstraints="NO" id="1">
|
||||||
<rect key="frame" x="0.0" y="0.0" width="400" height="410"/>
|
<rect key="frame" x="0.0" y="0.0" width="400" height="424"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<box autoresizesSubviews="NO" verticalHuggingPriority="500" title="Keepass HTTP" borderType="line" translatesAutoresizingMaskIntoConstraints="NO" id="KbH-0Q-5Tw">
|
<box autoresizesSubviews="NO" verticalHuggingPriority="500" title="Keepass HTTP" borderType="line" translatesAutoresizingMaskIntoConstraints="NO" id="KbH-0Q-5Tw">
|
||||||
<rect key="frame" x="17" y="336" width="366" height="54"/>
|
<rect key="frame" x="17" y="350" width="366" height="54"/>
|
||||||
<view key="contentView">
|
<view key="contentView" id="8nz-mp-KUp">
|
||||||
<rect key="frame" x="1" y="1" width="364" height="38"/>
|
<rect key="frame" x="1" y="1" width="364" height="38"/>
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<button misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="2">
|
<button translatesAutoresizingMaskIntoConstraints="NO" id="2">
|
||||||
<rect key="frame" x="16" y="12" width="187" height="18"/>
|
<rect key="frame" x="16" y="12" width="191" height="18"/>
|
||||||
<buttonCell key="cell" type="check" title="Enable KeePassHttp server" bezelStyle="regularSquare" imagePosition="left" lineBreakMode="truncatingMiddle" state="on" inset="2" id="3">
|
<buttonCell key="cell" type="check" title="Enable KeePassHttp server" bezelStyle="regularSquare" imagePosition="left" lineBreakMode="truncatingMiddle" state="on" inset="2" id="3">
|
||||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||||
<font key="font" metaFont="system"/>
|
<font key="font" metaFont="system"/>
|
||||||
@@ -40,21 +42,21 @@
|
|||||||
</subviews>
|
</subviews>
|
||||||
</view>
|
</view>
|
||||||
<constraints>
|
<constraints>
|
||||||
<constraint firstItem="2" firstAttribute="top" secondItem="KbH-0Q-5Tw" secondAttribute="top" constant="25" id="I1K-oc-SCv"/>
|
<constraint firstItem="2" firstAttribute="leading" secondItem="KbH-0Q-5Tw" secondAttribute="leading" constant="16" id="2Qk-ad-9AX"/>
|
||||||
<constraint firstAttribute="bottom" secondItem="2" secondAttribute="bottom" constant="11" id="IfW-lq-9Nf"/>
|
<constraint firstAttribute="bottom" secondItem="2" secondAttribute="bottom" constant="11" id="W6e-Pj-6qk"/>
|
||||||
<constraint firstItem="2" firstAttribute="leading" secondItem="KbH-0Q-5Tw" secondAttribute="leading" constant="16" id="Xod-Hc-0rx"/>
|
<constraint firstItem="2" firstAttribute="top" secondItem="KbH-0Q-5Tw" secondAttribute="top" constant="25" id="nEn-ND-YR7"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
|
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
|
||||||
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||||
</box>
|
</box>
|
||||||
<box autoresizesSubviews="NO" verticalHuggingPriority="500" title="Autotype" borderType="line" translatesAutoresizingMaskIntoConstraints="NO" id="P9N-HM-wER">
|
<box autoresizesSubviews="NO" verticalHuggingPriority="500" title="Autotype" borderType="line" translatesAutoresizingMaskIntoConstraints="NO" id="P9N-HM-wER">
|
||||||
<rect key="frame" x="17" y="115" width="366" height="217"/>
|
<rect key="frame" x="17" y="115" width="366" height="231"/>
|
||||||
<view key="contentView">
|
<view key="contentView" id="faU-Ok-HJ3">
|
||||||
<rect key="frame" x="1" y="1" width="364" height="201"/>
|
<rect key="frame" x="1" y="1" width="364" height="215"/>
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Kvg-he-3c8" customClass="DDHotKeyTextField">
|
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Kvg-he-3c8" customClass="DDHotKeyTextField">
|
||||||
<rect key="frame" x="79" y="147" width="89" height="22"/>
|
<rect key="frame" x="79" y="161" width="89" height="22"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<constraint firstAttribute="width" constant="89" id="Mia-b8-HCZ"/>
|
<constraint firstAttribute="width" constant="89" id="Mia-b8-HCZ"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
@@ -64,23 +66,23 @@
|
|||||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||||
</textFieldCell>
|
</textFieldCell>
|
||||||
</textField>
|
</textField>
|
||||||
<button misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="tik-Ar-FJg">
|
<button translatesAutoresizingMaskIntoConstraints="NO" id="tik-Ar-FJg">
|
||||||
<rect key="frame" x="16" y="175" width="168" height="18"/>
|
<rect key="frame" x="16" y="189" width="165" height="18"/>
|
||||||
<buttonCell key="cell" type="check" title="Enable global Autotype" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="1qb-Rd-jYu">
|
<buttonCell key="cell" type="check" title="Enable global Autotype" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="1qb-Rd-jYu">
|
||||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||||
<font key="font" metaFont="system"/>
|
<font key="font" metaFont="system"/>
|
||||||
</buttonCell>
|
</buttonCell>
|
||||||
</button>
|
</button>
|
||||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="buI-Wb-o3V">
|
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="buI-Wb-o3V">
|
||||||
<rect key="frame" x="16" y="149" width="57" height="17"/>
|
<rect key="frame" x="16" y="163" width="57" height="17"/>
|
||||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Shortcut" id="6oN-CH-T0O">
|
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Shortcut" id="6oN-CH-T0O">
|
||||||
<font key="font" metaFont="system"/>
|
<font key="font" metaFont="system"/>
|
||||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||||
</textFieldCell>
|
</textFieldCell>
|
||||||
</textField>
|
</textField>
|
||||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="f5q-EW-RHf">
|
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="f5q-EW-RHf">
|
||||||
<rect key="frame" x="174" y="152" width="127" height="14"/>
|
<rect key="frame" x="174" y="166" width="129" height="14"/>
|
||||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Shortcut is missing Key" id="Lxp-wI-yQy">
|
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Shortcut is missing Key" id="Lxp-wI-yQy">
|
||||||
<font key="font" metaFont="smallSystem"/>
|
<font key="font" metaFont="smallSystem"/>
|
||||||
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
|
<color key="textColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
|
||||||
@@ -88,85 +90,95 @@
|
|||||||
</textFieldCell>
|
</textFieldCell>
|
||||||
</textField>
|
</textField>
|
||||||
<button translatesAutoresizingMaskIntoConstraints="NO" id="DAX-V8-Say">
|
<button translatesAutoresizingMaskIntoConstraints="NO" id="DAX-V8-Say">
|
||||||
<rect key="frame" x="16" y="119" width="175" height="18"/>
|
<rect key="frame" x="16" y="133" width="174" height="18"/>
|
||||||
<buttonCell key="cell" type="check" title="Inlcude URL for matches" bezelStyle="regularSquare" imagePosition="left" enabled="NO" state="on" inset="2" id="tmL-dT-D0G">
|
<buttonCell key="cell" type="check" title="Inlcude Title for matches" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="tmL-dT-D0G">
|
||||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||||
<font key="font" metaFont="system"/>
|
<font key="font" metaFont="system"/>
|
||||||
</buttonCell>
|
</buttonCell>
|
||||||
</button>
|
</button>
|
||||||
<button misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="TiO-ah-BlR">
|
<button translatesAutoresizingMaskIntoConstraints="NO" id="TiO-ah-BlR">
|
||||||
<rect key="frame" x="16" y="99" width="179" height="18"/>
|
<rect key="frame" x="16" y="93" width="177" height="18"/>
|
||||||
<buttonCell key="cell" type="check" title="Inlcude Host for matches" bezelStyle="regularSquare" imagePosition="left" enabled="NO" state="on" inset="2" id="B1D-j9-L8x">
|
<buttonCell key="cell" type="check" title="Inlcude Host for matches" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="B1D-j9-L8x">
|
||||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||||
<font key="font" metaFont="system"/>
|
<font key="font" metaFont="system"/>
|
||||||
</buttonCell>
|
</buttonCell>
|
||||||
</button>
|
</button>
|
||||||
<button misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9MH-jx-GpG">
|
<button translatesAutoresizingMaskIntoConstraints="NO" id="9MH-jx-GpG">
|
||||||
<rect key="frame" x="16" y="79" width="179" height="18"/>
|
<rect key="frame" x="16" y="73" width="177" height="18"/>
|
||||||
<buttonCell key="cell" type="check" title="Inlcude Tags for matches" bezelStyle="regularSquare" imagePosition="left" enabled="NO" state="on" inset="2" id="rbu-G7-MT8">
|
<buttonCell key="cell" type="check" title="Inlcude Tags for matches" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="rbu-G7-MT8">
|
||||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||||
<font key="font" metaFont="system"/>
|
<font key="font" metaFont="system"/>
|
||||||
</buttonCell>
|
</buttonCell>
|
||||||
</button>
|
</button>
|
||||||
<button verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="VK8-z4-2ci">
|
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="VK8-z4-2ci">
|
||||||
<rect key="frame" x="16" y="53" width="126" height="18"/>
|
<rect key="frame" x="16" y="53" width="124" height="18"/>
|
||||||
<buttonCell key="cell" type="check" title="Interpret ⌃ as ⌘" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="QfO-yG-l3F">
|
<buttonCell key="cell" type="check" title="Interpret ⌃ as ⌘" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="QfO-yG-l3F">
|
||||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||||
<font key="font" metaFont="system"/>
|
<font key="font" metaFont="system"/>
|
||||||
</buttonCell>
|
</buttonCell>
|
||||||
</button>
|
</button>
|
||||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="wbP-A9-jpw">
|
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="wbP-A9-jpw">
|
||||||
<rect key="frame" x="16" y="19" width="332" height="28"/>
|
<rect key="frame" x="33" y="19" width="315" height="28"/>
|
||||||
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="If enabled, every {CONTROL} command will be sent as ⌘. Only disable this if you are sure you need to." id="QRy-CY-ENC">
|
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="If enabled, every {CONTROL} command will be sent as ⌘. Only disable this if you are sure you need to." id="QRy-CY-ENC">
|
||||||
<font key="font" metaFont="smallSystem"/>
|
<font key="font" metaFont="smallSystem"/>
|
||||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||||
</textFieldCell>
|
</textFieldCell>
|
||||||
</textField>
|
</textField>
|
||||||
|
<button translatesAutoresizingMaskIntoConstraints="NO" id="8Wz-lo-AXG">
|
||||||
|
<rect key="frame" x="16" y="113" width="175" height="18"/>
|
||||||
|
<buttonCell key="cell" type="check" title="Include URL for matches" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="TzR-00-Vp3">
|
||||||
|
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||||
|
<font key="font" metaFont="system"/>
|
||||||
|
</buttonCell>
|
||||||
|
</button>
|
||||||
</subviews>
|
</subviews>
|
||||||
|
<constraints>
|
||||||
|
<constraint firstItem="8Wz-lo-AXG" firstAttribute="top" secondItem="DAX-V8-Say" secondAttribute="bottom" constant="6" symbolic="YES" id="MoH-z7-kAd"/>
|
||||||
|
<constraint firstItem="9MH-jx-GpG" firstAttribute="leading" secondItem="TiO-ah-BlR" secondAttribute="leading" id="ZD4-CI-kNs"/>
|
||||||
|
<constraint firstItem="8Wz-lo-AXG" firstAttribute="leading" secondItem="tik-Ar-FJg" secondAttribute="leading" id="djt-ZE-TVX"/>
|
||||||
|
<constraint firstItem="TiO-ah-BlR" firstAttribute="top" secondItem="8Wz-lo-AXG" secondAttribute="bottom" constant="6" symbolic="YES" id="ejm-fw-tc2"/>
|
||||||
|
<constraint firstItem="VK8-z4-2ci" firstAttribute="leading" secondItem="tik-Ar-FJg" secondAttribute="leading" id="umE-F4-nDY"/>
|
||||||
|
</constraints>
|
||||||
</view>
|
</view>
|
||||||
<constraints>
|
<constraints>
|
||||||
<constraint firstItem="tik-Ar-FJg" firstAttribute="top" secondItem="P9N-HM-wER" secondAttribute="top" constant="25" id="1HW-Ac-jq4"/>
|
<constraint firstAttribute="trailing" secondItem="wbP-A9-jpw" secondAttribute="trailing" constant="16" id="2V3-QT-fHc"/>
|
||||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="Kvg-he-3c8" secondAttribute="trailing" constant="26" id="1cu-ot-jaU"/>
|
<constraint firstItem="DAX-V8-Say" firstAttribute="top" secondItem="Kvg-he-3c8" secondAttribute="bottom" constant="12" id="3uN-8n-txN"/>
|
||||||
<constraint firstItem="buI-Wb-o3V" firstAttribute="baseline" secondItem="Kvg-he-3c8" secondAttribute="baseline" id="49G-2q-5ye"/>
|
<constraint firstItem="Kvg-he-3c8" firstAttribute="leading" secondItem="buI-Wb-o3V" secondAttribute="trailing" constant="8" symbolic="YES" id="53L-pe-f6c"/>
|
||||||
<constraint firstItem="TiO-ah-BlR" firstAttribute="leading" secondItem="9MH-jx-GpG" secondAttribute="leading" id="4Ta-Nl-wk9"/>
|
<constraint firstAttribute="bottom" secondItem="wbP-A9-jpw" secondAttribute="bottom" constant="16" id="Cz4-ys-xjj"/>
|
||||||
<constraint firstItem="9MH-jx-GpG" firstAttribute="top" secondItem="TiO-ah-BlR" secondAttribute="bottom" constant="6" symbolic="YES" id="87J-fo-zxM"/>
|
<constraint firstItem="tik-Ar-FJg" firstAttribute="leading" secondItem="P9N-HM-wER" secondAttribute="leading" constant="16" id="DfG-iG-Cdv"/>
|
||||||
<constraint firstAttribute="trailing" secondItem="wbP-A9-jpw" secondAttribute="trailing" constant="16" id="9NI-Sn-76Y"/>
|
<constraint firstItem="tik-Ar-FJg" firstAttribute="top" secondItem="P9N-HM-wER" secondAttribute="top" constant="25" id="E3O-BW-PBU"/>
|
||||||
<constraint firstItem="Kvg-he-3c8" firstAttribute="baseline" secondItem="f5q-EW-RHf" secondAttribute="baseline" constant="3" id="ANl-zC-sOX"/>
|
<constraint firstItem="f5q-EW-RHf" firstAttribute="leading" secondItem="Kvg-he-3c8" secondAttribute="trailing" constant="8" symbolic="YES" id="F3E-6w-vYY"/>
|
||||||
<constraint firstItem="f5q-EW-RHf" firstAttribute="leading" secondItem="Kvg-he-3c8" secondAttribute="trailing" constant="8" symbolic="YES" id="AkG-U9-TdD"/>
|
<constraint firstItem="wbP-A9-jpw" firstAttribute="top" secondItem="VK8-z4-2ci" secondAttribute="bottom" constant="8" symbolic="YES" id="SjT-SU-tCe"/>
|
||||||
<constraint firstItem="Kvg-he-3c8" firstAttribute="leading" secondItem="buI-Wb-o3V" secondAttribute="trailing" constant="8" symbolic="YES" id="Khi-Pi-iBU"/>
|
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="Kvg-he-3c8" secondAttribute="trailing" constant="26" id="U4h-wP-3di"/>
|
||||||
<constraint firstItem="VK8-z4-2ci" firstAttribute="top" secondItem="9MH-jx-GpG" secondAttribute="bottom" constant="12" id="O4y-q6-wtM"/>
|
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="f5q-EW-RHf" secondAttribute="trailing" constant="26" id="Xme-uO-a5Z"/>
|
||||||
<constraint firstItem="wbP-A9-jpw" firstAttribute="top" secondItem="VK8-z4-2ci" secondAttribute="bottom" constant="8" symbolic="YES" id="OVF-L6-rLK"/>
|
<constraint firstItem="Kvg-he-3c8" firstAttribute="baseline" secondItem="f5q-EW-RHf" secondAttribute="baseline" constant="3" id="Zvz-jd-nLG"/>
|
||||||
<constraint firstItem="TiO-ah-BlR" firstAttribute="top" secondItem="DAX-V8-Say" secondAttribute="bottom" constant="6" symbolic="YES" id="RjQ-Al-xG7"/>
|
<constraint firstItem="Kvg-he-3c8" firstAttribute="top" secondItem="tik-Ar-FJg" secondAttribute="bottom" constant="8" symbolic="YES" id="bxR-sX-uV3"/>
|
||||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="f5q-EW-RHf" secondAttribute="trailing" constant="26" id="U3J-vD-O03"/>
|
<constraint firstItem="buI-Wb-o3V" firstAttribute="baseline" secondItem="Kvg-he-3c8" secondAttribute="baseline" id="her-EX-xCf"/>
|
||||||
<constraint firstItem="DAX-V8-Say" firstAttribute="top" secondItem="Kvg-he-3c8" secondAttribute="bottom" constant="12" id="W4U-F9-ZJc"/>
|
<constraint firstItem="9MH-jx-GpG" firstAttribute="top" secondItem="TiO-ah-BlR" secondAttribute="bottom" constant="6" symbolic="YES" id="mDj-Hg-CFH"/>
|
||||||
<constraint firstItem="VK8-z4-2ci" firstAttribute="leading" secondItem="wbP-A9-jpw" secondAttribute="leading" id="aII-Dc-SrH"/>
|
<constraint firstItem="tik-Ar-FJg" firstAttribute="leading" secondItem="buI-Wb-o3V" secondAttribute="leading" id="qDJ-3S-cPr"/>
|
||||||
<constraint firstItem="Kvg-he-3c8" firstAttribute="top" secondItem="tik-Ar-FJg" secondAttribute="bottom" constant="8" symbolic="YES" id="cn1-4v-XHZ"/>
|
<constraint firstItem="VK8-z4-2ci" firstAttribute="top" secondItem="9MH-jx-GpG" secondAttribute="bottom" constant="6" symbolic="YES" id="qaN-4g-KJh"/>
|
||||||
<constraint firstItem="tik-Ar-FJg" firstAttribute="leading" secondItem="buI-Wb-o3V" secondAttribute="leading" id="eVT-oc-Oz8"/>
|
<constraint firstItem="DAX-V8-Say" firstAttribute="leading" secondItem="tik-Ar-FJg" secondAttribute="leading" id="s2L-A8-WQ2"/>
|
||||||
<constraint firstItem="DAX-V8-Say" firstAttribute="leading" secondItem="tik-Ar-FJg" secondAttribute="leading" id="h3Q-Ek-YXQ"/>
|
<constraint firstItem="tik-Ar-FJg" firstAttribute="leading" secondItem="TiO-ah-BlR" secondAttribute="leading" id="uJP-4u-dr4"/>
|
||||||
<constraint firstAttribute="bottom" secondItem="wbP-A9-jpw" secondAttribute="bottom" constant="16" id="nFT-v0-cpZ"/>
|
|
||||||
<constraint firstItem="tik-Ar-FJg" firstAttribute="leading" secondItem="P9N-HM-wER" secondAttribute="leading" constant="16" id="rMB-zA-WBv"/>
|
|
||||||
<constraint firstItem="tik-Ar-FJg" firstAttribute="leading" secondItem="TiO-ah-BlR" secondAttribute="leading" id="tzg-JW-Xgm"/>
|
|
||||||
<constraint firstItem="VK8-z4-2ci" firstAttribute="leading" secondItem="9MH-jx-GpG" secondAttribute="leading" id="zxB-d2-oKp"/>
|
|
||||||
</constraints>
|
</constraints>
|
||||||
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
|
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
|
||||||
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||||
</box>
|
</box>
|
||||||
<box autoresizesSubviews="NO" verticalHuggingPriority="500" title="Preview" borderType="line" translatesAutoresizingMaskIntoConstraints="NO" id="VVs-b5-cX9">
|
<box autoresizesSubviews="NO" verticalHuggingPriority="500" title="Preview" borderType="line" translatesAutoresizingMaskIntoConstraints="NO" id="VVs-b5-cX9">
|
||||||
<rect key="frame" x="17" y="16" width="366" height="95"/>
|
<rect key="frame" x="17" y="16" width="366" height="95"/>
|
||||||
<view key="contentView">
|
<view key="contentView" id="ww4-uR-8gP">
|
||||||
<rect key="frame" x="1" y="1" width="364" height="79"/>
|
<rect key="frame" x="1" y="1" width="364" height="79"/>
|
||||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
<subviews>
|
<subviews>
|
||||||
<button misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="LNw-5t-TS4">
|
<button translatesAutoresizingMaskIntoConstraints="NO" id="LNw-5t-TS4">
|
||||||
<rect key="frame" x="16" y="53" width="183" height="18"/>
|
<rect key="frame" x="16" y="53" width="182" height="18"/>
|
||||||
<buttonCell key="cell" type="check" title="Enable Quicklook Preview" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="ERs-ct-Eyx">
|
<buttonCell key="cell" type="check" title="Enable Quicklook Preview" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="ERs-ct-Eyx">
|
||||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||||
<font key="font" metaFont="system"/>
|
<font key="font" metaFont="system"/>
|
||||||
</buttonCell>
|
</buttonCell>
|
||||||
</button>
|
</button>
|
||||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" misplaced="YES" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="V6l-R9-hIj">
|
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="V6l-R9-hIj">
|
||||||
<rect key="frame" x="16" y="19" width="322" height="28"/>
|
<rect key="frame" x="16" y="19" width="320" height="28"/>
|
||||||
<textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" title="If enabled attached files will be copied to a temporary location for preview and deleted after the preview is closed." id="WmI-IB-Aso">
|
<textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" title="If enabled attached files will be copied to a temporary location for preview and deleted after the preview is closed." id="WmI-IB-Aso">
|
||||||
<font key="font" metaFont="smallSystem"/>
|
<font key="font" metaFont="smallSystem"/>
|
||||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||||
@@ -176,12 +188,12 @@
|
|||||||
</subviews>
|
</subviews>
|
||||||
</view>
|
</view>
|
||||||
<constraints>
|
<constraints>
|
||||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="V6l-R9-hIj" secondAttribute="trailing" constant="16" id="6va-Ii-axg"/>
|
<constraint firstItem="V6l-R9-hIj" firstAttribute="leading" secondItem="VVs-b5-cX9" secondAttribute="leading" constant="16" id="4UQ-7R-4C6"/>
|
||||||
<constraint firstAttribute="bottom" secondItem="V6l-R9-hIj" secondAttribute="bottom" constant="16" id="W4Q-ec-J2U"/>
|
<constraint firstItem="V6l-R9-hIj" firstAttribute="top" secondItem="LNw-5t-TS4" secondAttribute="bottom" constant="8" id="DJD-D7-pAx"/>
|
||||||
<constraint firstItem="LNw-5t-TS4" firstAttribute="leading" secondItem="VVs-b5-cX9" secondAttribute="leading" constant="16" id="dgd-Gt-Zxu"/>
|
<constraint firstAttribute="bottom" secondItem="V6l-R9-hIj" secondAttribute="bottom" constant="16" id="GEG-HY-C2F"/>
|
||||||
<constraint firstItem="LNw-5t-TS4" firstAttribute="top" secondItem="VVs-b5-cX9" secondAttribute="top" constant="25" id="obp-WH-C6P"/>
|
<constraint firstItem="LNw-5t-TS4" firstAttribute="top" secondItem="VVs-b5-cX9" secondAttribute="top" constant="25" id="IhZ-TA-uHR"/>
|
||||||
<constraint firstItem="V6l-R9-hIj" firstAttribute="leading" secondItem="VVs-b5-cX9" secondAttribute="leading" constant="16" id="qDK-YA-moR"/>
|
<constraint firstItem="LNw-5t-TS4" firstAttribute="leading" secondItem="VVs-b5-cX9" secondAttribute="leading" constant="16" id="NsS-Nl-Lso"/>
|
||||||
<constraint firstItem="V6l-R9-hIj" firstAttribute="top" secondItem="LNw-5t-TS4" secondAttribute="bottom" constant="8" id="yiH-zj-kL4"/>
|
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="V6l-R9-hIj" secondAttribute="trailing" constant="16" id="ivY-UD-QFJ"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
|
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
|
||||||
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||||
|
|||||||
@@ -109,8 +109,8 @@ NSString *const kMPProcessIdentifierKey = @"kMPProcessIdentifierKey";
|
|||||||
#pragma mark -
|
#pragma mark -
|
||||||
#pragma mark Actions
|
#pragma mark Actions
|
||||||
- (void)performAutotypeWithSelectedMatch:(id)sender {
|
- (void)performAutotypeWithSelectedMatch:(id)sender {
|
||||||
NSMenuItem *item = [self.matchSelectionButton selectedItem];
|
NSMenuItem *item = self.matchSelectionButton.selectedItem;
|
||||||
MPAutotypeContext *context = [item representedObject];
|
MPAutotypeContext *context = item.representedObject;
|
||||||
[self.matchSelectionWindow orderOut:self];
|
[self.matchSelectionWindow orderOut:self];
|
||||||
[self _performAutotypeForContext:context];
|
[self _performAutotypeForContext:context];
|
||||||
}
|
}
|
||||||
@@ -131,17 +131,16 @@ NSString *const kMPProcessIdentifierKey = @"kMPProcessIdentifierKey";
|
|||||||
return; // We do not perform Autotype on ourselves
|
return; // We do not perform Autotype on ourselves
|
||||||
}
|
}
|
||||||
|
|
||||||
MPDocument *document = [self _findAutotypeDocument];
|
NSArray *documents = [self _findAutotypeDocuments];
|
||||||
if(!document) {
|
if(documents.count == 0) {
|
||||||
/* We do not have a document. This can be
|
/* We do not have a document. This can be
|
||||||
a) there is none - nothing happens
|
a) there is none - nothing happens
|
||||||
b) there is at least one, but locked - we get called again after the document has been unlocked
|
b) there is at least one, but locked - we get called again after the document has been unlocked
|
||||||
*/
|
*/
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
MPAutotypeContext *context = [self _autotypeContextForDocuments:documents forWindowTitle:self.targetWindowTitle preferredEntry:entryOrNil];
|
||||||
MPAutotypeContext *context = [self _autotypeContextInDocument:document forWindowTitle:self.targetWindowTitle preferredEntry:entryOrNil];
|
/* TODO: that's popping up if the mulit seleciton dialog goes up! */
|
||||||
/* TODO: that's popping up if the multi selection dialog goes up! */
|
|
||||||
if(!entryOrNil) {
|
if(!entryOrNil) {
|
||||||
NSImage *appIcon = [[NSApplication sharedApplication] applicationIconImage];
|
NSImage *appIcon = [[NSApplication sharedApplication] applicationIconImage];
|
||||||
NSString *label = context ? NSLocalizedString(@"AUTOTYPE_OVERLAY_SINGLE_MATCH", "") : NSLocalizedString(@"AUTOTYPE_OVERLAY_NO_MATCH", "");
|
NSString *label = context ? NSLocalizedString(@"AUTOTYPE_OVERLAY_SINGLE_MATCH", "") : NSLocalizedString(@"AUTOTYPE_OVERLAY_NO_MATCH", "");
|
||||||
@@ -150,36 +149,40 @@ NSString *const kMPProcessIdentifierKey = @"kMPProcessIdentifierKey";
|
|||||||
[self _performAutotypeForContext:context];
|
[self _performAutotypeForContext:context];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (MPDocument *)_findAutotypeDocument {
|
- (NSArray<MPDocument *> *)_findAutotypeDocuments {
|
||||||
|
|
||||||
NSArray *documents = [NSApp orderedDocuments];
|
NSArray *documents = [NSApp orderedDocuments];
|
||||||
MPDocument *currentDocument = nil;
|
NSPredicate *filterPredicate = [NSPredicate predicateWithBlock:^BOOL(id _Nonnull evaluatedObject, NSDictionary<NSString *,id> * _Nullable bindings) {
|
||||||
for(MPDocument *openDocument in documents) {
|
MPDocument *document = evaluatedObject;
|
||||||
if(NO == openDocument.encrypted) {
|
return document.encrypted;}];
|
||||||
currentDocument = openDocument;
|
NSArray *unlockedDocuments = [documents filteredArrayUsingPredicate:filterPredicate];
|
||||||
break;
|
/* We look for all unlocked documents, if all open documents are locked, we pop the front most and try to search again */
|
||||||
}
|
if(unlockedDocuments.count == 0 && documents.count > 0) {
|
||||||
}
|
|
||||||
BOOL hasOpenDocuments = [documents count] > 0;
|
|
||||||
if(!currentDocument && hasOpenDocuments) {
|
|
||||||
[NSApp activateIgnoringOtherApps:YES];
|
[NSApp activateIgnoringOtherApps:YES];
|
||||||
[[NSApp mainWindow] makeKeyAndOrderFront:self];
|
[[NSApp mainWindow] makeKeyAndOrderFront:self];
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didUnlockDatabase:) name:MPDocumentDidUnlockDatabaseNotification object:nil];
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didUnlockDatabase:) name:MPDocumentDidUnlockDatabaseNotification object:nil];
|
||||||
}
|
}
|
||||||
return currentDocument;
|
return unlockedDocuments;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (MPAutotypeContext *)_autotypeContextInDocument:(MPDocument *)document forWindowTitle:(NSString *)windowTitle preferredEntry:(KPKEntry *)entry {
|
- (MPAutotypeContext *)_autotypeContextForDocuments:(NSArray<MPDocument *> *)documents forWindowTitle:(NSString *)windowTitle preferredEntry:(KPKEntry *)entry {
|
||||||
/*
|
/*
|
||||||
Query the document to generate a autotype command list for the window title
|
Query the document to generate a autotype command list for the window title
|
||||||
We do not care where this came form, just get the autotype commands
|
We do not care where this came form, just get the autotype commands
|
||||||
*/
|
*/
|
||||||
NSArray *autotypeCandidates = [document autotypContextsForWindowTitle:windowTitle preferredEntry:entry];
|
NSMutableArray *autotypeCandidates = [[NSMutableArray alloc] init];
|
||||||
NSUInteger candidates = [autotypeCandidates count];
|
for(MPDocument *document in documents) {
|
||||||
|
NSArray *contexts = [document autotypContextsForWindowTitle:windowTitle preferredEntry:entry];
|
||||||
|
if(contexts ) {
|
||||||
|
[autotypeCandidates addObjectsFromArray:contexts];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
NSUInteger candidates = autotypeCandidates.count;
|
||||||
if(candidates == 0) {
|
if(candidates == 0) {
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
if(candidates == 1 ) {
|
if(candidates == 1 ) {
|
||||||
return [autotypeCandidates lastObject];
|
return autotypeCandidates.lastObject;
|
||||||
}
|
}
|
||||||
[self _presentSelectionWindow:autotypeCandidates];
|
[self _presentSelectionWindow:autotypeCandidates];
|
||||||
return nil; // Nothing to do, we get called back by the window
|
return nil; // Nothing to do, we get called back by the window
|
||||||
@@ -191,11 +194,11 @@ NSString *const kMPProcessIdentifierKey = @"kMPProcessIdentifierKey";
|
|||||||
}
|
}
|
||||||
if([self _orderApplicationToFront:self.targetPID]) {
|
if([self _orderApplicationToFront:self.targetPID]) {
|
||||||
/* Sleep a bit after the app was activated */
|
/* Sleep a bit after the app was activated */
|
||||||
/* TODO - we can use a saver way and use a notification to check if the app actually was activated */
|
/* TODO - we can use a saver way and use a notification to chekc if the app actally was activated */
|
||||||
usleep(1 * NSEC_PER_MSEC);
|
usleep(1 * NSEC_PER_MSEC);
|
||||||
}
|
}
|
||||||
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
|
||||||
NSArray *commands = [MPAutotypeCommand commandsForContext:context];
|
NSArray<MPAutotypeCommand *> *commands = [MPAutotypeCommand commandsForContext:context];
|
||||||
for(MPAutotypeCommand *command in commands) {
|
for(MPAutotypeCommand *command in commands) {
|
||||||
[command execute];
|
[command execute];
|
||||||
}
|
}
|
||||||
@@ -230,7 +233,7 @@ NSString *const kMPProcessIdentifierKey = @"kMPProcessIdentifierKey";
|
|||||||
NSArray *currentWindows = CFBridgingRelease(CGWindowListCopyWindowInfo(kCGWindowListOptionOnScreenOnly | kCGWindowListExcludeDesktopElements, kCGNullWindowID));
|
NSArray *currentWindows = CFBridgingRelease(CGWindowListCopyWindowInfo(kCGWindowListOptionOnScreenOnly | kCGWindowListExcludeDesktopElements, kCGNullWindowID));
|
||||||
for(NSDictionary *windowDict in currentWindows) {
|
for(NSDictionary *windowDict in currentWindows) {
|
||||||
NSString *windowTitle = windowDict[(NSString *)kCGWindowName];
|
NSString *windowTitle = windowDict[(NSString *)kCGWindowName];
|
||||||
if([windowTitle length] <= 0) {
|
if(windowTitle.length <= 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
NSNumber *processId = windowDict[(NSString *)kCGWindowOwnerPID];
|
NSNumber *processId = windowDict[(NSString *)kCGWindowOwnerPID];
|
||||||
@@ -247,12 +250,12 @@ NSString *const kMPProcessIdentifierKey = @"kMPProcessIdentifierKey";
|
|||||||
- (void)_presentSelectionWindow:(NSArray *)candidates {
|
- (void)_presentSelectionWindow:(NSArray *)candidates {
|
||||||
if(!self.matchSelectionWindow) {
|
if(!self.matchSelectionWindow) {
|
||||||
[[NSBundle mainBundle] loadNibNamed:@"AutotypeCandidateSelectionWindow" owner:self topLevelObjects:nil];
|
[[NSBundle mainBundle] loadNibNamed:@"AutotypeCandidateSelectionWindow" owner:self topLevelObjects:nil];
|
||||||
[self.matchSelectionWindow setLevel:NSFloatingWindowLevel];
|
self.matchSelectionWindow.level = NSFloatingWindowLevel;
|
||||||
}
|
}
|
||||||
NSMenu *associationMenu = [[NSMenu alloc] init];
|
NSMenu *associationMenu = [[NSMenu alloc] init];
|
||||||
[associationMenu addItemWithTitle:NSLocalizedString(@"SELECT_AUTOTYPE_CANDIDATE", "") action:NULL keyEquivalent:@""];
|
[associationMenu addItemWithTitle:NSLocalizedString(@"SELECT_AUTOTYPE_CANDIDATE", "") action:NULL keyEquivalent:@""];
|
||||||
[associationMenu addItem:[NSMenuItem separatorItem]];
|
[associationMenu addItem:[NSMenuItem separatorItem]];
|
||||||
[associationMenu setAutoenablesItems:NO];
|
associationMenu.autoenablesItems = NO;
|
||||||
for(MPAutotypeContext *context in candidates) {
|
for(MPAutotypeContext *context in candidates) {
|
||||||
NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:context.entry.title action:0 keyEquivalent:@""];
|
NSMenuItem *item = [[NSMenuItem alloc] initWithTitle:context.entry.title action:0 keyEquivalent:@""];
|
||||||
[item setRepresentedObject:context];
|
[item setRepresentedObject:context];
|
||||||
@@ -263,12 +266,12 @@ NSString *const kMPProcessIdentifierKey = @"kMPProcessIdentifierKey";
|
|||||||
|
|
||||||
for(NSString *value in attributes) {
|
for(NSString *value in attributes) {
|
||||||
NSMenuItem *valueItem = [[NSMenuItem alloc] initWithTitle:value action:NULL keyEquivalent:@""];
|
NSMenuItem *valueItem = [[NSMenuItem alloc] initWithTitle:value action:NULL keyEquivalent:@""];
|
||||||
[valueItem setIndentationLevel:1];
|
valueItem.indentationLevel = 1;
|
||||||
[valueItem setEnabled:NO];
|
valueItem.enabled = NO;
|
||||||
[associationMenu addItem:valueItem];
|
[associationMenu addItem:valueItem];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[self.matchSelectionButton setMenu:associationMenu];
|
self.matchSelectionButton.menu = associationMenu;
|
||||||
[self.matchSelectionWindow makeKeyAndOrderFront:self];
|
[self.matchSelectionWindow makeKeyAndOrderFront:self];
|
||||||
[NSApp activateIgnoringOtherApps:YES];
|
[NSApp activateIgnoringOtherApps:YES];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,11 +23,14 @@
|
|||||||
#import "MPDocument.h"
|
#import "MPDocument.h"
|
||||||
#import "MPAutotypeContext.h"
|
#import "MPAutotypeContext.h"
|
||||||
|
|
||||||
|
#import "KPKNode.h"
|
||||||
#import "KPKGroup.h"
|
#import "KPKGroup.h"
|
||||||
#import "KPKEntry.h"
|
#import "KPKEntry.h"
|
||||||
#import "KPKAutotype.h"
|
#import "KPKAutotype.h"
|
||||||
#import "KPKWindowAssociation.h"
|
#import "KPKWindowAssociation.h"
|
||||||
|
|
||||||
|
#import "MPSettingsHelper.h"
|
||||||
|
|
||||||
@implementation MPDocument (Autotype)
|
@implementation MPDocument (Autotype)
|
||||||
|
|
||||||
+ (BOOL)isCandidateForMalformedAutotype:(id)item {
|
+ (BOOL)isCandidateForMalformedAutotype:(id)item {
|
||||||
@@ -51,37 +54,58 @@
|
|||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
BOOL usePreferredEntry = (nil != entry);
|
BOOL usePreferredEntry = (nil != entry);
|
||||||
|
/* We might get a preferred entry from other documents, if so, stop searching and return */
|
||||||
|
if(usePreferredEntry && entry.rootGroup != self.root) {
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
NSArray *autotypeEntries = usePreferredEntry ? [[NSArray alloc] initWithObjects:entry, nil] : [self.root autotypeableChildEntries];
|
NSArray *autotypeEntries = usePreferredEntry ? [[NSArray alloc] initWithObjects:entry, nil] : [self.root autotypeableChildEntries];
|
||||||
NSMutableArray *contexts = [[NSMutableArray alloc] initWithCapacity:MAX(1,ceil([autotypeEntries count] / 4.0))];
|
NSMutableArray *contexts = [[NSMutableArray alloc] initWithCapacity:MAX(1,ceil(autotypeEntries.count / 4.0))];
|
||||||
|
|
||||||
|
BOOL matchTitle = [[NSUserDefaults standardUserDefaults] boolForKey:kMPSettingsKeyAutotypeMatchTitle];
|
||||||
|
BOOL matchURL = [[NSUserDefaults standardUserDefaults] boolForKey:kMPSettingsKeyAutotypeMatchURL];
|
||||||
|
BOOL matchHost = [[NSUserDefaults standardUserDefaults] boolForKey:kMPSettingsKeyAutotypeMatchHost];
|
||||||
|
BOOL matchTags = [[NSUserDefaults standardUserDefaults] boolForKey:kMPSettingsKeyAutotypeMatchTags];
|
||||||
|
|
||||||
MPAutotypeContext *context;
|
MPAutotypeContext *context;
|
||||||
for(KPKEntry *entry in autotypeEntries) {
|
for(KPKEntry *entry in autotypeEntries) {
|
||||||
/* TODO:
|
|
||||||
|
|
||||||
KeePass for Windows has the following options for matching:
|
|
||||||
Title is contained
|
|
||||||
URL is contained
|
|
||||||
Host component is contained
|
|
||||||
A tag is contained
|
|
||||||
|
|
||||||
*/
|
|
||||||
/* Test for entry title in window title */
|
|
||||||
NSRange titleRange = [windowTitle rangeOfString:entry.title options:NSCaseInsensitiveSearch];
|
|
||||||
/* Test for window title in entry title */
|
|
||||||
if (titleRange.location == NSNotFound || titleRange.length == 0) {
|
|
||||||
titleRange = [entry.title rangeOfString:windowTitle options:NSCaseInsensitiveSearch];
|
|
||||||
}
|
|
||||||
if(titleRange.location != NSNotFound && titleRange.length != 0) {
|
|
||||||
context = [[MPAutotypeContext alloc] initWithEntry:entry andSequence:entry.autotype.defaultKeystrokeSequence];
|
|
||||||
}
|
|
||||||
/* search in Autotype entries for match */
|
/* search in Autotype entries for match */
|
||||||
else {
|
KPKWindowAssociation *association = [entry.autotype windowAssociationMatchingWindowTitle:windowTitle];
|
||||||
KPKWindowAssociation *association = [entry.autotype windowAssociationMatchingWindowTitle:windowTitle];
|
context = [[MPAutotypeContext alloc] initWithWindowAssociation:association];
|
||||||
context = [[MPAutotypeContext alloc] initWithWindowAssociation:association];
|
|
||||||
}
|
|
||||||
if(context.valid) {
|
if(context.valid) {
|
||||||
[contexts addObject:context];
|
[contexts addObject:context];
|
||||||
|
continue; // association did match
|
||||||
|
}
|
||||||
|
BOOL foundMatch = NO;
|
||||||
|
/* Test for entry title in window title */
|
||||||
|
if(matchTitle && !foundMatch) {
|
||||||
|
foundMatch = [windowTitle rangeOfString:entry.title options:NSCaseInsensitiveSearch].length != 0 || [entry.title rangeOfString:windowTitle options:NSCaseInsensitiveSearch].length != 0;
|
||||||
|
}
|
||||||
|
/* test for URL */
|
||||||
|
if(matchURL && !foundMatch) {
|
||||||
|
foundMatch = [windowTitle rangeOfString:entry.url options:NSCaseInsensitiveSearch].length != 0;
|
||||||
|
}
|
||||||
|
/* test for host */
|
||||||
|
if(matchHost && foundMatch) {
|
||||||
|
//TODO:
|
||||||
|
}
|
||||||
|
/* test for tags */
|
||||||
|
if(matchTags && !context.valid) {
|
||||||
|
NSArray *tags = [entry.tags componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@".:;"]];
|
||||||
|
for(NSString *tag in tags) {
|
||||||
|
foundMatch = ([windowTitle rangeOfString:tag options:NSCaseInsensitiveSearch].length != 0);
|
||||||
|
if(foundMatch) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(foundMatch) {
|
||||||
|
context = [[MPAutotypeContext alloc] initWithDefaultSequenceForEntry:entry];
|
||||||
|
if(context.valid) {
|
||||||
|
[contexts addObject:context];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fall back to preferred Entry if no match was found */
|
/* Fall back to preferred Entry if no match was found */
|
||||||
if(contexts.count == 0 && usePreferredEntry) {
|
if(contexts.count == 0 && usePreferredEntry) {
|
||||||
context = [[MPAutotypeContext alloc] initWithEntry:entry andSequence:entry.autotype.defaultKeystrokeSequence];
|
context = [[MPAutotypeContext alloc] initWithEntry:entry andSequence:entry.autotype.defaultKeystrokeSequence];
|
||||||
@@ -116,5 +140,4 @@
|
|||||||
[self _flattenGroup:childGroup toArray:array];
|
[self _flattenGroup:childGroup toArray:array];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
@property (weak) IBOutlet DDHotKeyTextField *hotKeyTextField;
|
@property (weak) IBOutlet DDHotKeyTextField *hotKeyTextField;
|
||||||
@property (weak) IBOutlet NSTextField *hotkeyWarningTextField;
|
@property (weak) IBOutlet NSTextField *hotkeyWarningTextField;
|
||||||
|
|
||||||
|
@property (weak) IBOutlet NSButton *matchTitleCheckBox;
|
||||||
@property (weak) IBOutlet NSButton *matchURLCheckBox;
|
@property (weak) IBOutlet NSButton *matchURLCheckBox;
|
||||||
@property (weak) IBOutlet NSButton *matchHostCheckBox;
|
@property (weak) IBOutlet NSButton *matchHostCheckBox;
|
||||||
@property (weak) IBOutlet NSButton *matchTagsCheckBox;
|
@property (weak) IBOutlet NSButton *matchTagsCheckBox;
|
||||||
|
|||||||
@@ -50,11 +50,11 @@
|
|||||||
[self.hotKeyTextField bind:NSEnabledBinding toObject:defaultsController withKeyPath:enableGlobalAutotypeKeyPath options:nil];
|
[self.hotKeyTextField bind:NSEnabledBinding toObject:defaultsController withKeyPath:enableGlobalAutotypeKeyPath options:nil];
|
||||||
self.hotKeyTextField.delegate = self;
|
self.hotKeyTextField.delegate = self;
|
||||||
|
|
||||||
/*
|
|
||||||
|
[self.matchTitleCheckBox bind:NSValueBinding toObject:defaultsController withKeyPath:[MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyAutotypeMatchTitle ] options:nil];
|
||||||
|
[self.matchURLCheckBox bind:NSValueBinding toObject:defaultsController withKeyPath:[MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyAutotypeMatchURL] options:nil];
|
||||||
[self.matchHostCheckBox bind:NSValueBinding toObject:defaultsController withKeyPath:[MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyAutotypeMatchHost] options:nil];
|
[self.matchHostCheckBox bind:NSValueBinding toObject:defaultsController withKeyPath:[MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyAutotypeMatchHost] options:nil];
|
||||||
[self.matchTagsCheckBox bind:NSValueBinding toObject:defaultsController withKeyPath:[MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyAutotypeMatchTags] options:nil];
|
[self.matchTagsCheckBox bind:NSValueBinding toObject:defaultsController withKeyPath:[MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyAutotypeMatchTags] options:nil];
|
||||||
[self.matchURLCheckBox bind:NSValueBinding toObject:defaultsController withKeyPath:[MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeyAutotypeMatchURL] options:nil];
|
|
||||||
*/
|
|
||||||
|
|
||||||
[self.sendCommandForControlCheckBox bind:NSValueBinding toObject:defaultsController withKeyPath:[MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeySendCommandForControlKey] options:nil];
|
[self.sendCommandForControlCheckBox bind:NSValueBinding toObject:defaultsController withKeyPath:[MPSettingsHelper defaultControllerPathForKey:kMPSettingsKeySendCommandForControlKey] options:nil];
|
||||||
|
|
||||||
|
|||||||
@@ -50,9 +50,10 @@ APPKIT_EXTERN NSString *const kMPSettingsKeySendCommandForControlKey; //
|
|||||||
APPKIT_EXTERN NSString *const kMPSettingsKeyEnableGlobalAutotype; // Is Global Autotype enabled?
|
APPKIT_EXTERN NSString *const kMPSettingsKeyEnableGlobalAutotype; // Is Global Autotype enabled?
|
||||||
APPKIT_EXTERN NSString *const kMPSettingsKeyGlobalAutotypeKeyDataKey; // The stored Data for the user defined global autotype key
|
APPKIT_EXTERN NSString *const kMPSettingsKeyGlobalAutotypeKeyDataKey; // The stored Data for the user defined global autotype key
|
||||||
APPKIT_EXTERN NSString *const kMPSettingsKeyDefaultGlobalAutotypeSequence; // Default sequence used for Autotype
|
APPKIT_EXTERN NSString *const kMPSettingsKeyDefaultGlobalAutotypeSequence; // Default sequence used for Autotype
|
||||||
APPKIT_EXTERN NSString *const kMPSettingsKeyAutotypeMatchURL; // Autotype lookup included entry URL
|
APPKIT_EXTERN NSString *const kMPSettingsKeyAutotypeMatchTitle; // Autotype lookup includes entry title
|
||||||
APPKIT_EXTERN NSString *const kMPSettingsKeyAutotypeMatchHost; // Autotype lookup included host part of entry URL
|
APPKIT_EXTERN NSString *const kMPSettingsKeyAutotypeMatchURL; // Autotype lookup includes entry URL
|
||||||
APPKIT_EXTERN NSString *const kMPSettingsKeyAutotypeMatchTags; // Autotype lookup included tags for entries
|
APPKIT_EXTERN NSString *const kMPSettingsKeyAutotypeMatchHost; // Autotype lookup includes host part of entry URL
|
||||||
|
APPKIT_EXTERN NSString *const kMPSettingsKeyAutotypeMatchTags; // Autotype lookup includes tags for entries
|
||||||
|
|
||||||
/* Search */
|
/* Search */
|
||||||
APPKIT_EXTERN NSString *const kMPSettingsKeyEntrySearchFilterContext;
|
APPKIT_EXTERN NSString *const kMPSettingsKeyEntrySearchFilterContext;
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ NSString *const kMPSettingsKeySendCommandForControlKey = @"SendCo
|
|||||||
NSString *const kMPSettingsKeyEnableGlobalAutotype = @"EnableGlobalAutotype";
|
NSString *const kMPSettingsKeyEnableGlobalAutotype = @"EnableGlobalAutotype";
|
||||||
NSString *const kMPSettingsKeyGlobalAutotypeKeyDataKey = @"GlobalAutotypeKeyDataKey";
|
NSString *const kMPSettingsKeyGlobalAutotypeKeyDataKey = @"GlobalAutotypeKeyDataKey";
|
||||||
NSString *const kMPSettingsKeyDefaultGlobalAutotypeSequence = @"DefaultGlobalAutotypeSequence";
|
NSString *const kMPSettingsKeyDefaultGlobalAutotypeSequence = @"DefaultGlobalAutotypeSequence";
|
||||||
|
NSString *const kMPSettingsKeyAutotypeMatchTitle = @"AutotypeMatchTitle";
|
||||||
NSString *const kMPSettingsKeyAutotypeMatchURL = @"AutotypeMatchURL";
|
NSString *const kMPSettingsKeyAutotypeMatchURL = @"AutotypeMatchURL";
|
||||||
NSString *const kMPSettingsKeyAutotypeMatchHost = @"AutotypeMatchHost";
|
NSString *const kMPSettingsKeyAutotypeMatchHost = @"AutotypeMatchHost";
|
||||||
NSString *const kMPSettingsKeyAutotypeMatchTags = @"AutotypeMatchTags";
|
NSString *const kMPSettingsKeyAutotypeMatchTags = @"AutotypeMatchTags";
|
||||||
@@ -108,6 +109,7 @@ NSString *const kMPDeprecatedSettingsKeyEntrySearchFilterMode = @"En
|
|||||||
kMPSettingsKeyEnableGlobalAutotype: @NO,
|
kMPSettingsKeyEnableGlobalAutotype: @NO,
|
||||||
kMPSettingsKeyGlobalAutotypeKeyDataKey: [[DDHotKey defaultHotKey] keyData],
|
kMPSettingsKeyGlobalAutotypeKeyDataKey: [[DDHotKey defaultHotKey] keyData],
|
||||||
kMPSettingsKeyDefaultGlobalAutotypeSequence: @"{USERNAME}{TAB}{PASSWORD}{ENTER}",
|
kMPSettingsKeyDefaultGlobalAutotypeSequence: @"{USERNAME}{TAB}{PASSWORD}{ENTER}",
|
||||||
|
kMPSettingsKeyAutotypeMatchTitle: @YES,
|
||||||
kMPSettingsKeyAutotypeMatchURL: @NO,
|
kMPSettingsKeyAutotypeMatchURL: @NO,
|
||||||
kMPSettingsKeyAutotypeMatchHost: @NO,
|
kMPSettingsKeyAutotypeMatchHost: @NO,
|
||||||
kMPSettingsKeyAutotypeMatchTags: @NO,
|
kMPSettingsKeyAutotypeMatchTags: @NO,
|
||||||
|
|||||||
Reference in New Issue
Block a user