mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 17:32:17 +00:00
fixed #165 Password generator is reseted if opened as single window not via generate button on entry
This commit is contained in:
@@ -192,7 +192,7 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi
|
||||
NSView *creatorView = [_passwordCreatorController view];
|
||||
[self.passwordCreatorWindow setContentView:creatorView];
|
||||
}
|
||||
|
||||
[self.passwordCreatorController reset];
|
||||
[self.passwordCreatorWindow makeKeyAndOrderFront:self.passwordCreatorWindow];
|
||||
}
|
||||
|
||||
|
||||
@@ -12,4 +12,11 @@
|
||||
|
||||
@property (copy, readonly) NSString *generatedPassword;
|
||||
|
||||
/**
|
||||
* Should be called to reset the generator
|
||||
*
|
||||
* @param sender sender of the action
|
||||
*/
|
||||
- (void)reset;
|
||||
|
||||
@end
|
||||
|
||||
@@ -108,13 +108,18 @@ typedef NS_ENUM(NSUInteger, MPPasswordRating) {
|
||||
[self.symbolsButton setTag:MPPasswordCharactersSymbols];
|
||||
|
||||
[self _resetCharacters];
|
||||
[self _generatePassword:nil];
|
||||
[self _generatePassword:self];
|
||||
}
|
||||
|
||||
- (void)reset {
|
||||
[self _resetCharacters];
|
||||
[self _generatePassword:self];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark Actions
|
||||
|
||||
- (IBAction)_generatePassword:(id)sender {
|
||||
- (IBAction)_generatePassword:(id)sender {
|
||||
if(_useCustomString) {
|
||||
if([[_customCharactersTextField stringValue] length] > 0) {
|
||||
self.password = [[_customCharactersTextField stringValue] passwordWithLength:_passwordLength];
|
||||
|
||||
Reference in New Issue
Block a user