Patch level : 12.0 no patch

Files correlati     : 
Commento            :

Corretti progress indicator

git-svn-id: svn://10.65.10.50/branches/R_10_00@23332 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
bonazzi 2016-09-26 22:41:18 +00:00
parent f9f8a576f5
commit 5dd5f371fa

View File

@ -1084,14 +1084,26 @@ bool Win32ProgressIndicator::SetProgress(long nCurrent, long nTotal)
if (nSec > 0)
{
const int nSpeed = nCurrent / nSec;
const int nRemaining = nTotal - nCurrent;
const int remainingTime = nRemaining / nSpeed;
int s = nSec;
const int h = s / 3600; s %= 3600;
const int m = s / 60; s %= 60;
wxString str;
if (nSpeed < 120)
str.Format("%d%% - %ld / %ld - %02d:%02d:%02d - %d / sec", _perc, nCurrent, nTotal, h, m, s, nSpeed);
str = str.Format("%d%% - Trascorsi %02d:%02d:%02d", _perc, h, m, s);
if (nSpeed < 120)
str << str.Format(" - Velocità %d/sec - %d sec.alla fine", nSpeed, remainingTime);
else
str.Format("%d%% - %ld / %ld - %02d:%02d:%02d - %d / min", _perc, nCurrent, nTotal, h, m, s, nSpeed/60);
{
const int mins = remainingTime / 60;
str << str.Format(" - Velocità %d/min", nSpeed * 60);
if (mins < 2)
str << str.Format(" - %d sec.alla fine", remainingTime);
else
str << str.Format(" - %d min.alla fine", mins);
}
m_ppd->SetLine(2, str2wstr(str), FALSE, NULL);
}
}
@ -1141,7 +1153,7 @@ Win32ProgressIndicator::Win32ProgressIndicator(WXHWND hwndParent, const char* st
if (strTitle && *strTitle)
m_ppd->SetTitle(str2wstr(strTitle)); // Set the title of the dialog.
DWORD dwFlags = PROGDLG_AUTOTIME | PROGDLG_MODAL | PROGDLG_NOMINIMIZE;
DWORD dwFlags = PROGDLG_NOTIME | PROGDLG_MODAL | PROGDLG_NOMINIMIZE;
if (nMax <= 1)
{
if (nMax == 1)