1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-26 09:37:56 +00:00

When loading from url, if set to download at the torrent location ask the user for a location instead

This commit is contained in:
Mitchell Livingston 2006-11-14 05:27:43 +00:00
parent c6f4df3195
commit 688f06863e
2 changed files with 11 additions and 10 deletions

View file

@ -99,11 +99,10 @@
} }
//set upload and download rate badges //set upload and download rate badges
NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults]; NSString * uploadRateString = uploadRate >= 0.1 && [[NSUserDefaults standardUserDefaults]
NSString * uploadRateString = uploadRate >= 0.1 && [defaults boolForKey: @"BadgeUploadRate"] boolForKey: @"BadgeUploadRate"] ? [NSString stringForSpeedAbbrev: uploadRate] : nil,
? [NSString stringForSpeedAbbrev: uploadRate] : nil, * downloadRateString = downloadRate >= 0.1 && [[NSUserDefaults standardUserDefaults]
* downloadRateString = downloadRate >= 0.1 && [defaults boolForKey: @"BadgeDownloadRate"] boolForKey: @"BadgeDownloadRate"] ? [NSString stringForSpeedAbbrev: downloadRate] : nil;
? [NSString stringForSpeedAbbrev: downloadRate] : nil;
if (uploadRateString || downloadRateString) if (uploadRateString || downloadRateString)
{ {

View file

@ -525,7 +525,8 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
{ {
NSString * path = [[fPendingTorrentDownloads objectForKey: [[download request] URL]] objectForKey: @"Path"]; NSString * path = [[fPendingTorrentDownloads objectForKey: [[download request] URL]] objectForKey: @"Path"];
[self openFiles: [NSArray arrayWithObject: path] ignoreDownloadFolder: NO forceDeleteTorrent: YES]; [self openFiles: [NSArray arrayWithObject: path] ignoreDownloadFolder:
![[fDefaults stringForKey: @"DownloadChoice"] isEqualToString: @"Constant"] forceDeleteTorrent: YES];
[fPendingTorrentDownloads removeObjectForKey: [[download request] URL]]; [fPendingTorrentDownloads removeObjectForKey: [[download request] URL]];
[download release]; [download release];
@ -1774,13 +1775,15 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
[self application: NSApp openFiles: filesToOpen]; [self application: NSApp openFiles: filesToOpen];
[filesToOpen release]; [filesToOpen release];
} }
else if ([[pasteboard types] containsObject: NSURLPboardType])
if ([[pasteboard types] containsObject: NSURLPboardType])
{ {
NSURL * url; NSURL * url;
if ((url = [NSURL URLFromPasteboard:pasteboard])) if ((url = [NSURL URLFromPasteboard: pasteboard]))
[self openURL: url]; [self openURL: url];
} }
else if ([[pasteboard types] containsObject: TORRENT_TABLE_VIEW_DATA_TYPE])
if ([[pasteboard types] containsObject: TORRENT_TABLE_VIEW_DATA_TYPE])
{ {
//remember selected rows if needed //remember selected rows if needed
NSArray * selectedTorrents = nil; NSArray * selectedTorrents = nil;
@ -1832,7 +1835,6 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
[indexSet release]; [indexSet release];
} }
} }
else;
return YES; return YES;
} }