summaryrefslogtreecommitdiff
path: root/Assistant/Threads
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-08-06 17:09:23 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-08-06 17:09:23 -0400
commit8f1a9ef8b5e914bbe447733650a5848fc553c708 (patch)
tree6ba3acbc6772ef60889cf975fb526502a3d49a49 /Assistant/Threads
parent05ed196ce5144154e8bbfbdc3cdcae90bd1c8a60 (diff)
added an alert after a file transfer
Diffstat (limited to 'Assistant/Threads')
-rw-r--r--Assistant/Threads/Committer.hs2
-rw-r--r--Assistant/Threads/MountWatcher.hs2
-rw-r--r--Assistant/Threads/Transferrer.hs7
3 files changed, 9 insertions, 2 deletions
diff --git a/Assistant/Threads/Committer.hs b/Assistant/Threads/Committer.hs
index 095c8feac..5aadcc02a 100644
--- a/Assistant/Threads/Committer.hs
+++ b/Assistant/Threads/Committer.hs
@@ -198,6 +198,8 @@ safeToAdd st changes = runThreadState st $
openfiles <- S.fromList . map fst3 . filter openwrite <$>
liftIO (Lsof.queryDir tmpdir)
+ -- TODO this is here for debugging a problem on
+ -- OSX, and is pretty expensive, so remove later
liftIO $ debug thisThread
[ "checking changes:"
, show changes
diff --git a/Assistant/Threads/MountWatcher.hs b/Assistant/Threads/MountWatcher.hs
index 18dfca42c..83f582a91 100644
--- a/Assistant/Threads/MountWatcher.hs
+++ b/Assistant/Threads/MountWatcher.hs
@@ -163,7 +163,7 @@ handleMount st dstatus scanremotes dir = do
unless (null rs) $ do
let nonspecial = filter (Git.repoIsLocal . Remote.repo) rs
unless (null nonspecial) $ do
- void $ alertWhile dstatus (syncMountAlert dir nonspecial) $ do
+ void $ alertWhile dstatus (syncAlert nonspecial) $ do
debug thisThread ["syncing with", show rs]
sync nonspecial =<< runThreadState st (inRepo Git.Branch.current)
addScanRemotes scanremotes nonspecial
diff --git a/Assistant/Threads/Transferrer.hs b/Assistant/Threads/Transferrer.hs
index 956e0fc9d..67fdcd2a7 100644
--- a/Assistant/Threads/Transferrer.hs
+++ b/Assistant/Threads/Transferrer.hs
@@ -12,6 +12,7 @@ import Assistant.ThreadedMonad
import Assistant.DaemonStatus
import Assistant.TransferQueue
import Assistant.TransferSlots
+import Assistant.Alert
import Logs.Transfer
import Logs.Presence
import Logs.Location
@@ -94,7 +95,8 @@ transferThread st dstatus slots t info = case (transferRemote info, associatedFi
, transferTid = Just tid
}
where
- isdownload = transferDirection t == Download
+ direction = transferDirection t
+ isdownload = direction == Download
tofrom
| isdownload = "from"
| otherwise = "to"
@@ -113,3 +115,6 @@ transferThread st dstatus slots t info = case (transferRemote info, associatedFi
Remote.logStatus remote key InfoPresent
return ok
showEndResult ok
+ liftIO $ addAlert dstatus $
+ makeAlertFiller ok $
+ transferFileAlert direction file