show version in upgrade alert

This commit is contained in:
Joey Hess 2013-11-24 13:28:34 -04:00
parent 6165284e39
commit 542ae4a855
2 changed files with 6 additions and 4 deletions

View file

@ -233,10 +233,12 @@ baseUpgradeAlert buttons message = Alert
, alertData = []
}
canUpgradeAlert :: AlertPriority -> AlertButton -> Alert
canUpgradeAlert priority button =
canUpgradeAlert :: AlertPriority -> GitAnnexVersion -> AlertButton -> Alert
canUpgradeAlert priority version button =
(baseUpgradeAlert [button] $ fromString msg)
{ alertPriority = priority }
{ alertPriority = priority
, alertData = [fromString $ " (version " ++ version ++ ")"]
}
where
msg = if priority >= High
then "An important upgrade of git-annex is available!"

View file

@ -81,7 +81,7 @@ canUpgrade urgency urlrenderer d = ifM autoUpgradeEnabled
, do
#ifdef WITH_WEBAPP
button <- mkAlertButton True (T.pack "Upgrade") urlrenderer (ConfigStartUpgradeR d)
void $ addAlert (canUpgradeAlert urgency button)
void $ addAlert (canUpgradeAlert urgency (distributionVersion d) button)
#else
noop
#endif