GUI: Show bytes sizes in saves sync dialog

And also makes percentage calculated based on bytes sizes, not files count.
This commit is contained in:
Alexander Tkachev 2022-07-31 18:08:29 +03:00 committed by Eugene Sandulenko
parent 645e1a0c83
commit 85739018fe
7 changed files with 80 additions and 3 deletions

View file

@ -109,7 +109,11 @@ void SaveLoadCloudSyncProgressDialog::pollCloudMan() {
_close = true;
}
_percentLabel->setLabel(Common::String::format("%u %%", progress));
Common::String downloaded, downloadedUnits, total, totalUnits;
downloaded = getHumanReadableBytes(CloudMan.getSyncDownloadBytesNumber(), downloadedUnits);
total = getHumanReadableBytes(CloudMan.getSyncDownloadTotalBytesNumber(), totalUnits);
_percentLabel->setLabel(Common::String::format("%u %% (%s %S / %s %S)", progress, downloaded.c_str(), _(downloadedUnits).c_str(), total.c_str(), _(totalUnits).c_str()));
_progressBar->setValue(progress);
_progressBar->markAsDirty();