diff --git a/Resources/de.lproj/Localizable.strings b/Resources/de.lproj/Localizable.strings index 0d87860b2..3ef2b707d 100644 Binary files a/Resources/de.lproj/Localizable.strings and b/Resources/de.lproj/Localizable.strings differ diff --git a/Resources/en.lproj/Localizable.strings b/Resources/en.lproj/Localizable.strings index 6c273948a..20b666b1d 100644 Binary files a/Resources/en.lproj/Localizable.strings and b/Resources/en.lproj/Localizable.strings differ diff --git a/Source/MonitorEvidenceSource.m b/Source/MonitorEvidenceSource.m index 00004d52a..3b404ac45 100644 --- a/Source/MonitorEvidenceSource.m +++ b/Source/MonitorEvidenceSource.m @@ -11,6 +11,8 @@ @implementation MonitorEvidenceSource +#define ANY_ADDITIONAL_MONITOR_SERIAL @"any-additional-monitor" + - (id)init { if (!(self = [super init])) @@ -113,12 +115,16 @@ - (BOOL)doesRuleMatch:(NSDictionary *)rule NSEnumerator *en = [monitors objectEnumerator]; NSDictionary *mon; NSString *serial = [rule valueForKey:@"parameter"]; - while ((mon = [en nextObject])) { - if ([[mon valueForKey:@"serial"] isEqualToString:serial]) { - match = YES; - break; - } - } + if ((1 < [monitors count]) && [serial isEqualToString:ANY_ADDITIONAL_MONITOR_SERIAL]) { + match = YES; + } else { + while ((mon = [en nextObject])) { + if ([[mon valueForKey:@"serial"] isEqualToString:serial]) { + match = YES; + break; + } + } + } [lock unlock]; return match; @@ -135,6 +141,13 @@ - (NSArray *)getSuggestions [lock lock]; NSEnumerator *en = [monitors objectEnumerator]; + + // add any monitor by default + [arr addObject:[NSDictionary dictionaryWithObjectsAndKeys: + @"Monitor", @"type", + ANY_ADDITIONAL_MONITOR_SERIAL, @"parameter", + NSLocalizedString(@"Any additional monitor", @"In getSuggestions"), @"description", nil]]; + NSDictionary *mon; while ((mon = [en nextObject])) { NSString *name = [mon valueForKey:@"name"];