changed password input to use block based api

This commit is contained in:
michael starke
2017-05-18 15:36:46 +02:00
parent 9e67d0a1ef
commit 4a95b10af1
3 changed files with 18 additions and 14 deletions

View File

@@ -323,7 +323,10 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
self.passwordInputController = [[MPPasswordInputController alloc] init];
}
[self _setContentViewController:self.passwordInputController];
[self.passwordInputController requestPassword];
__weak MPDocumentWindowController *welf = self;
[self.passwordInputController requestPassword:^BOOL(NSString *password, NSURL *keyURL, NSError *__autoreleasing *error) {
return [((MPDocument *)welf.document) unlockWithPassword:password keyFileURL:keyURL error:error];
}];
}
- (void)editPassword:(id)sender {