From a88d20e8ea401b86c8a3394c12ad18b1406d1a75 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 24 Nov 2013 14:04:03 -0400 Subject: cleanup on failed upgrade --- Assistant/Alert.hs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'Assistant') diff --git a/Assistant/Alert.hs b/Assistant/Alert.hs index dc321f097..c767d429d 100644 --- a/Assistant/Alert.hs +++ b/Assistant/Alert.hs @@ -82,8 +82,8 @@ warningAlert name msg = Alert , alertButtons = [] } -errorAlert :: String -> AlertButton -> Alert -errorAlert msg button = Alert +errorAlert :: String -> [AlertButton] -> Alert +errorAlert msg buttons = Alert { alertClass = Error , alertHeader = Nothing , alertMessageRender = renderData @@ -95,7 +95,7 @@ errorAlert msg button = Alert , alertIcon = Just ErrorIcon , alertCombiner = Nothing , alertName = Nothing - , alertButtons = [button] + , alertButtons = buttons } activityAlert :: Maybe TenseText -> [TenseChunk] -> Alert @@ -256,7 +256,11 @@ upgradeFinishedAlert button version = baseUpgradeAlert (maybe [] (:[]) button) $ fromString $ "Finished upgrading git-annex to version " ++ version -brokenRepositoryAlert :: AlertButton -> Alert +upgradeFailedAlert :: String -> Alert +upgradeFailedAlert msg = (errorAlert msg []) + { alertHeader = Just $ fromString "Upgrade failed." } + +brokenRepositoryAlert :: [AlertButton] -> Alert brokenRepositoryAlert = errorAlert "Serious problems have been detected with your repository. This needs your immediate attention!" repairingAlert :: String -> Alert -- cgit v1.2.3