Registered Member
|
Hi!
I'm planning on coding a feature for generating magnet URI:s from the torrents and need some feedback. Description: Insert an option in the right-click menu of a torrent to generate a magnet link. The URI is placed in the clipboard and/or displayed in a small popup. Preferences UI: * What trackers to use, if any? (tr=) * Toggle if torrent name should be a part of the URI (dn=) * Toggle if generated URI should be copied to clipboard. * Toggle if a small popup with the URI in a textfield should be displayed. Should I make this as a plugin? Is it possible for a plugin to add a option to the viewmodel? I dunno when I can start to code, but perhaps I can get cranking on it on sunday. |
Moderator
|
It is possible to add items to the ViewMenu from plugins, the download order plugin does this.
It's quite simple actually, you need to add a ui.rc file (use plugins/downloadorder/ktdownloadorderpluginui.rc as an example), and in the constructor of the plugin you create actions for the items in the ui.rc file and call setXMLFile("mypluginui.rc"). So yes you could do it in a plugin. |
Registered Member
|
I've made a plugin now and you guys can download it here to test it out: http://info.gannon.se/magnetgenerator.tar.bz2
I didn't implement the option to display the URI in a popup. I realized I won't use that feature and don't know if anybody else will. If there is a high demand for it I will however consider coding it. Right now the URI is copied to the clipboard (and the "selection"-clipboard). I will be glad to hear some feedback :) |
Moderator
|
The plugin looks good, don't see any bugs at first sight. You seem to have covered all the bases.
Maybe some sort of feedback could be useful, a system tray notification or a passive popup. A real popup dialog is probably not what you would want, to intrusive. |
Registered Member
|
Good idea, I'll look into that later. I was thinking about perhaps adding an option to grab the tracker URL from the torrent instead of the one defined in the prefwidget. Another thing I was thinking about was the possibility to disable the viewmenu item on private torrents since I can't really see the point of magnet links on non-public torrents. Unfortunatly I don't have alot of time this week, so these features might be put on hold for a while. |
Moderator
|
Well, selecting a tracker from the torrent is probably the best option, that way you know the tracker works for the torrent.
Any objections if I add it in it's current form, so it can be part of 4.0beta2, or do you want to wait and add some more features ? |
Registered Member
|
Go ahead and add it. :) |
Registered Member
|
Is there any easy way to display a passive popup? I've found the method showPassivePopup() in the TrayIcon class, but I have no idea how to reach it from a plugin. Is there anything like the getGUI()->infoMsg() method but displays a passive popup (or systray notification)? Perhaps if there was a getTrayIcon() method in the GUIInterface life would be easy :) |
Registered Member
|
Nevermind the last post, I figured it out :)
Here is a new patch for the plugin: http://info.gannon.se/magnetgen.patch New stuff:
Enjoy! PS. Is there any way to change the forum settings so it's possible to upload patches as attachments? |
Moderator
|
OK will check it out
Attachments are enabled, so patches should work, I will try it out myself. |
Moderator
|
I have committed your patch, with some small modifications
As for adding patches as attachments, that should work now. |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]