2
0

Bugfixes, a gradient backdrop behind bottom buttons and support for generated login names.

This commit is contained in:
Maarten Billemont 2016-05-16 00:50:17 -04:00
parent 0f7793e9ba
commit 060059ff0c
11 changed files with 232 additions and 73 deletions

View File

@ -496,7 +496,7 @@ NSOperationQueue *_mpwQueue = nil;
NSAssert( [[siteKey keyIDForAlgorithm:site.user.algorithm] isEqualToData:site.user.keyID], @"Site does not belong to current user." );
NSString *name = site.name;
BOOL loginGenerated = site.loginGenerated && [[MPAppDelegate_Shared get] isFeatureUnlocked:MPProductGenerateLogins];
NSString *loginName = loginGenerated? nil: site.loginName;
NSString *loginName = site.loginName;
id<MPAlgorithm> algorithm = nil;
if (!name.length)
err( @"Missing name." );
@ -506,10 +506,8 @@ NSOperationQueue *_mpwQueue = nil;
algorithm = site.algorithm;
dispatch_async( dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0 ), ^{
if (loginGenerated)
resultBlock( [algorithm generateLoginForSiteNamed:name usingKey:siteKey] );
else
resultBlock( loginName );
resultBlock( loginName || !loginGenerated? loginName:
[algorithm generateLoginForSiteNamed:name usingKey:siteKey] );
} );
}
@ -611,7 +609,7 @@ NSOperationQueue *_mpwQueue = nil;
err( @"Missing name." );
else if (!siteKey)
err( @"Missing key." );
else
else if ([[MPAppDelegate_Shared get] isFeatureUnlocked:MPProductGenerateAnswers])
algorithm = question.site.algorithm;
dispatch_async( dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0 ), ^{

View File

@ -66,7 +66,7 @@ PearlAssociatedObjectProperty( NSMutableArray*, ProductObservers, productObserve
return NO;
#if ADHOC || DEBUG
// All features are unlocked for beta / debug versions.
// All features are unlocked for beta / debug / mac versions.
return YES;
#else
// Check if product is purchased.

View File

@ -0,0 +1,16 @@
//
// Created by Maarten Billemont on 2016-05-15.
// Copyright (c) 2016 Lyndir. All rights reserved.
//
#import <Foundation/Foundation.h>
IB_DESIGNABLE
@interface MPGradientView : NSView
@property(nonatomic, retain) IBInspectable NSColor *startingColor;
@property(nonatomic, retain) IBInspectable NSColor *endingColor;
@property(nonatomic, assign) IBInspectable NSInteger angle;
@property(nonatomic, assign) IBInspectable CGFloat ratio;
@end

View File

@ -0,0 +1,81 @@
//
// Created by Maarten Billemont on 2016-05-15.
// Copyright (c) 2016 Lyndir. All rights reserved.
//
#import "MPGradientView.h"
@implementation MPGradientView {
NSGradient *gradient;
}
- (id)initWithFrame:(NSRect)frame {
if (!(self = [super initWithFrame:frame]))
return nil;
[self defaults];
return self;
}
- (instancetype)initWithCoder:(NSCoder *)coder {
if (!(self = [super initWithCoder:coder]))
return nil;
[self defaults];
return self;
}
- (void)defaults {
self.startingColor = [NSColor colorWithCalibratedWhite:0.0 alpha:0.0];
self.endingColor = [NSColor colorWithCalibratedWhite:0.0 alpha:1.0];
self.angle = 270;
self.ratio = 0.5f;
}
- (void)setStartingColor:(NSColor *)startingColor {
_startingColor = startingColor;
gradient = nil;
[self setNeedsDisplay:YES];
}
- (void)setEndingColor:(NSColor *)endingColor {
_endingColor = endingColor;
gradient = nil;
[self setNeedsDisplay:YES];
}
- (void)setAngle:(NSInteger)angle {
_angle = angle;
gradient = nil;
[self setNeedsDisplay:YES];
}
- (void)setRatio:(CGFloat)ratio {
_ratio = ratio;
gradient = nil;
[self setNeedsDisplay:YES];
}
- (void)drawRect:(NSRect)dirtyRect {
if (!self.startingColor || !self.endingColor || [self.startingColor isEqual:self.endingColor]) {
[(self.startingColor?: self.endingColor) set];
NSRectFill( dirtyRect );
return;
}
[(gradient?: (gradient = [[NSGradient alloc] initWithColorsAndLocations:
self.startingColor, (CGFloat)0.f,
[self.startingColor blendedColorWithFraction:0.5f ofColor:self.endingColor], self.ratio,
self.endingColor, (CGFloat)1.f, nil]))
drawInRect:self.bounds angle:self.angle];
}
@end

View File

@ -17,7 +17,7 @@
<window title="Welcome to Master Password" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" animationBehavior="default" id="1">
<windowStyleMask key="styleMask" titled="YES" closable="YES"/>
<windowCollectionBehavior key="collectionBehavior" moveToActiveSpace="YES"/>
<rect key="contentRect" x="196" y="240" width="1000" height="640"/>
<rect key="contentRect" x="0.0" y="0.0" width="1000" height="640"/>
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="877"/>
<view key="contentView" id="2" userLabel="Container">
<rect key="frame" x="0.0" y="0.0" width="1000" height="640"/>
@ -102,11 +102,8 @@ from anywhere.</string>
<constraint firstItem="C4d-ih-ARL" firstAttribute="top" secondItem="283" secondAttribute="bottom" constant="8" symbolic="YES" id="tqS-gV-jpd"/>
</constraints>
</customView>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="508">
<rect key="frame" x="858" y="8" width="122" height="25"/>
<constraints>
<constraint firstAttribute="width" constant="122" id="509"/>
</constraints>
<button horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="508">
<rect key="frame" x="770" y="8" width="210" height="25"/>
<buttonCell key="cell" type="roundTextured" title="Launch After Computer Restarts" bezelStyle="texturedRounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="510">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES" changeBackground="YES" changeGray="YES"/>
<font key="font" metaFont="system"/>
@ -116,7 +113,7 @@ from anywhere.</string>
</connections>
</button>
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="562">
<rect key="frame" x="21" y="13" width="831" height="17"/>
<rect key="frame" x="21" y="13" width="743" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="To begin: hold command, control and P (⌘⌃P) or access the ●●●| menu icon next to your clock." id="563">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>

View File

@ -216,6 +216,12 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven
return NO;
}
- (BOOL)isFeatureUnlocked:(NSString *)productIdentifier {
// All features are unlocked for mac versions.
return YES;
}
#pragma mark - Actions
- (void)selectUser:(NSMenuItem *)item {

View File

@ -17,7 +17,6 @@
//
#import <QuartzCore/QuartzCore.h>
#import <Foundation/Foundation.h>
#import "MPPasswordWindowController.h"
#import "MPMacAppDelegate.h"
#import "MPAppDelegate_Store.h"
@ -260,21 +259,36 @@
[alert addButtonWithTitle:@"Save"];
[alert addButtonWithTitle:@"Cancel"];
[alert setMessageText:@"Change Login Name"];
[alert setInformativeText:strf( @"Enter the login name for: %@", self.selectedSite.name )];
NSTextField *loginField = [[NSTextField alloc] initWithFrame:NSMakeRect( 0, 0, 200, 22 )];
loginField.stringValue = self.selectedSite.loginName?: @"";
[loginField selectText:self];
[alert setAccessoryView:loginField];
[alert setInformativeText:strf( @"Your login name for: %@", self.selectedSite.name )];
NSTextField *loginField = [NSTextField new];
[loginField bind:@"value" toObject:self.selectedSite withKeyPath:@"loginName" options:nil];
NSButton *generatedField = [NSButton new];
[generatedField setButtonType:NSSwitchButton];
[generatedField bind:@"value" toObject:self.selectedSite withKeyPath:@"loginGenerated" options:nil];
generatedField.title = @"Generated";
NSStackView *stackView = [NSStackView stackViewWithViews:@[ loginField, generatedField ]];
stackView.orientation = NSUserInterfaceLayoutOrientationVertical;
stackView.frame = NSMakeRect( 0, 0, 200, 44 );
[stackView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"[loginField(200)]"
options:0 metrics:nil
views:NSDictionaryOfVariableBindings( loginField, stackView )]];
[stackView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"[generatedField(200)]"
options:0 metrics:nil
views:NSDictionaryOfVariableBindings( generatedField, stackView )]];
[alert setAccessoryView:stackView];
[alert layout];
[loginField selectText:self];
[alert beginSheetModalForWindow:self.window completionHandler:^(NSModalResponse returnCode) {
switch (returnCode) {
case NSAlertFirstButtonReturn: {
// "Save" button.
NSString *loginName = [(NSSecureTextField *)alert.accessoryView stringValue];
NSString *loginName = [loginField stringValue];
[MPMacAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) {
MPSiteEntity *entity = [self.selectedSite entityInContext:context];
entity.loginName = loginName;
entity.loginName = !self.selectedSite.loginGenerated && [loginName length]? loginName: nil;
[context saveToStore];
[self.selectedSite updateContent];
}];
break;
}
@ -311,7 +325,7 @@
alert_.messageText = @"Master Password Reset";
alert_.informativeText = strf( @"%@'s master password has been reset.\n\nYou can now set a new one by logging in.",
activeUserName );
[alert_ beginSheetModalForWindow:self.window modalDelegate:nil didEndSelector:NULL contextInfo:nil];
[alert_ beginSheetModalForWindow:self.window completionHandler:nil];
if ([MPMacAppDelegate get].key)
[[MPMacAppDelegate get] signOutAnimated:YES];
@ -334,17 +348,19 @@
[alert addButtonWithTitle:@"Cancel"];
[alert setMessageText:@"Change Password"];
[alert setInformativeText:strf( @"Enter the new password for: %@", self.selectedSite.name )];
[alert setAccessoryView:[[NSSecureTextField alloc] initWithFrame:NSMakeRect( 0, 0, 200, 22 )]];
NSSecureTextField *passwordField = [[NSSecureTextField alloc] initWithFrame:NSMakeRect( 0, 0, 200, 22 )];
[alert setAccessoryView:passwordField];
[alert layout];
[alert beginSheetModalForWindow:self.window completionHandler:^(NSModalResponse returnCode) {
switch (returnCode) {
case NSAlertFirstButtonReturn: {
// "Save" button.
NSString *password = [(NSSecureTextField *)alert.accessoryView stringValue];
NSString *password = [passwordField stringValue];
[MPMacAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) {
MPSiteEntity *entity = [self.selectedSite entityInContext:context];
[entity.algorithm savePassword:password toSite:entity usingKey:[MPMacAppDelegate get].key];
[context saveToStore];
[self.selectedSite updateContent];
}];
break;
}

View File

@ -29,20 +29,20 @@
<window title="Master Password" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="default" id="QvC-M9-y7g" customClass="MPPasswordWindow">
<windowStyleMask key="styleMask" texturedBackground="YES" unifiedTitleAndToolbar="YES" fullSizeContentView="YES"/>
<windowCollectionBehavior key="collectionBehavior" moveToActiveSpace="YES" transient="YES" ignoresCycle="YES" fullScreenAuxiliary="YES"/>
<rect key="contentRect" x="0.0" y="0.0" width="640" height="600"/>
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="900"/>
<rect key="contentRect" x="0.0" y="0.0" width="640" height="577"/>
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="877"/>
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ" userLabel="Root">
<rect key="frame" x="0.0" y="0.0" width="640" height="600"/>
<rect key="frame" x="0.0" y="0.0" width="640" height="577"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<visualEffectView blendingMode="behindWindow" state="followsWindowActiveState" translatesAutoresizingMaskIntoConstraints="NO" id="eRe-Ef-AZx">
<rect key="frame" x="0.0" y="0.0" width="640" height="600"/>
<rect key="frame" x="0.0" y="0.0" width="640" height="577"/>
</visualEffectView>
<progressIndicator hidden="YES" wantsLayer="YES" horizontalHuggingPriority="750" verticalHuggingPriority="750" maxValue="100" displayedWhenStopped="NO" bezeled="NO" indeterminate="YES" controlSize="small" style="spinning" translatesAutoresizingMaskIntoConstraints="NO" id="oSh-Ec-8Nf" userLabel="Progress Spinner">
<rect key="frame" x="312" y="564" width="16" height="16"/>
<rect key="frame" x="312" y="541" width="16" height="16"/>
</progressIndicator>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="NGk-Io-Buc" userLabel="Top Box">
<rect key="frame" x="20" y="406" width="600" height="150"/>
<rect key="frame" x="20" y="383" width="600" height="150"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Ond-dT-x5d" userLabel="Site Password Label">
<rect key="frame" x="157" y="116" width="285" height="14"/>
@ -217,17 +217,17 @@
</constraints>
</customView>
<scrollView focusRingType="none" borderType="none" autohidesScrollers="YES" horizontalLineScroll="35" horizontalPageScroll="10" verticalLineScroll="35" verticalPageScroll="10" hasHorizontalScroller="NO" hasVerticalScroller="NO" horizontalScrollElasticity="none" translatesAutoresizingMaskIntoConstraints="NO" id="Bme-XK-MMc" userLabel="Sites Table">
<rect key="frame" x="64" y="0.0" width="512" height="232"/>
<rect key="frame" x="64" y="40" width="512" height="180"/>
<clipView key="contentView" drawsBackground="NO" copiesOnScroll="NO" id="e11-59-xSS">
<rect key="frame" x="0.0" y="0.0" width="512" height="232"/>
<rect key="frame" x="0.0" y="0.0" width="512" height="180"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnReordering="NO" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" rowHeight="33" rowSizeStyle="automatic" viewBased="YES" floatsGroupRows="NO" id="xvJ-5c-vDp" customClass="MPSitesTableView">
<rect key="frame" x="0.0" y="0.0" width="515" height="0.0"/>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnReordering="NO" columnResizing="NO" multipleSelection="NO" emptySelection="NO" autosaveColumns="NO" rowHeight="33" rowSizeStyle="automatic" viewBased="YES" floatsGroupRows="NO" id="xvJ-5c-vDp" customClass="MPSitesTableView">
<rect key="frame" x="0.0" y="0.0" width="515" height="180"/>
<autoresizingMask key="autoresizingMask"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" white="1" alpha="0.0" colorSpace="deviceWhite"/>
<color key="gridColor" name="selectedControlColor" catalog="System" colorSpace="catalog"/>
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
<tableColumns>
<tableColumn editable="NO" width="512" minWidth="512" maxWidth="512" id="S71-gk-yF7">
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left">
@ -311,8 +311,22 @@
<binding destination="-2" name="hidden" keyPath="locked" id="FF1-c9-zmm"/>
</connections>
</scrollView>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="nM8-O3-spM" customClass="MPGradientView">
<rect key="frame" x="0.0" y="0.0" width="640" height="212"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="startingColor">
<color key="value" red="0.7019608021" green="0.7019608021" blue="0.7019608021" alpha="0.0" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="endingColor">
<color key="value" red="0.7019608021" green="0.7019608021" blue="0.7019608021" alpha="1" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="ratio">
<real key="value" value="0.20000000000000001"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</customView>
<button translatesAutoresizingMaskIntoConstraints="NO" id="Aue-Zx-6Mf" userLabel="Settings Gear">
<rect key="frame" x="585" y="536" width="35" height="44"/>
<rect key="frame" x="585" y="513" width="35" height="44"/>
<shadow key="shadow">
<color key="color" name="controlLightHighlightColor" catalog="System" colorSpace="catalog"/>
</shadow>
@ -327,7 +341,7 @@
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="gAU-xs-aae">
<rect key="frame" x="593" y="522" width="19" height="14"/>
<rect key="frame" x="593" y="499" width="19" height="14"/>
<shadow key="shadow" blurRadius="0.5">
<size key="offset" width="0.0" height="1"/>
<color key="color" name="controlLightHighlightColor" catalog="System" colorSpace="catalog"/>
@ -346,7 +360,7 @@
</connections>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="OnR-s6-d4P" userLabel="Site Name Label">
<rect key="frame" x="209" y="330" width="223" height="20"/>
<rect key="frame" x="209" y="318" width="223" height="20"/>
<shadow key="shadow" blurRadius="0.5">
<size key="offset" width="0.0" height="1"/>
<color key="color" name="controlLightHighlightColor" catalog="System" colorSpace="catalog"/>
@ -358,7 +372,7 @@
</textFieldCell>
</textField>
<secureTextField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="iGR-wo-ual" userLabel="Secure Master Password">
<rect key="frame" x="18" y="278" width="604" height="44"/>
<rect key="frame" x="18" y="266" width="604" height="44"/>
<shadow key="shadow" blurRadius="0.5">
<size key="offset" width="0.0" height="1"/>
<color key="color" name="controlLightHighlightColor" catalog="System" colorSpace="catalog"/>
@ -393,7 +407,7 @@
</connections>
</secureTextField>
<textField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="v80-wd-hUR" userLabel="Revealed Master Password">
<rect key="frame" x="18" y="278" width="604" height="44"/>
<rect key="frame" x="18" y="266" width="604" height="44"/>
<shadow key="shadow" blurRadius="0.5">
<size key="offset" width="0.0" height="1"/>
<color key="color" name="controlLightHighlightColor" catalog="System" colorSpace="catalog"/>
@ -432,7 +446,7 @@
</connections>
</textField>
<textField hidden="YES" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="lW3-2z-cEa" userLabel="Master Password Tip">
<rect key="frame" x="194.5" y="255" width="251" height="15"/>
<rect key="frame" x="194" y="243" width="251" height="15"/>
<shadow key="shadow" blurRadius="0.5">
<size key="offset" width="0.0" height="1"/>
<color key="color" name="controlLightHighlightColor" catalog="System" colorSpace="catalog"/>
@ -459,7 +473,7 @@
</connections>
</textField>
<textField hidden="YES" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Oy5-B7-hdN" userLabel="Revealed Master Password Tip">
<rect key="frame" x="194.5" y="255" width="250" height="15"/>
<rect key="frame" x="194" y="243" width="250" height="15"/>
<shadow key="shadow" blurRadius="0.5">
<size key="offset" width="0.0" height="1"/>
<color key="color" name="controlLightHighlightColor" catalog="System" colorSpace="catalog"/>
@ -487,7 +501,7 @@
</connections>
</textField>
<searchField focusRingType="none" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="CnS-iI-dhr" userLabel="Site Name">
<rect key="frame" x="62" y="278" width="516" height="44"/>
<rect key="frame" x="62" y="266" width="516" height="44"/>
<constraints>
<constraint firstAttribute="width" constant="512" id="rW7-Vq-4Xy"/>
</constraints>
@ -507,7 +521,7 @@
</connections>
</searchField>
<textField hidden="YES" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="npC-Kk-gUM" userLabel="Site Name Tip">
<rect key="frame" x="101" y="255" width="438" height="15"/>
<rect key="frame" x="101" y="243" width="438" height="15"/>
<shadow key="shadow" blurRadius="0.5">
<size key="offset" width="0.0" height="1"/>
<color key="color" name="controlLightHighlightColor" catalog="System" colorSpace="catalog"/>
@ -530,7 +544,7 @@
</connections>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="rhm-sC-xFS" userLabel="Site Name Tip">
<rect key="frame" x="137" y="240" width="365" height="30"/>
<rect key="frame" x="137" y="228" width="365" height="30"/>
<shadow key="shadow" blurRadius="0.5">
<size key="offset" width="0.0" height="1"/>
<color key="color" name="controlLightHighlightColor" catalog="System" colorSpace="catalog"/>
@ -555,15 +569,15 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit.</string>
<binding destination="-2" name="hidden" keyPath="locked" id="bcg-eq-V5Z"/>
</connections>
</textField>
<stackView distribution="fill" orientation="horizontal" alignment="bottom" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="pHt-gg-ZNX">
<rect key="frame" x="61" y="20" width="519" height="152"/>
<stackView distribution="fill" orientation="horizontal" alignment="bottom" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" misplaced="YES" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="pHt-gg-ZNX">
<rect key="frame" x="61" y="20" width="495" height="152"/>
<subviews>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="1Qo-iG-CQt">
<rect key="frame" x="0.0" y="-1" width="109" height="19"/>
<button verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="1Qo-iG-CQt">
<rect key="frame" x="0.0" y="-1" width="85" height="19"/>
<shadow key="shadow">
<color key="color" name="controlLightHighlightColor" catalog="System" colorSpace="catalog"/>
</shadow>
<buttonCell key="cell" type="recessed" title="Set Login Name" bezelStyle="recessed" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="QFo-9y-aVe" customClass="MPNoStateButtonCell">
<buttonCell key="cell" type="recessed" title="Login Name" bezelStyle="recessed" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="QFo-9y-aVe" customClass="MPNoStateButtonCell">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES" changeBackground="YES" changeGray="YES"/>
<font key="font" metaFont="systemBold" size="12"/>
<string key="keyEquivalent">l</string>
@ -576,15 +590,10 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit.</string>
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
<binding destination="mcS-ik-b0n" name="title" keyPath="selection.loginName" id="uub-7k-XZ8">
<dictionary key="options">
<string key="NSNullPlaceholder">Set Login Name</string>
</dictionary>
</binding>
</connections>
</button>
<stackView distribution="fill" orientation="vertical" alignment="centerX" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="DT0-RU-3LT">
<rect key="frame" x="117" y="0.0" width="177" height="152"/>
<stackView distribution="fill" orientation="vertical" alignment="centerX" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" misplaced="YES" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="DT0-RU-3LT">
<rect key="frame" x="93" y="0.0" width="177" height="152"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="uol-dE-I8H">
<rect key="frame" x="77" y="138" width="23" height="14"/>
@ -624,7 +633,7 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit.</string>
</connections>
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="brI-fg-Kav">
<rect key="frame" x="40.5" y="111" width="96" height="19"/>
<rect key="frame" x="41" y="111" width="96" height="19"/>
<shadow key="shadow">
<color key="color" name="controlLightHighlightColor" catalog="System" colorSpace="catalog"/>
</shadow>
@ -679,7 +688,7 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit.</string>
</connections>
</button>
<stackView distribution="fill" orientation="horizontal" alignment="top" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Bgn-Ne-fQ7" userLabel="Version Container">
<rect key="frame" x="70.5" y="56" width="36" height="22"/>
<rect key="frame" x="71" y="56" width="36" height="22"/>
<subviews>
<stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="mcq-qD-yte">
<rect key="frame" x="-3" y="-3" width="19" height="27"/>
@ -733,7 +742,7 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit.</string>
</connections>
</stackView>
<stackView distribution="fill" orientation="horizontal" alignment="centerY" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="6II-KA-cNi" userLabel="Counter Container">
<rect key="frame" x="74.5" y="26" width="28" height="22"/>
<rect key="frame" x="75" y="26" width="28" height="22"/>
<subviews>
<stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="XgA-Vl-CKh" userLabel="Counter Stepper">
<rect key="frame" x="-3" y="-3" width="19" height="27"/>
@ -746,7 +755,7 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit.</string>
</connections>
</stepper>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="NvO-kt-eZ2" userLabel="Counter Field">
<rect key="frame" x="19" y="1.5" width="11" height="19"/>
<rect key="frame" x="19" y="2" width="11" height="19"/>
<shadow key="shadow" blurRadius="0.5">
<size key="offset" width="0.0" height="1"/>
<color key="color" name="controlLightHighlightColor" catalog="System" colorSpace="catalog"/>
@ -824,8 +833,8 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit.</string>
<real value="3.4028234663852886e+38"/>
</customSpacing>
</stackView>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="whJ-Bw-pr4">
<rect key="frame" x="302" y="-1" width="129" height="19"/>
<button verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="whJ-Bw-pr4">
<rect key="frame" x="278" y="-1" width="129" height="19"/>
<shadow key="shadow">
<color key="color" name="controlLightHighlightColor" catalog="System" colorSpace="catalog"/>
</shadow>
@ -844,8 +853,8 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit.</string>
</binding>
</connections>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="XuF-Sp-6JD">
<rect key="frame" x="439" y="-1" width="80" height="19"/>
<button verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="XuF-Sp-6JD">
<rect key="frame" x="415" y="-1" width="80" height="19"/>
<shadow key="shadow">
<color key="color" name="controlLightHighlightColor" catalog="System" colorSpace="catalog"/>
</shadow>
@ -878,7 +887,7 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit.</string>
<real value="3.4028234663852886e+38"/>
</customSpacing>
</stackView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="luC-0j-BeV">
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="luC-0j-BeV">
<rect key="frame" x="147.5" y="50" width="103" height="14"/>
<shadow key="shadow" blurRadius="0.5">
<size key="offset" width="0.0" height="1"/>
@ -915,7 +924,7 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit.</string>
</binding>
</connections>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="gjx-bt-fKM">
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="gjx-bt-fKM">
<rect key="frame" x="146.5" y="80" width="100" height="14"/>
<shadow key="shadow" blurRadius="0.5">
<size key="offset" width="0.0" height="1"/>
@ -952,7 +961,7 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit.</string>
</binding>
</connections>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="dbM-ja-dKO" userLabel="Version Tip">
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="dbM-ja-dKO" userLabel="Version Tip">
<rect key="frame" x="100.5" y="106" width="332" height="14"/>
<shadow key="shadow" blurRadius="0.5">
<size key="offset" width="0.0" height="1"/>
@ -1008,7 +1017,7 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit.</string>
</binding>
</connections>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="9b3-wy-KBb">
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="9b3-wy-KBb">
<rect key="frame" x="255" y="2" width="23" height="14"/>
<shadow key="shadow" blurRadius="0.5">
<size key="offset" width="0.0" height="1"/>
@ -1036,7 +1045,7 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit.</string>
</binding>
</connections>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="qal-PP-YtO">
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="qal-PP-YtO">
<rect key="frame" x="528" y="1" width="23" height="15"/>
<shadow key="shadow" blurRadius="0.5">
<size key="offset" width="0.0" height="1"/>
@ -1064,7 +1073,7 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit.</string>
</binding>
</connections>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="qLF-A6-ThX">
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="qLF-A6-ThX">
<rect key="frame" x="416" y="1" width="23" height="15"/>
<shadow key="shadow" blurRadius="0.5">
<size key="offset" width="0.0" height="1"/>
@ -1097,6 +1106,7 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit.</string>
<constraint firstItem="eRe-Ef-AZx" firstAttribute="top" secondItem="EiT-Mj-1SZ" secondAttribute="top" id="1Ar-vS-kS1"/>
<constraint firstItem="v80-wd-hUR" firstAttribute="top" secondItem="iGR-wo-ual" secondAttribute="top" id="1iV-OU-5Ay"/>
<constraint firstItem="qLF-A6-ThX" firstAttribute="top" secondItem="whJ-Bw-pr4" secondAttribute="bottom" constant="4" id="28t-Qy-bhD"/>
<constraint firstAttribute="bottom" secondItem="nM8-O3-spM" secondAttribute="bottom" id="5un-QN-A3T"/>
<constraint firstItem="Ido-NQ-3MY" firstAttribute="centerX" secondItem="1Qo-iG-CQt" secondAttribute="centerX" id="74O-bk-TKU"/>
<constraint firstItem="NGk-Io-Buc" firstAttribute="top" secondItem="oSh-Ec-8Nf" secondAttribute="bottom" priority="250" constant="8" symbolic="YES" id="8AC-MT-cz4"/>
<constraint firstItem="6II-KA-cNi" firstAttribute="leading" secondItem="luC-0j-BeV" secondAttribute="trailing" constant="4" id="8Us-64-kBH"/>
@ -1115,15 +1125,17 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit.</string>
<constraint firstAttribute="trailing" secondItem="eRe-Ef-AZx" secondAttribute="trailing" id="KXq-D3-FUM"/>
<constraint firstAttribute="trailing" secondItem="iGR-wo-ual" secondAttribute="trailing" constant="20" symbolic="YES" id="LW8-vu-scs"/>
<constraint firstItem="Aue-Zx-6Mf" firstAttribute="top" secondItem="EiT-Mj-1SZ" secondAttribute="top" constant="20" symbolic="YES" id="Lts-go-pIX"/>
<constraint firstAttribute="bottom" secondItem="Bme-XK-MMc" secondAttribute="bottom" id="MbE-Oa-J9k"/>
<constraint firstAttribute="bottom" secondItem="Bme-XK-MMc" secondAttribute="bottom" constant="40" id="MbE-Oa-J9k"/>
<constraint firstItem="Oy5-B7-hdN" firstAttribute="centerY" secondItem="lW3-2z-cEa" secondAttribute="centerY" id="Mt6-VS-6Zo"/>
<constraint firstItem="Oy5-B7-hdN" firstAttribute="centerX" secondItem="lW3-2z-cEa" secondAttribute="centerX" id="NQu-Jc-cOd"/>
<constraint firstItem="CnS-iI-dhr" firstAttribute="centerX" secondItem="npC-Kk-gUM" secondAttribute="centerX" id="O7q-Xc-mx3"/>
<constraint firstAttribute="trailing" secondItem="nM8-O3-spM" secondAttribute="trailing" id="P9Q-JW-nBd"/>
<constraint firstAttribute="centerX" secondItem="OnR-s6-d4P" secondAttribute="centerX" id="Pun-kD-jgl"/>
<constraint firstItem="gAU-xs-aae" firstAttribute="top" secondItem="Aue-Zx-6Mf" secondAttribute="bottom" id="QkM-BN-dOT"/>
<constraint firstAttribute="centerX" secondItem="CnS-iI-dhr" secondAttribute="centerX" id="Qqi-bu-q65"/>
<constraint firstItem="pHt-gg-ZNX" firstAttribute="centerX" secondItem="EiT-Mj-1SZ" secondAttribute="centerX" id="Wpn-vZ-iqe"/>
<constraint firstAttribute="bottom" secondItem="pHt-gg-ZNX" secondAttribute="bottom" constant="20" id="YJV-bt-uUV"/>
<constraint firstItem="pHt-gg-ZNX" firstAttribute="top" secondItem="nM8-O3-spM" secondAttribute="top" constant="40" id="Yds-xQ-2C2"/>
<constraint firstItem="NGk-Io-Buc" firstAttribute="leading" secondItem="EiT-Mj-1SZ" secondAttribute="leading" constant="20" symbolic="YES" id="ZVb-SX-b24"/>
<constraint firstAttribute="bottom" secondItem="eRe-Ef-AZx" secondAttribute="bottom" id="a09-Gf-lZe"/>
<constraint firstItem="qLF-A6-ThX" firstAttribute="centerX" secondItem="whJ-Bw-pr4" secondAttribute="centerX" id="a3q-sg-y5c"/>
@ -1142,6 +1154,7 @@ Use the arrows ⇅ to navigate the list or esc ⎋ to exit.</string>
<constraint firstAttribute="centerX" secondItem="iGR-wo-ual" secondAttribute="centerX" id="kXB-yZ-sur"/>
<constraint firstItem="eRe-Ef-AZx" firstAttribute="leading" secondItem="EiT-Mj-1SZ" secondAttribute="leading" id="pxS-U4-7ak"/>
<constraint firstItem="v80-wd-hUR" firstAttribute="trailing" secondItem="iGR-wo-ual" secondAttribute="trailing" id="rIx-cQ-PNt"/>
<constraint firstItem="nM8-O3-spM" firstAttribute="leading" secondItem="EiT-Mj-1SZ" secondAttribute="leading" id="uVI-Ew-WIN"/>
<constraint firstItem="lW3-2z-cEa" firstAttribute="centerX" secondItem="iGR-wo-ual" secondAttribute="centerX" id="vML-2u-shw"/>
<constraint firstItem="v80-wd-hUR" firstAttribute="bottom" secondItem="iGR-wo-ual" secondAttribute="bottom" id="xiX-8e-pNR"/>
<constraint firstItem="v80-wd-hUR" firstAttribute="leading" secondItem="iGR-wo-ual" secondAttribute="leading" id="yVZ-Ar-5ov"/>

View File

@ -34,6 +34,7 @@
@property (nonatomic) NSString *question;
@property (nonatomic) NSString *answer;
@property (nonatomic) NSString *loginName;
@property (nonatomic) BOOL loginGenerated;
@property (nonatomic) NSNumber *uses;
@property (nonatomic) NSUInteger counter;
@property (nonatomic) NSDate *lastUsed;

View File

@ -79,6 +79,8 @@
self.typeName = entity.typeName;
self.uses = entity.uses_;
self.counter = [entity isKindOfClass:[MPGeneratedSiteEntity class]]? [(MPGeneratedSiteEntity *)entity counter]: 0;
self.loginGenerated = entity.loginGenerated;
NSLog( @"%@: loginGenerated: %d", self.name, self.loginGenerated );
// Find all password types and the index of the current type amongst them.
[self updateContent:entity];
@ -143,6 +145,28 @@
[self updateContent];
}
- (void)setLoginGenerated:(BOOL)loginGenerated {
if (loginGenerated == _loginGenerated)
return;
_loginGenerated = loginGenerated;
if (!_initialized)
// This wasn't a change to the entity.
return;
if (_entityOID)
[MPMacAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) {
MPSiteEntity *entity = [self entityInContext:context];
entity.loginGenerated = loginGenerated;
[context saveToStore];
[self updateContent:entity];
}];
else
[self updateContent];
}
- (MPAlgorithmVersion)algorithmVersion {
return self.algorithm.version;
@ -252,6 +276,7 @@
PearlMainQueue( ^{
self.loginName = loginName;
NSLog( @"%@: loginGenerated: %d, loginName: %@", self.name, self.loginGenerated, loginName );
} );
}

View File

@ -16,6 +16,7 @@
93D395F08A087F8A24689347 /* NSArray+Indexing.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39067C0AFDC581794E2B8 /* NSArray+Indexing.m */; };
93D39784E725A34D1EE3FB3B /* MPInitialWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39D3CB30874147D9A9E1B /* MPInitialWindowController.m */; };
93D3987F6D9046DBEE4D8364 /* NSView+Traversing.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D392870DF659AFC1870521 /* NSView+Traversing.m */; };
93D398D1F5D8CD5A22AF6929 /* MPGradientView.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39934FD8D5BFABA46F41C /* MPGradientView.m */; };
93D39C34FE35830EF5BE1D2A /* NSArray+Indexing.h in Headers */ = {isa = PBXBuildFile; fileRef = 93D396D04E57792A54D437AC /* NSArray+Indexing.h */; };
93D39C5789EFA607CF788082 /* MPSiteModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39E73BF5CBF8E5B005CD3 /* MPSiteModel.m */; };
93D39E281E3658B30550CB55 /* NSDictionary+Indexing.m in Sources */ = {isa = PBXBuildFile; fileRef = 93D39AA1EE2E1E7B81372240 /* NSDictionary+Indexing.m */; };
@ -271,6 +272,7 @@
93D392870DF659AFC1870521 /* NSView+Traversing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSView+Traversing.m"; sourceTree = "<group>"; };
93D392A4F3DE0BD758B9B056 /* MPNoStateButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPNoStateButton.h; sourceTree = "<group>"; };
93D392C3918763B3B72CF366 /* MPPasswordWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPasswordWindowController.h; sourceTree = "<group>"; };
93D392FD65A1DF0E8B2A45C6 /* MPGradientView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPGradientView.h; sourceTree = "<group>"; };
93D39368EF3CBFEF2AFCA15A /* MPInitialWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPInitialWindowController.h; sourceTree = "<group>"; };
93D393B97158D7BE9332EA53 /* NSDictionary+Indexing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+Indexing.h"; sourceTree = "<group>"; };
93D393EE88DE554BCCBC1C2D /* NSView+Traversing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSView+Traversing.h"; sourceTree = "<group>"; };
@ -279,6 +281,7 @@
93D39538C4CEFF46DF379254 /* MPNoStateButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPNoStateButton.m; sourceTree = "<group>"; };
93D396D04E57792A54D437AC /* NSArray+Indexing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSArray+Indexing.h"; sourceTree = "<group>"; };
93D3977484534E99F9BA579D /* MPPasswordWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPPasswordWindow.h; sourceTree = "<group>"; };
93D39934FD8D5BFABA46F41C /* MPGradientView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPGradientView.m; sourceTree = "<group>"; };
93D39A57A7823DE98A0FF83C /* MPPasswordWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPPasswordWindowController.m; sourceTree = "<group>"; };
93D39AA1EE2E1E7B81372240 /* NSDictionary+Indexing.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+Indexing.m"; sourceTree = "<group>"; };
93D39AC6360DDC16AEAA4119 /* MPSitesTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPSitesTableView.h; sourceTree = "<group>"; };
@ -1145,6 +1148,8 @@
93D39423D7BF4FD31FE6D27C /* MPSitesTableView.m */,
93D39F83DD151985F2C7345A /* MPMacApplication.m */,
93D3942099C9AD0374B5777D /* MPMacApplication.h */,
93D39934FD8D5BFABA46F41C /* MPGradientView.m */,
93D392FD65A1DF0E8B2A45C6 /* MPGradientView.h */,
);
path = Mac;
sourceTree = "<group>";
@ -2269,6 +2274,7 @@
DA4DAE941A7D8117003E5423 /* MPAlgorithmV3.m in Sources */,
DA4DAE951A7D8117003E5423 /* MPTypes.m in Sources */,
93D393A1646430FAAC73E7FE /* MPMacApplication.m in Sources */,
93D398D1F5D8CD5A22AF6929 /* MPGradientView.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};