summaryrefslogtreecommitdiff
path: root/Assistant/Alert.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-09-06 13:56:23 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-09-06 13:56:23 -0400
commitd11ded822cf68d4f33a886e0f97f95a3781e0dc1 (patch)
treebf01cb30263bb7e9d2333ecb9aa5117a797a0334 /Assistant/Alert.hs
parentec23eeb9eb273438a59f287f9252e7b1af987fc9 (diff)
display alert for inotify/kqueue errors
Diffstat (limited to 'Assistant/Alert.hs')
-rw-r--r--Assistant/Alert.hs16
1 files changed, 15 insertions, 1 deletions
diff --git a/Assistant/Alert.hs b/Assistant/Alert.hs
index 4c4906ef5..296f992bd 100644
--- a/Assistant/Alert.hs
+++ b/Assistant/Alert.hs
@@ -27,7 +27,7 @@ data AlertPriority = Filler | Low | Medium | High | Pinned
{- An alert can have an name, which is used to combine it with other similar
- alerts. -}
-data AlertName = FileAlert TenseChunk | DownloadFailedAlert | SanityCheckFixAlert
+data AlertName = FileAlert TenseChunk | SanityCheckFixAlert | WarningAlert String
deriving (Eq)
{- The first alert is the new alert, the second is an old alert.
@@ -180,6 +180,20 @@ baseActivityAlert = Alert
, alertName = Nothing
}
+warningAlert :: String -> String -> Alert
+warningAlert name msg = Alert
+ { alertClass = Warning
+ , alertHeader = Just $ tenseWords ["warning"]
+ , alertMessageRender = tenseWords
+ , alertData = [UnTensed $ T.pack msg]
+ , alertBlockDisplay = True
+ , alertClosable = True
+ , alertPriority = High
+ , alertIcon = Just "exclamation-sign"
+ , alertCombiner = Just $ dataCombiner (++)
+ , alertName = Just $ WarningAlert name
+ }
+
activityAlert :: Maybe TenseText -> [TenseChunk] -> Alert
activityAlert header dat = baseActivityAlert
{ alertHeader = header