From f768f16999d997077be98c0d8eabd3d85fd8caa5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 3 Apr 2013 17:01:40 -0400 Subject: detect when unwanted remote is empty and remove it Needs fixes to build when the webapp is disabled. --- Assistant/Alert.hs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'Assistant/Alert.hs') 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 -- cgit v1.2.3