mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-18 20:49:26 +00:00
Changed layout to accommodate locking
Fixed Autolayout hickups Added lock screen Removed unused views Some refactorings
This commit is contained in:
@@ -51,10 +51,21 @@
|
||||
}
|
||||
|
||||
- (IBAction)_decrypt:(id)sender {
|
||||
MPDocumentWindowController *windowController = (MPDocumentWindowController *)[[[self view] window] windowController];
|
||||
id windowController = [[[self view] window] windowController];
|
||||
MPDocument *document = [windowController document];
|
||||
if(document) {
|
||||
BOOL isOk = [document decryptWithPassword:[self.passwordTextField stringValue] keyFileURL:[self.keyPathControl URL]];
|
||||
BOOL isOk = NO;
|
||||
if(document.isDecrypted) {
|
||||
// TODO: Fix unlocking to actually test
|
||||
BOOL noPassword = !document.password && [[self.passwordTextField stringValue] length] == 0;
|
||||
BOOL passwordOk = [document.password isEqualToString:[self.passwordTextField stringValue]];
|
||||
BOOL noKey = document.key == [self.keyPathControl URL];
|
||||
BOOL keyOk = [document.key isEqualTo:[self.keyPathControl URL]];
|
||||
isOk = (noPassword || passwordOk) && (noKey || keyOk);
|
||||
}
|
||||
else {
|
||||
isOk = [document decryptWithPassword:[self.passwordTextField stringValue] keyFileURL:[self.keyPathControl URL]];
|
||||
}
|
||||
if(!isOk) {
|
||||
[self _showError];
|
||||
}
|
||||
@@ -69,6 +80,7 @@
|
||||
[self.keyPathControl setURL:nil];
|
||||
[self.errorInfoTextField setHidden:YES];
|
||||
[self.errorImageView setHidden:YES];
|
||||
|
||||
}
|
||||
|
||||
- (void)_showError {
|
||||
|
||||
Reference in New Issue
Block a user