aboutsummaryrefslogtreecommitdiff
path: root/Assistant/Alert.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-04-03 17:01:40 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-04-03 17:01:40 -0400
commitf768f16999d997077be98c0d8eabd3d85fd8caa5 (patch)
tree40ff7020f523d3eb67f344a983af4a6d7c0aca26 /Assistant/Alert.hs
parent6543d5406c64bb00a58e74305ec9ca09a49faf0b (diff)
detect when unwanted remote is empty and remove it
Needs fixes to build when the webapp is disabled.
Diffstat (limited to 'Assistant/Alert.hs')
-rw-r--r--Assistant/Alert.hs18
1 files changed, 18 insertions, 0 deletions
diff --git a/Assistant/Alert.hs b/Assistant/Alert.hs
index 206694031..81dc362e4 100644
--- a/Assistant/Alert.hs
+++ b/Assistant/Alert.hs
@@ -34,6 +34,7 @@ data AlertName
| WarningAlert String
| PairAlert String
| XMPPNeededAlert
+ | RemoteRemovalAlert String
| CloudRepoNeededAlert
| SyncAlert
deriving (Eq)
@@ -351,6 +352,23 @@ cloudRepoNeededAlert friendname button = Alert
, alertData = []
}
+remoteRemovalAlert :: String -> AlertButton -> Alert
+remoteRemovalAlert desc button = Alert
+ { alertHeader = Just $ fromString $
+ "The repository \"" ++ desc ++
+ "\" has been emptied, and can now be removed."
+ , alertIcon = Just InfoIcon
+ , alertPriority = High
+ , alertButton = Just button
+ , alertClosable = True
+ , alertClass = Message
+ , alertMessageRender = tenseWords
+ , alertBlockDisplay = True
+ , alertName = Just $ RemoteRemovalAlert desc
+ , alertCombiner = Just $ dataCombiner $ \_old new -> new
+ , alertData = []
+ }
+
fileAlert :: TenseChunk -> FilePath -> Alert
fileAlert msg file = (activityAlert Nothing [f])
{ alertName = Just $ FileAlert msg