webapp: Display an alert when there are XMPP remotes, and a cloud transfer repository needs to be configured.

This commit is contained in:
Joey Hess 2013-03-15 17:52:41 -04:00
parent 39e979fb65
commit 77c82de4ea
13 changed files with 146 additions and 27 deletions

View file

@ -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