mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 21:13:35 +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 {
|
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem {
|
||||||
NSLog(@"Valdiate MenuItem:%@", [menuItem title]);
|
|
||||||
return [self validateUserInterfaceItem:menuItem];
|
return [self validateUserInterfaceItem:menuItem];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL)validateToolbarItem:(NSToolbarItem *)theItem {
|
- (BOOL)validateToolbarItem:(NSToolbarItem *)theItem {
|
||||||
NSLog(@"Valdiate ToolbarItem:%@", [theItem label]);
|
|
||||||
return [self validateUserInterfaceItem:theItem];
|
return [self validateUserInterfaceItem:theItem];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,9 @@
|
|||||||
|
|
||||||
#pragma mark Actions
|
#pragma mark Actions
|
||||||
- (IBAction)save:(id)sender {
|
- (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];
|
[self dismissSheet:NSRunStoppedResponse];
|
||||||
if(self.delegate && [self.delegate respondsToSelector:@selector(didFinishPasswordEditing:)]) {
|
if(self.delegate && [self.delegate respondsToSelector:@selector(didFinishPasswordEditing:)]) {
|
||||||
[self.delegate didFinishPasswordEditing:YES];
|
[self.delegate didFinishPasswordEditing:YES];
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
id target = [NSApp targetForAction:[self action] to:nil from:self];
|
id target = [NSApp targetForAction:[self action] to:nil from:self];
|
||||||
BOOL isValid = (nil != target);
|
BOOL isValid = (nil != target);
|
||||||
id validateTarget = [NSApp targetForAction:@selector(validateToolbarItem:) to:nil from:self];
|
id validateTarget = [NSApp targetForAction:@selector(validateToolbarItem:) to:nil from:self];
|
||||||
//NSLog(@"Validation for ToolbarItem:%@", [validateTarget class]);
|
|
||||||
if(validateTarget) {
|
if(validateTarget) {
|
||||||
isValid &= [validateTarget validateToolbarItem:self];
|
isValid &= [validateTarget validateToolbarItem:self];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user