mirror of
https://github.com/transmission/transmission
synced 2025-02-20 13:16:53 +00:00
with multiple torrents selected, show the latest "last activity"
This commit is contained in:
parent
5e3dcb5f6f
commit
d347e428c9
1 changed files with 8 additions and 2 deletions
|
@ -239,6 +239,7 @@ typedef enum
|
|||
[fDownloadedTotalField setStringValue: @""];
|
||||
[fUploadedTotalField setStringValue: @""];
|
||||
[fFailedHashField setStringValue: @""];
|
||||
[fDateActivityField setStringValue: @""];
|
||||
|
||||
//options fields
|
||||
[fUploadLimitPopUp setEnabled: NO];
|
||||
|
@ -328,7 +329,6 @@ typedef enum
|
|||
|
||||
[fDateAddedField setStringValue: @""];
|
||||
[fDateCompletedField setStringValue: @""];
|
||||
[fDateActivityField setStringValue: @""];
|
||||
|
||||
[fPiecesControl setSelected: NO forSegment: PIECES_CONTROL_AVAILABLE];
|
||||
[fPiecesControl setSelected: NO forSegment: PIECES_CONTROL_PROGRESS];
|
||||
|
@ -1057,6 +1057,7 @@ typedef enum
|
|||
return;
|
||||
|
||||
uint64_t have = 0, haveVerified = 0, downloadedTotal = 0, uploadedTotal = 0, failedHash = 0;
|
||||
NSDate * lastActivity = nil;
|
||||
Torrent * torrent;
|
||||
NSEnumerator * enumerator = [fTorrents objectEnumerator];
|
||||
while ((torrent = [enumerator nextObject]))
|
||||
|
@ -1066,6 +1067,10 @@ typedef enum
|
|||
downloadedTotal += [torrent downloadedTotal];
|
||||
uploadedTotal += [torrent uploadedTotal];
|
||||
failedHash += [torrent failedHash];
|
||||
|
||||
NSDate * nextLastActivity;
|
||||
if ((nextLastActivity = [torrent dateActivity]))
|
||||
lastActivity = [nextLastActivity laterDate: lastActivity];
|
||||
}
|
||||
|
||||
if (have == 0)
|
||||
|
@ -1081,6 +1086,8 @@ typedef enum
|
|||
[fUploadedTotalField setStringValue: [NSString stringForFileSize: uploadedTotal]];
|
||||
[fFailedHashField setStringValue: [NSString stringForFileSize: failedHash]];
|
||||
|
||||
[fDateActivityField setObjectValue: lastActivity];
|
||||
|
||||
if (numberSelected == 1)
|
||||
{
|
||||
torrent = [fTorrents objectAtIndex: 0];
|
||||
|
@ -1099,7 +1106,6 @@ typedef enum
|
|||
}
|
||||
|
||||
[fDateCompletedField setObjectValue: [torrent dateCompleted]];
|
||||
[fDateActivityField setObjectValue: [torrent dateActivity]];
|
||||
|
||||
[fPiecesView updateView: NO];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue