From 95328f55351ac5a4d3dc2dd3562723d8b2defcc7 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Fri, 27 Nov 2009 03:20:19 +0000 Subject: [PATCH] display progress of retrieving metadata on a magnetized transfer --- macosx/Controller.m | 4 ++++ macosx/Info.plist | 1 - macosx/Torrent.m | 8 ++++++-- macosx/TorrentCell.m | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/macosx/Controller.m b/macosx/Controller.m index 1f2347e8c..4d2ee8c61 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -946,9 +946,13 @@ static void sleepCallback(void * controller, io_service_t y, natural_t messageTy return; } + #warning show add window perhaps? + #warning should we do this? [torrent setWaitToStart: [fDefaults boolForKey: @"AutoStartDownload"]]; + #warning should set group + [torrent update]; [fTorrents addObject: torrent]; [torrent release]; diff --git a/macosx/Info.plist b/macosx/Info.plist index 5824a4d33..e1bd20872 100644 --- a/macosx/Info.plist +++ b/macosx/Info.plist @@ -51,7 +51,6 @@ CFBundleURLSchemes magnet - dht CFBundleURLName BitTorrent Magnet URL diff --git a/macosx/Torrent.m b/macosx/Torrent.m index cf896e240..e2fb484dc 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -809,7 +809,7 @@ int trashDataFile(const char * filename) - (BOOL) allDownloaded { - return [self sizeLeft] == 0; + return [self sizeLeft] == 0 && ![self isMagnet]; } - (BOOL) isComplete @@ -909,8 +909,12 @@ int trashDataFile(const char * filename) - (NSString *) progressString { if ([self isMagnet]) + { + NSString * progressString = [NSString localizedStringWithFormat: @"%.2f%% of torrent metadata retrieved", + fStat->metadataPercentComplete]; return [NSString stringWithFormat: @"%@ - %@", NSLocalizedString(@"Magnetized transfer", "Torrent -> progress string"), - NSLocalizedString(@"torrent information needed", "Torrent -> progress string")]; + progressString]; + } NSString * string; diff --git a/macosx/TorrentCell.m b/macosx/TorrentCell.m index 5f2cc87d6..d4b1da12d 100644 --- a/macosx/TorrentCell.m +++ b/macosx/TorrentCell.m @@ -629,7 +629,7 @@ } } - if (![torrent allDownloaded] && ![torrent isMagnet]) + if (![torrent allDownloaded]) { const CGFloat widthRemaining = round(NSWidth(barRect) * [torrent progressLeft]);