mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 23:52:21 +00:00
Fixed: UUID on copy operation are generated for copied items
Fixed: Export to XML Dialog now shows hide extension button Fixed: Export to XML Dialog now uses XML as default file type (and thus extension)
This commit is contained in:
@@ -190,6 +190,8 @@ typedef NS_ENUM(NSUInteger, MPAlertContext) {
|
||||
- (void)exportDatabase:(id)sender {
|
||||
NSSavePanel *savePanel = [NSSavePanel savePanel];
|
||||
[savePanel setAllowsOtherFileTypes:YES];
|
||||
[savePanel setAllowedFileTypes:@[(id)kUTTypeXML]];
|
||||
[savePanel setCanSelectHiddenExtension:YES];
|
||||
[savePanel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result) {
|
||||
if(result == NSFileHandlingPanelOKButton) {
|
||||
[[self document] writeXMLToURL:savePanel.URL];
|
||||
|
||||
@@ -131,7 +131,9 @@
|
||||
if(copyItem || (nil == self.localDraggedGroup) ) {
|
||||
/* Add Copy to title */
|
||||
NSString *copyTemplate = NSLocalizedString(@"%@_COPY", "");
|
||||
/* If we copy, we need to update the uuid */
|
||||
draggedGroup.name = [NSString stringWithFormat:copyTemplate, draggedGroup.name];
|
||||
draggedGroup.uuid = [NSUUID UUID];
|
||||
[targetGroup addGroup:draggedGroup atIndex:index];
|
||||
[targetGroup.undoManager setActionName:NSLocalizedString(@"COPY_GROUP", "")];
|
||||
return YES;
|
||||
@@ -147,8 +149,10 @@
|
||||
}
|
||||
else if(draggedEntry) {
|
||||
if(copyItem || (nil == self.localDraggedEntry)) {
|
||||
/* if we copy, we need to update the uuid */
|
||||
NSString *copyTemplate = NSLocalizedString(@"%@_COPY", "");
|
||||
draggedEntry.title = [NSString stringWithFormat:copyTemplate, draggedEntry.title];
|
||||
draggedEntry.uuid = [NSUUID UUID];
|
||||
[targetGroup addEntry:draggedEntry atIndex:index];
|
||||
[targetGroup.undoManager setActionName:NSLocalizedString(@"COPY_ENTRY", "")];
|
||||
return YES;
|
||||
|
||||
Reference in New Issue
Block a user