mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 12:52:21 +00:00
Fixed wrongfully setting password when password is disabled in editPasswordWindow
Removed some debug logging
This commit is contained in:
@@ -511,12 +511,10 @@ typedef NS_ENUM(NSUInteger, MPAlertType) {
|
||||
}
|
||||
|
||||
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem {
|
||||
NSLog(@"Valdiate MenuItem:%@", [menuItem title]);
|
||||
return [self validateUserInterfaceItem:menuItem];
|
||||
}
|
||||
|
||||
- (BOOL)validateToolbarItem:(NSToolbarItem *)theItem {
|
||||
NSLog(@"Valdiate ToolbarItem:%@", [theItem label]);
|
||||
return [self validateUserInterfaceItem:theItem];
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,9 @@
|
||||
|
||||
#pragma mark Actions
|
||||
- (IBAction)save:(id)sender {
|
||||
[_currentDocument changePassword:[self.passwordTextField stringValue] keyFileURL:[self.keyfilePathControl URL]];
|
||||
const BOOL hasPassword = ([self.hasPasswordSwitchButton state] == NSOnState);
|
||||
NSString *password = hasPassword ? [self.passwordTextField stringValue] : nil;
|
||||
[_currentDocument changePassword:password keyFileURL:[self.keyfilePathControl URL]];
|
||||
[self dismissSheet:NSRunStoppedResponse];
|
||||
if(self.delegate && [self.delegate respondsToSelector:@selector(didFinishPasswordEditing:)]) {
|
||||
[self.delegate didFinishPasswordEditing:YES];
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
id target = [NSApp targetForAction:[self action] to:nil from:self];
|
||||
BOOL isValid = (nil != target);
|
||||
id validateTarget = [NSApp targetForAction:@selector(validateToolbarItem:) to:nil from:self];
|
||||
//NSLog(@"Validation for ToolbarItem:%@", [validateTarget class]);
|
||||
if(validateTarget) {
|
||||
isValid &= [validateTarget validateToolbarItem:self];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user