From 9d85580029286c70a9e7d8f8ca037a6199632be4 Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Mon, 17 Sep 2007 09:55:48 +0000 Subject: [PATCH] pause torrent before move and resume afterwards --- plugins/MoveTorrent/__init__.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/MoveTorrent/__init__.py b/plugins/MoveTorrent/__init__.py index 4db4c2d1a..4feac325e 100644 --- a/plugins/MoveTorrent/__init__.py +++ b/plugins/MoveTorrent/__init__.py @@ -94,8 +94,14 @@ class movetorrentMenu: path = self.dialogs.show_directory_chooser_dialog(None, \ _("Choose a directory to move files to")) if path: - for unique_id in unique_ids: - self.core.move_storage(unique_id, path) + self.paused_or_not = {} + for unique_id in unique_ids: + self.paused_or_not[unique_id] = self.core.is_user_paused(unique_id) + if not self.paused_or_not[unique_id]: + self.core.set_user_pause(unique_id, True, enforce_queue=False) + self.core.move_storage(unique_id, path) + if not self.paused_or_not[unique_id]: + self.core.set_user_pause(unique_id, False, enforce_queue=False) def configure(self, window): import os.path