From 78d95148dcbfdb99196cc2228cd527bf24599130 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sun, 14 Oct 2007 14:24:34 +0000 Subject: [PATCH] add a warning and improve some commented out code....nothing to see here --- macosx/Controller.m | 4 ++-- macosx/TorrentCell.m | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/macosx/Controller.m b/macosx/Controller.m index 0f0a85b1c..417ce3cb1 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -493,10 +493,10 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi if ([torrent isActive]) { active++; - if (![torrent isSeeding]) + if (![torrent allDownloaded]) downloading++; } - + if ([fDefaults boolForKey: @"CheckQuitDownloading"] ? downloading > 0 : active > 0) { NSString * message = active == 1 diff --git a/macosx/TorrentCell.m b/macosx/TorrentCell.m index f8d3da214..17fba7a10 100644 --- a/macosx/TorrentCell.m +++ b/macosx/TorrentCell.m @@ -268,30 +268,30 @@ if (rightWidth > 0) { + int availableWidth = 0; /*if (![fDefaults boolForKey: @"DisplayProgressBarAvailable"]) { - int notAvailableWidth = barRect.size.width * [torrent notAvailableDesired]; //NSLog(@"notAvailableWidth %d rightWidth %d", notAvailableWidth, rightWidth); - notAvailableWidth = MIN(notAvailableWidth, rightWidth); + availableWidth = MAX(0, (float)rightWidth - barRect.size.width * [torrent notAvailableDesired]); - if (notAvailableWidth > 0) + if (availableWidth > 0) { - rightWidth -= notAvailableWidth; + rightWidth -= availableWidth; - NSRect notAvailableRect = barRect; - notAvailableRect.origin.x += leftWidth + rightWidth; - notAvailableRect.size.width = notAvailableWidth; + NSRect availableRect = barRect; + availableRect.origin.x += leftWidth; + availableRect.size.width = availableWidth; if (!fYellowGradient) fYellowGradient = [[CTGradient progressYellowGradient] retain]; - [fYellowGradient fillRect: notAvailableRect angle: -90]; + [fYellowGradient fillRect: availableRect angle: -90]; } }*/ if (rightWidth > 0) { NSRect includeRect = barRect; - includeRect.origin.x += leftWidth; + includeRect.origin.x += leftWidth + availableWidth; includeRect.size.width = rightWidth; if (!fWhiteGradient)