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:
michael starke
2013-09-30 10:26:46 +02:00
parent e54790b745
commit 63a756039c
2 changed files with 6 additions and 0 deletions

View File

@@ -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];

View File

@@ -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;