I know this has been asked before here:
http://forum.deluge-torrent.org/viewtop ... 10&t=11045
I didn't want to awaken a 1year+ old post, so I'm posting a solution here for anyone else interested.
You will need the full build environment for Deluge, which implies you will need to build it from source. So far I've tested this under Ubuntu Lucid and FreeBSD 8 but since I haven't used any platform dependent code (correct me if I'm wrong) this should work elsewhere.
I've done some tinkering with 1.3.0-RC1, to get this to work. I modified menubar.py around line 314 to do the following:
Code: Select all
def on_menuitem_open_folder_activate(self, data=None):
log.debug("on_menuitem_open_folder")
status_keys = ["name", "save_path"]
def _on_torrent_status(status):
#open torrent directly or open parent directory or open parent directory if torrent not a directory
option = 3
#open torrent directly or open parent directory or open parent directory if torrent not a directory
if option==1:
path = status["save_path"]
elif option==2:
path = os.path.join(status["save_path"],status["name"])
else:
path = status["save_path"];
if os.path.isdir(path):
path = os.path.join(status["save_path"],status["name"])
else:
path = status["save_path"]
log.debug(path)
deluge.common.open_file(path)
for torrent_id in component.get("TorrentView").get_selected_torrents():
component.get("SessionProxy").get_torrent_status(torrent_id, status_keys).addCallback(_on_torrent_status)
Code: Select all
import os.path
you will need to change this variable according to the behaviour you desire
Code: Select all
#open torrent directly or open parent directory or open parent directory if torrent not a directory
option = 3
#open torrent directly or open parent directory or open parent directory if torrent not a directory
[1]0| Open Parent #tooltip: default behaviour, open global directory
[2]0| Open Torrent #tooltip: open torrent, directory or file (can be dangerous for executables)
[3]0| Open Torrent if Dir otherwise open Parent #tooltip: like option 2 if and only if dir, otherwise option 1 - safer if executables involved
I know this modification would need to be reflected through the various interfaces supported by Deluge so I'm posting it here in case some gentle soul finds the time.
Toad