mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-19 03:49:21 +00:00
started modularization of entry inspector
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="17156" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="19529" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="17156"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="19529"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
@@ -44,7 +44,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="x9d-0h-hyJ">
|
||||
<rect key="frame" x="38" y="321" width="236" height="32"/>
|
||||
<rect key="frame" x="37" y="322" width="230" height="32"/>
|
||||
<buttonCell key="cell" type="push" title="Open Accessibilty Preferences…" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="8m1-vs-pd5">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
@@ -54,20 +54,20 @@
|
||||
</connections>
|
||||
</button>
|
||||
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="vvZ-Lj-v22">
|
||||
<rect key="frame" x="20" y="283" width="16" height="16"/>
|
||||
<rect key="frame" x="20" y="284" width="16" height="16"/>
|
||||
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="NSStatusAvailable" id="kCX-CB-5vQ"/>
|
||||
</imageView>
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" verticalCompressionResistancePriority="751" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="6vq-iM-inn">
|
||||
<rect key="frame" x="42" y="177" width="340" height="98"/>
|
||||
<rect key="frame" x="42" y="164" width="340" height="112"/>
|
||||
<textFieldCell key="cell" controlSize="small" selectable="YES" id="7of-1z-Nfk">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<string key="title">MacPass will read every window title when Global Autotype is executed to find a match. Since macOS 10.15 Catalina it is not possible to read any window title, if the user has not granted permissions to record the screen. If you are running macOS 10.15 or higher, MacPass will check if it can read every window title of currently visible windows. This test will not read the actual title. The titles aren't stored or processed in any way.</string>
|
||||
<string key="title">MacPass will read every window title when Autotype or Global Autotype is executed to find a match. Since macOS 10.15 Catalina it is not possible to read any window title, if the user has not granted permissions to record the screen. If you are running macOS 10.15 or higher, MacPass will check if it can read every window title of currently visible windows. This test will not read the actual title. The titles aren't stored or processed in any way.</string>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="IP0-CP-tlA">
|
||||
<rect key="frame" x="42" y="283" width="112" height="16"/>
|
||||
<rect key="frame" x="42" y="284" width="112" height="16"/>
|
||||
<textFieldCell key="cell" lineBreakMode="clipping" title="Screen Recording" id="9gr-mz-2I4">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -75,10 +75,10 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="BHb-cd-Q0r">
|
||||
<rect key="frame" x="20" y="305" width="360" height="5"/>
|
||||
<rect key="frame" x="20" y="306" width="360" height="5"/>
|
||||
</box>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="d5Z-hD-bpr">
|
||||
<rect key="frame" x="38" y="129" width="177" height="32"/>
|
||||
<rect key="frame" x="37" y="117" width="172" height="32"/>
|
||||
<buttonCell key="cell" type="push" title="Request Permissions…" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="1Nx-Cg-TCn">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
@@ -88,7 +88,7 @@
|
||||
</connections>
|
||||
</button>
|
||||
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" preferredMaxLayoutWidth="336" translatesAutoresizingMaskIntoConstraints="NO" id="cu4-Jq-eaS">
|
||||
<rect key="frame" x="42" y="86" width="340" height="42"/>
|
||||
<rect key="frame" x="42" y="74" width="340" height="42"/>
|
||||
<textFieldCell key="cell" selectable="YES" id="Mhg-rd-1hK">
|
||||
<font key="font" metaFont="smallSystem"/>
|
||||
<string key="title">To request Screen Recording permissions, MacPass will try to capture a 1 by 1 Pixel sized screenshot of the top left part of your screen. The data is not stored nor processed in any way.</string>
|
||||
@@ -97,7 +97,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="dek-ho-dPm">
|
||||
<rect key="frame" x="38" y="50" width="271" height="32"/>
|
||||
<rect key="frame" x="37" y="39" width="266" height="32"/>
|
||||
<buttonCell key="cell" type="push" title="Open Screen Recording Preferences…" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="lgB-Ys-L9R">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
<rect key="frame" x="20" y="26" width="233" height="396"/>
|
||||
<clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="F3N-QI-Di5">
|
||||
<rect key="frame" x="1" y="1" width="231" height="394"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" multipleSelection="NO" autosaveColumns="NO" rowHeight="36" rowSizeStyle="automatic" viewBased="YES" id="137">
|
||||
<rect key="frame" x="0.0" y="0.0" width="231" height="394"/>
|
||||
@@ -259,10 +259,10 @@
|
||||
<constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="82" secondAttribute="trailing" constant="20" symbolic="YES" id="4df-0Y-ggz"/>
|
||||
<constraint firstItem="82" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="3" secondAttribute="leading" constant="20" symbolic="YES" id="zU6-5h-Swa"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="-680" y="-1408"/>
|
||||
<point key="canvasLocation" x="-457" y="-1614"/>
|
||||
</view>
|
||||
<customView translatesAutoresizingMaskIntoConstraints="NO" id="4" customClass="HNHUIScrollDocumentViewAdapter">
|
||||
<rect key="frame" x="0.0" y="0.0" width="291" height="484"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="291" height="840"/>
|
||||
<subviews>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" horizontalCompressionResistancePriority="249" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="0U8-TS-giU">
|
||||
<rect key="frame" x="18" y="77" width="32" height="14"/>
|
||||
@@ -309,7 +309,7 @@
|
||||
</connections>
|
||||
</segmentedControl>
|
||||
<stackView distribution="fill" orientation="vertical" alignment="leading" horizontalStackHuggingPriority="250" verticalStackHuggingPriority="250" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="dx3-E2-FFt">
|
||||
<rect key="frame" x="20" y="135" width="251" height="329"/>
|
||||
<rect key="frame" x="20" y="491" width="251" height="329"/>
|
||||
<subviews>
|
||||
<textField horizontalHuggingPriority="249" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="52">
|
||||
<rect key="frame" x="-2" y="315" width="255" height="14"/>
|
||||
@@ -533,7 +533,7 @@
|
||||
<constraint firstItem="dx3-E2-FFt" firstAttribute="leading" secondItem="4" secondAttribute="leading" constant="20" symbolic="YES" id="sjr-Xo-zxh"/>
|
||||
<constraint firstItem="G9J-nn-2bu" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="4" secondAttribute="leading" constant="20" symbolic="YES" id="z4K-PB-Qfb"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="-310" y="-1413"/>
|
||||
<point key="canvasLocation" x="-104.5" y="-1440"/>
|
||||
</customView>
|
||||
<view translatesAutoresizingMaskIntoConstraints="NO" id="zv7-wE-Bmg" customClass="HNHUIScrollDocumentViewAdapter">
|
||||
<rect key="frame" x="0.0" y="0.0" width="301" height="424"/>
|
||||
@@ -764,7 +764,7 @@
|
||||
<constraint firstAttribute="trailing" secondItem="45R-v4-ywl" secondAttribute="trailing" constant="20" symbolic="YES" id="uUm-S5-cxM"/>
|
||||
<constraint firstAttribute="trailing" secondItem="z03-zW-GN3" secondAttribute="trailing" constant="20" symbolic="YES" id="wiq-pY-TG8"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="145.5" y="-1275"/>
|
||||
<point key="canvasLocation" x="244" y="-1648"/>
|
||||
</view>
|
||||
<scrollView borderType="line" autohidesScrollers="YES" horizontalLineScroll="56" horizontalPageScroll="10" verticalLineScroll="56" verticalPageScroll="10" usesPredominantAxisScrolling="NO" horizontalScrollElasticity="none" translatesAutoresizingMaskIntoConstraints="NO" id="180" customClass="HNHUIScrollView">
|
||||
<rect key="frame" x="0.0" y="0.0" width="290" height="268"/>
|
||||
|
||||
@@ -11,6 +11,19 @@
|
||||
#import <KeePassKit/KeePassKit.h>
|
||||
#import "MPPasteBoardController.h"
|
||||
|
||||
NSString *nameForDefaultKey(NSString *key) {
|
||||
static NSDictionary *mapping;
|
||||
static dispatch_once_t onceToken;
|
||||
dispatch_once(&onceToken, ^{
|
||||
mapping = @{ kKPKTitleKey: NSLocalizedString(@"TITTLE_ATTRIBUTE_KEY", @"Localized name for title attribute"),
|
||||
kKPKUsernameKey: NSLocalizedString(@"USERNAME_ATTRIBUTE_KEY", @"Localized name for username attribute"),
|
||||
kKPKPasswordKey: NSLocalizedString(@"PASSEORD_ATTRIBUTE_KEY", @"Localized name for password attribute"),
|
||||
kKPKURLKey: NSLocalizedString(@"URL_ATTRIBUTE_KEY", @"Localized name for URL attribute") };
|
||||
});
|
||||
return mapping[key];
|
||||
}
|
||||
|
||||
|
||||
@interface MPEntryAttributeViewController () {
|
||||
BOOL _isDefaultAttribute;
|
||||
}
|
||||
@@ -90,6 +103,18 @@
|
||||
}
|
||||
_isDefaultAttribute = self.representedAttribute.isDefault;
|
||||
[self updateValues];
|
||||
[self updateEditing];
|
||||
}
|
||||
|
||||
-(void)commitChanges {
|
||||
if(!self.isEditor) {
|
||||
// do not commit changes if we are no editor!
|
||||
}
|
||||
// FIXME: better handling of key uniqueness
|
||||
if(!_isDefaultAttribute) {
|
||||
self.representedAttribute.key = self.keyTextField.stringValue;
|
||||
}
|
||||
self.representedAttribute.value = self.valueTextField.stringValue;
|
||||
}
|
||||
|
||||
- (BOOL)textField:(NSTextField *)textField textView:(NSTextView *)textView performAction:(SEL)action {
|
||||
@@ -110,10 +135,9 @@
|
||||
if([self.representedAttribute.key isEqual:kKPKUsernameKey]) {
|
||||
info = MPPasteboardOverlayInfoUsername;
|
||||
}
|
||||
/*else if([self.representedAttribute.key isEqual:kKPKPasswordKey]) {
|
||||
else if([self.representedAttribute.key isEqual:kKPKPasswordKey]) {
|
||||
info = MPPasteboardOverlayInfoPassword;
|
||||
}
|
||||
*/
|
||||
else if([self.representedAttribute.key isEqual:kKPKURLKey]) {
|
||||
info = MPPasteboardOverlayInfoURL;
|
||||
}
|
||||
@@ -138,7 +162,16 @@
|
||||
|
||||
- (void)updateValues {
|
||||
self.view.hidden = (!self.isEditor && self.representedAttribute.value.length == 0);
|
||||
|
||||
NSString *localizedKey = nameForDefaultKey(self.representedAttribute.key);
|
||||
if(localizedKey) {
|
||||
self.keyTextField.stringValue = localizedKey;
|
||||
}
|
||||
else {
|
||||
self.keyTextField.stringValue = self.representedAttribute.key ? self.representedAttribute.key : @"";
|
||||
}
|
||||
self.keyTextField.stringValue = self.representedAttribute.key ? self.representedAttribute.key : @"";
|
||||
|
||||
self.valueTextField.stringValue = self.representedAttribute.value ? self.representedAttribute.value : @"";
|
||||
self.valueTextField.showPassword = !self.representedAttribute.protect;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="18122" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="19529" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="18122"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="19529"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#import "MPTOTPViewController.h"
|
||||
#import "MPTOTPSetupViewController.h"
|
||||
#import "MPEntryAttributeViewController.h"
|
||||
#import "MPEntryPasswordAttributeViewController.h"
|
||||
#import "MPNodeExpirationViewController.h"
|
||||
|
||||
#import "MPPrettyPasswordTransformer.h"
|
||||
@@ -61,18 +62,6 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
||||
MPEntryTabAutotype
|
||||
};
|
||||
|
||||
typedef NS_ENUM(NSUInteger, MPInpspectorEditorIndex) {
|
||||
MPInpspectorEditorIndexImageEditor,
|
||||
MPInpspectorEditorIndexTitle,
|
||||
MPInpspectorEditorIndexUsername,
|
||||
MPInpspectorEditorIndexPassword,
|
||||
MPInpspectorEditorIndexURL,
|
||||
MPInpspectorEditorIndexExpires,
|
||||
MPInpspectorEditorIndexTags,
|
||||
MPInpspectorEditorIndexDefaultCount
|
||||
};
|
||||
|
||||
|
||||
@interface NSObject (MPAppKitPrivateAPI)
|
||||
- (void)_searchWithGoogleFromMenu:(id)obj;
|
||||
@end
|
||||
@@ -89,7 +78,14 @@ typedef NS_ENUM(NSUInteger, MPInpspectorEditorIndex) {
|
||||
MPWindowTitleComboBoxDelegate *_windowTitleMenuDelegate;
|
||||
MPTagsTokenFieldDelegate *_tagTokenFieldDelegate;
|
||||
MPAddCustomFieldContextMenuDelegate *_addCustomFieldContextMenuDelegate;
|
||||
|
||||
NSMutableArray<NSViewController<MPInspectorEditor> *> *_attributeEditorViewControllers;
|
||||
|
||||
MPEntryAttributeViewController *_titleEditorViewController;
|
||||
MPEntryAttributeViewController *_usernameEditorViewController;
|
||||
MPEntryAttributeViewController *_urlEditorViewController;
|
||||
MPNodeExpirationViewController *_expiresEditorViewController;
|
||||
MPEntryPasswordAttributeViewController *_passwordEditorViewController;
|
||||
}
|
||||
|
||||
@property (nonatomic, assign) BOOL showPassword;
|
||||
@@ -634,31 +630,36 @@ typedef NS_ENUM(NSUInteger, MPInpspectorEditorIndex) {
|
||||
[self addChildViewController:self.totpViewController];
|
||||
[self.fieldsStackView insertArrangedSubview:self.totpViewController.view atIndex:urlindex - 1];
|
||||
|
||||
/*
|
||||
MPNodeExpirationViewController *vc = [[MPNodeExpirationViewController alloc] init];
|
||||
vc.isEditor = NO;
|
||||
[_attributeEditorViewControllers addObject:vc];
|
||||
[self.fieldsStackView addArrangedSubview:vc.view];
|
||||
|
||||
MPEntryAttributeViewController *vc = [[MPEntryAttributeViewController alloc] init];
|
||||
vc.isEditor = NO;
|
||||
[_attributeEditorViewControllers addObject:vc];
|
||||
[self.fieldsStackView addArrangedSubview:vc.view];
|
||||
_titleEditorViewController = [[MPEntryAttributeViewController alloc] init];
|
||||
_titleEditorViewController.isEditor = NO;
|
||||
[self.fieldsStackView addArrangedSubview:_titleEditorViewController.view];
|
||||
|
||||
for(NSUInteger index = 0; index < kKPKDefaultEntryKeysCount; index++) {
|
||||
MPEntryAttributeViewController *vc = [[MPEntryAttributeViewController alloc] init];
|
||||
vc.isEditor = NO;
|
||||
[_attributeEditorViewControllers addObject:vc];
|
||||
[self.fieldsStackView addArrangedSubview:vc.view];
|
||||
}
|
||||
*/
|
||||
_usernameEditorViewController = [[MPEntryAttributeViewController alloc] init];
|
||||
_usernameEditorViewController.isEditor = NO;
|
||||
[self.fieldsStackView addArrangedSubview:_usernameEditorViewController.view];
|
||||
|
||||
_passwordEditorViewController = [[MPEntryPasswordAttributeViewController alloc] init];
|
||||
_passwordEditorViewController.isEditor = NO;
|
||||
[self.fieldsStackView addArrangedSubview:_passwordEditorViewController.view];
|
||||
|
||||
_urlEditorViewController = [[MPEntryAttributeViewController alloc] init];
|
||||
_urlEditorViewController.isEditor = NO;
|
||||
[self.fieldsStackView addArrangedSubview:_urlEditorViewController.view];
|
||||
|
||||
_expiresEditorViewController = [[MPNodeExpirationViewController alloc] init];
|
||||
_expiresEditorViewController.isEditor = NO;
|
||||
[self.fieldsStackView addArrangedSubview:_expiresEditorViewController.view];
|
||||
}
|
||||
|
||||
- (void)_updateEditors {
|
||||
self.totpViewController.representedObject = self.representedObject;
|
||||
/* Update all the Attribute editors
|
||||
_attributeEditorViewControllers[MPInpspectorEditorIndexUsername].representedObject = [self.representedEntry attributeWithKey:kKPKUsernameKey];
|
||||
*/
|
||||
|
||||
_titleEditorViewController.representedObject = [self.representedEntry attributeWithKey:kKPKTitleKey];
|
||||
_usernameEditorViewController.representedObject = [self.representedEntry attributeWithKey:kKPKUsernameKey];
|
||||
_passwordEditorViewController.representedObject = [self.representedEntry attributeWithKey:kKPKPasswordKey];
|
||||
_urlEditorViewController.representedObject = [self.representedEntry attributeWithKey:kKPKURLKey];
|
||||
_expiresEditorViewController.representedObject = self.representedEntry.timeInfo;
|
||||
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
@@ -22,6 +22,24 @@
|
||||
|
||||
@implementation MPEntryPasswordAttributeViewController
|
||||
|
||||
@dynamic representedAttribute;
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
self.togglePasswordButton.action = @selector(toggleDisplay:);
|
||||
self.togglePasswordButton.target = self.passwordTextField;
|
||||
|
||||
__weak MPEntryPasswordAttributeViewController *welf = self;
|
||||
self.passwordTextField.buttonTitle = NSLocalizedString(@"COPY", "Button to copy the value of an Attribute");
|
||||
self.passwordTextField.buttonActionBlock = ^void(NSTextField *tf) {
|
||||
NSText *text = [welf.view.window fieldEditor:NO forObject:welf.passwordTextField];
|
||||
if([text isKindOfClass:NSTextView.class]) {
|
||||
[welf textField:welf.passwordTextField textView:(NSTextView *)text performAction:@selector(copy:)];
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
- (void)updateValues {
|
||||
self.view.hidden = (!self.isEditor && self.representedAttribute.value.length == 0);
|
||||
self.passwordTextField.stringValue = self.representedAttribute.value ? self.representedAttribute.value : @"";
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="18122" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="19529" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="18122"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="19529"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
@@ -46,6 +46,7 @@
|
||||
</allowedInputSourceLocales>
|
||||
</secureTextFieldCell>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="-2" id="QBE-5i-J4H"/>
|
||||
<outlet property="nextKeyView" destination="AY0-XE-8S7" id="uPk-2E-Bwh"/>
|
||||
</connections>
|
||||
</secureTextField>
|
||||
@@ -95,7 +96,7 @@
|
||||
<constraint firstAttribute="bottom" secondItem="jTp-ga-xuT" secondAttribute="bottom" id="pcp-4W-Bvc"/>
|
||||
<constraint firstItem="jTp-ga-xuT" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="wEy-tv-xz0"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="173" y="112"/>
|
||||
<point key="canvasLocation" x="-93" y="-125"/>
|
||||
</customView>
|
||||
</objects>
|
||||
<resources>
|
||||
|
||||
@@ -18,6 +18,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@required
|
||||
@property (nonatomic) BOOL isEditor;
|
||||
|
||||
- (void)commitChanges;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
||||
@@ -60,8 +60,12 @@
|
||||
[self _updateValues];
|
||||
}
|
||||
|
||||
- (void)commitChanges {
|
||||
// write back expiration changes
|
||||
}
|
||||
|
||||
- (void)_updateValues {
|
||||
self.view.hidden = self.representedTimeInfo.expires;
|
||||
self.view.hidden = !self.representedTimeInfo.expires;
|
||||
self.expiredCheckButton.state = HNHUIStateForBool(self.representedTimeInfo.expires);
|
||||
NSValueTransformer *dateTransformer = [NSValueTransformer valueTransformerForName:MPExpiryDateValueTransformerName];
|
||||
self.expiredCheckButton.title = [dateTransformer transformedValue:self.representedTimeInfo.expirationDate];
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="18122" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="19529" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="18122"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="19529"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
@@ -16,21 +16,21 @@
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<customView id="Hz6-mo-xeY">
|
||||
<rect key="frame" x="0.0" y="0.0" width="187" height="20"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="187" height="22"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<subviews>
|
||||
<stackView distribution="fill" orientation="horizontal" alignment="centerY" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" horizontalHuggingPriority="248" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="l8k-GC-FnL">
|
||||
<rect key="frame" x="0.0" y="0.0" width="187" height="20"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="187" height="22"/>
|
||||
<subviews>
|
||||
<button horizontalHuggingPriority="249" horizontalCompressionResistancePriority="249" translatesAutoresizingMaskIntoConstraints="NO" id="HAQ-Wk-M7P">
|
||||
<rect key="frame" x="-2" y="1" width="150" height="18"/>
|
||||
<rect key="frame" x="-2" y="2" width="150" height="18"/>
|
||||
<buttonCell key="cell" type="check" title="Expires" bezelStyle="regularSquare" imagePosition="left" lineBreakMode="truncatingMiddle" state="on" inset="2" id="7kV-WE-lr3">
|
||||
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="G7C-WZ-ad7">
|
||||
<rect key="frame" x="149" y="-7" width="45" height="32"/>
|
||||
<rect key="frame" x="149" y="-6" width="45" height="32"/>
|
||||
<buttonCell key="cell" type="push" bezelStyle="rounded" image="NSActionTemplate" imagePosition="only" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="hgC-Qj-aTs">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
@@ -40,6 +40,10 @@
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstAttribute="bottom" secondItem="G7C-WZ-ad7" secondAttribute="bottom" constant="1" id="62i-sg-sio"/>
|
||||
<constraint firstItem="G7C-WZ-ad7" firstAttribute="top" secondItem="l8k-GC-FnL" secondAttribute="top" constant="1" id="QLH-zK-eyP"/>
|
||||
</constraints>
|
||||
<visibilityPriorities>
|
||||
<integer value="1000"/>
|
||||
<integer value="1000"/>
|
||||
@@ -56,7 +60,7 @@
|
||||
<constraint firstItem="l8k-GC-FnL" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="Qvv-5F-nde"/>
|
||||
<constraint firstAttribute="trailing" secondItem="l8k-GC-FnL" secondAttribute="trailing" id="ckb-kh-R60"/>
|
||||
</constraints>
|
||||
<point key="canvasLocation" x="-91" y="-25"/>
|
||||
<point key="canvasLocation" x="-91.5" y="-41"/>
|
||||
</customView>
|
||||
</objects>
|
||||
<resources>
|
||||
|
||||
Reference in New Issue
Block a user