mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 07:51:19 +02:00
CProgressWindow: add member showStatus()
This displays only one progress bar instead two and shows the global status. That's senseful , if only one progress bar is required.
This commit is contained in:
@@ -62,6 +62,7 @@ void CProgressWindow::Init()
|
|||||||
|
|
||||||
//create local_bar object
|
//create local_bar object
|
||||||
local_bar = new CProgressBar();
|
local_bar = new CProgressBar();
|
||||||
|
local_bar->allowPaint(false);
|
||||||
local_bar->setDimensionsAll(x_item, y_item, w_item, h_pbar);
|
local_bar->setDimensionsAll(x_item, y_item, w_item, h_pbar);
|
||||||
local_bar->setColorBody(col_body);
|
local_bar->setColorBody(col_body);
|
||||||
local_bar->setActiveColor(COL_MENUCONTENT_PLUS_7);
|
local_bar->setActiveColor(COL_MENUCONTENT_PLUS_7);
|
||||||
@@ -72,6 +73,7 @@ void CProgressWindow::Init()
|
|||||||
|
|
||||||
//create global_bar object
|
//create global_bar object
|
||||||
global_bar = new CProgressBar();
|
global_bar = new CProgressBar();
|
||||||
|
global_bar->allowPaint(false);
|
||||||
global_bar->setDimensionsAll(x_item, y_item, w_item, h_pbar);
|
global_bar->setDimensionsAll(x_item, y_item, w_item, h_pbar);
|
||||||
global_bar->setColorBody(col_body);
|
global_bar->setColorBody(col_body);
|
||||||
global_bar->setActiveColor(COL_MENUCONTENT_PLUS_7);
|
global_bar->setActiveColor(COL_MENUCONTENT_PLUS_7);
|
||||||
@@ -94,12 +96,26 @@ void CProgressWindow::setTitle(const neutrino_locale_t title)
|
|||||||
#endif // VFD_UPDATE
|
#endif // VFD_UPDATE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CProgressWindow::showStatus(const unsigned int prog)
|
||||||
|
{
|
||||||
|
if (global_progress == prog)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!global_bar->isPainted()){
|
||||||
|
int g_height = global_bar->getHeight();
|
||||||
|
global_bar->setYPos(local_bar->getYPos() + g_height/2);
|
||||||
|
global_bar->setHeight(g_height + g_height/2);
|
||||||
|
}
|
||||||
|
|
||||||
|
showGlobalStatus(prog);
|
||||||
|
}
|
||||||
|
|
||||||
void CProgressWindow::showGlobalStatus(const unsigned int prog)
|
void CProgressWindow::showGlobalStatus(const unsigned int prog)
|
||||||
{
|
{
|
||||||
if (global_progress == prog)
|
if (global_progress == prog)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
global_bar->allowPaint(true);
|
||||||
global_progress = prog;
|
global_progress = prog;
|
||||||
global_bar->setValues(prog, 100);
|
global_bar->setValues(prog, 100);
|
||||||
global_bar->paint(false);
|
global_bar->paint(false);
|
||||||
@@ -114,6 +130,7 @@ void CProgressWindow::showLocalStatus(const unsigned int prog)
|
|||||||
if (local_progress == prog)
|
if (local_progress == prog)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
local_bar->allowPaint(true);
|
||||||
local_progress = prog;
|
local_progress = prog;
|
||||||
local_bar->setValues(prog, 100);
|
local_bar->setValues(prog, 100);
|
||||||
local_bar->paint(false);
|
local_bar->paint(false);
|
||||||
|
@@ -48,10 +48,11 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget
|
|||||||
|
|
||||||
virtual int exec( CMenuTarget* parent, const std::string & actionKey );
|
virtual int exec( CMenuTarget* parent, const std::string & actionKey );
|
||||||
|
|
||||||
virtual void showGlobalStatus(const unsigned int prog);
|
void showStatus(const unsigned int prog);
|
||||||
virtual unsigned int getGlobalStatus(void);
|
void showGlobalStatus(const unsigned int prog);
|
||||||
virtual void showLocalStatus(const unsigned int prog);
|
unsigned int getGlobalStatus(void);
|
||||||
virtual void showStatusMessageUTF(const std::string & text); // UTF-8
|
void showLocalStatus(const unsigned int prog);
|
||||||
|
void showStatusMessageUTF(const std::string & text); // UTF-8
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user