mirror of
https://github.com/MacPass/MacPass.git
synced 2026-01-30 18:08:17 +00:00
Actions for add and remove of window associations stubbed
Autotype inspector binding extended
This commit is contained in:
@@ -855,7 +855,7 @@
|
|||||||
</constraints>
|
</constraints>
|
||||||
<buttonCell key="cell" type="roundRect" bezelStyle="roundedRect" image="NSAddTemplate" imagePosition="only" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="5J6-uD-iK6">
|
<buttonCell key="cell" type="roundRect" bezelStyle="roundedRect" image="NSAddTemplate" imagePosition="only" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="5J6-uD-iK6">
|
||||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||||
<font key="font" metaFont="controlContent"/>
|
<font key="font" metaFont="cellTitle"/>
|
||||||
</buttonCell>
|
</buttonCell>
|
||||||
</button>
|
</button>
|
||||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="AAj-Ak-z46">
|
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="AAj-Ak-z46">
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ NSString *const kMPApplciationNameKey = @"applicationName";
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)_didPressHotKey {
|
- (void)_didPressHotKey {
|
||||||
// copy items to pasteboard
|
|
||||||
NSArray *documents = [NSApp orderedDocuments];
|
NSArray *documents = [NSApp orderedDocuments];
|
||||||
MPDocument *currentDocument = nil;
|
MPDocument *currentDocument = nil;
|
||||||
for(MPDocument *openDocument in documents) {
|
for(MPDocument *openDocument in documents) {
|
||||||
|
|||||||
@@ -55,6 +55,9 @@
|
|||||||
- (IBAction)addCustomField:(id)sender;
|
- (IBAction)addCustomField:(id)sender;
|
||||||
- (IBAction)removeCustomField:(id)sender;
|
- (IBAction)removeCustomField:(id)sender;
|
||||||
|
|
||||||
|
- (IBAction)addWindowAssociation:(id)sender;
|
||||||
|
- (IBAction)removeWindowAssociation:(id)sender;
|
||||||
|
|
||||||
- (void)beginEditing;
|
- (void)beginEditing;
|
||||||
- (void)endEditing;
|
- (void)endEditing;
|
||||||
|
|
||||||
|
|||||||
@@ -115,17 +115,17 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
|||||||
#pragma mark -
|
#pragma mark -
|
||||||
#pragma mark Actions
|
#pragma mark Actions
|
||||||
|
|
||||||
- (IBAction)addCustomField:(id)sender {
|
- (void)addCustomField:(id)sender {
|
||||||
MPDocument *document = [[self windowController] document];
|
MPDocument *document = [[self windowController] document];
|
||||||
[document createCustomAttribute:self.entry];
|
[document createCustomAttribute:self.entry];
|
||||||
}
|
}
|
||||||
- (IBAction)removeCustomField:(id)sender {
|
- (void)removeCustomField:(id)sender {
|
||||||
NSUInteger index = [sender tag];
|
NSUInteger index = [sender tag];
|
||||||
KPKAttribute *attribute = self.entry.customAttributes[index];
|
KPKAttribute *attribute = self.entry.customAttributes[index];
|
||||||
[self.entry removeCustomAttribute:attribute];
|
[self.entry removeCustomAttribute:attribute];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (IBAction)saveAttachment:(id)sender {
|
- (void)saveAttachment:(id)sender {
|
||||||
KPKBinary *binary = self.entry.binaries[[sender tag]];
|
KPKBinary *binary = self.entry.binaries[[sender tag]];
|
||||||
NSSavePanel *savePanel = [NSSavePanel savePanel];
|
NSSavePanel *savePanel = [NSSavePanel savePanel];
|
||||||
[savePanel setCanCreateDirectories:YES];
|
[savePanel setCanCreateDirectories:YES];
|
||||||
@@ -138,7 +138,7 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
|||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (IBAction)addAttachment:(id)sender {
|
- (void)addAttachment:(id)sender {
|
||||||
NSOpenPanel *openPanel = [NSOpenPanel openPanel];
|
NSOpenPanel *openPanel = [NSOpenPanel openPanel];
|
||||||
[openPanel setCanChooseDirectories:NO];
|
[openPanel setCanChooseDirectories:NO];
|
||||||
[openPanel setCanChooseFiles:YES];
|
[openPanel setCanChooseFiles:YES];
|
||||||
@@ -153,11 +153,20 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
|||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (IBAction)removeAttachment:(id)sender {
|
- (void)removeAttachment:(id)sender {
|
||||||
KPKBinary *binary = self.entry.binaries[[sender tag]];
|
KPKBinary *binary = self.entry.binaries[[sender tag]];
|
||||||
[self.entry removeBinary:binary];
|
[self.entry removeBinary:binary];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)addWindowAssociation:(id)sender {
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)removeWindowAssociation:(id)sender {
|
||||||
|
NSInteger row = [self.windowAssociationsTableView selectedRow];
|
||||||
|
if(row > - 1 && row < [self.entry.autotype.associations count]) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark Editing
|
#pragma mark Editing
|
||||||
- (void)beginEditing {
|
- (void)beginEditing {
|
||||||
[self _toggleEditing:YES];
|
[self _toggleEditing:YES];
|
||||||
@@ -285,14 +294,31 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)_bindCustomFields {
|
- (void)_bindCustomFields {
|
||||||
[_customFieldsController bind:NSContentArrayBinding toObject:self.entry withKeyPath:@"customAttributes" options:nil];
|
if(self.entry) {
|
||||||
|
[_customFieldsController bind:NSContentArrayBinding toObject:self.entry withKeyPath:@"customAttributes" options:nil];
|
||||||
|
}
|
||||||
|
else if ([_customFieldsController content] != nil ) {
|
||||||
|
[_customFieldsController unbind:NSContentArrayBinding];
|
||||||
|
[_customFieldsController setContent:nil];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)_bindAutotype {
|
- (void)_bindAutotype {
|
||||||
[self.enableAutotypeCheckButton bind:NSValueBinding toObject:self.entry.autotype withKeyPath:@"isEnabled" options:nil];
|
if(self.entry) {
|
||||||
[self.customEntrySequenceTextField bind:NSEnabledBinding toObject:self.entry.autotype withKeyPath:@"isEnabled" options:nil];
|
[self.enableAutotypeCheckButton bind:NSValueBinding toObject:self.entry.autotype withKeyPath:@"isEnabled" options:nil];
|
||||||
[self.customEntrySequenceTextField bind:NSValueBinding toObject:self.entry.autotype withKeyPath:@"defaultSequence" options:nil];
|
[self.customEntrySequenceTextField bind:NSEnabledBinding toObject:self.entry.autotype withKeyPath:@"isEnabled" options:nil];
|
||||||
[_windowAssociationsController bind:NSContentArrayBinding toObject:self.entry.autotype withKeyPath:@"associations" options:nil];
|
[self.customEntrySequenceTextField bind:NSValueBinding toObject:self.entry.autotype withKeyPath:@"defaultSequence" options:nil];
|
||||||
|
[_windowAssociationsController bind:NSContentArrayBinding toObject:self.entry.autotype withKeyPath:@"associations" options:nil];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
[self.enableAutotypeCheckButton unbind:NSValueBinding];
|
||||||
|
[self.customEntrySequenceTextField unbind:NSEnabledBinding];
|
||||||
|
[self.customEntrySequenceTextField unbind:NSValueBinding];
|
||||||
|
if([_windowAssociationsController content] != nil) {
|
||||||
|
[_windowAssociationsController unbind:NSContentArrayBinding];
|
||||||
|
[_windowAssociationsController setContent:nil];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)_toggleEditing:(BOOL)edit {
|
- (void)_toggleEditing:(BOOL)edit {
|
||||||
@@ -313,7 +339,7 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
|||||||
[_notesTextView setSelectable:edit];
|
[_notesTextView setSelectable:edit];
|
||||||
[_modifiedTextField setEditable:edit];
|
[_modifiedTextField setEditable:edit];
|
||||||
[_modifiedTextField setSelectable:edit];
|
[_modifiedTextField setSelectable:edit];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -10,6 +10,11 @@
|
|||||||
"KPK_GROUP_COPY_%@" = "Kopie von %@";
|
"KPK_GROUP_COPY_%@" = "Kopie von %@";
|
||||||
"KPK_ENTRY_COPY_%@" = "Kopie von %@";
|
"KPK_ENTRY_COPY_%@" = "Kopie von %@";
|
||||||
|
|
||||||
|
/* Validation Errors */
|
||||||
|
"ERROR_WINDOW_TITLE_VALIDATION_FAILED" = "The Format of the Window Title is not valid!";
|
||||||
|
"ERROR_ATTRIBUTE_KEY_VALIDATION_FAILED" = "The Attribute Key is not unique!";
|
||||||
|
"ERROR_AUTOTYPE_SEQUENCE_VALIDATION_FAILED" = "Tht Autotype Sequence is not valid!";
|
||||||
|
|
||||||
/* Errors */
|
/* Errors */
|
||||||
"ERROR_CORRUPT_TREE" = "The internal file structure is corrupted!";
|
"ERROR_CORRUPT_TREE" = "The internal file structure is corrupted!";
|
||||||
"ERROR_INVALID_FIELD_SIZE" = "A data filed has an incorrect size!";
|
"ERROR_INVALID_FIELD_SIZE" = "A data filed has an incorrect size!";
|
||||||
|
|||||||
Reference in New Issue
Block a user