mirror of
https://github.com/transmission/transmission
synced 2024-12-22 07:42:37 +00:00
feat(qt): Add ETA to compact view (#3926)
* feat(qt): Add ETA to compcat view
* style: Apply codestyle guides
* fix: Remove whitespaces from translatable string
* chore: fix FTBFS from 76521a1
code shear
---------
Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
parent
e951ed2508
commit
33c4cd1c44
1 changed files with 21 additions and 0 deletions
|
@ -308,6 +308,27 @@ QString TorrentDelegate::shortStatusString(Torrent const& tor)
|
|||
break;
|
||||
}
|
||||
|
||||
// add time when downloading
|
||||
auto const seed_ratio_limit = tor.getSeedRatioLimit();
|
||||
if ((seed_ratio_limit && tor.isSeeding()) || tor.isDownloading())
|
||||
{
|
||||
if (tor.hasETA())
|
||||
{
|
||||
//: Second (optional) part of torrent progress string,
|
||||
//: %1 is duration,
|
||||
//: notice that leading space (before the dash) is included here
|
||||
str += QStringLiteral(" ");
|
||||
str += tr("%1 left").arg(Formatter::time_to_string(tor.getETA()));
|
||||
}
|
||||
else
|
||||
{
|
||||
//: Second (optional) part of torrent progress string,
|
||||
//: notice that leading space (before the dash) is included here
|
||||
str += QStringLiteral(" ");
|
||||
str += tr("Remaining time unknown");
|
||||
}
|
||||
}
|
||||
|
||||
return str.trimmed();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue