summaryrefslogtreecommitdiff
path: root/Command/TransferKey.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/TransferKey.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/TransferKey.hs')
-rw-r--r--Command/TransferKey.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/Command/TransferKey.hs b/Command/TransferKey.hs
index b6b237467..13bfd825e 100644
--- a/Command/TransferKey.hs
+++ b/Command/TransferKey.hs
@@ -11,7 +11,7 @@ import Common.Annex
import Command
import Annex.Content
import Logs.Location
-import Logs.Transfer
+import Annex.Transfer
import qualified Remote
import Types.Remote
@@ -41,7 +41,7 @@ start to from file key =
_ -> error "specify either --from or --to"
toPerform :: Remote -> Key -> AssociatedFile -> CommandPerform
-toPerform remote key file = go $
+toPerform remote key file = go Upload file $
upload (uuid remote) key file forwardRetry $ \p -> do
ok <- Remote.storeKey remote key file p
when ok $
@@ -49,9 +49,9 @@ toPerform remote key file = go $
return ok
fromPerform :: Remote -> Key -> AssociatedFile -> CommandPerform
-fromPerform remote key file = go $
+fromPerform remote key file = go Upload file $
download (uuid remote) key file forwardRetry $ \p ->
getViaTmp key $ \t -> Remote.retrieveKeyFile remote key file t p
-go :: Annex Bool -> CommandPerform
-go a = a >>= liftIO . exitBool
+go :: Direction -> AssociatedFile -> (NotifyWitness -> Annex Bool) -> CommandPerform
+go direction file a = notifyTransfer direction file a >>= liftIO . exitBool