aboutsummaryrefslogtreecommitdiff
path: root/Assistant/Alert.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-31 03:10:16 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-07-31 03:10:16 -0400
commite9d9d9d5ea36c9d20913470079db9ea8ac0db994 (patch)
tree7bca8dc47839471aade565f34887b3cfe4f09841 /Assistant/Alert.hs
parentf0a88e120367fb68f36e316361c14639c338f8c3 (diff)
add icons
Diffstat (limited to 'Assistant/Alert.hs')
-rw-r--r--Assistant/Alert.hs16
1 files changed, 4 insertions, 12 deletions
diff --git a/Assistant/Alert.hs b/Assistant/Alert.hs
index 9a0bba8ae..0412dfe51 100644
--- a/Assistant/Alert.hs
+++ b/Assistant/Alert.hs
@@ -34,6 +34,7 @@ data Alert = Alert
, alertBlockDisplay :: Bool
, alertClosable :: Bool
, alertPriority :: AlertPriority
+ , alertIcon :: Maybe String
}
type AlertPair = (AlertId, Alert)
@@ -108,26 +109,15 @@ makeAlertFiller success alert
| otherwise = alert
{ alertClass = if c == Activity then c' else c
, alertPriority = Filler
- , alertHeader = finished <$> h
- , alertMessage = massage m
, alertClosable = True
+ , alertIcon = Just $ if success then "ok" else "exclamation-sign"
}
where
- h = alertHeader alert
- m = alertMessage alert
c = alertClass alert
c'
| success = Success
| otherwise = Error
- massage (WidgetAlert w) = WidgetAlert w -- renders old on its own
- massage (StringAlert s) = StringAlert $
- maybe (finished s) (const s) h
-
- finished s
- | success = s ++ ": Ok"
- | otherwise = s ++ ": Failed"
-
isFiller :: Alert -> Bool
isFiller alert = alertPriority alert == Filler
@@ -163,6 +153,7 @@ baseActivityAlert = Alert
, alertBlockDisplay = False
, alertClosable = False
, alertPriority = Medium
+ , alertIcon = Just "refresh"
}
activityAlert :: Maybe String -> String -> Alert
@@ -220,4 +211,5 @@ sanityCheckFixAlert msg = Alert
, alertBlockDisplay = True
, alertPriority = High
, alertClosable = True
+ , alertIcon = Just "exclamation-sign"
}