From 30697648b9a4c3b704c846914206e643fb207581 Mon Sep 17 00:00:00 2001 From: michael starke Date: Sat, 20 Jul 2013 17:04:13 +0200 Subject: [PATCH] Updated localization Fixed an issue that automatically set the first group to be the trashcan --- MacPass/MPDatabaseSettingsWindowController.m | 10 +++++++--- MacPass/MPDocument.m | 12 ++++++++++++ MacPass/de.lproj/Localizable.strings | Bin 10502 -> 10716 bytes MacPass/en.lproj/Localizable.strings | Bin 9834 -> 10024 bytes 4 files changed, 19 insertions(+), 3 deletions(-) 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 c7515ddd053efd51641959fbe262bc09b86cdd00..6ec2e42ce93329e9dc57f130de2dd758cdb69567 100644 GIT binary patch delta 322 zcmZn*x)Z$N0^{TqDUtd#hJ1!11_g#hhEj$SAUhYxDq+ZENCt|P0A&&xiWxG1>|`K2 z6)Km{kOvgeV$f&cVo+jmWC&#lVen^gW(Z<%1@c0GWIT`z02_X9c$CG3^uEoFLT$7$^b~O=c(ok|{tDEe3rCE(RrrUAG7n`4&QqYFW&W5P_kY*FClP%g%C$b>MfPT1`$2UPKXq1>WDi2^aOTvnrNW} z8xCd&Fh&PHT)qO<1*=azMW4FI?hsx2KIbj8d2P-!(as}d8qOa;h=k{)9AlnUiubDK zooPlZXGzH;sU`VzfMnfb&o6od?W{N_7`x{VUtW(in$N`u6LOJQiCW$C^5ozrCCwhD NDyWGu$dbmZ{03DOKJfqm delta 158 zcmZ4C_sVC(DaOeUq`WrYV7em;W-ODmVw`-6QA9bDA&o(SA&(&+NER`qGE_1oGvoki zCx%R*r~;5Io_t0Z6qrhMb g#2~e)V6&1LN`U+zATJqcKFIVWkm;K*N`>