summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstuebinm2021-12-26 22:55:16 +0100
committerstuebinm2022-01-02 01:55:49 +0100
commite8d993e2932ea1dc4826ad371abe274165521429 (patch)
tree7fd09bb3fb6174ce7c063bb4b67858c22d00fdd6
parentafd2f44b451f66c5254da176f2c783b73fc35eda (diff)
openWebsiteTriggerMessage can also be used for openTab
Diffstat (limited to '')
-rw-r--r--lib/Properties.hs10
1 files changed, 8 insertions, 2 deletions
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."