mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-18 23:09:21 +00:00
Fix Autotype window now displays content again
This commit is contained in:
@@ -420,7 +420,7 @@ typedef NS_ENUM(NSUInteger, MPEntryTab) {
|
|||||||
[self.enableAutotypeCheckButton bind:NSValueBinding toObject:self.entry.autotype withKeyPath:NSStringFromSelector(@selector(isEnabled)) options:nil];
|
[self.enableAutotypeCheckButton bind:NSValueBinding toObject:self.entry.autotype withKeyPath:NSStringFromSelector(@selector(isEnabled)) options:nil];
|
||||||
[self.obfuscateAutotypeCheckButton bind:NSValueBinding toObject:self.entry.autotype withKeyPath:NSStringFromSelector(@selector(obfuscateDataTransfer)) options:nil];
|
[self.obfuscateAutotypeCheckButton bind:NSValueBinding toObject:self.entry.autotype withKeyPath:NSStringFromSelector(@selector(obfuscateDataTransfer)) options:nil];
|
||||||
[self.customEntrySequenceTextField bind:NSEnabledBinding toObject:self.entry.autotype withKeyPath:NSStringFromSelector(@selector(isEnabled)) options:nil];
|
[self.customEntrySequenceTextField bind:NSEnabledBinding toObject:self.entry.autotype withKeyPath:NSStringFromSelector(@selector(isEnabled)) options:nil];
|
||||||
[self.customEntrySequenceTextField bind:NSValueBinding toObject:self.entry.autotype withKeyPath:NSStringFromSelector(@selector(defaultKeystrokeSequence)) options:nil];
|
[self.customEntrySequenceTextField bind:NSValueBinding toObject:self.entry.autotype withKeyPath:NSStringFromSelector(@selector(defaultKeystrokeSequence)) options:@{ NSValidatesImmediatelyBindingOption: @(YES) }];
|
||||||
[_windowAssociationsController bind:NSContentArrayBinding toObject:self.entry.autotype withKeyPath:NSStringFromSelector(@selector(associations)) options:nil];
|
[_windowAssociationsController bind:NSContentArrayBinding toObject:self.entry.autotype withKeyPath:NSStringFromSelector(@selector(associations)) options:nil];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
@@ -25,6 +25,13 @@ NSString *const kMPIsDefaultCell = @"IsDefaultCell";
|
|||||||
NSString *const kMPIconCell = @"IconCell";
|
NSString *const kMPIconCell = @"IconCell";
|
||||||
|
|
||||||
|
|
||||||
|
@interface KPKWindowAssociation (MPFixAutotypeWindowControllerQualifedName)
|
||||||
|
|
||||||
|
@property (nonatomic, readonly) NSString *qualifedName;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
|
||||||
@implementation KPKWindowAssociation (MPFixAutotypeWindowControllerQualifedName)
|
@implementation KPKWindowAssociation (MPFixAutotypeWindowControllerQualifedName)
|
||||||
|
|
||||||
- (NSString *)qualifedName {
|
- (NSString *)qualifedName {
|
||||||
@@ -119,7 +126,7 @@ NSString *const kMPIconCell = @"IconCell";
|
|||||||
association = item;
|
association = item;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(nil == entry || nil == group || nil == association) {
|
if(nil == entry && nil == group && nil == association) {
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -142,26 +149,12 @@ NSString *const kMPIconCell = @"IconCell";
|
|||||||
return association.keystrokeSequence;
|
return association.keystrokeSequence;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
BOOL isDefault = NO;
|
BOOL isMalformed = [MPDocument isCandidateForMalformedAutotype:item];
|
||||||
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]) {
|
if([[tableColumn identifier] isEqualToString:kMPIsDefaultCell]) {
|
||||||
return isDefault ? @"Yes" : @"No";
|
return isMalformed ? @"Yes" : @"No";
|
||||||
}
|
}
|
||||||
else if( [[tableColumn identifier] isEqualToString:kMPIconCell]) {
|
else if( [[tableColumn identifier] isEqualToString:kMPIconCell]) {
|
||||||
BOOL isWrongFormat = (NSOrderedSame == [@"{TAB}{USERNAME}{TAB}{PASSWORD}{ENTER}" compare:keystrokeSequence options:NSCaseInsensitiveSearch]);
|
return isMalformed ? [MPIconHelper icon:MPIconWarning] : nil;
|
||||||
return (isWrongFormat && !isDefault) ? [MPIconHelper icon:MPIconWarning] : nil;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil;
|
return nil;
|
||||||
|
|||||||
Reference in New Issue
Block a user