diff options
author | Joey Hess <joey@kitenet.net> | 2013-03-15 17:52:41 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-03-15 17:52:41 -0400 |
commit | 77e43ec65fff0aaaa1e08caffeb654971aee0b36 (patch) | |
tree | 4f09745fe8b3433293dd78eb74c5abf9f3154e10 /Assistant/Alert.hs | |
parent | e41db4a717f8e92c2c33704196f43224ae6a5ec8 (diff) |
webapp: Display an alert when there are XMPP remotes, and a cloud transfer repository needs to be configured.
Diffstat (limited to 'Assistant/Alert.hs')
-rw-r--r-- | Assistant/Alert.hs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Assistant/Alert.hs b/Assistant/Alert.hs index 65f8c3e67..40c37a94a 100644 --- a/Assistant/Alert.hs +++ b/Assistant/Alert.hs @@ -34,6 +34,7 @@ data AlertName | WarningAlert String | PairAlert String | XMPPNeededAlert + | CloudRepoNeededAlert deriving (Eq) {- The first alert is the new alert, the second is an old alert. @@ -333,6 +334,24 @@ xmppNeededAlert button = Alert , alertData = [] } +cloudRepoNeededAlert :: Maybe String -> AlertButton -> Alert +cloudRepoNeededAlert friendname button = Alert + { alertHeader = Just $ fromString $ unwords + [ "Unable to download files from" + , (fromMaybe "your other devices" friendname) ++ "." + ] + , alertIcon = Just ErrorIcon + , alertPriority = High + , alertButton = Just button + , alertClosable = True + , alertClass = Message + , alertMessageRender = tenseWords + , alertBlockDisplay = True + , alertName = Just $ CloudRepoNeededAlert + , alertCombiner = Just $ dataCombiner $ \_old new -> new + , alertData = [] + } + fileAlert :: TenseChunk -> FilePath -> Alert fileAlert msg file = (activityAlert Nothing [f]) { alertName = Just $ FileAlert msg |