began extracting Autotypecandidate selection to separate controller

This commit is contained in:
michael starke
2017-10-26 19:34:09 +02:00
parent 991e7eb763
commit d6f4411313
7 changed files with 265 additions and 38 deletions

View File

@@ -0,0 +1,40 @@
//
// MPAutotypeCandidateSelectionViewController.m
// MacPass
//
// Created by Michael Starke on 26.10.17.
// Copyright © 2017 HicknHack Software GmbH. All rights reserved.
//
#import "MPAutotypeCandidateSelectionViewController.h"
#import "MPAutotypeContext.h"
#import <KeePassKit/KeePassKit.h>
@interface MPAutotypeCandidateSelectionViewController () <NSTableViewDataSource, NSTableViewDelegate>
@end
@implementation MPAutotypeCandidateSelectionViewController
- (NSNibName)nibName {
return @"AutotypeCandidateSelectionViewController";
}
- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView {
return self.candidates.count;
}
- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
NSTableCellView *view = [tableView makeViewWithIdentifier:tableColumn.identifier owner:self];
MPAutotypeContext *context = self.candidates[row];
view.textField.stringValue = context.entry.title;
view.imageView.image = context.entry.icon.image;
return view;
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do view setup here.
}
@end