mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-15 01:02:24 +00:00
Enhanced error display of password input view. Now aloe localized errors are reported (this needs to be filtered, as the user doesn't need to know all the details)
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
#import "MPKeyfilePathControlDelegate.h"
|
#import "MPKeyfilePathControlDelegate.h"
|
||||||
|
|
||||||
#import "HNHRoundedSecureTextField.h"
|
#import "HNHRoundedSecureTextField.h"
|
||||||
|
#import "NSError+Messages.h"
|
||||||
|
|
||||||
@interface MPPasswordInputController ()
|
@interface MPPasswordInputController ()
|
||||||
|
|
||||||
@@ -60,9 +61,11 @@
|
|||||||
id windowController = [[[self view] window] windowController];
|
id windowController = [[[self view] window] windowController];
|
||||||
MPDocument *document = [windowController document];
|
MPDocument *document = [windowController document];
|
||||||
if(document) {
|
if(document) {
|
||||||
|
NSError *error = nil;
|
||||||
if(![document unlockWithPassword:[self.passwordTextField stringValue]
|
if(![document unlockWithPassword:[self.passwordTextField stringValue]
|
||||||
keyFileURL:[self.keyPathControl URL]]) {
|
keyFileURL:[self.keyPathControl URL]
|
||||||
[self _showError];
|
error:&error]) {
|
||||||
|
[self _showError:error];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
[windowController showEntries];
|
[windowController showEntries];
|
||||||
@@ -83,7 +86,11 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)_showError {
|
- (void)_showError:(NSError *)error {
|
||||||
|
if(error) {
|
||||||
|
NSString *errorMessage = [error descriptionForErrorCode];
|
||||||
|
[self.errorInfoTextField setStringValue:errorMessage];
|
||||||
|
}
|
||||||
[self.errorImageView setHidden:NO];
|
[self.errorImageView setHidden:NO];
|
||||||
[self.errorInfoTextField setHidden:NO];
|
[self.errorInfoTextField setHidden:NO];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user