mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-13 08:52:20 +00:00
using properties
This commit is contained in:
@@ -45,7 +45,7 @@
|
||||
NSTableCellView *view;
|
||||
if([selectedIndexes containsIndex:row]) {
|
||||
MPSelectedAttachmentTableCellView *cellView = [tableView makeViewWithIdentifier:@"SelectedCell" owner:tableView];
|
||||
[cellView.actionButton setMenu:[self allocateActionMenu]];
|
||||
cellView.actionButton.menu = [self allocateActionMenu];
|
||||
view = cellView;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -200,17 +200,16 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
||||
[self.observer didChangeModelProperty];
|
||||
}
|
||||
- (void)removeCustomField:(id)sender {
|
||||
NSUInteger index = [sender tag];
|
||||
NSUInteger viewIndex = [self.customFieldsTableView rowForView:sender];
|
||||
NSLog(@"index:%ld viewIndex:%ld", index, viewIndex);
|
||||
KPKAttribute *attribute = self.representedEntry.customAttributes[index];
|
||||
NSInteger rowIndex = [self.customFieldsTableView rowForView:sender];
|
||||
NSAssert(rowIndex > 0 && rowIndex < self.representedEntry.customAttributes.count, @"Invalid custom attribute index.");
|
||||
KPKAttribute *attribute = self.representedEntry.customAttributes[rowIndex];
|
||||
[self.observer willChangeModelProperty];
|
||||
[self.representedEntry removeCustomAttribute:attribute];
|
||||
[self.observer didChangeModelProperty];
|
||||
}
|
||||
|
||||
- (void)saveAttachment:(id)sender {
|
||||
NSInteger row = [self.attachmentTableView selectedRow];
|
||||
NSInteger row = self.attachmentTableView.selectedRow;
|
||||
if(row < 0) {
|
||||
return; // No selection
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user