diff --git a/KeePassKit b/KeePassKit index dd4bb1d7..24cb9124 160000 --- a/KeePassKit +++ b/KeePassKit @@ -1 +1 @@ -Subproject commit dd4bb1d77ebb34c047aa0f1bb5e874b301b874ea +Subproject commit 24cb912488d23599a325b3842feb71f8ca77fd4a diff --git a/MacPass.xcodeproj/project.pbxproj b/MacPass.xcodeproj/project.pbxproj index 9442951f..68c82b74 100644 --- a/MacPass.xcodeproj/project.pbxproj +++ b/MacPass.xcodeproj/project.pbxproj @@ -475,9 +475,9 @@ 4C52A88C1788628B00868229 /* 13_KeysTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 13_KeysTemplate.pdf; sourceTree = ""; }; 4C52A88D1788628B00868229 /* 18_DisplayTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 18_DisplayTemplate.pdf; sourceTree = ""; }; 4C52A891178863B000868229 /* 68_PhoneTemplate.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = 68_PhoneTemplate.pdf; sourceTree = ""; }; - 4C53A7A81864C3A1000DFF0D /* de */ = {isa = PBXFileReference; lastKnownFileType = file; name = de; path = de.lproj/KPKLocalizeable.strings; sourceTree = ""; }; - 4C53A7A91864C3A2000DFF0D /* en */ = {isa = PBXFileReference; lastKnownFileType = file; name = en; path = en.lproj/KPKLocalizeable.strings; sourceTree = ""; }; - 4C53A7AA1864C3A2000DFF0D /* fr */ = {isa = PBXFileReference; lastKnownFileType = file; name = fr; path = fr.lproj/KPKLocalizeable.strings; sourceTree = ""; }; + 4C53A7A81864C3A1000DFF0D /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/KPKLocalizeable.strings; sourceTree = ""; }; + 4C53A7A91864C3A2000DFF0D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/KPKLocalizeable.strings; sourceTree = ""; }; + 4C53A7AA1864C3A2000DFF0D /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = fr.lproj/KPKLocalizeable.strings; sourceTree = ""; }; 4C5426F217BEEA8700A4424C /* Autotype_test.kdbx */ = {isa = PBXFileReference; lastKnownFileType = file; name = Autotype_test.kdbx; path = Databases/Autotype_test.kdbx; sourceTree = ""; }; 4C569D9C17652AC800595B62 /* MPConstants.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPConstants.h; sourceTree = ""; }; 4C569D9D17652B0600595B62 /* MPConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPConstants.m; sourceTree = ""; }; @@ -2306,7 +2306,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_ARC = YES; - "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer"; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = ""; COMBINE_HIDPI_IMAGES = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "MacPass/MacPass-Prefix.pch"; @@ -2322,7 +2322,7 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_ARC = YES; - "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Mac Developer"; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = ""; COMBINE_HIDPI_IMAGES = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "MacPass/MacPass-Prefix.pch"; diff --git a/MacPass/Base.lproj/InspectorView.xib b/MacPass/Base.lproj/InspectorView.xib index 43602a55..d4fc2b15 100644 --- a/MacPass/Base.lproj/InspectorView.xib +++ b/MacPass/Base.lproj/InspectorView.xib @@ -2,10 +2,10 @@ 1080 - 13A603 + 13B42 4514 1265 - 695.00 + 696.00 com.apple.InterfaceBuilder.CocoaPlugin 4514 @@ -328,6 +328,14 @@ 3122 + + + handleEditButtonClickEvent: + + + + 3125 + @@ -988,7 +996,7 @@ - 3123 + 3125 @@ -1003,17 +1011,20 @@ MPInspectorViewController MPViewController - - showImagePopup: - id - - - showImagePopup: - + + id + id + + + + handleEditButtonClickEvent: + id + + showImagePopup: id - + HNHGradientView NSTextField diff --git a/MacPass/MPDocumentWindowController.m b/MacPass/MPDocumentWindowController.m index 4460421b..85ed99a5 100644 --- a/MacPass/MPDocumentWindowController.m +++ b/MacPass/MPDocumentWindowController.m @@ -354,18 +354,18 @@ typedef NS_ENUM(NSUInteger, MPAlertContext) { options:0 metrics:nil views:views]]; - /* Restore the State the inspector view was in before the view change */ - if(removeInspector) { - [inspectorView removeFromSuperview]; - } - [contentView layoutSubtreeIfNeeded]; - [_entryViewController updateResponderChain]; [_inspectorViewController updateResponderChain]; [_outlineViewController updateResponderChain]; /* Custom setup after being added to window */ [_inspectorViewController prepareView]; [_outlineViewController showOutline]; + + /* Restore the State the inspector view was in before the view change */ + if(removeInspector) { + [inspectorView removeFromSuperview]; + } + [contentView layoutSubtreeIfNeeded]; } #pragma mark Validation diff --git a/MacPass/MPEntryInspectorViewController.h b/MacPass/MPEntryInspectorViewController.h index 77f41f2d..8e827b58 100644 --- a/MacPass/MPEntryInspectorViewController.h +++ b/MacPass/MPEntryInspectorViewController.h @@ -44,6 +44,7 @@ - (IBAction)addCustomField:(id)sender; - (IBAction)removeCustomField:(id)sender; - +- (void)beginEditing; +- (void)endEditing; @end diff --git a/MacPass/MPEntryInspectorViewController.m b/MacPass/MPEntryInspectorViewController.m index 9f364fbc..94941439 100644 --- a/MacPass/MPEntryInspectorViewController.m +++ b/MacPass/MPEntryInspectorViewController.m @@ -184,6 +184,39 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) { [self.entry removeBinary:binary]; } +// CS: could there be a better way? +- (void)beginEditing +{ + NSLog(@"beganEditing:"); + + _titleTextField.editable = YES; + _usernameTextField.editable = YES; + _URLTextField.editable = YES; + _passwordTextField.editable = YES; + + _createdTextField.editable = YES; + _modifiedTextField.editable = YES; + + _notesTextView.editable = YES; + +} + +// CS: could there be a better way? +- (void)endEditing +{ + NSLog(@"endEditing"); + _titleTextField.editable = NO; + _usernameTextField.editable = NO; + _URLTextField.editable = NO; + _passwordTextField.editable = NO; + + _createdTextField.editable = NO; + _modifiedTextField.editable = NO; + + _notesTextView.editable = NO; +} + + #pragma mark - #pragma mark Popovers diff --git a/MacPass/MPEntryViewController.m b/MacPass/MPEntryViewController.m index 89f6db35..afc15647 100644 --- a/MacPass/MPEntryViewController.m +++ b/MacPass/MPEntryViewController.m @@ -469,6 +469,23 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell"; if(![document validateMenuItem:menuItem]) { return NO; } + + // CS: don't know how to iterate through KPKEntry properties to check for blanks so just check the declared properties + KPKEntry *targetEntry = [self _clickedOrSelectedEntry]; + MPActionType actionType = [MPActionHelper typeForAction:[menuItem action]]; + + if (([[targetEntry username] length] == 0) && (actionType == MPActionCopyUsername)) { + return NO; + } + + if (([[targetEntry password] length] == 0) && (actionType == MPActionCopyPassword)) { + return NO; + } + + if (([[targetEntry url] length] == 0) && (actionType == MPActionCopyURL || actionType == MPActionOpenURL)) { + return NO; + } + return YES; /* TODO handle _clickedOrSlectedEnty */ } diff --git a/MacPass/MPInspectorViewController.h b/MacPass/MPInspectorViewController.h index c447829b..668ed392 100644 --- a/MacPass/MPInspectorViewController.h +++ b/MacPass/MPInspectorViewController.h @@ -22,6 +22,7 @@ @property (weak) IBOutlet NSButton *editButton; - (IBAction)showImagePopup:(id)sender; +- (IBAction)handleEditButtonClickEvent:(id)sender; /* Seperate call to ensure alle registered objects are in place */ - (void)setupNotifications:(NSWindowController *)windowController; diff --git a/MacPass/MPInspectorViewController.m b/MacPass/MPInspectorViewController.m index 9e50fcc9..c1e89498 100644 --- a/MacPass/MPInspectorViewController.m +++ b/MacPass/MPInspectorViewController.m @@ -156,6 +156,28 @@ typedef NS_ENUM(NSUInteger, MPContentTab) { } +#pragma mark - +#pragma mark Click Edit Button + +// button title can be used as a status indicator +- (IBAction)handleEditButtonClickEvent:(id)sender +{ + NSString *buttonTitle; + + buttonTitle = self.editButton.title; + + if ([buttonTitle isEqualToString:@"Edit"]) { + NSLog(@"begin editing"); + [_entryViewController beginEditing]; + self.editButton.title = @"Done"; + } + else if ([buttonTitle isEqualToString:@"Done"]) { + NSLog(@"finished editing"); + [_entryViewController endEditing]; + self.editButton.title = @"Edit"; + } +} + #pragma mark - #pragma mark Popup - (IBAction)showImagePopup:(id)sender { @@ -246,5 +268,9 @@ typedef NS_ENUM(NSUInteger, MPContentTab) { } } [self _updateItemBindings:document.selectedItem]; + + // disable the entry text fields whenever the entry selection changes + [_entryViewController endEditing]; + self.editButton.title = @"Edit"; } @end \ No newline at end of file diff --git a/MacPass/WelcomeWindow.xib b/MacPass/WelcomeWindow.xib index 09a85087..1d37b32b 100644 --- a/MacPass/WelcomeWindow.xib +++ b/MacPass/WelcomeWindow.xib @@ -1,5 +1,5 @@ - + @@ -15,7 +15,7 @@ - +