extracted merge to function. Added action to merge arbitrary files

This commit is contained in:
michael starke
2017-05-18 12:10:49 +02:00
parent 0dd4a2cc1f
commit 10556d6c08
4 changed files with 38 additions and 6 deletions

View File

@@ -296,6 +296,20 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
}];
}
- (void)mergeWithOther:(id)sender {
NSOpenPanel *openPanel = [NSOpenPanel openPanel];
MPDocument *document = self.document;
openPanel.allowsMultipleSelection = NO;
openPanel.canChooseDirectories = NO;
openPanel.canChooseFiles = YES;
//openPanel.allowedFileTypes = @[(id)kUTTypeXML];
[openPanel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result) {
if(result == NSFileHandlingPanelOKButton) {
[document mergeWithContentsFromURL:openPanel.URL];
}
}];
}
- (void)fixAutotype:(id)sender {
if(!self.fixAutotypeWindowController) {
self.fixAutotypeWindowController = [[MPFixAutotypeWindowController alloc] init];