From d26304285f6988b582ed795d521bba2d200f0983 Mon Sep 17 00:00:00 2001 From: Michael Starke Date: Sun, 31 Mar 2019 15:52:38 +0200 Subject: [PATCH] Fixed enforce each of group setting not being correctly stored as defaults (fixes #914) --- MacPass/MPPasswordCreatorViewController.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MacPass/MPPasswordCreatorViewController.m b/MacPass/MPPasswordCreatorViewController.m index b68c5ac6..8c73ea27 100644 --- a/MacPass/MPPasswordCreatorViewController.m +++ b/MacPass/MPPasswordCreatorViewController.m @@ -241,6 +241,7 @@ typedef NS_ENUM(NSUInteger, MPPasswordRating) { [NSUserDefaults.standardUserDefaults setInteger:self.characterFlags forKey:kMPSettingsKeyPasswordCharacterFlags]; [NSUserDefaults.standardUserDefaults setBool:self.useCustomString forKey:kMPSettingsKeyPasswordUseCustomString]; [NSUserDefaults.standardUserDefaults setObject:self.customCharactersTextField.stringValue forKey:kMPSettingsKeyPasswordCustomString]; + [NSUserDefaults.standardUserDefaults setBool:self.ensureOccurance forKey:kMPSettingsKeyPasswordEnsureOccurance]; } else { NSLog(@"Cannot set password generator defaults. Inconsistent state. Aborting."); @@ -274,10 +275,8 @@ typedef NS_ENUM(NSUInteger, MPPasswordRating) { } - (void)setRepresentedObject:(id)representedObject { - if(self.representedObject != representedObject) { - self.useEntryDefaults = [self _hasValidDefaultsForCurrentEntry]; - } [super setRepresentedObject:representedObject]; + self.useEntryDefaults = [self _hasValidDefaultsForCurrentEntry]; } - (void)setPassword:(NSString *)password { @@ -307,6 +306,7 @@ typedef NS_ENUM(NSUInteger, MPPasswordRating) { - (void)setEnsureOccurance:(BOOL)useCharacterFromEachGroup { if(self.ensureOccurance != useCharacterFromEachGroup) { + self.setDefaultButton.enabled = YES; _ensureOccurance = useCharacterFromEachGroup; [self _resetCharacters]; [self _generatePassword:nil];