adopting new KeePassKit API for multiple matching window associations

This commit is contained in:
michael starke
2017-10-09 18:44:16 +02:00
parent da34f0361a
commit d9b9cd78cb
4 changed files with 15 additions and 8 deletions

View File

@@ -1,3 +1,3 @@
github "sparkle-project/Sparkle" ~> 1.18.1
github "mstarke/KeePassKit" "6f6a5c6b8d1a8fadb430a34f72785c67138ff58d"
github "mstarke/KeePassKit" "a0d459f52e0d4d3c0b0fba92de6dc54ddffba486"
github "mstarke/HNHUi" ~> 1.1

View File

@@ -1,3 +1,3 @@
github "mstarke/HNHUi" "1.2"
github "mstarke/KeePassKit" "6f6a5c6b8d1a8fadb430a34f72785c67138ff58d"
github "mstarke/KeePassKit" "a0d459f52e0d4d3c0b0fba92de6dc54ddffba486"
github "sparkle-project/Sparkle" "1.18.1"

View File

@@ -259,6 +259,8 @@
- (void)_setupAdvancedTab:(KPKTree *)tree {
HNHUISetStateFromBool(self.enableTrashCheckButton, tree.metaData.useTrash);
self.selectTrashGoupPopUpButton.enabled = tree.metaData.useTrash;
self.historyMaximumItemsTextField.stringValue = [NSString stringWithFormat:@"%ld", tree.metaData.historyMaxItems];
self.historyMaxiumSizeTextField.stringValue = [NSString stringWithFormat:@"%ld", tree.metaData.historyMaxSize];
[self.enableTrashCheckButton bind:NSValueBinding toObject:self.selectTrashGoupPopUpButton withKeyPath:NSEnabledBinding options:nil];
[self _updateTrashFolders:tree];

View File

@@ -65,13 +65,18 @@
MPAutotypeContext *context;
for(KPKEntry *entry in autotypeEntries) {
/* search in Autotype entries for match */
KPKWindowAssociation *association = [entry.autotype windowAssociationMatchingWindowTitle:windowTitle];
context = [[MPAutotypeContext alloc] initWithWindowAssociation:association];
if(context.valid) {
[contexts addObject:context];
continue; // association did match
}
BOOL foundMatch = NO;
for(KPKWindowAssociation *association in [entry.autotype windowAssociationsMatchingWindowTitle:windowTitle]) {
context = [[MPAutotypeContext alloc] initWithWindowAssociation:association];
if(context.valid) {
foundMatch = YES;
[contexts addObject:context];
}
}
/* association match found, no need to use the default sequence! */
if(foundMatch) {
continue;
}
/* Test for entry title in window title */
if(matchTitle && !foundMatch) {
foundMatch = [windowTitle rangeOfString:entry.title options:NSCaseInsensitiveSearch].length != 0 || [entry.title rangeOfString:windowTitle options:NSCaseInsensitiveSearch].length != 0;