mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 05:52:58 +00:00
Fixed missing binding to enable trahs in settings tab
Updated copy/drag and drop to changed KeePassKit
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="4514" systemVersion="13A603" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="4514" systemVersion="13B42" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment defaultVersion="1080" identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="4514"/>
|
||||
|
||||
@@ -184,6 +184,7 @@
|
||||
}
|
||||
|
||||
- (void)_setupAdvancedTab:(KPKTree *)tree {
|
||||
[self bind:@"trashEnabled" toObject:tree.metaData withKeyPath:@"recycleBinEnabled" options:nil];
|
||||
[self.enableRecycleBinCheckButton bind:NSValueBinding toObject:self withKeyPath:@"trashEnabled" options:nil];
|
||||
[self.selectRecycleBinGroupPopUpButton bind:NSEnabledBinding toObject:self withKeyPath:@"trashEnabled" options:nil];
|
||||
[self _updateTrashFolders:tree];
|
||||
|
||||
@@ -48,6 +48,7 @@ APPKIT_EXTERN NSString *const MPDocumentGroupKey;
|
||||
@property (strong, readonly, nonatomic) KPKTree *tree;
|
||||
@property (nonatomic, weak, readonly) KPKGroup *root;
|
||||
@property (nonatomic, weak) KPKGroup *trash;
|
||||
@property (nonatomic, readonly) BOOL useTrash;
|
||||
@property (nonatomic, weak) KPKGroup *templates;
|
||||
|
||||
@property (nonatomic, strong, readonly) KPKCompositeKey *compositeKey;
|
||||
|
||||
@@ -73,7 +73,6 @@ typedef NS_ENUM(NSUInteger, MPAlertType) {
|
||||
@property (strong) NSURL *lockFileURL;
|
||||
@property (nonatomic, assign) BOOL isAllowedToStoreKeyFile;
|
||||
|
||||
@property (readonly) BOOL useTrash;
|
||||
@property (strong) IBOutlet NSView *warningView;
|
||||
@property (weak) IBOutlet NSImageView *warningViewImage;
|
||||
|
||||
@@ -325,6 +324,10 @@ typedef NS_ENUM(NSUInteger, MPAlertType) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (BOOL)useTrash {
|
||||
return self.tree.metaData.recycleBinEnabled;
|
||||
}
|
||||
|
||||
- (KPKGroup *)templates {
|
||||
static KPKGroup *_templates = nil;
|
||||
BOOL templateValid = [_templates.uuid isEqual:self.tree.metaData.entryTemplatesGroup];
|
||||
@@ -404,10 +407,6 @@ typedef NS_ENUM(NSUInteger, MPAlertType) {
|
||||
return self.tree.allGroups;
|
||||
}
|
||||
|
||||
- (BOOL)useTrash {
|
||||
return self.tree.metaData.recycleBinEnabled;
|
||||
}
|
||||
|
||||
- (BOOL)isItemTrashed:(id)item {
|
||||
BOOL validItem = [item isKindOfClass:[KPKEntry class]] || [item isKindOfClass:[KPKGroup class]];
|
||||
if(!item) {
|
||||
@@ -540,7 +539,7 @@ typedef NS_ENUM(NSUInteger, MPAlertType) {
|
||||
if(entryUUID) {
|
||||
KPKEntry *templateEntry = [self findEntry:entryUUID];
|
||||
if(templateEntry && self.selectedGroup) {
|
||||
KPKEntry *copy = [templateEntry copyWithTitle:templateEntry.title options:0];
|
||||
KPKEntry *copy = [templateEntry copyWithTitle:templateEntry.title];
|
||||
[self.selectedGroup addEntry:copy];
|
||||
[self.selectedGroup.undoManager setActionName:NSLocalizedString(@"ADD_TREMPLATE_ENTRY", "")];
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell";
|
||||
- (void)_updateContextBar {
|
||||
MPDocument *document = [[self windowController] document];
|
||||
if(![self.contextBarViewController hasFilter]) {
|
||||
BOOL showTrash = (document.selectedGroup == document.trash || [document isItemTrashed:document.selectedItem]);
|
||||
BOOL showTrash = document.useTrash && (document.selectedGroup == document.trash || [document isItemTrashed:document.selectedItem]);
|
||||
if(showTrash) {
|
||||
[self _showTrashBar];
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
KPKGroup *targetGroup = (KPKGroup *)targetItem;
|
||||
if(draggedGroup) {
|
||||
if(copyItem || (nil == self.localDraggedGroup) ) {
|
||||
draggedGroup = [draggedGroup copyWithName:nil options:0];
|
||||
draggedGroup = [draggedGroup copyWithName:nil];
|
||||
[targetGroup addGroup:draggedGroup atIndex:index];
|
||||
[targetGroup.undoManager setActionName:NSLocalizedString(@"COPY_GROUP", "")];
|
||||
return YES;
|
||||
@@ -159,7 +159,7 @@
|
||||
}
|
||||
else if(draggedEntry) {
|
||||
if(copyItem || (nil == self.localDraggedEntry)) {
|
||||
draggedEntry = [draggedEntry copyWithTitle:nil options:0];
|
||||
draggedEntry = [draggedEntry copyWithTitle:nil];
|
||||
[targetGroup addEntry:draggedEntry atIndex:index];
|
||||
[targetGroup.undoManager setActionName:NSLocalizedString(@"COPY_ENTRY", "")];
|
||||
return YES;
|
||||
|
||||
Reference in New Issue
Block a user