Added window associations to the auto type fix dialog

Moved handling from app delegate to window controller
fixed isse with wrongfully setting document on fixAutotypeWindow
This commit is contained in:
michael starke
2014-03-28 00:11:53 +01:00
parent 34b8169895
commit e8a0e0f0a3
7 changed files with 122 additions and 63 deletions

View File

@@ -20,6 +20,7 @@
#import "MPConstants.h"
#import "MPSettingsHelper.h"
#import "MPDocumentWindowDelegate.h"
#import "MPFixAutotypeWindowController.h"
#import "MPContextToolbarButton.h"
#import "KPKTree.h"
@@ -48,6 +49,7 @@ typedef void (^MPPasswordChangedBlock)(void);
@property (strong) MPDocumentWindowDelegate *documentWindowDelegate;
@property (strong) MPPasswordEditWindowController *passwordEditWindowController;
@property (strong) MPToolbarDelegate *toolbarDelegate;
@property (strong) MPFixAutotypeWindowController *fixAutotypeWindowController;
@property (nonatomic, copy) MPPasswordChangedBlock passwordChangedBlock;
@@ -238,6 +240,14 @@ typedef void (^MPPasswordChangedBlock)(void);
}];
}
- (void)fixAutotype:(id)sender {
if(!self.fixAutotypeWindowController) {
self.fixAutotypeWindowController = [[MPFixAutotypeWindowController alloc] init];
}
self.fixAutotypeWindowController.workingDocument = [self document];
[[self.fixAutotypeWindowController window] makeKeyAndOrderFront:sender];
}
- (void)showPasswordInput {
if(!self.passwordInputController) {
self.passwordInputController = [[MPPasswordInputController alloc] init];