mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-14 05:26:28 +00:00
Treat empty rename field as canceling the rename
This commit is contained in:
parent
93a0040b68
commit
0c93d20980
@ -793,6 +793,8 @@ class TorrentDetail(BaseMode, component.Component):
|
|||||||
client.core.rename_folder(torrent_id, folder, new_folder)
|
client.core.rename_folder(torrent_id, folder, new_folder)
|
||||||
|
|
||||||
def _do_rename_file(self, torrent_id, file_idx, new_filename):
|
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)])
|
client.core.rename_files(torrent_id, [(file_idx, new_filename)])
|
||||||
|
|
||||||
def _show_rename_popup(self):
|
def _show_rename_popup(self):
|
||||||
@ -811,6 +813,8 @@ class TorrentDetail(BaseMode, component.Component):
|
|||||||
if _file[3]:
|
if _file[3]:
|
||||||
|
|
||||||
def do_rename(result):
|
def do_rename(result):
|
||||||
|
if not result["new_foldername"]:
|
||||||
|
return
|
||||||
old_fname = self._get_full_folder_path(self.current_file_idx)
|
old_fname = self._get_full_folder_path(self.current_file_idx)
|
||||||
new_fname = "%s/%s/" % (old_fname.strip("/").rpartition("/")[0], result["new_foldername"])
|
new_fname = "%s/%s/" % (old_fname.strip("/").rpartition("/")[0], result["new_foldername"])
|
||||||
self._do_rename_folder(tid, old_fname, new_fname)
|
self._do_rename_folder(tid, old_fname, new_fname)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user