Skip to content

Commit

Permalink
gui: shorten the estimated time left in tooltip
Browse files Browse the repository at this point in the history
Signed-off-by: Jyrki Gadinger <[email protected]>
  • Loading branch information
nilsding committed Aug 30, 2024
1 parent 1f3a6e9 commit 0c10eb9
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/gui/folderman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1729,21 +1729,28 @@ QString FolderMan::trayTooltipStatusString(SyncResult::Status syncStatus, bool h
break;
case SyncResult::SyncRunning:
if (progress && progress->status() == ProgressInfo::Propagation) {
const auto estimatedEta = progress->totalProgress().estimatedEta;
if (progress->totalSize() == 0) {
qint64 currentFile = progress->currentFile();
qint64 totalFileCount = qMax(progress->totalFiles(), currentFile);
if (progress->trustEta()) {
folderMessage = tr("Syncing %1 of %2 (%3 left)")
.arg(currentFile)
.arg(totalFileCount)
.arg(Utility::durationToDescriptiveString2(progress->totalProgress().estimatedEta));
if (estimatedEta == 0) {
folderMessage = tr("Syncing %1 of %2 (A few seconds left)").arg(currentFile).arg(totalFileCount);
} else {
folderMessage =
tr("Syncing %1 of %2 (%3 left)").arg(currentFile).arg(totalFileCount).arg(Utility::durationToDescriptiveString1(estimatedEta));
}
} else {
folderMessage = tr("Syncing %1 of %2").arg(currentFile).arg(totalFileCount);
}
} else {
QString totalSizeStr = Utility::octetsToString(progress->totalSize());
if (progress->trustEta()) {
folderMessage = tr("Syncing %1 (%2 left)").arg(totalSizeStr, Utility::durationToDescriptiveString2(progress->totalProgress().estimatedEta));
if (estimatedEta == 0) {
folderMessage = tr("Syncing %1 (A few seconds left)").arg(totalSizeStr, Utility::durationToDescriptiveString1(estimatedEta));
} else {
folderMessage = tr("Syncing %1 (%2 left)").arg(totalSizeStr, Utility::durationToDescriptiveString1(estimatedEta));
}
} else {
folderMessage = tr("Syncing %1").arg(totalSizeStr);
}
Expand Down

0 comments on commit 0c10eb9

Please sign in to comment.