mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 07:02:39 +00:00
Updated localization
Fixed an issue that automatically set the first group to be the trashcan
This commit is contained in:
@@ -297,7 +297,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)_updateTrashFolders:(Kdb4Tree *)tree {
|
- (void)_updateTrashFolders:(Kdb4Tree *)tree {
|
||||||
NSMenu *menu = [self _buildTreeMenu:tree];
|
NSMenu *menu = [self _buildTrashTreeMenu:tree];
|
||||||
[self.selectRecycleBinGroupPopUpButton setMenu:menu];
|
[self.selectRecycleBinGroupPopUpButton setMenu:menu];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -308,7 +308,9 @@
|
|||||||
- (NSMenu *)_buildTrashTreeMenu:(Kdb4Tree *)tree {
|
- (NSMenu *)_buildTrashTreeMenu:(Kdb4Tree *)tree {
|
||||||
NSMenu *menu = [self _buildTreeMenu: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];
|
[selectItem setEnabled:YES];
|
||||||
[menu insertItem:selectItem atIndex:0];
|
[menu insertItem:selectItem atIndex:0];
|
||||||
|
|
||||||
@@ -318,7 +320,9 @@
|
|||||||
- (NSMenu *)_buildTemplateTreeMenu:(Kdb4Tree *)tree {
|
- (NSMenu *)_buildTemplateTreeMenu:(Kdb4Tree *)tree {
|
||||||
NSMenu *menu = [self _buildTreeMenu: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];
|
[selectItem setEnabled:YES];
|
||||||
[menu insertItem:selectItem atIndex:0];
|
[menu insertItem:selectItem atIndex:0];
|
||||||
|
|
||||||
|
|||||||
@@ -350,6 +350,9 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey";
|
|||||||
if(parent == self.trash) {
|
if(parent == self.trash) {
|
||||||
return nil; // no new Groups in trash
|
return nil; // no new Groups in trash
|
||||||
}
|
}
|
||||||
|
if([self isItemTrashed:parent]) {
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
KdbEntry *newEntry = [self.tree createEntry:parent];
|
KdbEntry *newEntry = [self.tree createEntry:parent];
|
||||||
newEntry.title = NSLocalizedString(@"DEFAULT_ENTRY_TITLE", @"Title for a newly created entry");
|
newEntry.title = NSLocalizedString(@"DEFAULT_ENTRY_TITLE", @"Title for a newly created entry");
|
||||||
if(self.treeV4 && ([self.treeV4.defaultUserName length] > 0)) {
|
if(self.treeV4 && ([self.treeV4.defaultUserName length] > 0)) {
|
||||||
@@ -368,6 +371,9 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey";
|
|||||||
if(parent == self.trash) {
|
if(parent == self.trash) {
|
||||||
return nil; // no new Groups in trash
|
return nil; // no new Groups in trash
|
||||||
}
|
}
|
||||||
|
if([self isItemTrashed:parent]) {
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
KdbGroup *newGroup = [self.tree createGroup:parent];
|
KdbGroup *newGroup = [self.tree createGroup:parent];
|
||||||
newGroup.name = NSLocalizedString(@"DEFAULT_GROUP_NAME", @"Title for a newly created group");
|
newGroup.name = NSLocalizedString(@"DEFAULT_GROUP_NAME", @"Title for a newly created group");
|
||||||
newGroup.image = MPIconFolder;
|
newGroup.image = MPIconFolder;
|
||||||
@@ -396,6 +402,9 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey";
|
|||||||
if(!self.trash) {
|
if(!self.trash) {
|
||||||
[self _createTrashGroup];
|
[self _createTrashGroup];
|
||||||
}
|
}
|
||||||
|
if([self isItemTrashed:entry]) {
|
||||||
|
return; // Entry is already trashed
|
||||||
|
}
|
||||||
[entry moveToTrashUndoable:self.trash atIndex:[self.trash.entries count]];
|
[entry moveToTrashUndoable:self.trash atIndex:[self.trash.entries count]];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -408,6 +417,9 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey";
|
|||||||
if(!self.trash) {
|
if(!self.trash) {
|
||||||
[self _createTrashGroup];
|
[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]];
|
[group moveToTrashUndoable:self.trash atIndex:[self.trash.groups count]];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user