summaryrefslogtreecommitdiff
path: root/Assistant/Threads/Watcher.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-29 11:31:06 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-07-29 11:31:06 -0400
commitc2f3e66d8c65e46046f83221996b3a180bd49657 (patch)
treeda30e48c507d5503ab48a6f9ed4d2910dad7abf6 /Assistant/Threads/Watcher.hs
parent5271d699d22f9addb35f2374a2a70da59897bb1d (diff)
show alerts in the sidebar
This has a bug -- it seems long polling can only wait on one page at a time. Need to re-unify the notifiers.
Diffstat (limited to 'Assistant/Threads/Watcher.hs')
-rw-r--r--Assistant/Threads/Watcher.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/Assistant/Threads/Watcher.hs b/Assistant/Threads/Watcher.hs
index ab57bf04a..5086f95a2 100644
--- a/Assistant/Threads/Watcher.hs
+++ b/Assistant/Threads/Watcher.hs
@@ -19,6 +19,7 @@ import Assistant.ThreadedMonad
import Assistant.DaemonStatus
import Assistant.Changes
import Assistant.TransferQueue
+import Assistant.Alert
import Logs.Transfer
import Utility.DirWatcher
import Utility.Types.DirWatcher
@@ -60,7 +61,7 @@ watchThread st dstatus transferqueue changechan = do
void $ watchDir "." ignored hooks startup
debug thisThread [ "watching", "."]
where
- startup = statupScan st dstatus
+ startup = startupScan st dstatus
hook a = Just $ runHandler thisThread st dstatus transferqueue changechan a
hooks = WatchHooks
{ addHook = hook onAdd
@@ -71,11 +72,12 @@ watchThread st dstatus transferqueue changechan = do
}
{- Initial scartup scan. The action should return once the scan is complete. -}
-statupScan :: ThreadState -> DaemonStatusHandle -> IO a -> IO a
-statupScan st dstatus scanner = do
+startupScan :: ThreadState -> DaemonStatusHandle -> IO a -> IO a
+startupScan st dstatus scanner = do
runThreadState st $
showAction "scanning"
- r <- scanner
+ let alert = activityAlert Nothing "Performing startup scan"
+ r <- alertWhile dstatus alert scanner
modifyDaemonStatus_ dstatus $ \s -> s { scanComplete = True }
-- Notice any files that were deleted before watching was started.