-progresswindow: fix progressbar if both bars have the same value (thx dbo)

This commit is contained in:
TangoCash
2017-06-18 15:06:11 +02:00
committed by Thilo Graf
parent 0bc31c6397
commit ac46bb0492
2 changed files with 7 additions and 10 deletions

View File

@@ -79,7 +79,7 @@ void CProgressWindow::Init( signal<void, size_t, size_t, string> *statusSignal,
if (globalSignal)
*globalSignal->connect(mem_fun(*this, &CProgressWindow::showGlobalStatus));
global_progress = local_progress = percent_progress = 0;
global_progress = local_progress = 0;
showFooter(false);
@@ -131,15 +131,13 @@ void CProgressWindow::initStatus(const unsigned int prog, const unsigned int max
{
pBar->allowPaint(true);
unsigned int cur_perc = prog*100/(max+1);
if (percent_progress != cur_perc || prog == 0){
pBar->setValues(prog, (int)max);
if (!statusText.empty() && (cur_statusText != statusText)){
showStatusMessageUTF(statusText);
cur_statusText = statusText;
}
pBar->paint(false);
percent_progress = cur_perc;
}
frameBuffer->blit();
}
void CProgressWindow::showStatus(const unsigned int prog, const unsigned int max, const string &statusText)

View File

@@ -39,7 +39,6 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget
unsigned int global_progress;
unsigned int local_progress;
unsigned int percent_progress;
std::string cur_statusText;
int h_height;
void Init( sigc::signal<void, size_t, size_t, std::string> *statusSignal,