summaryrefslogtreecommitdiff
path: root/Command/Move.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-03-22 10:42:38 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-03-22 14:12:19 -0400
commit35419994e9418444dc82e5c90c579203cc4c3616 (patch)
tree0d4374fbc7f233cfa409e9e142b36f00d12f71f4 /Command/Move.hs
parentf2a5858f85f1d6e999d707f4b48cd2ea643197bc (diff)
add desktop notifications
Motivation: Hook scripts for nautilus or other file managers need to provide the user with feedback that a file is being downloaded. This commit was sponsored by THM Schoemaker.
Diffstat (limited to 'Command/Move.hs')
-rw-r--r--Command/Move.hs14
1 files changed, 8 insertions, 6 deletions
diff --git a/Command/Move.hs b/Command/Move.hs
index 3a39e1de0..206a875b7 100644
--- a/Command/Move.hs
+++ b/Command/Move.hs
@@ -14,8 +14,8 @@ import qualified Annex
import Annex.Content
import qualified Remote
import Annex.UUID
+import Annex.Transfer
import Logs.Presence
-import Logs.Transfer
def :: [Command]
def = [withOptions moveOptions $ command "move" paramPaths seek
@@ -98,8 +98,9 @@ toPerform dest move key afile fastcheck isthere = moveLock move key $
stop
Right False -> do
showAction $ "to " ++ Remote.name dest
- ok <- upload (Remote.uuid dest) key afile noRetry $
- Remote.storeKey dest key afile
+ ok <- notifyTransfer Upload afile $
+ upload (Remote.uuid dest) key afile noRetry $
+ Remote.storeKey dest key afile
if ok
then do
Remote.logStatus dest key InfoPresent
@@ -155,9 +156,10 @@ fromPerform src move key afile = moveLock move key $
, handle move =<< go
)
where
- go = download (Remote.uuid src) key afile noRetry $ \p -> do
- showAction $ "from " ++ Remote.name src
- getViaTmp key $ \t -> Remote.retrieveKeyFile src key afile t p
+ go = notifyTransfer Download afile $
+ download (Remote.uuid src) key afile noRetry $ \p -> do
+ showAction $ "from " ++ Remote.name src
+ getViaTmp key $ \t -> Remote.retrieveKeyFile src key afile t p
handle _ False = stop -- failed
handle False True = next $ return True -- copy complete
handle True True = do -- finish moving