mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-19 06:09:32 +00:00
Extracted context bar for trash, history and filter browsing. Some regressions in focus handling were introduced. History tab will go away as this will be incorporated in the entry comparable to searching. Code cleanup. Moved copying to KeePassKit
This commit is contained in:
@@ -24,13 +24,15 @@
|
||||
typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
||||
MPEntryTabGeneral,
|
||||
MPEntryTabFiles,
|
||||
MPEntryTabCustomFields
|
||||
MPEntryTabCustomFields,
|
||||
MPEntryTabHistory
|
||||
};
|
||||
|
||||
@interface MPEntryInspectorViewController () {
|
||||
@private
|
||||
NSArrayController *_attachmentsController;
|
||||
NSArrayController *_customFieldsController;
|
||||
NSArrayController *_historyController;
|
||||
MPAttachmentTableViewDelegate *_attachmentTableDelegate;
|
||||
MPCustomFieldTableViewDelegate *_customFieldTableDelegate;
|
||||
MPAttachmentTableDataSource *_attachmentDataSource;
|
||||
@@ -57,6 +59,7 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
||||
_showPassword = NO;
|
||||
_attachmentsController = [[NSArrayController alloc] init];
|
||||
_customFieldsController = [[NSArrayController alloc] init];
|
||||
_historyController = [[NSArrayController alloc] init];
|
||||
_attachmentTableDelegate = [[MPAttachmentTableViewDelegate alloc] init];
|
||||
_customFieldTableDelegate = [[MPCustomFieldTableViewDelegate alloc] init];
|
||||
_attachmentDataSource = [[MPAttachmentTableDataSource alloc] init];
|
||||
@@ -105,7 +108,7 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
||||
[[self view] layoutSubtreeIfNeeded];
|
||||
|
||||
[_infoTabControl bind:NSSelectedIndexBinding toObject:self withKeyPath:@"activeTab" options:nil];
|
||||
[_tabView bind:NSSelectedIndexBinding toObject:self withKeyPath:@"activeTab" options:nil];
|
||||
[_tabView bind:NSSelectedIndexBinding toObject:self withKeyPath:@"activeTab" options:nil];
|
||||
|
||||
/* Set background to clearcolor so we can draw in the scrollview */
|
||||
[_attachmentTableView setBackgroundColor:[NSColor clearColor]];
|
||||
@@ -118,6 +121,7 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
||||
[_customFieldsTableView bind:NSContentBinding toObject:_customFieldsController withKeyPath:@"arrangedObjects" options:nil];
|
||||
[_customFieldsTableView setDelegate:_customFieldTableDelegate];
|
||||
|
||||
[_historyTableView bind:NSContentBinding toObject:_historyController withKeyPath:@"arrangedObjects" options:nil];
|
||||
|
||||
[self.passwordTextField bind:@"showPassword" toObject:self withKeyPath:@"showPassword" options:nil];
|
||||
[self.togglePassword bind:NSValueBinding toObject:self withKeyPath:@"showPassword" options:nil];
|
||||
@@ -224,6 +228,7 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
||||
[self _bindEntry];
|
||||
[self _bindAttachments];
|
||||
[self _bindCustomFields];
|
||||
[self _bindHistory];
|
||||
}
|
||||
|
||||
- (void)_bindEntry {
|
||||
@@ -261,4 +266,14 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
||||
[_customFieldsController bind:NSContentArrayBinding toObject:self.entry withKeyPath:@"customAttributes" options:nil];
|
||||
}
|
||||
|
||||
- (void)_bindHistory {
|
||||
if(self.entry) {
|
||||
[_historyController bind:NSContentArrayBinding toObject:self.entry withKeyPath:@"history" options:nil];
|
||||
}
|
||||
else if([_historyController content] != nil) {
|
||||
[_historyController unbind:NSContentArrayBinding];
|
||||
[_historyController setContent:nil];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user