mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 23:52:21 +00:00
Added duplicate entry with options
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#import "MPDatabaseSettingsWindowController.h"
|
||||
#import "MPDocument.h"
|
||||
#import "MPDocumentWindowDelegate.h"
|
||||
#import "MPDuplicateEntryOptionsWindowController.h"
|
||||
#import "MPEntryViewController.h"
|
||||
#import "MPFixAutotypeWindowController.h"
|
||||
#import "MPInspectorViewController.h"
|
||||
@@ -397,6 +398,27 @@ typedef void (^MPPasswordChangedBlock)(BOOL didChangePassword);
|
||||
[self.document deleteNode:node];
|
||||
}
|
||||
}
|
||||
- (void)duplicateEntryWithOptions:(id)sender {
|
||||
MPDuplicateEntryOptionsWindowController *wc = [[MPDuplicateEntryOptionsWindowController alloc] init];
|
||||
__weak MPDocumentWindowController *welf = self;
|
||||
|
||||
[self.window beginSheet:wc.window completionHandler:^(NSModalResponse returnCode) {
|
||||
if(returnCode == NSModalResponseOK) {
|
||||
|
||||
KPKCopyOptions options = kKPKCopyOptionNone;
|
||||
if(wc.referenceUsername) {
|
||||
options |= kKPKCopyOptionReferenceUsername;
|
||||
}
|
||||
if(wc.referencePassword) {
|
||||
options |= kKPKCopyOptionReferencePassword;
|
||||
}
|
||||
if(wc.duplicateHistory) {
|
||||
options |= kKPKCopyOptionCopyHistory;
|
||||
}
|
||||
[((MPDocument *)welf.document) duplicateEntryWithOptions:options];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)pickExpiryDate:(id)sender {
|
||||
[self.inspectorViewController pickExpiryDate:sender];
|
||||
|
||||
Reference in New Issue
Block a user