diff --git a/MacPass/MPDatabaseSettingsWindowController.m b/MacPass/MPDatabaseSettingsWindowController.m index e5267ef5..a373978e 100644 --- a/MacPass/MPDatabaseSettingsWindowController.m +++ b/MacPass/MPDatabaseSettingsWindowController.m @@ -297,7 +297,7 @@ } - (void)_updateTrashFolders:(Kdb4Tree *)tree { - NSMenu *menu = [self _buildTreeMenu:tree]; + NSMenu *menu = [self _buildTrashTreeMenu:tree]; [self.selectRecycleBinGroupPopUpButton setMenu:menu]; } @@ -308,7 +308,9 @@ - (NSMenu *)_buildTrashTreeMenu:(Kdb4Tree *)tree { NSMenu *menu = [self _buildTreeMenu:tree]; - NSMenuItem *selectItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"SELECT_RECYCLEBIN", @"Menu item if no reycleBin is selected") action:NULL keyEquivalent:@""]; + NSMenuItem *selectItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"AUTOCREATE_TRASH_FOLDER", @"Menu item for automatic trash creation") + action:NULL + keyEquivalent:@""]; [selectItem setEnabled:YES]; [menu insertItem:selectItem atIndex:0]; @@ -318,7 +320,9 @@ - (NSMenu *)_buildTemplateTreeMenu:(Kdb4Tree *)tree { NSMenu *menu = [self _buildTreeMenu:tree]; - NSMenuItem *selectItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"SELECT_RECYCLEBIN", @"Menu item if no reycleBin is selected") action:NULL keyEquivalent:@""]; + NSMenuItem *selectItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"NO_TEMPLATE_GROUP", @"Menu item to reset the template groups") + action:NULL + keyEquivalent:@""]; [selectItem setEnabled:YES]; [menu insertItem:selectItem atIndex:0]; diff --git a/MacPass/MPDocument.m b/MacPass/MPDocument.m index e9ec7069..9d6814c6 100644 --- a/MacPass/MPDocument.m +++ b/MacPass/MPDocument.m @@ -350,6 +350,9 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey"; if(parent == self.trash) { return nil; // no new Groups in trash } + if([self isItemTrashed:parent]) { + return nil; + } KdbEntry *newEntry = [self.tree createEntry:parent]; newEntry.title = NSLocalizedString(@"DEFAULT_ENTRY_TITLE", @"Title for a newly created entry"); if(self.treeV4 && ([self.treeV4.defaultUserName length] > 0)) { @@ -368,6 +371,9 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey"; if(parent == self.trash) { return nil; // no new Groups in trash } + if([self isItemTrashed:parent]) { + return nil; + } KdbGroup *newGroup = [self.tree createGroup:parent]; newGroup.name = NSLocalizedString(@"DEFAULT_GROUP_NAME", @"Title for a newly created group"); newGroup.image = MPIconFolder; @@ -396,6 +402,9 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey"; if(!self.trash) { [self _createTrashGroup]; } + if([self isItemTrashed:entry]) { + return; // Entry is already trashed + } [entry moveToTrashUndoable:self.trash atIndex:[self.trash.entries count]]; } else { @@ -408,6 +417,9 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey"; if(!self.trash) { [self _createTrashGroup]; } + if( (group == self.trash) || [self isItemTrashed:group] ) { + return; //Groups already trashed cannot be deleted + } [group moveToTrashUndoable:self.trash atIndex:[self.trash.groups count]]; } else { diff --git a/MacPass/de.lproj/Localizable.strings b/MacPass/de.lproj/Localizable.strings index c7515ddd..6ec2e42c 100644 Binary files a/MacPass/de.lproj/Localizable.strings and b/MacPass/de.lproj/Localizable.strings differ diff --git a/MacPass/en.lproj/Localizable.strings b/MacPass/en.lproj/Localizable.strings index 70ad69a1..759134d7 100644 Binary files a/MacPass/en.lproj/Localizable.strings and b/MacPass/en.lproj/Localizable.strings differ