mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 14:02:28 +00:00
using explicit setters instead of bindings for selection
This commit is contained in:
@@ -104,12 +104,9 @@ typedef NS_ENUM(NSUInteger, MPContentTab) {
|
|||||||
|
|
||||||
[self.view layout];
|
[self.view layout];
|
||||||
|
|
||||||
/* Init edit and cancel buttons */
|
|
||||||
self.editButton.action = @selector(beginEditing:);
|
|
||||||
self.cancelEditButton.action = @selector(cancelEditing:);
|
|
||||||
self.cancelEditButton.hidden = YES;
|
self.cancelEditButton.hidden = YES;
|
||||||
|
|
||||||
[self _toggleEditors:NO];
|
[self _establishBindings];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)registerNotificationsForDocument:(MPDocument *)document {
|
- (void)registerNotificationsForDocument:(MPDocument *)document {
|
||||||
@@ -119,10 +116,6 @@ typedef NS_ENUM(NSUInteger, MPContentTab) {
|
|||||||
object:document];
|
object:document];
|
||||||
[self.entryViewController registerNotificationsForDocument:document];
|
[self.entryViewController registerNotificationsForDocument:document];
|
||||||
|
|
||||||
|
|
||||||
[self.nodeController bind:NSContentBinding toObject:document withKeyPath:NSStringFromSelector(@selector(selectedItem)) options:nil];
|
|
||||||
[self _establishBindings];
|
|
||||||
|
|
||||||
[self.entryViewController setupBindings:document];
|
[self.entryViewController setupBindings:document];
|
||||||
[self.groupViewController setupBindings:document];
|
[self.groupViewController setupBindings:document];
|
||||||
}
|
}
|
||||||
@@ -284,8 +277,9 @@ typedef NS_ENUM(NSUInteger, MPContentTab) {
|
|||||||
else {
|
else {
|
||||||
self.activeTab = MPEmptyTab;
|
self.activeTab = MPEmptyTab;
|
||||||
}
|
}
|
||||||
|
self.nodeController.content = document.selectedItem;
|
||||||
[self _establishBindings];
|
self.entryViewController.representedObject = document.selectedItem.asEntry;
|
||||||
|
self.groupViewController.representedObject = document.selectedItem.asGroup;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (IBAction)beginEditing:(id)sender {
|
- (IBAction)beginEditing:(id)sender {
|
||||||
|
|||||||
Reference in New Issue
Block a user