diff --git a/MacPass/FixAutotypeWindow.xib b/MacPass/FixAutotypeWindow.xib
index 9a273801..45cb2e36 100644
--- a/MacPass/FixAutotypeWindow.xib
+++ b/MacPass/FixAutotypeWindow.xib
@@ -16,26 +16,35 @@
-
-
+
+
-
+
-
+
-
+
-
+
+
+
+
+
+
+
+
+
+
@@ -62,7 +71,7 @@
-
+
@@ -79,13 +88,14 @@
+
-
+
@@ -93,12 +103,12 @@
-
+
-
+
@@ -156,5 +166,15 @@ To fix this, you can select entries and clear their sequence. You may also custo
+
diff --git a/MacPass/MPDocumentWindowController.h b/MacPass/MPDocumentWindowController.h
index 37397876..9ad66d90 100644
--- a/MacPass/MPDocumentWindowController.h
+++ b/MacPass/MPDocumentWindowController.h
@@ -54,6 +54,7 @@
#pragma mark View Actions
- (IBAction)toggleInspector:(id)sender;
+- (IBAction)showInspector:(id)sender;
- (IBAction)focusGroups:(id)sender;
- (IBAction)focusEntries:(id)sender;
- (IBAction)focusInspector:(id)sender;
diff --git a/MacPass/MPDocumentWindowController.m b/MacPass/MPDocumentWindowController.m
index 339eeac4..66a852e6 100644
--- a/MacPass/MPDocumentWindowController.m
+++ b/MacPass/MPDocumentWindowController.m
@@ -308,14 +308,11 @@ typedef void (^MPPasswordChangedBlock)(void);
- (void)toggleInspector:(id)sender {
NSView *inspectorView = [_inspectorViewController view];
- BOOL inspectorVisible = NO;
- if([inspectorView superview]) {
- //[inspectorView animator]
+ BOOL inspectorWasVisible = [self _isInspectorVisible];
+ if(inspectorWasVisible) {
[inspectorView removeFromSuperview];
}
else {
- // Remove contraint on view removal.
- inspectorVisible = YES;
[_splitView addSubview:inspectorView];
[_splitView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"[inspectorView(>=200)]"
options:0
@@ -323,7 +320,11 @@ typedef void (^MPPasswordChangedBlock)(void);
views:NSDictionaryOfVariableBindings(inspectorView)]];
[self.inspectorViewController updateResponderChain];
}
- [[NSUserDefaults standardUserDefaults] setBool:inspectorVisible forKey:kMPSettingsKeyShowInspector];
+ [[NSUserDefaults standardUserDefaults] setBool:!inspectorWasVisible forKey:kMPSettingsKeyShowInspector];
+}
+
+- (void)showInspector:(id)sender {
+ // TODO;
}
- (void)focusEntries:(id)sender {
@@ -434,6 +435,10 @@ typedef void (^MPPasswordChangedBlock)(void);
return; // Cancel or unknown
}
}
+
+#pragma mark -
+#pragma mark UI Helper
+
- (void)_showDatabaseSetting:(MPDatabaseSettingsTab)tab {
if(!self.documentSettingsWindowController) {
_documentSettingsWindowController = [[MPDatabaseSettingsWindowController alloc] initWithDocument:[self document]];
@@ -447,4 +452,9 @@ typedef void (^MPPasswordChangedBlock)(void);
}
+- (BOOL)_isInspectorVisible {
+ NSView *inspectorView = [_inspectorViewController view];
+ return (nil != [inspectorView superview]);
+}
+
@end
diff --git a/MacPass/MPEntryViewController.m b/MacPass/MPEntryViewController.m
index 35fd9028..ed14a221 100644
--- a/MacPass/MPEntryViewController.m
+++ b/MacPass/MPEntryViewController.m
@@ -613,7 +613,10 @@ NSString *const _MPTAbleSecurCellView = @"PasswordCell";
}
NSTableColumn *column = [self.entryTable tableColumns][[self.entryTable clickedColumn]];
NSString *identifier = [column identifier];
- if([identifier isEqualToString:MPEntryTablePasswordColumnIdentifier]) {
+ if([identifier isEqualToString:MPEntryTableTitleColumnIdentifier]) {
+
+ }
+ else if([identifier isEqualToString:MPEntryTablePasswordColumnIdentifier]) {
[self copyPassword:nil];
}
else if([identifier isEqualToString:MPEntryTableUserNameColumnIdentifier]) {
diff --git a/MacPass/MPFixAutotypeWindowController.h b/MacPass/MPFixAutotypeWindowController.h
index c1d0326a..90d9cfff 100644
--- a/MacPass/MPFixAutotypeWindowController.h
+++ b/MacPass/MPFixAutotypeWindowController.h
@@ -16,7 +16,7 @@
@property (nonatomic, weak) MPDocument *workingDocument;
/**
- * Clears the autotype sequences for the selected entries
+ * Clears the autotype sequences for the selected entries, groups or window associations
*
* @param sender sender of the action
*/
diff --git a/MacPass/MPFixAutotypeWindowController.m b/MacPass/MPFixAutotypeWindowController.m
index 46a45953..7f5090b9 100644
--- a/MacPass/MPFixAutotypeWindowController.m
+++ b/MacPass/MPFixAutotypeWindowController.m
@@ -14,9 +14,12 @@
#import "KPKAutotype.h"
#import "KPKWindowAssociation.h"
+#import "MPIconHelper.h"
+
NSString *const kMPAutotypeCell = @"AutotypeCell";
NSString *const kMPTitleCell = @"TitleCell";
NSString *const kMPIsDefaultCell = @"IsDefaultCell";
+NSString *const kMPIconCell = @"IconCell";
/* Helper Categries */
@@ -63,6 +66,10 @@ NSString *const kMPIsDefaultCell = @"IsDefaultCell";
[super windowDidLoad];
}
+- (void)dealloc {
+ [self.window orderOut:self];
+}
+
#pragma mark -
#pragma mark Properties
@@ -139,18 +146,28 @@ NSString *const kMPIsDefaultCell = @"IsDefaultCell";
}
return association.keystrokeSequence;
}
- else if([[tableColumn identifier] isEqualToString:kMPIsDefaultCell]) {
+ else {
BOOL isDefault = NO;
+ NSString *keystrokeSequence;
if(entry) {
isDefault = entry.autotype.hasDefaultKeystrokeSequence;
+ keystrokeSequence = entry.autotype.defaultKeystrokeSequence;
}
else if( group ) {
isDefault = group.hasDefaultAutotypeSequence;
+ keystrokeSequence = group.defaultAutoTypeSequence;
}
else {
isDefault = association.hasDefaultKeystrokeSequence;
+ keystrokeSequence = association.keystrokeSequence;
+ }
+ if([[tableColumn identifier] isEqualToString:kMPIsDefaultCell]) {
+ return isDefault ? @"Yes" : @"No";
+ }
+ else if( [[tableColumn identifier] isEqualToString:kMPIconCell]) {
+ BOOL isWrongFormat = (NSOrderedSame == [@"{TAB}{USERNAME}{TAB}{PASSWORD}{ENTER}" compare:keystrokeSequence options:NSCaseInsensitiveSearch]);
+ return (isWrongFormat && !isDefault) ? [MPIconHelper icon:MPIconWarning] : nil;
}
- return isDefault ? @"Yes" : @"No";
}
return nil;
}
@@ -182,6 +199,16 @@ NSString *const kMPIsDefaultCell = @"IsDefaultCell";
return [item isKindOfClass:[KPKGroup class]];
}
+#pragma mark -
+#pragma mark MenuItem Validation
+
+- (BOOL)validateMenuItem:(NSMenuItem *)menuItem {
+ if(!([menuItem action] == @selector(clearAutotype:))) {
+ return NO;
+ }
+ return ([[self.tableView selectedRowIndexes] count] > 0);
+}
+
#pragma mark -
#pragma mark Data accessors