From 0c93d209800bffeecaea5bddbfdd92bdc93e7763 Mon Sep 17 00:00:00 2001 From: Asmageddon Date: Mon, 2 Jul 2012 17:31:53 +0200 Subject: [PATCH] Treat empty rename field as canceling the rename --- deluge/ui/console/modes/torrentdetail.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/deluge/ui/console/modes/torrentdetail.py b/deluge/ui/console/modes/torrentdetail.py index e7e6e6b5b..5aaed4605 100644 --- a/deluge/ui/console/modes/torrentdetail.py +++ b/deluge/ui/console/modes/torrentdetail.py @@ -793,6 +793,8 @@ class TorrentDetail(BaseMode, component.Component): client.core.rename_folder(torrent_id, folder, new_folder) def _do_rename_file(self, torrent_id, file_idx, new_filename): + if not new_filename: + return client.core.rename_files(torrent_id, [(file_idx, new_filename)]) def _show_rename_popup(self): @@ -811,6 +813,8 @@ class TorrentDetail(BaseMode, component.Component): if _file[3]: def do_rename(result): + if not result["new_foldername"]: + return old_fname = self._get_full_folder_path(self.current_file_idx) new_fname = "%s/%s/" % (old_fname.strip("/").rpartition("/")[0], result["new_foldername"]) self._do_rename_folder(tid, old_fname, new_fname)