From dc282004c8a5e5aacd284f5549c6c68b1171e1ec Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Thu, 17 Aug 2006 03:24:40 +0000 Subject: [PATCH] percentage next to valid downloaded in inspector --- macosx/InfoWindowController.h | 4 +--- macosx/InfoWindowController.m | 13 ++++++------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/macosx/InfoWindowController.h b/macosx/InfoWindowController.h index ccd0fcfb1..ceea441a3 100644 --- a/macosx/InfoWindowController.h +++ b/macosx/InfoWindowController.h @@ -39,9 +39,7 @@ * fAnnounceField, * fPieceSizeField, * fPiecesField, * fHashField, * fTorrentLocationField, * fDataLocationField, - * fDateStartedField, - //* fPercentField, - * fStateField, + * fDateStartedField, * fStateField, * fDownloadedValidField, * fDownloadedTotalField, * fUploadedTotalField, * fRatioField, * fSeedersField, * fLeechersField, * fConnectedPeersField, * fDownloadingFromField, * fUploadingToField, * fSwarmSpeedField; diff --git a/macosx/InfoWindowController.m b/macosx/InfoWindowController.m index d63c64a0a..ab4b94502 100644 --- a/macosx/InfoWindowController.m +++ b/macosx/InfoWindowController.m @@ -156,9 +156,6 @@ [fDataLocationField setSelectable: NO]; [fStateField setStringValue: @""]; -/* - [fPercentField setStringValue: @""]; -*/ [fRatioField setStringValue: @""]; [fSeedersField setStringValue: @""]; @@ -248,11 +245,13 @@ if (numberSelected == 1) { torrent = [fTorrents objectAtIndex: 0]; - + + //append percentage to amount downloaded if 1 torrent + [fDownloadedValidField setStringValue: [[fDownloadedValidField stringValue] + stringByAppendingFormat: @" (%.2f%%)", 100.0 * [torrent progress]]]; + [fStateField setStringValue: [torrent stateString]]; -/* - [fPercentField setStringValue: [NSString stringWithFormat: @"%.2f%%", 100.0 * [torrent progress]]]; -*/ + int seeders = [torrent seeders], leechers = [torrent leechers]; [fSeedersField setStringValue: seeders < 0 ? @"" : [NSString stringWithInt: seeders]]; [fLeechersField setStringValue: leechers < 0 ? @"" : [NSString stringWithInt: leechers]];