mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
-progresswindow: fix progressbar if both bars have the same value (thx dbo)
This commit is contained in:
@@ -79,7 +79,7 @@ void CProgressWindow::Init( signal<void, size_t, size_t, string> *statusSignal,
|
|||||||
if (globalSignal)
|
if (globalSignal)
|
||||||
*globalSignal->connect(mem_fun(*this, &CProgressWindow::showGlobalStatus));
|
*globalSignal->connect(mem_fun(*this, &CProgressWindow::showGlobalStatus));
|
||||||
|
|
||||||
global_progress = local_progress = percent_progress = 0;
|
global_progress = local_progress = 0;
|
||||||
|
|
||||||
showFooter(false);
|
showFooter(false);
|
||||||
|
|
||||||
@@ -131,15 +131,13 @@ void CProgressWindow::initStatus(const unsigned int prog, const unsigned int max
|
|||||||
{
|
{
|
||||||
pBar->allowPaint(true);
|
pBar->allowPaint(true);
|
||||||
unsigned int cur_perc = prog*100/(max+1);
|
unsigned int cur_perc = prog*100/(max+1);
|
||||||
if (percent_progress != cur_perc || prog == 0){
|
pBar->setValues(prog, (int)max);
|
||||||
pBar->setValues(prog, (int)max);
|
if (!statusText.empty() && (cur_statusText != statusText)){
|
||||||
if (!statusText.empty() && (cur_statusText != statusText)){
|
showStatusMessageUTF(statusText);
|
||||||
showStatusMessageUTF(statusText);
|
cur_statusText = statusText;
|
||||||
cur_statusText = statusText;
|
|
||||||
}
|
|
||||||
pBar->paint(false);
|
|
||||||
percent_progress = cur_perc;
|
|
||||||
}
|
}
|
||||||
|
pBar->paint(false);
|
||||||
|
frameBuffer->blit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CProgressWindow::showStatus(const unsigned int prog, const unsigned int max, const string &statusText)
|
void CProgressWindow::showStatus(const unsigned int prog, const unsigned int max, const string &statusText)
|
||||||
|
@@ -39,7 +39,6 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget
|
|||||||
|
|
||||||
unsigned int global_progress;
|
unsigned int global_progress;
|
||||||
unsigned int local_progress;
|
unsigned int local_progress;
|
||||||
unsigned int percent_progress;
|
|
||||||
std::string cur_statusText;
|
std::string cur_statusText;
|
||||||
int h_height;
|
int h_height;
|
||||||
void Init( sigc::signal<void, size_t, size_t, std::string> *statusSignal,
|
void Init( sigc::signal<void, size_t, size_t, std::string> *statusSignal,
|
||||||
|
Reference in New Issue
Block a user