mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 12:52: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 "MPNotifications.h"
|
||||||
#import "MPConstants.h"
|
#import "MPConstants.h"
|
||||||
#import "MPSavePanelAccessoryViewController.h"
|
#import "MPSavePanelAccessoryViewController.h"
|
||||||
|
#import "MPTreeDelegate.h"
|
||||||
|
|
||||||
|
|
||||||
#import "DDXMLNode.h"
|
#import "DDXMLNode.h"
|
||||||
|
|
||||||
@@ -65,6 +67,7 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey
|
|||||||
@private
|
@private
|
||||||
BOOL _didLockFile;
|
BOOL _didLockFile;
|
||||||
NSData *_encryptedData;
|
NSData *_encryptedData;
|
||||||
|
MPTreeDelegate *_treeDelgate;
|
||||||
}
|
}
|
||||||
|
|
||||||
@property (nonatomic, assign) NSUInteger unlockCount;
|
@property (nonatomic, assign) NSUInteger unlockCount;
|
||||||
@@ -396,6 +399,10 @@ NSString *const MPDocumentGroupKey = @"MPDocumentGroupKey
|
|||||||
if(_tree != tree) {
|
if(_tree != tree) {
|
||||||
_tree = tree;
|
_tree = tree;
|
||||||
_tree.undoManager = [self undoManager];
|
_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 kMPSettingsKeySendCommandForControlKey = @"SendCommandKeyForControlKey";
|
||||||
NSString *const kMPSettingsKeyEnableGlobalAutotype = @"EnableGlobalAutotype";
|
NSString *const kMPSettingsKeyEnableGlobalAutotype = @"EnableGlobalAutotype";
|
||||||
NSString *const kMPSettingsKeyGlobalAutotypeKeyDataKey = @"GlobalAutotypeKeyDataKey";
|
NSString *const kMPSettingsKeyGlobalAutotypeKeyDataKey = @"GlobalAutotypeKeyDataKey";
|
||||||
|
NSString *const kMPSettingsKeyDefaultGlobalAutotypeSequence = @"DefaultGlobalAutotypeSequence";
|
||||||
|
|
||||||
NSString *const kMPSettingsKeyEntrySearchFilterContext = @"EntrySearchFilterContext";
|
NSString *const kMPSettingsKeyEntrySearchFilterContext = @"EntrySearchFilterContext";
|
||||||
|
|
||||||
@@ -99,6 +100,7 @@ NSString *const kMPDeprecatedSettingsKeyEntrySearchFilterMode = @"En
|
|||||||
kMPSettingsKeyRememberKeyFilesForDatabases: @NO,
|
kMPSettingsKeyRememberKeyFilesForDatabases: @NO,
|
||||||
kMPSettingsKeySendCommandForControlKey: @YES,
|
kMPSettingsKeySendCommandForControlKey: @YES,
|
||||||
kMPSettingsKeyEnableGlobalAutotype: @NO,
|
kMPSettingsKeyEnableGlobalAutotype: @NO,
|
||||||
|
kMPSettingsKeyDefaultGlobalAutotypeSequence: @"{USERNAME}{TAB}{PASSWORD}{ENTER}",
|
||||||
kMPSettingsKeyEnableQuicklookPreview: @NO,
|
kMPSettingsKeyEnableQuicklookPreview: @NO,
|
||||||
kMPSettingsKeyCopyGeneratedPasswordToClipboard: @NO,
|
kMPSettingsKeyCopyGeneratedPasswordToClipboard: @NO,
|
||||||
kMPSettingsKeyDefaultPasswordRounds: @50000,
|
kMPSettingsKeyDefaultPasswordRounds: @50000,
|
||||||
|
|||||||
@@ -9,6 +9,10 @@
|
|||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import "KPKTree.h"
|
#import "KPKTree.h"
|
||||||
|
|
||||||
|
@class MPDocument;
|
||||||
|
|
||||||
@interface MPTreeDelegate : NSObject <KPKTreeDelegate>
|
@interface MPTreeDelegate : NSObject <KPKTreeDelegate>
|
||||||
|
|
||||||
|
- (instancetype)initWithDocument:(MPDocument *)document;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -8,11 +8,32 @@
|
|||||||
|
|
||||||
#import "MPTreeDelegate.h"
|
#import "MPTreeDelegate.h"
|
||||||
|
|
||||||
|
#import "MPDocument.h"
|
||||||
|
#import "MPSettingsHelper.h"
|
||||||
|
|
||||||
|
@interface MPTreeDelegate ();
|
||||||
|
|
||||||
|
@property (weak) MPDocument *document;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
|
||||||
@implementation MPTreeDelegate
|
@implementation MPTreeDelegate
|
||||||
|
|
||||||
|
- (instancetype)initWithDocument:(MPDocument *)document {
|
||||||
|
self = [super init];
|
||||||
|
if(self) {
|
||||||
|
self.document = document;
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
- (NSString *)defaultAutotypeSequenceForTree:(KPKTree *)tree {
|
- (NSString *)defaultAutotypeSequenceForTree:(KPKTree *)tree {
|
||||||
/* TODO use Settings for the default autotype sequence */
|
return [[NSUserDefaults standardUserDefaults] stringForKey:kMPSettingsKeyDefaultGlobalAutotypeSequence];
|
||||||
return nil;
|
}
|
||||||
|
|
||||||
|
- (BOOL)shouldEditTree:(KPKTree *)tree {
|
||||||
|
return (NO == self.document.isReadOnly);
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
Reference in New Issue
Block a user