diff --git a/MacPass/EntryInspectorView.xib b/MacPass/EntryInspectorView.xib index 93f6db70..81ad35e1 100644 --- a/MacPass/EntryInspectorView.xib +++ b/MacPass/EntryInspectorView.xib @@ -855,7 +855,7 @@ - + diff --git a/MacPass/MPAutotypeDaemon.m b/MacPass/MPAutotypeDaemon.m index 4bf2aa84..484e652e 100644 --- a/MacPass/MPAutotypeDaemon.m +++ b/MacPass/MPAutotypeDaemon.m @@ -35,7 +35,6 @@ NSString *const kMPApplciationNameKey = @"applicationName"; } - (void)_didPressHotKey { - // copy items to pasteboard NSArray *documents = [NSApp orderedDocuments]; MPDocument *currentDocument = nil; for(MPDocument *openDocument in documents) { diff --git a/MacPass/MPEntryInspectorViewController.h b/MacPass/MPEntryInspectorViewController.h index bfacf73f..f31f4a54 100644 --- a/MacPass/MPEntryInspectorViewController.h +++ b/MacPass/MPEntryInspectorViewController.h @@ -55,6 +55,9 @@ - (IBAction)addCustomField:(id)sender; - (IBAction)removeCustomField:(id)sender; +- (IBAction)addWindowAssociation:(id)sender; +- (IBAction)removeWindowAssociation:(id)sender; + - (void)beginEditing; - (void)endEditing; diff --git a/MacPass/MPEntryInspectorViewController.m b/MacPass/MPEntryInspectorViewController.m index 685b754d..dd06d5aa 100644 --- a/MacPass/MPEntryInspectorViewController.m +++ b/MacPass/MPEntryInspectorViewController.m @@ -115,17 +115,17 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) { #pragma mark - #pragma mark Actions -- (IBAction)addCustomField:(id)sender { +- (void)addCustomField:(id)sender { MPDocument *document = [[self windowController] document]; [document createCustomAttribute:self.entry]; } -- (IBAction)removeCustomField:(id)sender { +- (void)removeCustomField:(id)sender { NSUInteger index = [sender tag]; KPKAttribute *attribute = self.entry.customAttributes[index]; [self.entry removeCustomAttribute:attribute]; } -- (IBAction)saveAttachment:(id)sender { +- (void)saveAttachment:(id)sender { KPKBinary *binary = self.entry.binaries[[sender tag]]; NSSavePanel *savePanel = [NSSavePanel savePanel]; [savePanel setCanCreateDirectories:YES]; @@ -138,7 +138,7 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) { }]; } -- (IBAction)addAttachment:(id)sender { +- (void)addAttachment:(id)sender { NSOpenPanel *openPanel = [NSOpenPanel openPanel]; [openPanel setCanChooseDirectories:NO]; [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]]; [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 - (void)beginEditing { [self _toggleEditing:YES]; @@ -285,14 +294,31 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) { } - (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 { - [self.enableAutotypeCheckButton bind:NSValueBinding toObject:self.entry.autotype withKeyPath:@"isEnabled" options:nil]; - [self.customEntrySequenceTextField bind:NSEnabledBinding toObject:self.entry.autotype withKeyPath:@"isEnabled" 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]; + if(self.entry) { + [self.enableAutotypeCheckButton bind:NSValueBinding toObject:self.entry.autotype withKeyPath:@"isEnabled" options:nil]; + [self.customEntrySequenceTextField bind:NSEnabledBinding toObject:self.entry.autotype withKeyPath:@"isEnabled" 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 { @@ -313,7 +339,7 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) { [_notesTextView setSelectable:edit]; [_modifiedTextField setEditable:edit]; [_modifiedTextField setSelectable:edit]; - + } @end diff --git a/MacPass/de.lproj/KPKLocalizeable.strings b/MacPass/de.lproj/KPKLocalizeable.strings index 7e1d20ea..dc1177d9 100644 --- a/MacPass/de.lproj/KPKLocalizeable.strings +++ b/MacPass/de.lproj/KPKLocalizeable.strings @@ -10,6 +10,11 @@ "KPK_GROUP_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 */ "ERROR_CORRUPT_TREE" = "The internal file structure is corrupted!"; "ERROR_INVALID_FIELD_SIZE" = "A data filed has an incorrect size!";