mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 17:32:17 +00:00
Re-enabled password request before saving a database that has no password and key
Stripped logging code Fixed issue with save panel not being updated correctly when panel is just reshown
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
- (id)initWithDocument:(MPDocument *)document {
|
||||
self = [super initWithWindowNibName:@"PasswordEditWindow"];
|
||||
if(self){
|
||||
_allowsEmptyPasswordOrKey = YES;
|
||||
_showPassword = NO;
|
||||
_hasValidPasswordOrKey = NO;
|
||||
_document = document;
|
||||
@@ -84,10 +85,16 @@
|
||||
_document.password = [self.passwordTextField stringValue];
|
||||
_document.key = [self.keyfilePathControl URL];
|
||||
[self dismissSheet:NSRunStoppedResponse];
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(didFinishPasswordEditing:)]) {
|
||||
[self.delegate didFinishPasswordEditing:YES];
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)cancel:(id)sender {
|
||||
[self dismissSheet:NSRunAbortedResponse];
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(didFinishPasswordEditing:)]) {
|
||||
[self.delegate didFinishPasswordEditing:NO];
|
||||
}
|
||||
}
|
||||
|
||||
- (IBAction)clearKey:(id)sender {
|
||||
@@ -138,7 +145,7 @@
|
||||
BOOL hasPasswordOrKey = (hasKey || hasPassword);
|
||||
keyOk = hasKey ? keyOk : YES;
|
||||
passwordOk = hasPassword ? passwordOk : YES;
|
||||
self.hasValidPasswordOrKey = passwordOk && keyOk;
|
||||
self.hasValidPasswordOrKey = (hasPasswordOrKey || self.allowsEmptyPasswordOrKey ) && passwordOk && keyOk;
|
||||
|
||||
if(!hasPasswordOrKey) {
|
||||
[self.errorTextField setTextColor:[NSColor controlTextColor]];
|
||||
|
||||
Reference in New Issue
Block a user