aboutsummaryrefslogtreecommitdiff
path: root/Assistant/Alert.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-11-22 23:12:06 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-11-22 23:12:06 -0400
commit14ccfc0abc1aa3130b07e7bd981b266f2eccd751 (patch)
treef3b59ccf222b36d7d7b9073b2c5625e129f0fcf6 /Assistant/Alert.hs
parent3cc42c088046d9ea279a2344fb6be7d7274c95fe (diff)
assistant restart on upgrade
Diffstat (limited to 'Assistant/Alert.hs')
-rw-r--r--Assistant/Alert.hs27
1 files changed, 23 insertions, 4 deletions
diff --git a/Assistant/Alert.hs b/Assistant/Alert.hs
index 93eea6d7d..fef78c1f0 100644
--- a/Assistant/Alert.hs
+++ b/Assistant/Alert.hs
@@ -217,11 +217,10 @@ notFsckedAlert mr button = Alert
canUpgradeAlert :: AlertPriority -> AlertButton -> Alert
canUpgradeAlert priority button = Alert
- { alertHeader = Just $ fromString $ concat
- [ if priority >= High
+ { alertHeader = Just $ fromString $
+ if priority >= High
then "An important upgrade of git-annex is available!"
else "An upgrade of git-annex is available."
- ]
, alertIcon = Just UpgradeIcon
, alertPriority = priority
, alertButton = Just button
@@ -230,11 +229,31 @@ canUpgradeAlert priority button = Alert
, alertMessageRender = renderData
, alertCounter = 0
, alertBlockDisplay = True
- , alertName = Just UpgradeAlert
+ , alertName = Just CanUpgradeAlert
+ , alertCombiner = Just $ dataCombiner $ \_old new -> new
+ , alertData = []
+ }
+
+upgradeReadyAlert :: AlertButton -> Alert
+upgradeReadyAlert button = Alert
+ { alertHeader = Just $ fromString
+ "A new version of git-annex has been installed."
+ , alertIcon = Just UpgradeIcon
+ , alertPriority = High
+ , alertButton = Just button
+ , alertClosable = True
+ , alertClass = Message
+ , alertMessageRender = renderData
+ , alertCounter = 0
+ , alertBlockDisplay = True
+ , alertName = Just UpgradeReadyAlert
, alertCombiner = Just $ dataCombiner $ \_old new -> new
, alertData = []
}
+upgradingAlert :: Alert
+upgradingAlert = activityAlert Nothing [fromString "Upgrading git-annex"]
+
brokenRepositoryAlert :: AlertButton -> Alert
brokenRepositoryAlert = errorAlert "Serious problems have been detected with your repository. This needs your immediate attention!"