mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-07 00:48:41 +00:00
GTKUI: Changes to autofill save path when creating torrent from remote path
This commit is contained in:
parent
463ac0c07e
commit
091b42d317
1 changed files with 8 additions and 5 deletions
|
@ -240,16 +240,21 @@ class CreateTorrentDialog:
|
||||||
if len(self.files_treestore) == 0:
|
if len(self.files_treestore) == 0:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Get the path
|
||||||
|
path = self.files_treestore[0][0].rstrip("\\/")
|
||||||
|
torrent_filename = "%s.torrent" % os.path.split(path)[-1]
|
||||||
|
|
||||||
is_remote = self.files_treestore[0][1] == gtk.STOCK_NETWORK
|
is_remote = self.files_treestore[0][1] == gtk.STOCK_NETWORK
|
||||||
torrent_filename = "%s.torrent" % os.path.split(self.files_treestore[0][0].rstrip('/'))[-1]
|
|
||||||
if is_remote:
|
if is_remote:
|
||||||
# This is a remote path
|
# This is a remote path
|
||||||
dialog = self.builder.get_object("remote_save_dialog")
|
dialog = self.builder.get_object("remote_save_dialog")
|
||||||
dialog.set_transient_for(self.dialog)
|
dialog.set_transient_for(self.dialog)
|
||||||
self.builder.get_object("entry_save_path").set_text(torrent_filename)
|
dialog_save_path = self.builder.get_object("entry_save_path")
|
||||||
|
dialog_save_path.set_text(path + ".torrent")
|
||||||
response = dialog.run()
|
response = dialog.run()
|
||||||
if response == gtk.RESPONSE_OK:
|
if response == gtk.RESPONSE_OK:
|
||||||
result = self.builder.get_object("entry_save_path").get_text()
|
result = dialog_save_path.get_text()
|
||||||
else:
|
else:
|
||||||
dialog.hide()
|
dialog.hide()
|
||||||
return
|
return
|
||||||
|
@ -292,8 +297,6 @@ class CreateTorrentDialog:
|
||||||
elif result[-8:] != ".torrent":
|
elif result[-8:] != ".torrent":
|
||||||
result += ".torrent"
|
result += ".torrent"
|
||||||
|
|
||||||
# Get the path
|
|
||||||
path = self.files_treestore[0][0]
|
|
||||||
# Get a list of trackers
|
# Get a list of trackers
|
||||||
trackers = []
|
trackers = []
|
||||||
if not len(self.trackers_liststore):
|
if not len(self.trackers_liststore):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue