summaryrefslogtreecommitdiff
path: root/Assistant/Alert.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-10-22 16:02:52 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-10-22 16:02:52 -0400
commit3ca53d2779c695ebb6cbdd210fea2167562637ff (patch)
tree9fc7fe17043d36ec22b62039de7e2ef16bc2edb2 /Assistant/Alert.hs
parentde5fdb11a238249c1b9b89a29277777a09f1cdb9 (diff)
add git fsck to cronner, and UI for repository repair (not yet wired up)
Diffstat (limited to 'Assistant/Alert.hs')
-rw-r--r--Assistant/Alert.hs19
1 files changed, 19 insertions, 0 deletions
diff --git a/Assistant/Alert.hs b/Assistant/Alert.hs
index 3455d0563..4e6dab033 100644
--- a/Assistant/Alert.hs
+++ b/Assistant/Alert.hs
@@ -79,6 +79,22 @@ warningAlert name msg = Alert
, alertButton = Nothing
}
+errorAlert :: String -> AlertButton -> Alert
+errorAlert msg button = Alert
+ { alertClass = Error
+ , alertHeader = Just $ tenseWords ["error"]
+ , alertMessageRender = renderData
+ , alertData = [UnTensed $ T.pack msg]
+ , alertCounter = 0
+ , alertBlockDisplay = True
+ , alertClosable = True
+ , alertPriority = Pinned
+ , alertIcon = Just ErrorIcon
+ , alertCombiner = Nothing
+ , alertName = Nothing
+ , alertButton = Just button
+ }
+
activityAlert :: Maybe TenseText -> [TenseChunk] -> Alert
activityAlert header dat = baseActivityAlert
{ alertHeader = header
@@ -158,6 +174,9 @@ fsckAlert button n = baseActivityAlert
, alertButton = Just button
}
+brokenRepositoryAlert :: AlertButton -> Alert
+brokenRepositoryAlert = errorAlert "Your repository needs repairs."
+
pairingAlert :: AlertButton -> Alert
pairingAlert button = baseActivityAlert
{ alertData = [ UnTensed "Pairing in progress" ]