mirror of
https://github.com/MacPass/MacPass.git
synced 2026-01-30 20:28:19 +00:00
began extracting Autotypecandidate selection to separate controller
This commit is contained in:
40
MacPass/MPAutotypeCandidateSelectionViewController.m
Normal file
40
MacPass/MPAutotypeCandidateSelectionViewController.m
Normal 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
|
||||
Reference in New Issue
Block a user