make old activiy alerts stay visible

They're updated to show whether the activity succeeded or failed.

This adds several TODOs to the code to fix later.
This commit is contained in:
Joey Hess 2012-07-30 02:07:02 -04:00
parent ec0493fa4d
commit 3dce75fb23
8 changed files with 85 additions and 30 deletions

View file

@ -72,24 +72,23 @@ watchThread st dstatus transferqueue changechan = do
}
{- Initial scartup scan. The action should return once the scan is complete. -}
startupScan :: ThreadState -> DaemonStatusHandle -> IO a -> IO a
startupScan :: ThreadState -> DaemonStatusHandle -> IO a -> IO ()
startupScan st dstatus scanner = do
runThreadState st $ showAction "scanning"
r <- alertWhile dstatus startupScanAlert $ do
r <- scanner
modifyDaemonStatus_ dstatus $ \s -> s { scanComplete = True }
void $ alertWhile dstatus startupScanAlert $ do
void $ scanner
-- Notice any files that were deleted before
-- watching was started.
runThreadState st $ do
inRepo $ Git.Command.run "add" [Param "--update"]
showAction "started"
return r
modifyDaemonStatus_ dstatus $ \s -> s { scanComplete = True }
return True
void $ addAlert dstatus runningAlert
return r
ignored :: FilePath -> Bool
ignored = ig . takeFileName
where