From 542ae4a855f3c158b17531bc56ffdebe9c1e3427 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 24 Nov 2013 13:28:34 -0400 Subject: [PATCH] show version in upgrade alert --- Assistant/Alert.hs | 8 +++++--- Assistant/Threads/Upgrader.hs | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Assistant/Alert.hs b/Assistant/Alert.hs index a8d49cc5bd..dc321f0970 100644 --- a/Assistant/Alert.hs +++ b/Assistant/Alert.hs @@ -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!" diff --git a/Assistant/Threads/Upgrader.hs b/Assistant/Threads/Upgrader.hs index 95796be226..f0c47e8441 100644 --- a/Assistant/Threads/Upgrader.hs +++ b/Assistant/Threads/Upgrader.hs @@ -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