Changed layout to accommodate locking

Fixed Autolayout hickups
Added lock screen
Removed unused views
Some refactorings
This commit is contained in:
michael starke
2013-06-08 23:54:57 +02:00
parent a014f2925c
commit 53850d8d35
26 changed files with 280 additions and 840 deletions

View File

@@ -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 {