mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-15 10:52:18 +00:00
Refactores document settings a bit
This commit is contained in:
@@ -35,16 +35,12 @@
|
|||||||
- (void)windowDidLoad {
|
- (void)windowDidLoad {
|
||||||
[super windowDidLoad];
|
[super windowDidLoad];
|
||||||
NSAssert(_document != nil, @"Document needs to be present");
|
NSAssert(_document != nil, @"Document needs to be present");
|
||||||
if( _document.version == MPDatabaseVersion4 ) {
|
Kdb4Tree *tree = _document.treeV4;
|
||||||
Kdb4Tree *tree = (Kdb4Tree *)_document.tree;
|
if( tree ) {
|
||||||
[self.databaseNameTextField bind:NSValueBinding toObject:tree withKeyPath:MPTree4DatabaseNameUndoableKey options:nil];
|
[self _setupDatabase:tree];
|
||||||
[self.databaseDescriptionTextView bind:NSValueBinding toObject:tree withKeyPath:MPTree4DatabaseDescriptionUndoableKey options:nil];
|
[self _setupProtectionTab:tree];
|
||||||
|
[self _setupHistoryTab:tree];
|
||||||
[self.protectNotesCheckButton bind:NSValueBinding toObject:tree withKeyPath:MPTree4ProtectNotesUndoableKey options:nil];
|
[self _setupPasswordTab:tree];
|
||||||
[self.protectPasswortCheckButton bind:NSValueBinding toObject:tree withKeyPath:MPTree4ProtectPasswordUndoableKey options:nil];
|
|
||||||
[self.protectTitleCheckButton bind:NSValueBinding toObject:tree withKeyPath:MPTree4ProtectTitleUndoableKey options:nil];
|
|
||||||
[self.protectURLCheckButton bind:NSValueBinding toObject:tree withKeyPath:MPTree4ProtectUrlUndoableKey options:nil];
|
|
||||||
[self.protectUserNameCheckButton bind:NSValueBinding toObject:tree withKeyPath:MPTree4ProtectUsernameUndoableKey options:nil];
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Switch to KdbV3 View
|
// Switch to KdbV3 View
|
||||||
@@ -56,4 +52,25 @@
|
|||||||
[[self window] orderOut:nil];
|
[[self window] orderOut:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)_setupDatabase:(Kdb4Tree *)tree {
|
||||||
|
[self.databaseNameTextField bind:NSValueBinding toObject:tree withKeyPath:MPTree4DatabaseNameUndoableKey options:nil];
|
||||||
|
[self.databaseDescriptionTextView bind:NSValueBinding toObject:tree withKeyPath:MPTree4DatabaseDescriptionUndoableKey options:nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)_setupProtectionTab:(Kdb4Tree *)tree {
|
||||||
|
[self.protectNotesCheckButton bind:NSValueBinding toObject:tree withKeyPath:MPTree4ProtectNotesUndoableKey options:nil];
|
||||||
|
[self.protectPasswortCheckButton bind:NSValueBinding toObject:tree withKeyPath:MPTree4ProtectPasswordUndoableKey options:nil];
|
||||||
|
[self.protectTitleCheckButton bind:NSValueBinding toObject:tree withKeyPath:MPTree4ProtectTitleUndoableKey options:nil];
|
||||||
|
[self.protectURLCheckButton bind:NSValueBinding toObject:tree withKeyPath:MPTree4ProtectUrlUndoableKey options:nil];
|
||||||
|
[self.protectUserNameCheckButton bind:NSValueBinding toObject:tree withKeyPath:MPTree4ProtectUsernameUndoableKey options:nil];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)_setupHistoryTab:(Kdb4Tree *)tree {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)_setupPasswordTab:(Kdb4Tree *)tree {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
Reference in New Issue
Block a user