ratanakvlun / deluge-ltconfig

292 stars 35 forks source link

Libtorrent preset support #2

Closed omaralvarez closed 10 years ago

omaralvarez commented 10 years ago

I have added a combo box that allows you to choose a libtorrent preset and applies automatically all the changes, as doing this yourself digging in lt documentation each time is a PIA.

ratanakvlun commented 10 years ago

I like the idea. I'll take a look right now.

ratanakvlun commented 10 years ago

Everything appears to be working. However, there are some changes that would be nice.

First, the layout of the preference page is a bit awkward with the options all on one line. Separating the options to their own lines flows better and conforms to the other Deluge preference pages. (Just curious, but what Glade editor do you use?)

Next, I don't really like the idea of applying right away after selecting a preset and having multiple apply buttons just makes the UI cluttered. Ideally, it would be a "Load Preset" button that gets the preset settings from the daemon and sets the preference values without actually applying it to libtorrent yet. This gives the user a chance to review the settings and make any additional changes.

I also noticed that presets only become available from libtorrent 0.15.0 and up, so there should be a version check to disable/hide the preset widgets for previous versions. I don't think anyone uses anything that old, but it would be for the sake of compatibility.

Finally, since there is now WebUI support, the presets should be exposed in the WebUI as well.

I can make these changes, but since it was your idea, I thought maybe you would be willing to do some of them. Please let me know if you decide to do anything. Thanks for the contribution.

omaralvarez commented 10 years ago

No problem, if you prefer I can change the layout so the presets are in their own line. I did it that way to use as less space as possible. I use the official editor in https://glade.gnome.org/. If you know of a better one please let me know. I haven't used pyGTK in a while, so any suggestions are welcome.

I agree with changing the apply button to load preset. And aplying with the options button. But there is one thing I am concerned about, I see that you discard settings that begin with _ (I think maybe I didn't get that right) and I do not know if some of the settings from the preset will be lost.

About the version check, that should be no problem; I could take care of that too if you want.

The only thing that I am not sure about is the WebUI support, I haven't programmed much in JS. Please let me take a look at it and I'll get back to you on that.

Please let me know what you want me to start doing and I will get to it!

ratanakvlun commented 10 years ago

From inspecting the settings object, none of the libtorrent settings start with underscores. I think it's generally understood that it is for private variables only in which case we don't want to mess with those settings anyway.

But you are right, it may be possible that the preset actually sets something that is not exposed in the libtorrent python bindings, but the libtorrent dev has generally been good about making sure all settings are properly exposed, so there is a good chance this is not a problem.

Do what you can. I will take over whatever you decide not to do.

omaralvarez commented 10 years ago

I have implemented:

omaralvarez commented 10 years ago

I'm looking into the WebUI support right now, I expect to have it ready in the weekend. There could be delays, because as I said I have never used JS.

ratanakvlun commented 10 years ago

Looking good so far.

omaralvarez commented 10 years ago

WebUI support added.

ratanakvlun commented 10 years ago

Nice. I'll work on getting this merged.

omaralvarez commented 10 years ago

It should be straightforward, as I started from your last commit.

omaralvarez commented 10 years ago

If you need help with new ideas or improvements please let me know, I'll be glad to help if I can.

ratanakvlun commented 10 years ago

I don't really have much else planned, but I was thinking of maybe extending the preset system so that users can actually make their own presets. Then again, that might be overkill. To be honest, I'm mostly happy with it the way it is right now, but if you think it's missing something let me know.

Once again, thanks for the help!

omaralvarez commented 10 years ago

No problem, you did the heavy lifting. I don't have any other ideas. Having your on presets could be cool. If I have time I'll try to imagine how to do it. Pretty much how to store them would be the complicated part. Anyway great plugin, I actually think it should be part of the core Deluge.

ratanakvlun commented 10 years ago

They have been talking about adding an official solution, but they seem busy, so I made this plugin in the meantime. It's hard to tell what they are working on, but I'm guessing they have their hands full with internal improvements for 1.4.