diff --git a/MacPass/MPEntryAttributeViewController.h b/MacPass/MPEntryAttributeViewController.h index 308f022e..b6a407f2 100644 --- a/MacPass/MPEntryAttributeViewController.h +++ b/MacPass/MPEntryAttributeViewController.h @@ -17,7 +17,7 @@ NS_ASSUME_NONNULL_BEGIN /// View controller to show and edit KPKAttributes of KPKEntries. /// Set the represented object to the KPKAttribute the editor shoudl show/edit /// The editor can be set to edit or view -@interface MPEntryAttributeViewController : NSViewController +@interface MPEntryAttributeViewController : NSViewController @property (strong) IBOutlet NSTextField *keyTextField; @property (strong) IBOutlet HNHUISecureTextField *valueTextField; diff --git a/MacPass/MPEntryAttributeViewController.m b/MacPass/MPEntryAttributeViewController.m index 981ad090..107385ef 100644 --- a/MacPass/MPEntryAttributeViewController.m +++ b/MacPass/MPEntryAttributeViewController.m @@ -27,7 +27,6 @@ NSString *nameForDefaultKey(NSString *key) { @interface MPEntryAttributeViewController () { BOOL _isDefaultAttribute; } -@property (readonly, nullable, strong) KPKAttribute *representedAttribute; @end diff --git a/MacPass/MPEntryInspectorViewController.m b/MacPass/MPEntryInspectorViewController.m index 96b09e59..f72ca479 100644 --- a/MacPass/MPEntryInspectorViewController.m +++ b/MacPass/MPEntryInspectorViewController.m @@ -79,7 +79,7 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) { MPTagsTokenFieldDelegate *_tagTokenFieldDelegate; MPAddCustomFieldContextMenuDelegate *_addCustomFieldContextMenuDelegate; - NSMutableArray *> *_attributeEditorViewControllers; + NSMutableArray *> *_customAttributeEditorViewControllers; MPEntryAttributeViewController *_titleEditorViewController; MPEntryAttributeViewController *_usernameEditorViewController; @@ -122,7 +122,7 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) { _customFieldTableDelegate.viewController = self; _addCustomFieldContextMenuDelegate.viewController = self; - _attributeEditorViewControllers = [[NSMutableArray alloc] init]; + _customAttributeEditorViewControllers = [[NSMutableArray alloc] init]; _activeTab = MPEntryTabGeneral; } return self; diff --git a/MacPass/MPEntryPasswordAttributeViewController.h b/MacPass/MPEntryPasswordAttributeViewController.h index a748e5fc..59e00e72 100644 --- a/MacPass/MPEntryPasswordAttributeViewController.h +++ b/MacPass/MPEntryPasswordAttributeViewController.h @@ -11,6 +11,7 @@ NS_ASSUME_NONNULL_BEGIN +/// View controller to edit password attributes of entries. @interface MPEntryPasswordAttributeViewController : MPEntryAttributeViewController @end diff --git a/MacPass/MPEntryPasswordAttributeViewController.m b/MacPass/MPEntryPasswordAttributeViewController.m index 52af40a9..d032d7da 100644 --- a/MacPass/MPEntryPasswordAttributeViewController.m +++ b/MacPass/MPEntryPasswordAttributeViewController.m @@ -16,8 +16,6 @@ @property (strong) IBOutlet NSButton *togglePasswordButton; @property (strong) IBOutlet NSButton *generatePasswordButton; -@property (strong, nullable, readonly) KPKAttribute *representedAttribute; - @end @implementation MPEntryPasswordAttributeViewController diff --git a/MacPass/MPInspectorEditor.h b/MacPass/MPInspectorEditor.h index 08e9c4c8..1ec5b897 100644 --- a/MacPass/MPInspectorEditor.h +++ b/MacPass/MPInspectorEditor.h @@ -7,6 +7,10 @@ // #import +@class KPKAttribute; +@class KPKEntry; +@class KPKTimeInfo; +@class KPKNode; NS_ASSUME_NONNULL_BEGIN @@ -14,12 +18,33 @@ NS_ASSUME_NONNULL_BEGIN /// Individual editors shoudl adopt different APIs to accomodate their needs /// The preferred way to set model data is to use the representedObject @protocol MPInspectorEditor - @required @property (nonatomic) BOOL isEditor; - - (void)commitChanges; +@end +/// NodeInspectorEditors require the represented object to be a KPKNode +@protocol KPKNodeInspectorEditor +@required +@property (nonatomic, nullable, readonly, strong) KPKNode *representedNode; +@end + +/// EntryInspectorEditors require the represented object to be a KPKEnty +@protocol MPEntryInspectorEditor +@required +@property (nonatomic, nullable, readonly, strong) KPKEntry *representedEntry; +@end + +/// AttributeInspectorEditors require the represented object to be a KPKAttribute +@protocol MPAttributeInspectorEditor +@required +@property (nonatomic, nullable, readonly, strong) KPKAttribute *representedAttribute; +@end + +/// TimeInfoInpspectorEditors require the represented object to be a KPKTimeInfo +@protocol MPTimeInfoInpspectorEditor +@required +@property (nonatomic, nullable, readonly, strong) KPKTimeInfo *representedTimeInfo; @end NS_ASSUME_NONNULL_END diff --git a/MacPass/MPNodeExpirationViewController.h b/MacPass/MPNodeExpirationViewController.h index 1a0422d1..bc1fd377 100644 --- a/MacPass/MPNodeExpirationViewController.h +++ b/MacPass/MPNodeExpirationViewController.h @@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN -@interface MPNodeExpirationViewController : NSViewController +@interface MPNodeExpirationViewController : NSViewController @end diff --git a/MacPass/MPNodeExpirationViewController.m b/MacPass/MPNodeExpirationViewController.m index be240d81..e115b9a5 100644 --- a/MacPass/MPNodeExpirationViewController.m +++ b/MacPass/MPNodeExpirationViewController.m @@ -13,7 +13,6 @@ @interface MPNodeExpirationViewController () -@property (nonatomic, readonly, strong) KPKTimeInfo *representedTimeInfo; @property (strong) IBOutlet NSButton *expiredCheckButton; @property (strong) IBOutlet NSButton *pickExpireDateButton;