From 4953496ec2e63f2fe29b335d76052a3f8478a00b Mon Sep 17 00:00:00 2001 From: stuebinm Date: Sun, 26 Dec 2021 22:55:16 +0100 Subject: openWebsiteTriggerMessage can also be used for openTab --- lib/Properties.hs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/Properties.hs b/lib/Properties.hs index e746401..4e8c7d9 100644 --- a/lib/Properties.hs +++ b/lib/Properties.hs @@ -409,9 +409,9 @@ checkTileLayerProperty p@(Property name _value) = case name of requireProperty "playAudio" "openWebsiteTrigger" -> do isString p - requireProperty "openWebsite" + requireOneOf ["openWebsite", "openTab"] unlessHasProperty "openWebsiteTriggerMessage" - $ suggest "set \"openWebsiteTriggerMessage\" to a custom message to\ + $ suggest "set \"openWebsiteTriggerMessage\" to a custom message to \ \overwrite the default \"press SPACE to open Website\"." "openWebsiteTriggerMessage" -> do isString p @@ -496,6 +496,12 @@ checkTileLayerProperty p@(Property name _value) = case name of warnUnknown p knownTileLayerProperites where requireProperty req = propertyRequiredBy req name + requireOneOf names = do + context <- askContext + when (all (not . containsProperty context) names) + $ complain $ "property " <> prettyprint name <> " requires one of " + <> prettyprint names + isUnsupported = warn $ "property " <> name <> " is not (yet) supported by walint." deprecatedUseInstead instead = warn $ "property \"" <> name <> "\" is deprecated. Use \"" <> instead <> "\" instead." -- cgit v1.2.3