mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 16:22:21 +00:00
Added default Autotype sequence to settings. Using sepearte MPTreeDeleagte for autotype and editing
This commit is contained in:
Submodule KeePassKit updated: 450ad0d4dc...5f2c98f46f
@@ -31,6 +31,8 @@
|
||||
#import "MPNotifications.h"
|
||||
#import "MPConstants.h"
|
||||
#import "MPSavePanelAccessoryViewController.h"
|
||||
#import "MPTreeDelegate.h"
|
||||
|
||||
|
||||
#import "DDXMLNode.h"
|
||||
|
||||
@@ -65,6 +67,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey
|
||||
@private
|
||||
BOOL _didLockFile;
|
||||
NSData *_encryptedData;
|
||||
MPTreeDelegate *_treeDelgate;
|
||||
}
|
||||
|
||||
@property (nonatomic, assign) NSUInteger unlockCount;
|
||||
@@ -396,6 +399,10 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey
|
||||
if(_tree != tree) {
|
||||
_tree = tree;
|
||||
_tree.undoManager = [self undoManager];
|
||||
if(nil == _treeDelgate) {
|
||||
_treeDelgate = [[MPTreeDelegate alloc] initWithDocument:self];
|
||||
}
|
||||
_tree.delegate = _treeDelgate;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@ NSString *const kMPSettingsKeyRememeberdKeysForDatabases = @"Rememe
|
||||
NSString *const kMPSettingsKeySendCommandForControlKey = @"SendCommandKeyForControlKey";
|
||||
NSString *const kMPSettingsKeyEnableGlobalAutotype = @"EnableGlobalAutotype";
|
||||
NSString *const kMPSettingsKeyGlobalAutotypeKeyDataKey = @"GlobalAutotypeKeyDataKey";
|
||||
NSString *const kMPSettingsKeyDefaultGlobalAutotypeSequence = @"DefaultGlobalAutotypeSequence";
|
||||
|
||||
NSString *const kMPSettingsKeyEntrySearchFilterContext = @"EntrySearchFilterContext";
|
||||
|
||||
@@ -99,6 +100,7 @@ NSString *const kMPDeprecatedSettingsKeyEntrySearchFilterMode = @"En
|
||||
kMPSettingsKeyRememberKeyFilesForDatabases: @NO,
|
||||
kMPSettingsKeySendCommandForControlKey: @YES,
|
||||
kMPSettingsKeyEnableGlobalAutotype: @NO,
|
||||
kMPSettingsKeyDefaultGlobalAutotypeSequence: @"{USERNAME}{TAB}{PASSWORD}{ENTER}",
|
||||
kMPSettingsKeyEnableQuicklookPreview: @NO,
|
||||
kMPSettingsKeyCopyGeneratedPasswordToClipboard: @NO,
|
||||
kMPSettingsKeyDefaultPasswordRounds: @50000,
|
||||
|
||||
@@ -9,6 +9,10 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "KPKTree.h"
|
||||
|
||||
@class MPDocument;
|
||||
|
||||
@interface MPTreeDelegate : NSObject <KPKTreeDelegate>
|
||||
|
||||
- (instancetype)initWithDocument:(MPDocument *)document;
|
||||
|
||||
@end
|
||||
|
||||
@@ -8,11 +8,32 @@
|
||||
|
||||
#import "MPTreeDelegate.h"
|
||||
|
||||
#import "MPDocument.h"
|
||||
#import "MPSettingsHelper.h"
|
||||
|
||||
@interface MPTreeDelegate ();
|
||||
|
||||
@property (weak) MPDocument *document;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation MPTreeDelegate
|
||||
|
||||
- (instancetype)initWithDocument:(MPDocument *)document {
|
||||
self = [super init];
|
||||
if(self) {
|
||||
self.document = document;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSString *)defaultAutotypeSequenceForTree:(KPKTree *)tree {
|
||||
/* TODO use Settings for the default autotype sequence */
|
||||
return nil;
|
||||
return [[NSUserDefaults standardUserDefaults] stringForKey:kMPSettingsKeyDefaultGlobalAutotypeSequence];
|
||||
}
|
||||
|
||||
- (BOOL)shouldEditTree:(KPKTree *)tree {
|
||||
return (NO == self.document.isReadOnly);
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user