1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 01:03:01 +00:00

#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] ? [[torrent publicTorrentLocation] stringByAbbreviatingWithTildeInPath]
: NSLocalizedString(@"Transmission Support Folder", "Torrent -> location when deleting original")]; : NSLocalizedString(@"Transmission Support Folder", "Torrent -> location when deleting original")];
if (publicTorrent) if (publicTorrent)
[fTorrentLocationField setToolTip: [NSString stringWithFormat: @"%@\n\n%@", [fTorrentLocationField setToolTip: [[torrent publicTorrentLocation] stringByAppendingFormat: @"\n\n%@",
[torrent publicTorrentLocation], [torrent torrentLocation]]]; [torrent torrentLocation]]];
else else
[fTorrentLocationField setToolTip: [torrent torrentLocation]]; [fTorrentLocationField setToolTip: [torrent torrentLocation]];

View file

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

View file

@ -528,6 +528,23 @@
[super keyDown: event]; [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 - (void) toggleControlForTorrent: (Torrent *) torrent
{ {
if ([torrent isActive]) if ([torrent isActive])