mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-17 07:39:27 +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 {
|
- (void)exportDatabase:(id)sender {
|
||||||
NSSavePanel *savePanel = [NSSavePanel savePanel];
|
NSSavePanel *savePanel = [NSSavePanel savePanel];
|
||||||
[savePanel setAllowsOtherFileTypes:YES];
|
[savePanel setAllowsOtherFileTypes:YES];
|
||||||
|
[savePanel setAllowedFileTypes:@[(id)kUTTypeXML]];
|
||||||
|
[savePanel setCanSelectHiddenExtension:YES];
|
||||||
[savePanel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result) {
|
[savePanel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result) {
|
||||||
if(result == NSFileHandlingPanelOKButton) {
|
if(result == NSFileHandlingPanelOKButton) {
|
||||||
[[self document] writeXMLToURL:savePanel.URL];
|
[[self document] writeXMLToURL:savePanel.URL];
|
||||||
|
|||||||
@@ -131,7 +131,9 @@
|
|||||||
if(copyItem || (nil == self.localDraggedGroup) ) {
|
if(copyItem || (nil == self.localDraggedGroup) ) {
|
||||||
/* Add Copy to title */
|
/* Add Copy to title */
|
||||||
NSString *copyTemplate = NSLocalizedString(@"%@_COPY", "");
|
NSString *copyTemplate = NSLocalizedString(@"%@_COPY", "");
|
||||||
|
/* If we copy, we need to update the uuid */
|
||||||
draggedGroup.name = [NSString stringWithFormat:copyTemplate, draggedGroup.name];
|
draggedGroup.name = [NSString stringWithFormat:copyTemplate, draggedGroup.name];
|
||||||
|
draggedGroup.uuid = [NSUUID UUID];
|
||||||
[targetGroup addGroup:draggedGroup atIndex:index];
|
[targetGroup addGroup:draggedGroup atIndex:index];
|
||||||
[targetGroup.undoManager setActionName:NSLocalizedString(@"COPY_GROUP", "")];
|
[targetGroup.undoManager setActionName:NSLocalizedString(@"COPY_GROUP", "")];
|
||||||
return YES;
|
return YES;
|
||||||
@@ -147,8 +149,10 @@
|
|||||||
}
|
}
|
||||||
else if(draggedEntry) {
|
else if(draggedEntry) {
|
||||||
if(copyItem || (nil == self.localDraggedEntry)) {
|
if(copyItem || (nil == self.localDraggedEntry)) {
|
||||||
|
/* if we copy, we need to update the uuid */
|
||||||
NSString *copyTemplate = NSLocalizedString(@"%@_COPY", "");
|
NSString *copyTemplate = NSLocalizedString(@"%@_COPY", "");
|
||||||
draggedEntry.title = [NSString stringWithFormat:copyTemplate, draggedEntry.title];
|
draggedEntry.title = [NSString stringWithFormat:copyTemplate, draggedEntry.title];
|
||||||
|
draggedEntry.uuid = [NSUUID UUID];
|
||||||
[targetGroup addEntry:draggedEntry atIndex:index];
|
[targetGroup addEntry:draggedEntry atIndex:index];
|
||||||
[targetGroup.undoManager setActionName:NSLocalizedString(@"COPY_ENTRY", "")];
|
[targetGroup.undoManager setActionName:NSLocalizedString(@"COPY_ENTRY", "")];
|
||||||
return YES;
|
return YES;
|
||||||
|
|||||||
Reference in New Issue
Block a user