Opened 12 years ago

Closed 12 years ago

#2117 closed Enhancement (invalid)

Short torrent description should give ETA and download speed

Reported by: alfwatt Owned by: livings124
Priority: Normal Milestone: None Set
Component: Mac Client Version: 1.61
Severity: Normal Keywords:
Cc:

Description

Showing the upload rate durning a download isn't particularly useful, but having the ETA in the Minimal View is nice to have.

Index: macosx/Torrent.m =================================================================== --- macosx/Torrent.m (revision 8542) +++ macosx/Torrent.m (working copy) @@ -52,6 +52,7 @@

  • (void) endQuickPause;

  • (NSString *) etaString;

+- (NSString *) shortEtaString;

  • (void) updateAllTrackers: (NSMutableArray *) trackers;

@@ -1204,9 +1205,9 @@

break;

case TR_STATUS_DOWNLOAD:

  • string = [NSString stringWithFormat: @"%@: %@, %@: %@",
  • NSLocalizedString(@"DL", "Torrent -> status string"), [NSString stringForSpeed: [self downloadRate]],
  • NSLocalizedString(@"UL", "Torrent -> status string"), [NSString stringForSpeed: [self uploadRate]]];

+ string = [NSString stringWithFormat: @"%@: %@ %@ %@", + NSLocalizedString(@"ETA", "Torrent -> status string"), [self shortEtaString], + NSLocalizedString(@"at", "Torrent -> status string"), [NSString stringForSpeed: [self downloadRate]]];

break;

case TR_STATUS_SEED:

@@ -1923,6 +1924,19 @@

}

}

+- (NSString *) shortEtaString +{ + const NSInteger eta = [self eta]; + switch (eta) + { + case TR_ETA_NOT_AVAIL: + case TR_ETA_UNKNOWN: + return NSLocalizedString(@"?", "Torrent -> eta string"); + default: + return [NSString timeString: eta showSeconds: YES maxFields: 1]; + } +} +

  • (void) updateAllTrackers: (NSMutableArray *) trackers {

get count

Change History (2)

comment:1 Changed 12 years ago by alfwatt

Index: macosx/Torrent.m
===================================================================
--- macosx/Torrent.m	(revision 8542)
+++ macosx/Torrent.m	(working copy)
@@ -52,6 +52,7 @@
 - (void) endQuickPause;
 
 - (NSString *) etaString;
+- (NSString *) shortEtaString;
 
 - (void) updateAllTrackers: (NSMutableArray *) trackers;
 
@@ -1204,9 +1205,9 @@
             break;
         
         case TR_STATUS_DOWNLOAD:
-            string = [NSString stringWithFormat: @"%@: %@, %@: %@",
-                            NSLocalizedString(@"DL", "Torrent -> status string"), [NSString stringForSpeed: [self downloadRate]],
-                            NSLocalizedString(@"UL", "Torrent -> status string"), [NSString stringForSpeed: [self uploadRate]]];
+            string = [NSString stringWithFormat: @"%@: %@ %@ %@",
+	                        NSLocalizedString(@"ETA", "Torrent -> status string"), [self shortEtaString],
+                      		NSLocalizedString(@"at", "Torrent -> status string"), [NSString stringForSpeed: [self downloadRate]]];
             break;
         
         case TR_STATUS_SEED:
@@ -1923,6 +1924,19 @@
     }
 }
 
+- (NSString *) shortEtaString
+{
+    const NSInteger eta = [self eta];
+    switch (eta)
+    {
+        case TR_ETA_NOT_AVAIL:
+        case TR_ETA_UNKNOWN:
+            return NSLocalizedString(@"?", "Torrent -> eta string");
+        default:
+            return [NSString timeString: eta showSeconds: YES maxFields: 1];
+    }
+}
+
 - (void) updateAllTrackers: (NSMutableArray *) trackers
 {
     //get count

comment:2 Changed 12 years ago by livings124

  • Resolution set to invalid
  • Status changed from new to closed

The minimal view already allows you to toggle between UL/DL speeds and eta in the gear button.

Note: See TracTickets for help on using tickets.