mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-15 06:12:24 +00:00
Enabled drag and drop of urls to create entries
This commit is contained in:
@@ -68,13 +68,9 @@
|
|||||||
- (void)windowDidLoad {
|
- (void)windowDidLoad {
|
||||||
[super windowDidLoad];
|
[super windowDidLoad];
|
||||||
|
|
||||||
/* Drag and Drop of URLS is working, but the current
|
[[self window] setDelegate:self.documentWindowDelegate];
|
||||||
und/Redo system cannot guarantee that the undomanager is found
|
[[self window] registerForDraggedTypes:@[NSURLPboardType]];
|
||||||
when no window is active, thus this needs to be addresed when switching to KeePassKit
|
|
||||||
|
|
||||||
[[self window] setDelegate:self.documentWindowDelegate];
|
|
||||||
[[self window] registerForDraggedTypes:@[NSURLPboardType]];
|
|
||||||
*/
|
|
||||||
|
|
||||||
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didRevertDocument:) name:MPDocumentDidRevertNotifiation object:[self document]];
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_didRevertDocument:) name:MPDocumentDidRevertNotifiation object:[self document]];
|
||||||
|
|
||||||
@@ -170,13 +166,13 @@
|
|||||||
[alert addButtonWithTitle:NSLocalizedString(@"CANCEL", "Cancel")];
|
[alert addButtonWithTitle:NSLocalizedString(@"CANCEL", "Cancel")];
|
||||||
|
|
||||||
[[alert buttons][1] setKeyEquivalent:[NSString stringWithFormat:@"%c", 0x1b]];
|
[[alert buttons][1] setKeyEquivalent:[NSString stringWithFormat:@"%c", 0x1b]];
|
||||||
|
|
||||||
[alert beginSheetModalForWindow:[self window] modalDelegate:nil didEndSelector:NULL contextInfo:NULL];
|
[alert beginSheetModalForWindow:[self window] modalDelegate:nil didEndSelector:NULL contextInfo:NULL];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!document.hasPasswordOrKey) {
|
if(!document.hasPasswordOrKey) {
|
||||||
// warning if no password ist set!
|
NSLog(@"No Password and/or kefile set");// warning if no password ist set!
|
||||||
}
|
}
|
||||||
[[self document] saveDocument:sender];
|
[[self document] saveDocument:sender];
|
||||||
}
|
}
|
||||||
@@ -206,7 +202,7 @@
|
|||||||
enabled &= (nil != document.selectedItem) && (document.selectedItem != document.trash);
|
enabled &= (nil != document.selectedItem) && (document.selectedItem != document.trash);
|
||||||
}
|
}
|
||||||
|
|
||||||
enabled &= !( !document.encrypted || document.isReadOnly );
|
enabled &= !( document.encrypted || document.isReadOnly );
|
||||||
return enabled;
|
return enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user