#902 pasting a link into transmission will open the url

This commit is contained in:
Mitchell Livingston 2008-05-01 02:20:53 +00:00
parent 31f3c1f136
commit bfa9efc9f3
3 changed files with 21 additions and 2 deletions

View File

@ -394,8 +394,8 @@ typedef enum
? [[torrent publicTorrentLocation] stringByAbbreviatingWithTildeInPath]
: NSLocalizedString(@"Transmission Support Folder", "Torrent -> location when deleting original")];
if (publicTorrent)
[fTorrentLocationField setToolTip: [NSString stringWithFormat: @"%@\n\n%@",
[torrent publicTorrentLocation], [torrent torrentLocation]]];
[fTorrentLocationField setToolTip: [[torrent publicTorrentLocation] stringByAppendingFormat: @"\n\n%@",
[torrent torrentLocation]]];
else
[fTorrentLocationField setToolTip: [torrent torrentLocation]];

View File

@ -66,6 +66,8 @@
- (NSArray *) selectedValues;
- (NSArray *) selectedTorrents;
- (void) paste: (id) sender;
- (void) toggleControlForTorrent: (Torrent *) torrent;
- (void) displayTorrentMenuForEvent: (NSEvent *) event;

View File

@ -528,6 +528,23 @@
[super keyDown: event];
}
- (void) paste: (id) sender
{
NSURL * url;
if ((url = [NSURL URLFromPasteboard: [NSPasteboard generalPasteboard]]))
[fController openURL: url];
}
- (BOOL) validateMenuItem: (NSMenuItem *) menuItem
{
SEL action = [menuItem action];
if (action == @selector(paste:))
return [[[NSPasteboard generalPasteboard] types] containsObject: NSURLPboardType];
return YES;
}
- (void) toggleControlForTorrent: (Torrent *) torrent
{
if ([torrent isActive])