This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Plans for magnet URI generator

Tags: None
(comma "," separated)
imported4-jonas
Registered Member
Posts
35
Karma
0

Plans for magnet URI generator

Fri Mar 26, 2010 10:21 am
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.
George
Moderator
Posts
5421
Karma
1

Re: Plans for magnet URI generator

Sat Mar 27, 2010 11:45 am
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.
imported4-jonas
Registered Member
Posts
35
Karma
0

Re: Plans for magnet URI generator

Tue Mar 30, 2010 9:36 am
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 :)
George
Moderator
Posts
5421
Karma
1

Re: Plans for magnet URI generator

Tue Mar 30, 2010 4:06 pm
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.
imported4-jonas
Registered Member
Posts
35
Karma
0

Re: Plans for magnet URI generator

Tue Mar 30, 2010 4:15 pm
George wrote: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.


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.
George
Moderator
Posts
5421
Karma
1

Re: Plans for magnet URI generator

Thu Apr 01, 2010 4:29 pm
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 ?
imported4-jonas
Registered Member
Posts
35
Karma
0

Re: Plans for magnet URI generator

Thu Apr 01, 2010 8:41 pm
George wrote: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 ?

Go ahead and add it. :)
imported4-jonas
Registered Member
Posts
35
Karma
0

Re: Plans for magnet URI generator

Mon Apr 05, 2010 10:35 am
George wrote: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.

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 :)
imported4-jonas
Registered Member
Posts
35
Karma
0

Re: Plans for magnet URI generator

Mon Apr 05, 2010 11:18 am
Nevermind the last post, I figured it out :)

Here is a new patch for the plugin: http://info.gannon.se/magnetgen.patch

New stuff:
  • Ability to get a tracker from the torrent (enabled by default)
  • Ability to disable the menuitem on private torrents (enabled by default)
  • Ability to show a passive popup which timeouts after 3 seconds (enabled by default)

Enjoy!

PS. Is there any way to change the forum settings so it's possible to upload patches as attachments?
George
Moderator
Posts
5421
Karma
1

Re: Plans for magnet URI generator

Wed Apr 07, 2010 6:49 pm
jonas wrote:Nevermind the last post, I figured it out :)

Here is a new patch for the plugin: http://info.gannon.se/magnetgen.patch

New stuff:
  • Ability to get a tracker from the torrent (enabled by default)
  • Ability to disable the menuitem on private torrents (enabled by default)
  • Ability to show a passive popup which timeouts after 3 seconds (enabled by default)

Enjoy!


OK will check it out

PS. Is there any way to change the forum settings so it's possible to upload patches as attachments?


Attachments are enabled, so patches should work, I will try it out myself.
George
Moderator
Posts
5421
Karma
1

Re: Plans for magnet URI generator

Thu Apr 08, 2010 5:17 pm
I have committed your patch, with some small modifications

As for adding patches as attachments, that should work now.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]