From 1b5751b7ddd2ad6adcd9d2f845e1e40b147b91f5 Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sun, 6 Aug 2006 20:40:12 +0000 Subject: [PATCH] Only show ratio, not upload speed, when seeding in minimal mode and set to display alternate status string. --- macosx/Controller.m | 2 +- macosx/Torrent.m | 9 +++++++-- macosx/TorrentCell.m | 4 ++-- macosx/TorrentTableView.m | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/macosx/Controller.m b/macosx/Controller.m index caa9547b9..27ba8a23b 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -1474,7 +1474,7 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy { //only allow reordering of rows if sorting by order with no filter if ([fSortType isEqualToString: @"Order"] && [fFilterType isEqualToString: @"None"] - && [[fSearchFilterField stringValue] isEqualToString: @""]) + && [[fSearchFilterField stringValue] length] == 0) { [pasteboard declareTypes: [NSArray arrayWithObject: TORRENT_TABLE_VIEW_DATA_TYPE] owner: self]; [pasteboard setData: [NSKeyedArchiver archivedDataWithRootObject: indexes] diff --git a/macosx/Torrent.m b/macosx/Torrent.m index 0f2c2b458..a58d80da2 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -256,8 +256,13 @@ [fShortStatusString setString: @""]; } else - [fShortStatusString setString: [NSString stringWithFormat: @"Ratio: %@, ", - [NSString stringForRatioWithDownload: [self downloadedTotal] upload: [self uploadedTotal]]]]; + { + NSString * ratioString = [NSString stringForRatioWithDownload: [self downloadedTotal] + upload: [self uploadedTotal]]; + + [fShortStatusString setString: [NSString stringWithFormat: @"Ratio: %@, ", ratioString]]; + [fRemainingTimeString setString: [@"Ratio: " stringByAppendingString: ratioString]]; + } stringToAppend = [stringToAppend stringByAppendingString: [@"UL: " stringByAppendingString: [NSString stringForSpeed: [self uploadRate]]]]; diff --git a/macosx/TorrentCell.m b/macosx/TorrentCell.m index a4e1c5570..252a4b399 100644 --- a/macosx/TorrentCell.m +++ b/macosx/TorrentCell.m @@ -363,8 +363,8 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80 //name and status string float mainWidth = cellFrame.size.width - iconSize.width - 3.0 * PADDING - EXTRA_NAME_SHIFT; - NSString * realStatusString = !fStatusRegular && [fTorrent isActive] && [fTorrent progress] < 1.0 - ? [fTorrent remainingTimeString] : [fTorrent shortStatusString]; + NSString * realStatusString = !fStatusRegular && [fTorrent isActive] ? [fTorrent remainingTimeString] + : [fTorrent shortStatusString]; NSAttributedString * statusString = [[[NSAttributedString alloc] initWithString: realStatusString attributes: statusAttributes] autorelease]; diff --git a/macosx/TorrentTableView.m b/macosx/TorrentTableView.m index 57d1b3cae..bb3ab2118 100644 --- a/macosx/TorrentTableView.m +++ b/macosx/TorrentTableView.m @@ -293,7 +293,7 @@ Torrent * torrent = [fTorrents objectAtIndex: row]; NSString * statusString = ![fDefaults boolForKey: @"SmallStatusRegular"] && [torrent isActive] - && [torrent progress] < 1.0 ? [torrent remainingTimeString] : [torrent shortStatusString]; + ? [torrent remainingTimeString] : [torrent shortStatusString]; float statusWidth = [statusString sizeWithAttributes: fSmallStatusAttributes].width + 3.0;