summaryrefslogtreecommitdiff
path: root/Assistant/Alert.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-09-09 16:24:34 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-09-09 16:24:34 -0400
commit16cefae7f276e12c20e203729aad23cfd90f0ec3 (patch)
tree24291391d3a9affc1f987f7b200c3c8fb0a49961 /Assistant/Alert.hs
parentded85175455bf355753ea26263898487c2162ab5 (diff)
add an alert while a locally initiated pairing request is in progress
Has a button to cancel the request.
Diffstat (limited to 'Assistant/Alert.hs')
-rw-r--r--Assistant/Alert.hs16
1 files changed, 12 insertions, 4 deletions
diff --git a/Assistant/Alert.hs b/Assistant/Alert.hs
index 666098c6f..a2f5db4e3 100644
--- a/Assistant/Alert.hs
+++ b/Assistant/Alert.hs
@@ -32,7 +32,7 @@ data AlertName
= FileAlert TenseChunk
| SanityCheckFixAlert
| WarningAlert String
- | PairRequestAlert String
+ | PairRequestReceivedAlert String
deriving (Eq)
{- The first alert is the new alert, the second is an old alert.
@@ -148,6 +148,7 @@ makeAlertFiller success alert
{ alertClass = if c == Activity then c' else c
, alertPriority = Filler
, alertClosable = True
+ , alertButton = Nothing
, alertIcon = Just $ if success then SuccessIcon else ErrorIcon
}
where
@@ -285,8 +286,15 @@ sanityCheckFixAlert msg = Alert
alerthead = "The daily sanity check found and fixed a problem:"
alertfoot = "If these problems persist, consider filing a bug report."
-pairRequestAlert :: String -> String -> AlertButton -> Alert
-pairRequestAlert repo msg button = Alert
+pairRequestAlert :: AlertButton -> Alert
+pairRequestAlert button = baseActivityAlert
+ { alertData = [ UnTensed "Pairing request in progress" ]
+ , alertPriority = High
+ , alertButton = Just button
+ }
+
+pairRequestReceivedAlert :: String -> String -> AlertButton -> Alert
+pairRequestReceivedAlert repo msg button = Alert
{ alertClass = Message
, alertHeader = Nothing
, alertMessageRender = tenseWords
@@ -295,7 +303,7 @@ pairRequestAlert repo msg button = Alert
, alertPriority = High
, alertClosable = True
, alertIcon = Just InfoIcon
- , alertName = Just $ PairRequestAlert repo
+ , alertName = Just $ PairRequestReceivedAlert repo
, alertCombiner = Just $ dataCombiner $ const id
, alertButton = Just button
}