mirror of
https://github.com/transmission/transmission
synced 2024-12-24 00:34:04 +00:00
#902 pasting a link into transmission will open the url
This commit is contained in:
parent
31f3c1f136
commit
bfa9efc9f3
3 changed files with 21 additions and 2 deletions
|
@ -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]];
|
||||
|
||||
|
|
|
@ -66,6 +66,8 @@
|
|||
- (NSArray *) selectedValues;
|
||||
- (NSArray *) selectedTorrents;
|
||||
|
||||
- (void) paste: (id) sender;
|
||||
|
||||
- (void) toggleControlForTorrent: (Torrent *) torrent;
|
||||
|
||||
- (void) displayTorrentMenuForEvent: (NSEvent *) event;
|
||||
|
|
|
@ -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])
|
||||
|
|
Loading…
Reference in a new issue