mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-15 06:12:24 +00:00
Merge pull request #436 from mariosangiorgio/master
Made the password length field editable in password generator
This commit is contained in:
@@ -299,6 +299,20 @@ static NSString *kMPContentBindingString3 = @"content.%@.%@.%@";
|
||||
[_activePopover showRelativeToRect:NSZeroRect ofView:view preferredEdge:edge];
|
||||
}
|
||||
|
||||
- ( BOOL) popoverShouldClose: ( NSPopover*) popover {
|
||||
/* See http://stackoverflow.com/a/34215887/353268
|
||||
* PasswordCreator uses a NSNumberFormatter to validate the input.
|
||||
* If the user types something that's not a number it will open a
|
||||
* dialog, which would cause the popover to close and MacPass to crash.
|
||||
*
|
||||
* This stops the popover to close when the dialog is active.
|
||||
*/
|
||||
if( ![[[[ popover contentViewController] view] window] makeFirstResponder: popover]) {
|
||||
return NO;
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)popoverDidClose:(NSNotification *)notification {
|
||||
/* We do not enable the button all the time, but it's working find this way */
|
||||
[self.generatePasswordButton setEnabled:YES];
|
||||
|
||||
Reference in New Issue
Block a user