mirror of
https://github.com/MacPass/MacPass.git
synced 2026-01-31 04:48:19 +00:00
extracted merge to function. Added action to merge arbitrary files
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user