mirror of
https://github.com/reactos/reactos.git
synced 2025-06-10 12:24:48 +00:00
[DWNL] Improve user experience and fix progress output (#7903)
- `CBindStatusCallback_UpdateProgress`: * Rework the failsafe check to enable percentage to be at 100%. * More thorough failsafe check, to avoid displaying 100% (or even 101%) where the actual and expected file sizes don't match. - `case BINDSTATUS_ENDDOWNLOADDATA`: Do update the progress one last time to be at 100%, on download success.
This commit is contained in:
parent
e6f5065f32
commit
a9ba54f678
1 changed files with 6 additions and 1 deletions
|
@ -73,7 +73,8 @@ CBindStatusCallback_UpdateProgress(CBindStatusCallback *This)
|
|||
UINT Percentage;
|
||||
|
||||
Percentage = (UINT)((This->Progress * 100) / This->Size);
|
||||
if (Percentage > 99)
|
||||
// If percentage is greater than 99% but sizes don't match, do a failsafe.
|
||||
if ((Percentage > 99) && (This->Progress != This->Size))
|
||||
Percentage = 99;
|
||||
|
||||
LoadStringW(NULL, IDS_BYTES_DOWNLOADED_FULL, szMessage, ARRAYSIZE(szMessage));
|
||||
|
@ -246,6 +247,10 @@ CBindStatusCallback_OnProgress(IBindStatusCallback *iface,
|
|||
break;
|
||||
|
||||
case BINDSTATUS_ENDDOWNLOADDATA:
|
||||
/* Since download is completed, update progress one last time to be at 100% */
|
||||
This->Progress = This->Size; // Ensure progress == total size
|
||||
CBindStatusCallback_UpdateProgress(This); // Show 100% progress now
|
||||
|
||||
ConResPrintf(StdOut, IDS_FILE_SAVED);
|
||||
break;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue