mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 14:02:28 +00:00
Used bindings in Inspector and Tabelview
Added undoable actions for KdbGroup
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
</object>
|
||||
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
|
||||
<object class="NSCustomObject" id="1001">
|
||||
<string key="NSClassName">MPInspectorTabViewController</string>
|
||||
<string key="NSClassName">MPInspectorViewController</string>
|
||||
</object>
|
||||
<object class="NSCustomObject" id="1003">
|
||||
<string key="NSClassName">FirstResponder</string>
|
||||
@@ -42,7 +42,7 @@
|
||||
<string key="NSClassName">NSApplication</string>
|
||||
</object>
|
||||
<object class="NSView" id="87082330">
|
||||
<reference key="NSNextResponder"/>
|
||||
<nil key="NSNextResponder"/>
|
||||
<int key="NSvFlags">256</int>
|
||||
<array class="NSMutableArray" key="NSSubviews">
|
||||
<object class="NSTextField" id="524369596">
|
||||
@@ -50,7 +50,6 @@
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{40, 416}, {41, 17}}</string>
|
||||
<reference key="NSSuperview" ref="87082330"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="290763686"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:1535</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
@@ -91,7 +90,6 @@
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{86, 416}, {120, 22}}</string>
|
||||
<reference key="NSSuperview" ref="87082330"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="582897606"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
@@ -126,7 +124,6 @@
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{14, 386}, {67, 17}}</string>
|
||||
<reference key="NSSuperview" ref="87082330"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="38182485"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:1535</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
@@ -147,7 +144,6 @@
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{86, 291}, {80, 22}}</string>
|
||||
<reference key="NSSuperview" ref="87082330"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="782711985"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
@@ -172,7 +168,6 @@
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{86, 384}, {120, 22}}</string>
|
||||
<reference key="NSSuperview" ref="87082330"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="738135925"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
@@ -194,7 +189,6 @@
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{86, 352}, {80, 22}}</string>
|
||||
<reference key="NSSuperview" ref="87082330"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="1040222427"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
@@ -216,7 +210,6 @@
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{52, 354}, {29, 17}}</string>
|
||||
<reference key="NSSuperview" ref="87082330"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="681190446"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:1535</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
@@ -237,7 +230,6 @@
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{174, 352}, {32, 25}}</string>
|
||||
<reference key="NSSuperview" ref="87082330"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="333573736"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:22</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
@@ -266,7 +258,6 @@
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{17, 293}, {64, 17}}</string>
|
||||
<reference key="NSSuperview" ref="87082330"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="568887030"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:1535</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
@@ -287,7 +278,6 @@
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{174, 289}, {32, 25}}</string>
|
||||
<reference key="NSSuperview" ref="87082330"/>
|
||||
<reference key="NSWindow"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:22</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
<object class="NSButtonCell" key="NSCell" id="353877023">
|
||||
@@ -323,7 +313,6 @@
|
||||
</set>
|
||||
<string key="NSFrame">{{20, 467}, {48, 48}}</string>
|
||||
<reference key="NSSuperview" ref="87082330"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="787130496"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="NSEnabled">YES</bool>
|
||||
@@ -348,7 +337,6 @@
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{73, 483}, {136, 17}}</string>
|
||||
<reference key="NSSuperview" ref="87082330"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="152677463"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:1535</string>
|
||||
<string key="NSAntiCompressionPriority">{200, 750}</string>
|
||||
@@ -370,15 +358,12 @@
|
||||
<int key="NSvFlags">268</int>
|
||||
<string key="NSFrame">{{20, 457}, {186, 2}}</string>
|
||||
<reference key="NSSuperview" ref="87082330"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="524369596"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<string key="NSClassName">MPSeparator</string>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrameSize">{226, 535}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="1013751338"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:11</string>
|
||||
</object>
|
||||
@@ -1614,74 +1599,6 @@
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">MPInspectorTabViewController</string>
|
||||
<string key="superclassName">MPViewController</string>
|
||||
<object class="NSMutableDictionary" key="actions">
|
||||
<string key="NS.key.0">togglePasswordDisplay:</string>
|
||||
<string key="NS.object.0">id</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="actionInfosByName">
|
||||
<string key="NS.key.0">togglePasswordDisplay:</string>
|
||||
<object class="IBActionInfo" key="NS.object.0">
|
||||
<string key="name">togglePasswordDisplay:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
</object>
|
||||
<dictionary class="NSMutableDictionary" key="outlets">
|
||||
<string key="URLTextField">NSTextField</string>
|
||||
<string key="itemImageView">MPPopupImageView</string>
|
||||
<string key="itemNameTextfield">NSTextField</string>
|
||||
<string key="openURLButton">NSButton</string>
|
||||
<string key="passwordTextField">NSSecureTextField</string>
|
||||
<string key="showPasswordCreator">NSButton</string>
|
||||
<string key="titleOrNameLabel">NSTextField</string>
|
||||
<string key="titleTextField">NSTextField</string>
|
||||
<string key="usernameTextField">NSTextField</string>
|
||||
</dictionary>
|
||||
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<object class="IBToOneOutletInfo" key="URLTextField">
|
||||
<string key="name">URLTextField</string>
|
||||
<string key="candidateClassName">NSTextField</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo" key="itemImageView">
|
||||
<string key="name">itemImageView</string>
|
||||
<string key="candidateClassName">MPPopupImageView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo" key="itemNameTextfield">
|
||||
<string key="name">itemNameTextfield</string>
|
||||
<string key="candidateClassName">NSTextField</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo" key="openURLButton">
|
||||
<string key="name">openURLButton</string>
|
||||
<string key="candidateClassName">NSButton</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo" key="passwordTextField">
|
||||
<string key="name">passwordTextField</string>
|
||||
<string key="candidateClassName">NSSecureTextField</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo" key="showPasswordCreator">
|
||||
<string key="name">showPasswordCreator</string>
|
||||
<string key="candidateClassName">NSButton</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo" key="titleOrNameLabel">
|
||||
<string key="name">titleOrNameLabel</string>
|
||||
<string key="candidateClassName">NSTextField</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo" key="titleTextField">
|
||||
<string key="name">titleTextField</string>
|
||||
<string key="candidateClassName">NSTextField</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo" key="usernameTextField">
|
||||
<string key="name">usernameTextField</string>
|
||||
<string key="candidateClassName">NSTextField</string>
|
||||
</object>
|
||||
</dictionary>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/MPInspectorTabViewController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">MPPopupImageView</string>
|
||||
<string key="superclassName">NSImageView</string>
|
||||
@@ -1698,14 +1615,6 @@
|
||||
<string key="minorKey">./Classes/MPSeparator.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">MPViewController</string>
|
||||
<string key="superclassName">NSViewController</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/MPViewController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">NSLayoutConstraint</string>
|
||||
<string key="superclassName">NSObject</string>
|
||||
@@ -8,6 +8,13 @@
|
||||
|
||||
#import "Kdb.h"
|
||||
|
||||
APPKIT_EXTERN NSString *const MPEntryTitleUndoableKey;
|
||||
APPKIT_EXTERN NSString *const MPEntryUsernameUndoableKey;
|
||||
APPKIT_EXTERN NSString *const MPEntryPasswordUndoableKey;
|
||||
APPKIT_EXTERN NSString *const MPEntryUrlUndoableKey;
|
||||
APPKIT_EXTERN NSString *const MPEntryNotesUndoableKey;
|
||||
|
||||
|
||||
@interface KdbEntry (Undo)
|
||||
|
||||
+ (NSUndoManager *)undoManager;
|
||||
|
||||
@@ -9,6 +9,12 @@
|
||||
#import "KdbEntry+Undo.h"
|
||||
#import "KdbGroup+MPAdditions.h"
|
||||
|
||||
NSString *const MPEntryTitleUndoableKey = @"titleUndoable";
|
||||
NSString *const MPEntryUsernameUndoableKey = @"usernameUndoable";
|
||||
NSString *const MPEntryPasswordUndoableKey = @"passwordUndoable";
|
||||
NSString *const MPEntryUrlUndoableKey = @"urlUndoable";
|
||||
NSString *const MPEntryNotesUndoableKey = @"notesUndoable";
|
||||
|
||||
@implementation KdbEntry (Undo)
|
||||
|
||||
+ (NSUndoManager *)undoManager {
|
||||
@@ -49,19 +55,19 @@
|
||||
}
|
||||
|
||||
- (void)setPasswordUndoable:(NSString *)password {
|
||||
[[KdbEntry undoManager] registerUndoWithTarget:self selector:@selector(setTitleUndoable:) object:self.password];
|
||||
[[KdbEntry undoManager] registerUndoWithTarget:self selector:@selector(setPasswordUndoable:) object:self.password];
|
||||
[[KdbEntry undoManager] setActionName:NSLocalizedString(@"UNDO_SET_PASSWORT", "Undo set password")];
|
||||
[self setPassword:password];
|
||||
}
|
||||
|
||||
- (void)setUrlUndoable:(NSString *)url {
|
||||
[[KdbEntry undoManager] registerUndoWithTarget:self selector:@selector(setTitleUndoable:) object:self.url];
|
||||
[[KdbEntry undoManager] registerUndoWithTarget:self selector:@selector(setUrlUndoable:) object:self.url];
|
||||
[[KdbEntry undoManager] setActionName:NSLocalizedString(@"UNDO_SET_URL", "Undo set URL")];
|
||||
[self setUrl:url];
|
||||
}
|
||||
|
||||
- (void)setNotesUndoable:(NSString *)notes {
|
||||
[[KdbEntry undoManager] registerUndoWithTarget:self selector:@selector(setTitleUndoable:) object:self.notes];
|
||||
[[KdbEntry undoManager] registerUndoWithTarget:self selector:@selector(setNotesUndoable:) object:self.notes];
|
||||
[[KdbEntry undoManager] setActionName:NSLocalizedString(@"UNDO_SET_NOTES", "Undo set notes")];
|
||||
[self setNotes:notes];
|
||||
}
|
||||
|
||||
@@ -8,10 +8,15 @@
|
||||
|
||||
#import "Kdb.h"
|
||||
|
||||
APPKIT_EXTERN NSString *const MPGroupNameUndoableKey;
|
||||
|
||||
@interface KdbGroup (Undo)
|
||||
|
||||
+ (NSUndoManager *)undoManager;
|
||||
|
||||
- (NSString *)nameUndoable;
|
||||
- (void)setNameUndoable:(NSString *)newName;
|
||||
|
||||
- (void)removeEntryUndoable:(KdbEntry *)entry;
|
||||
- (void)addEntryUndoable:(KdbEntry *)entry;
|
||||
|
||||
|
||||
@@ -8,12 +8,24 @@
|
||||
|
||||
#import "KdbGroup+Undo.h"
|
||||
|
||||
NSString *const MPGroupNameUndoableKey = @"nameUndoable";
|
||||
|
||||
@implementation KdbGroup (Undo)
|
||||
|
||||
+ (NSUndoManager *)undoManager {
|
||||
return [[[NSDocumentController sharedDocumentController] currentDocument] undoManager];
|
||||
}
|
||||
|
||||
- (NSString *)nameUndoable {
|
||||
return [self name];
|
||||
}
|
||||
|
||||
- (void)setNameUndoable:(NSString *)newName {
|
||||
[[KdbGroup undoManager] registerUndoWithTarget:self selector:@selector(setNameUndoable:) object:self.name];
|
||||
[[KdbGroup undoManager] setActionName:NSLocalizedString(@"UNDO_SET_NAME", "Undo set name")];
|
||||
self.name = newName;
|
||||
}
|
||||
|
||||
- (void)removeEntryUndoable:(KdbEntry *)entry {
|
||||
[[KdbGroup undoManager] registerUndoWithTarget:self selector:@selector(addEntryUndoable:) object:entry];
|
||||
[[KdbGroup undoManager] setActionName:NSLocalizedString(@"UNDO_DELETE_ENTRY", "Undo deleting of entry")];
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
@class MPViewController;
|
||||
@class MPEntryViewController;
|
||||
@class MPInspectorTabViewController;
|
||||
@class MPInspectorViewController;
|
||||
@class MPPasswordEditViewController;
|
||||
@class MPPasswordInputController;
|
||||
@class MPOutlineViewController;
|
||||
@@ -23,7 +23,7 @@
|
||||
@property (readonly, retain) MPPasswordEditViewController *passwordEditController;
|
||||
@property (readonly, retain) MPEntryViewController *entryViewController;
|
||||
@property (readonly, retain) MPOutlineViewController *outlineViewController;
|
||||
@property (readonly, retain) MPInspectorTabViewController *inspectorTabViewController;
|
||||
@property (readonly, retain) MPInspectorViewController *inspectorTabViewController;
|
||||
@property (readonly, retain) MPCreationViewController *creationViewController;
|
||||
|
||||
- (void)showEntries;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#import "MPPasswordEditViewController.h"
|
||||
#import "MPToolbarDelegate.h"
|
||||
#import "MPOutlineViewController.h"
|
||||
#import "MPInspectorTabViewController.h"
|
||||
#import "MPInspectorViewController.h"
|
||||
#import "MPAppDelegate.h"
|
||||
#import "DMSplitView.h"
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
@property (retain) MPPasswordEditViewController *passwordEditController;
|
||||
@property (retain) MPEntryViewController *entryViewController;
|
||||
@property (retain) MPOutlineViewController *outlineViewController;
|
||||
@property (retain) MPInspectorTabViewController *inspectorTabViewController;
|
||||
@property (retain) MPInspectorViewController *inspectorTabViewController;
|
||||
|
||||
@property (retain) MPToolbarDelegate *toolbarDelegate;
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
_needsDecryption = NO;
|
||||
_toolbarDelegate = [[MPToolbarDelegate alloc] init];
|
||||
_outlineViewController = [[MPOutlineViewController alloc] init];
|
||||
_inspectorTabViewController = [[MPInspectorTabViewController alloc] init];
|
||||
_inspectorTabViewController = [[MPInspectorViewController alloc] init];
|
||||
_passwordEditController = [[MPPasswordEditViewController alloc] init];
|
||||
}
|
||||
return self;
|
||||
|
||||
@@ -198,7 +198,8 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
|
||||
if(isTitleColumn || isGroupColumn) {
|
||||
view = [tableView makeViewWithIdentifier:_MPTableImageCellView owner:self];
|
||||
if( isTitleColumn ) {
|
||||
[[view textField] setStringValue:entry.title];
|
||||
[[view textField] bind:NSValueBinding toObject:entry withKeyPath:@"title" options:nil];
|
||||
//[[view textField] setStringValue:entry.title];
|
||||
[[view imageView] setImage:[MPIconHelper icon:(MPIconType)entry.image]];
|
||||
}
|
||||
else {
|
||||
@@ -208,15 +209,18 @@ NSString *const _toggleFilterUsernameButton = @"SearchUsername";
|
||||
}
|
||||
else if( isPasswordColum ) {
|
||||
view = [tableView makeViewWithIdentifier:_MPTAbleSecurCellView owner:self];
|
||||
[[view textField] bind:NSValueBinding toObject:entry withKeyPath:@"password" options:nil];
|
||||
[[view textField] setStringValue:entry.password];
|
||||
}
|
||||
else if( isUsernameColumn || isURLColumn ) {
|
||||
view = [tableView makeViewWithIdentifier:_MPTableStringCellView owner:self];
|
||||
if(isURLColumn) {
|
||||
[[view textField] setStringValue:entry.url];
|
||||
[[view textField] bind:NSValueBinding toObject:entry withKeyPath:@"url" options:nil];
|
||||
//[[view textField] setStringValue:entry.url];
|
||||
}
|
||||
else {
|
||||
[[view textField] setStringValue:entry.username];
|
||||
[[view textField] bind:NSValueBinding toObject:entry withKeyPath:@"username" options:nil];
|
||||
//[[view textField] setStringValue:entry.username];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
@class MPPopupImageView;
|
||||
|
||||
@interface MPInspectorTabViewController : MPViewController
|
||||
@interface MPInspectorViewController : MPViewController
|
||||
|
||||
@property (assign) IBOutlet MPPopupImageView *itemImageView;
|
||||
@property (assign) IBOutlet NSTextField *itemNameTextfield;
|
||||
@@ -6,7 +6,7 @@
|
||||
// Copyright (c) 2013 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MPInspectorTabViewController.h"
|
||||
#import "MPInspectorViewController.h"
|
||||
#import "MPEntryViewController.h"
|
||||
#import "MPOutlineViewDelegate.h"
|
||||
#import "MPShadowBox.h"
|
||||
@@ -15,8 +15,9 @@
|
||||
#import "MPIconSelectViewController.h"
|
||||
#import "KdbLib.h"
|
||||
#import "KdbEntry+Undo.h"
|
||||
#import "KdbGroup+Undo.h"
|
||||
|
||||
@interface MPInspectorTabViewController () {
|
||||
@interface MPInspectorViewController () {
|
||||
BOOL _visible;
|
||||
}
|
||||
|
||||
@@ -38,10 +39,10 @@
|
||||
|
||||
@end
|
||||
|
||||
@implementation MPInspectorTabViewController
|
||||
@implementation MPInspectorViewController
|
||||
|
||||
- (id)init {
|
||||
return [[MPInspectorTabViewController alloc] initWithNibName:@"InspectorTabView" bundle:nil];
|
||||
return [[MPInspectorViewController alloc] initWithNibName:@"InspectorView" bundle:nil];
|
||||
}
|
||||
|
||||
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
|
||||
@@ -120,33 +121,46 @@
|
||||
}
|
||||
|
||||
- (void)_showEntry {
|
||||
[self.itemNameTextfield setStringValue:self.selectedEntry.title];
|
||||
[self.itemNameTextfield bind:NSValueBinding toObject:self.selectedEntry withKeyPath:MPEntryTitleUndoableKey options:nil];
|
||||
[self.itemImageView setImage:[MPIconHelper icon:(MPIconType)self.selectedEntry.image ]];
|
||||
[self.passwordTextField setStringValue:self.selectedEntry.password];
|
||||
[self.usernameTextField bind:NSValueBinding toObject:self.selectedEntry withKeyPath:@"usernameUndoable" options:nil];
|
||||
//[self.usernameTextField setStringValue:self.selectedEntry.username];
|
||||
[self.passwordTextField bind:NSValueBinding toObject:self.selectedEntry withKeyPath:MPEntryPasswordUndoableKey options:nil];
|
||||
[self.usernameTextField bind:NSValueBinding toObject:self.selectedEntry withKeyPath:MPEntryUsernameUndoableKey options:nil];
|
||||
[self.titleOrNameLabel setStringValue:NSLocalizedString(@"TITLE",@"")];
|
||||
[self.titleTextField setStringValue:self.selectedEntry.title];
|
||||
[self.URLTextField setStringValue:self.selectedEntry.url];
|
||||
[self.titleTextField bind:NSValueBinding toObject:self.selectedEntry withKeyPath:MPEntryTitleUndoableKey options:nil];
|
||||
[self.URLTextField bind:NSValueBinding toObject:self.selectedEntry withKeyPath:MPEntryUrlUndoableKey options:nil];
|
||||
|
||||
[self _setInputEnabled:YES];
|
||||
}
|
||||
|
||||
- (void)_showGroup {
|
||||
[self.itemNameTextfield setStringValue:self.selectedGroup.name];
|
||||
[self.itemNameTextfield bind:NSValueBinding toObject:self.selectedGroup withKeyPath:MPGroupNameUndoableKey options:nil];
|
||||
[self.itemImageView setImage:[MPIconHelper icon:(MPIconType)self.selectedGroup.image ]];
|
||||
[self.titleOrNameLabel setStringValue:NSLocalizedString(@"NAME",@"")];
|
||||
[self.titleTextField setStringValue:self.selectedGroup.name];
|
||||
[self.titleTextField bind:NSValueBinding toObject:self.selectedGroup withKeyPath:MPGroupNameUndoableKey options:nil];
|
||||
|
||||
// Clear other bindins
|
||||
[self.passwordTextField unbind:NSValueBinding];
|
||||
[self.usernameTextField unbind:NSValueBinding];
|
||||
[self.URLTextField unbind:NSValueBinding];
|
||||
|
||||
// Reset Fields
|
||||
[self.passwordTextField setStringValue:@""];
|
||||
[self.usernameTextField setStringValue:@""];
|
||||
[self.URLTextField setStringValue:@""];
|
||||
|
||||
|
||||
[self _setInputEnabled:YES];
|
||||
}
|
||||
|
||||
- (void)_clearContent {
|
||||
|
||||
[self _setInputEnabled:NO];
|
||||
|
||||
[self.itemNameTextfield unbind:NSValueBinding];
|
||||
[self.passwordTextField unbind:NSValueBinding];
|
||||
[self.usernameTextField unbind:NSValueBinding];
|
||||
[self.titleTextField unbind:NSValueBinding];
|
||||
[self.URLTextField unbind:NSValueBinding];
|
||||
|
||||
[self.itemNameTextfield setStringValue:NSLocalizedString(@"INSPECTOR_NO_SELECTION", @"No item selected in inspector")];
|
||||
[self.itemImageView setImage:[NSImage imageNamed:NSImageNameActionTemplate]];
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>74B</string>
|
||||
<string>759</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user