added sketch for autotype builder to show all autotype commands

This commit is contained in:
michael starke
2016-09-01 19:54:21 +02:00
parent 1c39f1c3fe
commit 6e2203bf51
7 changed files with 75 additions and 34 deletions

View File

@@ -7,16 +7,45 @@
//
#import "MPAutotypeBuilderViewController.h"
#import <KeePassKit/KeePassKit.h>
@interface MPAutotypeBuilderViewController ()
@property (weak) IBOutlet NSTokenField *tokenField;
@property (nonatomic, readonly, strong) NSArray<NSString *> *tokens;
@end
@implementation MPAutotypeBuilderViewController
#define _MPToken(short,long) [NSString stringWithFormat:@"%@ %@", short, long]
- (NSArray<NSString *> *)tokens {
static NSArray *_tokens;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
NSMutableArray *fields = [[NSMutableArray alloc] init];
for(NSString *attribute in [KPKFormat sharedFormat].entryDefaultKeys) {
[fields addObject:[NSString stringWithFormat:@"{%@}", attribute]];
}
_tokens = [fields arrayByAddingObjectsFromArray:@[ _MPToken(kKPKAutotypeShortEnter, kKPKAutotypeEnter),
_MPToken(kKPKAutotypeShortAlt, kKPKAutotypeAlt),
_MPToken(kKPKAutotypeShortControl, kKPKAutotypeControl),
]];
});
return _tokens;
}
- (NSString *)nibName {
return @"AutotypeBuilderView";
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do view setup here.
[super viewDidLoad];
self.tokenField.editable = NO;
self.tokenField.objectValue = self.tokens;
}
@end