From 5dd5f371fa1d8c954ebea2897335eef293d1c8da Mon Sep 17 00:00:00 2001 From: bonazzi Date: Mon, 26 Sep 2016 22:41:18 +0000 Subject: [PATCH] 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 --- src/xvaga/oswin32.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/xvaga/oswin32.cpp b/src/xvaga/oswin32.cpp index 700c70339..06cec3dd0 100755 --- a/src/xvaga/oswin32.cpp +++ b/src/xvaga/oswin32.cpp @@ -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)