diff --git a/macosx/InfoWindowController.m b/macosx/InfoWindowController.m index 8f499abf8..3f9342827 100644 --- a/macosx/InfoWindowController.m +++ b/macosx/InfoWindowController.m @@ -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]]; diff --git a/macosx/TorrentTableView.h b/macosx/TorrentTableView.h index d07191b8f..8733c9a9a 100644 --- a/macosx/TorrentTableView.h +++ b/macosx/TorrentTableView.h @@ -66,6 +66,8 @@ - (NSArray *) selectedValues; - (NSArray *) selectedTorrents; +- (void) paste: (id) sender; + - (void) toggleControlForTorrent: (Torrent *) torrent; - (void) displayTorrentMenuForEvent: (NSEvent *) event; diff --git a/macosx/TorrentTableView.m b/macosx/TorrentTableView.m index 28fe7d993..52ce65096 100644 --- a/macosx/TorrentTableView.m +++ b/macosx/TorrentTableView.m @@ -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])