mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 23:42:58 +02:00
Merge remote-tracking branch 'uncool/cst-next'
This need buildfixes and some functional updates...
This commit is contained in:
@@ -60,11 +60,13 @@ void CProgressWindow::Init()
|
||||
int h_txt = max(g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(), h_item);
|
||||
status_txt->setDimensionsAll(x_item, y_item, w_item, h_txt);
|
||||
status_txt->setColorBody(col_body);
|
||||
status_txt->doPaintTextBoxBg(true);
|
||||
addWindowItem(status_txt);
|
||||
y_item += h_txt + 10;
|
||||
|
||||
//create local_bar object
|
||||
local_bar = new CProgressBar();
|
||||
local_bar->allowPaint(false);
|
||||
local_bar->setDimensionsAll(x_item, y_item, w_item, h_pbar);
|
||||
local_bar->setColorBody(col_body);
|
||||
local_bar->setActiveColor(COL_MENUCONTENT_PLUS_7);
|
||||
@@ -75,6 +77,7 @@ void CProgressWindow::Init()
|
||||
|
||||
//create global_bar object
|
||||
global_bar = new CProgressBar();
|
||||
global_bar->allowPaint(false);
|
||||
global_bar->setDimensionsAll(x_item, y_item, w_item, h_pbar);
|
||||
global_bar->setColorBody(col_body);
|
||||
global_bar->setActiveColor(COL_MENUCONTENT_PLUS_7);
|
||||
@@ -83,7 +86,8 @@ void CProgressWindow::Init()
|
||||
addWindowItem(global_bar);
|
||||
y_item += 2*h_pbar;
|
||||
|
||||
height = y_item + ccw_head->getHeight();
|
||||
h_height = ccw_head->getHeight();
|
||||
height = y_item + h_height;
|
||||
|
||||
setCenterPos();
|
||||
}
|
||||
@@ -97,12 +101,47 @@ void CProgressWindow::setTitle(const neutrino_locale_t title)
|
||||
#endif // VFD_UPDATE
|
||||
}
|
||||
|
||||
void CProgressWindow::setTitle(const std::string & title)
|
||||
{
|
||||
setWindowCaption(title);
|
||||
|
||||
#ifdef VFD_UPDATE
|
||||
CVFD::getInstance()->showProgressBar2(-1,NULL,-1,g_Locale->getText(ccw_caption)); // set global text in VFD
|
||||
#endif // VFD_UPDATE
|
||||
}
|
||||
|
||||
//if header is disabled we need new position for body items
|
||||
void CProgressWindow::fitItems()
|
||||
{
|
||||
if (ccw_show_header)
|
||||
return;
|
||||
|
||||
for(size_t i=0; i<ccw_body->size() ;i++){
|
||||
int y_item = ccw_body->getCCItem(i)->getYPos() + h_height - 10;
|
||||
ccw_body->getCCItem(i)->setYPos(y_item);
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
if (global_progress == prog)
|
||||
return;
|
||||
|
||||
global_bar->allowPaint(true);
|
||||
global_progress = prog;
|
||||
global_bar->setValues(prog, 100);
|
||||
global_bar->paint(false);
|
||||
@@ -117,6 +156,7 @@ void CProgressWindow::showLocalStatus(const unsigned int prog)
|
||||
if (local_progress == prog)
|
||||
return;
|
||||
|
||||
local_bar->allowPaint(true);
|
||||
local_progress = prog;
|
||||
local_bar->setValues(prog, 100);
|
||||
local_bar->paint(false);
|
||||
@@ -163,3 +203,9 @@ int CProgressWindow::exec(CMenuTarget* parent, const std::string & /*actionKey*/
|
||||
|
||||
return menu_return::RETURN_REPAINT;
|
||||
}
|
||||
|
||||
void CProgressWindow::paint(bool do_save_bg)
|
||||
{
|
||||
fitItems();
|
||||
CComponentsWindow::paint(do_save_bg);
|
||||
}
|
||||
|
Reference in New Issue
Block a user