PDA

View Full Version : Add torrent from firefox


christooss
November 2nd, 2006, 02:07 PM
Im using Deluge on regular basis but one thing really anoys me. I can't make deluge default torrent opener in Firefox.

Anyway I can do that.

I have "showed" mozilla /usr/bin/deluge file

zachtib
November 2nd, 2006, 03:14 PM
this just plain doesn't work in 0.3.0
0.4 will be the first release to allow this, and the code is already in SVN

baze
November 3rd, 2006, 01:24 PM
i'm running the current svn but opening torrents from firefox doesn't work here.
adding them by drag and drop does work, but adding them from a file manager or a web browser does not work for me.

zachtib
November 3rd, 2006, 01:28 PM
i'm running the current svn but opening torrents from firefox doesn't work here.
adding them by drag and drop does work, but adding them from a file manager or a web browser does not work for me.
it's really buggy right now. Like I said, the code is there, but it's not completed yet.

and what you'd have to do it is to execute:

python /path/to/svn/deluge/trunk/deluge.py /path/to/torrent/file.torrent


in fact, I've never tried running it and referencing the .py file by absolute path, so that may be what's causing your trouble

andrewresch
November 3rd, 2006, 03:42 PM
Adding torrents while deluge is running crashes for me. I believe the problem happens when deluge tries to call any gtk function outside of the main gtk thread. In particular, gtk.FileChooserDialog() is being called for me because I do not have a global save dir. When deluge tries to call gtk.* from the DBUS thread, a segfault is generated and the program crashes.

Need a way to not call any gtk functions outside of the main gtk loop. Perhaps put the torrent in a queue and emit a signal for the main gtk loop to pick up on and run a callback? The callback could process the queue and add them to the download list (asking for a save directory if necessary).

zachtib
November 3rd, 2006, 03:52 PM
Adding torrents while deluge is running crashes for me. I believe the problem happens when deluge tries to call any gtk function outside of the main gtk thread. In particular, gtk.FileChooserDialog() is being called for me because I do not have a global save dir. When deluge tries to call gtk.* from the DBUS thread, a segfault is generated and the program crashes.

Need a way to not call any gtk functions outside of the main gtk loop. Perhaps put the torrent in a queue and emit a signal for the main gtk loop to pick up on and run a callback? The callback could process the queue and add them to the download list (asking for a save directory if necessary).

holy ****

I think you're exactly right

I've been racking my brain over this for days.


you, sir, are a genious

andrewresch
November 3rd, 2006, 07:39 PM
I may be wrong, because the gtk calls seem to work on my laptop. I must have something screwy on my desktop. Although, after picking a save directory on my laptop, Deluge freezes. I will look into it more.

andrewresch
November 3rd, 2006, 08:45 PM
It looks like I was half right. I removed the call to gtk.FileOpenDialog and replaced it with a hardcoded return "/home/andrew". After this point I had to add a couple functions to torrenthandler.py so that it could queue adding torrents at the next update(). This seems to work just fine, but I still need to figure out a way to get the gtk call working correctly.

Let me know if you want a patch of my progress so far.