rufuscoder / Shakespeer

A Direct Connect Client for Multiple Platforms
GNU General Public License v2.0
28 stars 13 forks source link

Copy magnet to clipboard #57

Closed rufuscoder closed 11 years ago

rufuscoder commented 11 years ago

Original author: void...@gmail.com (May 27, 2008 07:34:19)

Added copy magnet to clipboard functionality found in other DC clients.

Original issue: http://code.google.com/p/shakespeer/issues/detail?id=29

rufuscoder commented 11 years ago

From hwa...@gmail.com on June 02, 2008 10:07:57 Thanks for the patch voidboi. I haven't forgotten about this patch. It looks like we're gonna concentrate on checking in fixes for some bad regressions for the next release (which is due hopefully soon).

The release after that would be nice to get in some new features, so I'll put this patch on hold just for now.

rufuscoder commented 11 years ago

From hwa...@gmail.com on June 02, 2008 10:18:59 (FYI, I'm using status: "Started" to keep track of tickets that have patches, whether they are finished or unfinished)

rufuscoder commented 11 years ago

From hwa...@gmail.com on June 07, 2008 23:44:56 voidboi, two comments:

1) Since the feature depends on a TTH being available for files, can you make sure the menuitem is disabled when the TTH is not available for a file (which does, happen I think)? I think you do this by returning NO in validateMenuItem: or something like that.

2) Can you see if there's a NSString equivalent to the CFString...Escape API?

Other than that, it looks good.

rufuscoder commented 11 years ago

From void...@gmail.com on July 18, 2008 02:59:48 All files really should have a TTH, but this code should fix it. It does use validateMenuItem:.

I don't think there's a NSString equivalent to the CFString escape API in Leopard or earlier.

rufuscoder commented 11 years ago

From void...@gmail.com on July 18, 2008 03:39:35 Whoops, it wasn't letting you download folders. Use this diff with the above nib file.

rufuscoder commented 11 years ago

From markus.m...@gmail.com on July 18, 2008 09:40:07 Fixed in r441, thanks a lot for the patch! You had a memory leak in your code which I fixed; the "name" variable wasn't released properly.

I will have a look at implementing display of magnet links too, so ShakesPeer users can click them and just not paste them.

rufuscoder commented 11 years ago

From void...@gmail.com on July 18, 2008 10:02:49 Thanks for fixing the memory leak.

Aethereal has written code to implement clicking of magnet links.

rufuscoder commented 11 years ago

From aetherea...@gmail.com on July 18, 2008 11:11:22 Hey guys. As VoidBoi said, I've already written code implementing clickable magnet links. To do it, I made changes to the URLMutableAttributedString, that is, making it recognise strings beginning with magnet: as being magnet links and making them blue and clickable.

The other change was in SPApplicationController, namely the getUrl method which is used for responding to dchub:// links. I added an else if statement that checks for magnet links, checks if it is a TTH magnet, extracts the hash string and runs a search for that TTH.

Finally, in info.plist.in I added magnet as a CFBundleURLType, telling Mac OS X to pass magnet links to ShakesPeer. It may require a reboot in order for this association to take place, though.

Possible To-Do's:

rufuscoder commented 11 years ago

From void...@gmail.com on July 18, 2008 11:26:46 It works for me without a reboot.

rufuscoder commented 11 years ago

From markus.m...@gmail.com on July 18, 2008 11:30:42 I had actually already run a diff on your previous source packaged and made all the necessary changes :)

When I tried it, the link went to Azureus instead, so I am implementing a "Default magnet link handler" in preferences.

rufuscoder commented 11 years ago

From markus.m...@gmail.com on July 18, 2008 15:06:13 Implemented in r443. Please give it a spin and report any problems as new issues. Thanks a lot for the original path, aethereal!

rufuscoder commented 11 years ago

From moment...@gmail.com on September 06, 2008 13:26:44 I don't have a patch. But generating a magnet link (in r464) of more than 1 selected file return only the link of the first one. A better solution would be to return a link for each file, or at least suppress the generation of magnet-links of 'more than one' selections.