From abff232156d59f4e7c516c856413ef1a4da26ce4 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 26 Feb 2017 01:01:15 +0100 Subject: [PATCH 01/20] channelist: use OFFSET-defines for channels w/o EPG too Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1aa5e929db9197bd5c2480471b4e57712995b734 Author: vanhofen Date: 2017-02-26 (Sun, 26 Feb 2017) Origin message was: ------------------ - channelist: use OFFSET-defines for channels w/o EPG too ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index d4a139537..9f8fc22be 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2087,7 +2087,7 @@ void CChannelList::paintItem(int pos, const bool firstpaint) pb.paint(); } //name - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 5+ numwidth+ 10+prg_offset, ypos+ fheight, width- numwidth- 40- 15-prg_offset, nameAndDescription, color); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + OFFSET_INNER_SMALL + numwidth + OFFSET_INNER_MID + prg_offset, ypos + fheight, width - numwidth - 4*OFFSET_INNER_MID - 15 - prg_offset, nameAndDescription, color); } if (!firstpaint && curr == selected) updateVfd(); From 1e00a117addb5eea46f5bad050b4dcf36db5c3be Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 26 Feb 2017 15:05:21 +0100 Subject: [PATCH 02/20] src/gui/movieplayer.cpp try fix stop play file on file end Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/df25b5094427705816f3264252e2c506ff50b9e2 Author: Jacek Jendrzej Date: 2017-02-26 (Sun, 26 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/movieplayer.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 87499697e..05fd0b093 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1285,8 +1285,11 @@ void CMoviePlayerGui::PlayFileLoop(void) bool first_start = true; bool update_lcd = true; int eof = 0; + int eof2 = 0; + int position_tmp = 0; bool at_eof = !(playstate >= CMoviePlayerGui::PLAY);; keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_NORMAL; + while (playstate >= CMoviePlayerGui::PLAY) { if (update_lcd) { @@ -1320,6 +1323,20 @@ void CMoviePlayerGui::PlayFileLoop(void) printf("CMoviePlayerGui::%s: spd %d pos %d/%d (%d, %d%%)\n", __func__, speed, position, duration, duration-position, file_prozent); #endif /* in case ffmpeg report incorrect values */ + if((playstate == CMoviePlayerGui::PLAY) && (speed == 1)){ + if(position_tmp != position){ + position_tmp = position ; + eof2 = 0; + }else{ + if (++eof2 > 6) { + at_eof = true; + break; + } + } + } + else{ + eof2 = 0; + } int posdiff = duration - position; if ((posdiff >= 0) && (posdiff < 2000) && timeshift == TSHIFT_MODE_OFF) { From cd669c5a78b14d90f9b1bc131622d2402298a215 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 15 Feb 2017 10:23:00 +0100 Subject: [PATCH 03/20] CProgressWindow: add overloaded constructor with string arg Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5049b69c3fdfec18e4eea04d3b441bfca9063c56 Author: Thilo Graf Date: 2017-02-15 (Wed, 15 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/progresswindow.cpp | 11 +++++++++++ src/gui/widget/progresswindow.h | 13 +++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index 84c74e15d..77782d65c 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -57,6 +57,17 @@ CProgressWindow::CProgressWindow(const neutrino_locale_t title, Init(statusSignal, localSignal, globalSignal); } +CProgressWindow::CProgressWindow(const std::string &title, + const int &dx, + const int &dy, + signal *statusSignal, + signal *localSignal, + signal *globalSignal) + : CComponentsWindow(0, 0, dx, dy, title, NEUTRINO_ICON_INFO, NULL, CC_SHADOW_ON) +{ + Init(statusSignal, localSignal, globalSignal); +} + void CProgressWindow::Init( signal *statusSignal, signal *localSignal, signal *globalSignal) diff --git a/src/gui/widget/progresswindow.h b/src/gui/widget/progresswindow.h index 811b5714a..30f6f485b 100644 --- a/src/gui/widget/progresswindow.h +++ b/src/gui/widget/progresswindow.h @@ -150,6 +150,19 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget sigc::signal *localSignal = NULL, sigc::signal *globalSignal = NULL); + /**CProgressWindow Constructor + * @param[in] title + * @li expects type std::string as window title + * + * @see For other arguments and examples, see related constructor(s) + */ + CProgressWindow(const std::string &title, + const int &dx = 700, + const int &dy = 200, + sigc::signal *status_Signal = NULL, + sigc::signal *localSignal = NULL, + sigc::signal *globalSignal = NULL); + /**Sets titel of window * @param[in] title * @li expects type neutrino_locale_t as window title From 660010a1f710de10112288cfb8fea4590246428b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 15 Feb 2017 10:35:20 +0100 Subject: [PATCH 04/20] CTestMenu: ad samples for progress window Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b250ae6b9d906dcc711cb1df2c3ba6be5e4d6932 Author: Thilo Graf Date: 2017-02-15 (Wed, 15 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/test_menu.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 060e7858b..54f6af3e4 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -50,6 +50,7 @@ #include #include +#include #include #include #include @@ -836,6 +837,26 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) } return res; } + else if (actionKey == "progress_window"){ + CProgressWindow progress0("Progress Single Test"); + progress0.paint(); + size_t max = 10; + for(size_t i = 0; i< max; i++){ + progress0.showStatus(i, max, to_string(i)); + sleep(1); + } + progress0.hide(); + + CProgressWindow progress1("Progress Local/Global Test"); + progress1.paint(); + for(size_t i = 0; i< max; i++){ + progress1.showLocalStatus(i, max, to_string(i)); + progress1.showGlobalStatus(i, max, to_string(i)); + sleep(1); + } + progress1.hide(); + return menu_return::RETURN_REPAINT; + } else if (actionKey == "hintbox_test") { ShowHint("Testmenu: Hintbox popup test", "Test for HintBox,\nPlease press any key or wait some seconds! ...", 700, 10, NULL, NEUTRINO_ICON_HINT_IMAGEINFO, CComponentsHeader::CC_BTN_EXIT); @@ -1080,6 +1101,7 @@ int CTestMenu::showTestMenu() void CTestMenu::showCCTests(CMenuWidget *widget) { widget->addIntroItems(); + widget->addItem(new CMenuForwarder("Progress Window", true, NULL, this, "progress_window")); widget->addItem(new CMenuForwarder("Running Clock", true, NULL, this, "running_clock")); widget->addItem(new CMenuForwarder("Clock", true, NULL, this, "clock")); widget->addItem(new CMenuForwarder("Button", true, NULL, this, "button")); From 47af4bedda5570ad1034d89340b1f236a70e5c7e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 16 Feb 2017 10:57:08 +0100 Subject: [PATCH 05/20] CProgressWindow: encapsulate show methodes, add dimension defines Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7339d3dd03179358e79c50c06edcd38105de51f6 Author: Thilo Graf Date: 2017-02-16 (Thu, 16 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/progresswindow.cpp | 96 ++++++++++++++----------------- src/gui/widget/progresswindow.h | 19 +++--- 2 files changed, 54 insertions(+), 61 deletions(-) diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index 77782d65c..59c95c74b 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -82,54 +82,52 @@ void CProgressWindow::Init( signal *statusSignal, global_progress = local_progress = 100; showFooter(false); - shadow = true; - - int x_item = 10; - int y_item = 10; - - int w_item = width-2*x_item; - int h_item = 14; - int h_pbar = 20; - w_bar_frame = 0; //create status text object status_txt = new CComponentsLabel(); - 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->setDimensionsAll(OFFSET_INNER_MID, OFFSET_INNER_MID, width-2*OFFSET_INNER_MID, g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight()); status_txt->setColorBody(col_body); status_txt->doPaintTextBoxBg(true); status_txt->doPaintBg(false); 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_PROGRESSBAR_ACTIVE_PLUS_0); - local_bar->setFrameThickness(w_bar_frame); - local_bar->setColorFrame(COL_PROGRESSBAR_ACTIVE_PLUS_0); - addWindowItem(local_bar); - y_item += 2*h_pbar; + local_bar = InitProgressItem(); //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_PROGRESSBAR_ACTIVE_PLUS_0); - global_bar->setFrameThickness(w_bar_frame); - global_bar->setColorFrame(COL_PROGRESSBAR_ACTIVE_PLUS_0); - addWindowItem(global_bar); - y_item += 2*h_pbar; + global_bar = InitProgressItem(); + //set window height h_height = ccw_head->getHeight(); - height = max(height, y_item + h_height); + ccw_body->setHeight((OFFSET_INNER_MID + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight())*ccw_body->size()); + height = max(height, ccw_body->getHeight() + h_height); + + //set position on screen setCenterPos(); } +CProgressBar* CProgressWindow::InitProgressItem() +{ + CProgressBar *pBar = new CProgressBar(); + pBar->allowPaint(false); + int y_tmp = 0; + for(size_t i = 0; i< ccw_body->size(); i++){ + y_tmp += ccw_body->getCCItem(i)->getHeight(); + y_tmp += OFFSET_INNER_MID; + } + pBar->setDimensionsAll(OFFSET_INNER_MID, y_tmp, width-2*OFFSET_INNER_MID, g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight()); + pBar->setColorBody(col_body); + pBar->setActiveColor(COL_PROGRESSBAR_ACTIVE_PLUS_0); + pBar->setFrameThickness(1); + pBar->setColorFrame(COL_PROGRESSBAR_ACTIVE_PLUS_0); + addWindowItem(pBar); + + ccw_body->setHeight(y_tmp+OFFSET_INNER_MID); + + return pBar; +} + void CProgressWindow::setTitle(const neutrino_locale_t title) { setWindowCaption(title); @@ -155,36 +153,31 @@ void CProgressWindow::fitItems() return; for(size_t i=0; isize() ;i++){ - int y_item = ccw_body->getCCItem(i)->getYPos() + h_height - 10; + int y_item = ccw_body->getCCItem(i)->getYPos() + h_height - OFFSET_INNER_MID; ccw_body->getCCItem(i)->setYPos(y_item); } } +void CProgressWindow::initStatus(const unsigned int prog, const unsigned int max, const string &statusText, CProgressBar *pBar) +{ + pBar->allowPaint(true); + pBar->setValues(prog, (int)max); + if (!statusText.empty()) + showStatusMessageUTF(statusText); + pBar->paint(false); +} + void CProgressWindow::showStatus(const unsigned int prog, const unsigned int max, const string &statusText) { - 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, max, statusText); + showLocalStatus(prog, max, statusText); } void CProgressWindow::showGlobalStatus(const unsigned int prog, const unsigned int max, const string &statusText) { if (global_progress == prog) return; - - global_bar->allowPaint(true); global_progress = prog; - global_bar->setValues(prog, (int)max); - if (!statusText.empty()) - showStatusMessageUTF(statusText); - global_bar->paint(false); + initStatus(prog, max, statusText, global_bar); #ifdef VFD_UPDATE CVFD::getInstance()->showProgressBar2(-1,NULL,global_progress); @@ -195,13 +188,8 @@ void CProgressWindow::showLocalStatus(const unsigned int prog, const unsigned in { if (local_progress == prog) return; - - local_bar->allowPaint(true); local_progress = prog; - local_bar->setValues(prog, (int)max); - if (!statusText.empty()) - showStatusMessageUTF(statusText); - local_bar->paint(false); + initStatus(prog, max, statusText, local_bar); #ifdef VFD_UPDATE CVFD::getInstance()->showProgressBar2(local_progress); diff --git a/src/gui/widget/progresswindow.h b/src/gui/widget/progresswindow.h index 30f6f485b..2b8d443b3 100644 --- a/src/gui/widget/progresswindow.h +++ b/src/gui/widget/progresswindow.h @@ -28,6 +28,9 @@ #include #include "menue.h" +#define PW_MIN_WIDTH 700 +#define PW_MIN_HEIGHT 100 + class CProgressWindow : public CComponentsWindow, public CMenuTarget { private: @@ -36,11 +39,13 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget unsigned int global_progress; unsigned int local_progress; - int w_bar_frame; int h_height; void Init( sigc::signal *statusSignal, sigc::signal *localSignal, sigc::signal *globalSignal); + + CProgressBar* InitProgressItem(); + void initStatus(const unsigned int prog, const unsigned int max, const std::string &statusText, CProgressBar *pBar); void fitItems(); public: @@ -131,8 +136,8 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget * Don't use status_Signal at same time with localSignal and globalSignal. In This case please set status_Signal = NULL */ CProgressWindow(CComponentsForm *parent = NULL, - const int &dx = 700, - const int &dy = 200, + const int &dx = PW_MIN_WIDTH, + const int &dy = PW_MIN_HEIGHT, sigc::signal *status_Signal = NULL, sigc::signal *localSignal = NULL, sigc::signal *globalSignal = NULL); @@ -144,8 +149,8 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget * @see For other arguments and examples, see related constructor(s) */ CProgressWindow(const neutrino_locale_t title, - const int &dx = 700, - const int &dy = 200, + const int &dx = PW_MIN_WIDTH, + const int &dy = PW_MIN_HEIGHT, sigc::signal *status_Signal = NULL, sigc::signal *localSignal = NULL, sigc::signal *globalSignal = NULL); @@ -157,8 +162,8 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget * @see For other arguments and examples, see related constructor(s) */ CProgressWindow(const std::string &title, - const int &dx = 700, - const int &dy = 200, + const int &dx = PW_MIN_WIDTH, + const int &dy = PW_MIN_HEIGHT, sigc::signal *status_Signal = NULL, sigc::signal *localSignal = NULL, sigc::signal *globalSignal = NULL); From ae237935c33e2f92d0671b1f2e13cfb0ba21f7c3 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 17 Feb 2017 21:11:34 +0100 Subject: [PATCH 06/20] CProgressWindow: move some methodes for more clarity Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9d3e5f4fd2b6beb5b29c8773dc8ea657fd02cf59 Author: Thilo Graf Date: 2017-02-17 (Fri, 17 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/progresswindow.cpp | 60 +++++++++++++++---------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index 59c95c74b..ad26a2a53 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -128,36 +128,6 @@ CProgressBar* CProgressWindow::InitProgressItem() return pBar; } -void CProgressWindow::setTitle(const neutrino_locale_t 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 -} - -void CProgressWindow::setTitle(const 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; isize() ;i++){ - int y_item = ccw_body->getCCItem(i)->getYPos() + h_height - OFFSET_INNER_MID; - ccw_body->getCCItem(i)->setYPos(y_item); - } -} - void CProgressWindow::initStatus(const unsigned int prog, const unsigned int max, const string &statusText, CProgressBar *pBar) { pBar->allowPaint(true); @@ -239,3 +209,33 @@ void CProgressWindow::paint(bool do_save_bg) fitItems(); CComponentsWindow::paint(do_save_bg); } + +void CProgressWindow::setTitle(const neutrino_locale_t 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 +} + +void CProgressWindow::setTitle(const 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; isize() ;i++){ + int y_item = ccw_body->getCCItem(i)->getYPos() + h_height - OFFSET_INNER_MID; + ccw_body->getCCItem(i)->setYPos(y_item); + } +} \ No newline at end of file From c340ab499b6b2869631748d90ee62027ed6b63bf Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 17 Feb 2017 21:13:12 +0100 Subject: [PATCH 07/20] CProgressWindow: rename InitProgressItem -> getProgressItem more plausible Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0281b7e8c7243346c1aac3ddb0345a53de104cee Author: Thilo Graf Date: 2017-02-17 (Fri, 17 Feb 2017) ------------------ This commit was generated by Migit --- src/gui/widget/progresswindow.cpp | 6 +++--- src/gui/widget/progresswindow.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index ad26a2a53..490b1396e 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -92,10 +92,10 @@ void CProgressWindow::Init( signal *statusSignal, addWindowItem(status_txt); //create local_bar object - local_bar = InitProgressItem(); + local_bar = getProgressItem(); //create global_bar object - global_bar = InitProgressItem(); + global_bar = getProgressItem(); //set window height h_height = ccw_head->getHeight(); @@ -107,7 +107,7 @@ void CProgressWindow::Init( signal *statusSignal, setCenterPos(); } -CProgressBar* CProgressWindow::InitProgressItem() +CProgressBar* CProgressWindow::getProgressItem() { CProgressBar *pBar = new CProgressBar(); pBar->allowPaint(false); diff --git a/src/gui/widget/progresswindow.h b/src/gui/widget/progresswindow.h index 2b8d443b3..c50d8840d 100644 --- a/src/gui/widget/progresswindow.h +++ b/src/gui/widget/progresswindow.h @@ -44,7 +44,7 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget sigc::signal *localSignal, sigc::signal *globalSignal); - CProgressBar* InitProgressItem(); + CProgressBar* getProgressItem(); void initStatus(const unsigned int prog, const unsigned int max, const std::string &statusText, CProgressBar *pBar); void fitItems(); From 03c524653940cbad2e31dbe1589051002b1cf869 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 17 Feb 2017 21:19:32 +0100 Subject: [PATCH 08/20] CProgressWindow: small cosmetic Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1e6997e3af83be3bcb1a8d1769a0db3783884d51 Author: Thilo Graf Date: 2017-02-17 (Fri, 17 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/progresswindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index 490b1396e..e2c077f30 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -69,7 +69,7 @@ CProgressWindow::CProgressWindow(const std::string &title, } void CProgressWindow::Init( signal *statusSignal, - signal *localSignal, + signal *localSignal, signal *globalSignal) { if (statusSignal) From 5b83d817c9041b9b5756b944b37a1bd3cd26d730 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 17 Feb 2017 21:40:48 +0100 Subject: [PATCH 09/20] CTestMenu: add samples for progress window with signals Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/42619c8d2cd82ef0b8fdbf110102487e012fedd1 Author: Thilo Graf Date: 2017-02-17 (Fri, 17 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/test_menu.cpp | 47 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 54f6af3e4..2572883ab 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -838,23 +838,50 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) return res; } else if (actionKey == "progress_window"){ - CProgressWindow progress0("Progress Single Test"); - progress0.paint(); - size_t max = 10; + //classical + CProgressWindow pw0("Progress Single Test"); + pw0.paint(); + size_t max = 3; for(size_t i = 0; i< max; i++){ - progress0.showStatus(i, max, to_string(i)); + pw0.showStatus(i, max, to_string(i)); sleep(1); } - progress0.hide(); + pw0.hide(); - CProgressWindow progress1("Progress Local/Global Test"); - progress1.paint(); + CProgressWindow pw1("Progress Local/Global Test"); + pw1.paint(); for(size_t i = 0; i< max; i++){ - progress1.showLocalStatus(i, max, to_string(i)); - progress1.showGlobalStatus(i, max, to_string(i)); + pw1.showGlobalStatus(i, max, to_string(i)); + for(size_t j = 0; j< max; j++){ + pw1.showLocalStatus(j, max, to_string(j)); + sleep(1); + } + } + pw1.hide(); + + //with signals + sigc::signal OnProgress0, OnProgress1; + CProgressWindow pw2("Progress Single Test -> single Signal", 700, 200, &OnProgress0); + pw2.paint(); + + for(size_t i = 0; i< max; i++){ + OnProgress0(i, max, to_string(i)); sleep(1); } - progress1.hide(); + pw2.hide(); + + CProgressWindow pw3("Progress Single Test -> dub Signal", 700, 200, NULL, &OnProgress0, &OnProgress1); + pw3.paint(); + + for(size_t i = 0; i< max; i++){ + OnProgress1(i, max, to_string(i)); + for(size_t j = 0; j< max; j++){ + OnProgress0(j, max, to_string(j)); + sleep(1); + } + } + pw3.hide(); + return menu_return::RETURN_REPAINT; } else if (actionKey == "hintbox_test") From 0a18ce9055154eae92b46125b935656e3b2de752 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 23 Feb 2017 21:25:20 +0100 Subject: [PATCH 10/20] CProgressWindow: syncronize paint of local and global bar on first paint In some cases progress bars were painted with delay. Now it should be looks better. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f478c75e26668d830bb28a4028198bb6c0c1644d Author: Thilo Graf Date: 2017-02-23 (Thu, 23 Feb 2017) ------------------ This commit was generated by Migit --- src/gui/widget/progresswindow.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index e2c077f30..f80d20de7 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -79,7 +79,7 @@ void CProgressWindow::Init( signal *statusSignal, if (globalSignal) *globalSignal->connect(mem_fun(*this, &CProgressWindow::showGlobalStatus)); - global_progress = local_progress = 100; + global_progress = local_progress = 0; showFooter(false); @@ -144,7 +144,9 @@ void CProgressWindow::showStatus(const unsigned int prog, const unsigned int max void CProgressWindow::showGlobalStatus(const unsigned int prog, const unsigned int max, const string &statusText) { - if (global_progress == prog) + if (!local_bar->isPainted()) + showLocalStatus(0, 0, statusText); // ensure first paint of local bar on painted global bar at same time + if (global_progress == prog && global_bar->isPainted()) return; global_progress = prog; initStatus(prog, max, statusText, global_bar); @@ -156,7 +158,7 @@ void CProgressWindow::showGlobalStatus(const unsigned int prog, const unsigned i void CProgressWindow::showLocalStatus(const unsigned int prog, const unsigned int max, const string &statusText) { - if (local_progress == prog) + if (local_progress == prog && local_bar->isPainted()) return; local_progress = prog; initStatus(prog, max, statusText, local_bar); From 2e9293fdc2323a912a87f08deab7f89420806f1b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 23 Feb 2017 21:41:35 +0100 Subject: [PATCH 11/20] CMovieBrowser: visualize global loading of defined directories Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6e487f28400648b3f08529137a326759d1a3834e Author: Thilo Graf Date: 2017-02-23 (Thu, 23 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.cpp | 10 ++++++---- src/gui/moviebrowser/mb.h | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index b6d49b888..c28e5ed6c 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -2754,7 +2754,7 @@ void CMovieBrowser::updateDir(void) void CMovieBrowser::loadAllTsFileNamesFromStorage(void) { //TRACE("[mb]->loadAllTsFileNamesFromStorage \n"); - int i,size; + size_t i,size; m_movieSelectionHandler = NULL; m_dirNames.clear(); @@ -2765,8 +2765,10 @@ void CMovieBrowser::loadAllTsFileNamesFromStorage(void) size = m_dir.size(); for (i=0; i < size;i++) { - if (*m_dir[i].used == true) + if (*m_dir[i].used == true){ + OnLoadDir(i+1, size, m_dir[i].name); loadTsFileNamesFromDir(m_dir[i].name); + } } TRACE("[mb] Dir%d, Files:%d\n", (int)m_dirNames.size(), (int)m_vMovieInfo.size()); @@ -2885,7 +2887,7 @@ bool CMovieBrowser::loadTsFileNamesFromDir(const std::string & dirname) } else { result |= addFile(flist[i], dirItNr); } - OnLoadFile(i, flist.size(), g_Locale->getText(LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES)); + OnLoadFile(i, flist.size(), dirname ); } //result = true; } @@ -3124,7 +3126,7 @@ void CMovieBrowser::loadMovies(bool doRefresh) { TRACE("[mb] loadMovies: \n"); - CProgressWindow loadBox((show_mode == MB_SHOW_YT) ? LOCALE_MOVIEPLAYER_YTPLAYBACK : LOCALE_MOVIEBROWSER_HEAD, 500, 150, show_mode == MB_SHOW_YT ? &ytparser.OnLoadVideoInfo : &OnLoadFile); + CProgressWindow loadBox((show_mode == MB_SHOW_YT) ? LOCALE_MOVIEPLAYER_YTPLAYBACK : LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES, 700, 150, NULL, show_mode == MB_SHOW_YT ? &ytparser.OnLoadVideoInfo : &OnLoadFile, &OnLoadDir); loadBox.enableShadow(); loadBox.paint(); diff --git a/src/gui/moviebrowser/mb.h b/src/gui/moviebrowser/mb.h index 3f29afdea..0b37d4c2e 100644 --- a/src/gui/moviebrowser/mb.h +++ b/src/gui/moviebrowser/mb.h @@ -363,6 +363,7 @@ class CMovieBrowser : public CMenuTarget bool supportedExtension(CFile &file); bool addFile(CFile &file, int dirItNr); sigc::signal OnLoadFile; + sigc::signal OnLoadDir; }; // I tried a lot to use the menu.cpp as ListBox selection, and I got three solution which are all garbage. From d1083f05d34f4a1ebcb16ffed2992b821fcd236e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 25 Feb 2017 13:25:50 +0100 Subject: [PATCH 12/20] CComponentsWindow: use percentage conversion for dimension values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dimension values for windows below a certain size are often not really useful, even with regard to different resolutions. Usage of percent values could be easier to handle. In the constructor, the argument values für dimesions must be only between 1 and 100 to achieve this. TODO: behavior inside parents Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/055fef8b58f1959a6243be60b2767cc2a0c4deb5 Author: Thilo Graf Date: 2017-02-25 (Sat, 25 Feb 2017) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_window.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index 80455a5ad..ab0663a2d 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -169,9 +169,13 @@ void CComponentsWindow::initWindowSize() if (cc_parent) return; + if (width > 0 && width <= 100) //percentage conversion TODO: behavior inside parent + width = frameBuffer->getScreenWidth()*width/100; if (width == 0 || (unsigned)width > frameBuffer->getScreenWidth()) width = frameBuffer->getScreenWidth(); + if (height > 0 && height <= 100) //percentage conversion TODO: behavior inside parent + height = frameBuffer->getScreenHeight()*height/100; if (height == 0 || (unsigned)height > frameBuffer->getScreenHeight()) height = frameBuffer->getScreenHeight(); } From de9ed22811ca4e05a016e3cddf4c736072faca65 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 25 Feb 2017 21:53:16 +0100 Subject: [PATCH 13/20] CComponentsWindow: add more tags for doxygen Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9b6893ee3454e4fb679bc7795838551b67773e18 Author: Thilo Graf Date: 2017-02-25 (Sat, 25 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_window.h | 305 ++++++++++++++++++++++++----- 1 file changed, 256 insertions(+), 49 deletions(-) diff --git a/src/gui/components/cc_frm_window.h b/src/gui/components/cc_frm_window.h index 7b2f71796..cb1b5288e 100644 --- a/src/gui/components/cc_frm_window.h +++ b/src/gui/components/cc_frm_window.h @@ -128,10 +128,47 @@ class CComponentsWindow : public CComponentsForm { CC_WINDOW_ITEM_HEADER = 0 }; - ///simple constructor for CComponentsWindow, this shows a window over full screen + + enum + { + CC_WINDOW_LEFT_SIDEBAR = 1, + CC_WINDOW_RIGHT_SIDEBAR = 2 + }; + + /**simple constructor for CComponentsWindow, this shows a window over full screen + * @param[in] parent + * @li optional: expects type CComponentsForm * as possible parent object, default = NULL + */ CComponentsWindow(CComponentsForm *parent = NULL); - ///advanced constructor for CComponentsWindow, provides parameters for the most required properties, and caption as string, x_pos or y_pos = 0 will center window + /** + * advanced constructor for CComponentsWindow, provides parameters for the most required properties, and caption as string, x_pos or y_pos = 0 will center window + * @param[in] x_pos + * @li expects type const &int, defines x position on screen + * @param[in] y_pos + * @li expects type const &int, defines y position on screen + * @param[in] w + * @li expects type const &int, width of window, Note: value = 0 uses full screen, value > 0 to 100 interpreted as percent value of screen, value > 100 use native lines count on screen + * @param[in] h + * @li expects type const &int, height of window, Note: value = 0 uses full screen, value > 0 to 100 interpreted as percent value of screen, value > 100 use native lines count on screen + * @param[in] caption + * @li optional: expects type const std::string&, defines title of window header + * @param[in] iconname + * @li optional: expects type const std::string&, defines icon name of window header + * @param[in] parent + * @li optional: expects type CComponentsForm * as possible parent object, default = NULL + * @param[in] shadow_mode + * @li optional: expects type int as mode, default = CC_SHADOW_OFF + * possible values are + * CC_SHADOW_ON = (CC_SHADOW_RIGHT | CC_SHADOW_BOTTOM | CC_SHADOW_CORNER_BOTTOM_LEFT | CC_SHADOW_CORNER_BOTTOM_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT) + * @see cc_types.h + * @param[in] color_frame + * @li optional: expects type fb_pixel_t, defines frame color, default = COL_FRAME_PLUS_0 + * @param[in] color_body + * @li optional: expects type fb_pixel_t, defines color color, default = COL_MENUCONTENT_PLUS_0 + * @param[in] color_shadow + * @li optional: expects type fb_pixel_t, defines shadow color, default = COL_SHADOW_PLUS_0 + */ CComponentsWindow( const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& caption = "", const std::string& iconname = "", @@ -141,7 +178,12 @@ class CComponentsWindow : public CComponentsForm fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); - ///advanced constructor for CComponentsWindow, provides parameters for the most required properties, and caption from locales, x_pos or y_pos = 0 will center window + /** + * advanced constructor for CComponentsWindow, provides parameters for the most required properties + * @param[in] locale_text + * @li optional: expects type neutrino_locale_t, defines title of window header + * @see for other parameters take a look to CComponentsWindow base class above + */ CComponentsWindow( const int& x_pos, const int& y_pos, const int& w, const int& h, neutrino_locale_t locale_text = NONEXISTANT_LOCALE, const std::string& iconname = "", @@ -151,90 +193,249 @@ class CComponentsWindow : public CComponentsForm fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); - ///add item to body object, also usable is addCCItem() to add items to the windo object + /** + * Add an item to body object, also usable is addCCItem() to add items to the window object + * @param[in] cc_Item + * @li expects type CComponentsItem* , defines a cc item + * @return Returns item ID + * @see Take a look to cc_types.h for possible types. + */ int addWindowItem(CComponentsItem* cc_Item); - ///allow/disallow paint a footer, default true, see also ccw_show_footer, showHeader() - void showFooter(bool show = true){ccw_show_footer = show; initCCWItems();}; - ///allow/disallow paint a header, default true, see also ccw_show_header, showFooter() - void showHeader(bool show = true){ccw_show_header = show; initCCWItems();}; + /** + * enable/disable paint of footer, default true + * @param[in] show + * @li expects type bool, default = true + * @see ccw_show_footer, showHeader() + */ + void showFooter(bool show = true){ccw_show_footer = show; initCCWItems();} - enum - { - CC_WINDOW_LEFT_SIDEBAR = 1, - CC_WINDOW_RIGHT_SIDEBAR = 2 - }; - ///allow/disallow paint a sidebar, default are enabled + /** + * enable/disable paint of header, default true + * @param[in] show + * @li expects type bool, default = true + * @see ccw_show_header, showFooter() + */ + void showHeader(bool show = true){ccw_show_header = show; initCCWItems();} + + /** + * enable/disable paint of sidebar, + * @param[in] show + * @li optional: expects type const int&, default = enabled + */ void enableSidebar(const int& sidbar_type = CC_WINDOW_LEFT_SIDEBAR | CC_WINDOW_RIGHT_SIDEBAR); - ///set caption in header with string, see also getHeaderObject() + /** + * sets title text in header + * @param[in] text + * @li expects type const std::string&, defines title of window header + * @param[in] align_mode + * @li optional: expects type const int&, defines allignment of title text + * @see CTextBox for alignment modes + */ void setWindowCaption(const std::string& text, const int& align_mode = CTextBox::NO_AUTO_LINEBREAK){ccw_caption = text; ccw_align_mode = align_mode;} - ///set header text color - void setWindowHeaderTextColor(const fb_pixel_t& color){ccw_col_head_text = color;} - ///set background to header - void setWindowHeaderColor(const fb_pixel_t& color){ccw_col_head = color;} - ///set caption in header from locales, see also getHeaderObject() + + /** + * sets title text in header + * @param[in] text + * @li expects type neutrino_locale_t + * @param[in] align_mode + * @li optional: expects type const int&, defines allignment of title text + * @see CTextBox for alignment modes + */ void setWindowCaption(neutrino_locale_t locale_text, const int& align_mode = CTextBox::NO_AUTO_LINEBREAK); - ///set caption alignment, see CTextBox for possible modes + + /** + * Sets header text color + * @param[in] const fb_pixel_t& + * @li expects type const fb_pixel_t& + */ + void setWindowHeaderTextColor(const fb_pixel_t& color){ccw_col_head_text = color;} + + /** + * Sets header background color + * @param[in] const fb_pixel_t& + * @li expects type const fb_pixel_t& + */ + void setWindowHeaderColor(const fb_pixel_t& color){ccw_col_head = color;} + + /** + * sets title text alignment + * @param[in] align_mode + * @li expects type const int& + * @see CTextBox for alignment modes + */ void setWindowCaptionAlignment(const int& align_mode){ccw_align_mode = align_mode;}; - ///set icon name in header, see also getHeaderObject() + /** + * Sets icon name of window header. + * @param[in] iconname + * @li expects type const std::string& + */ void setWindowIcon(const std::string& iconname){ccw_icon_name = iconname; initHeader();}; ///set default header icon buttons, see also getHeaderObject() - void setWindowHeaderButtons(const int& buttons){ccw_buttons = buttons;}; + /** + * Sets context buttons in window header. + * @param[in] buttons + * @li expects type const int& + * @note possible types are: + * CC_BTN_HELP, + CC_BTN_INFO, + CC_BTN_MENU, + CC_BTN_EXIT, + CC_BTN_MUTE_ZAP_ACTIVE, + CC_BTN_MUTE_ZAP_INACTIVE, + CC_BTN_OKAY, + CC_BTN_MUTE, + CC_BTN_UP, + CC_BTN_DOWN, + CC_BTN_LEFT, + CC_BTN_RIGHT, + CC_BTN_FORWARD, + CC_BTN_BACKWARD, + CC_BTN_PAUSE, + CC_BTN_PLAY, + CC_BTN_RECORD_ACTIVE, + CC_BTN_RECORD_INACTIVE, + CC_BTN_RECORD_STOP, + * @see cc_frm_header.h for current types + */ + void setWindowHeaderButtons(const int& buttons){ccw_buttons = buttons;} - ///returns a pointer to the internal header object, use this to get access to header properities - CComponentsHeader* getHeaderObject(){return ccw_head;}; + /** + * Gets a pointer to the internal header object, use this to get direct access to header properities + * @return CComponentsHeader* + */ + CComponentsHeader* getHeaderObject(){return ccw_head;} - ///returns a pointer to the internal body object, use this to get access to body properities - CComponentsForm* getBodyObject(){return ccw_body;}; - ///returns a pointer to the internal footer object, use this to get access to footer properities - CComponentsFooter* getFooterObject(){return ccw_footer;}; + /** + * Gets a pointer to the internal body object, use this to get access to body properities + * @return CComponentsForm* + */ + CComponentsForm* getBodyObject(){return ccw_body;} - ///set background to footer + /** + * Gets a pointer to the internal footer object, use this to get access to footer properities + * @return CComponentsFooter* + */ + CComponentsFooter* getFooterObject(){return ccw_footer;} + + /** + * Sets footer background color + * @param[in] color + * @li expects type const fb_pixel_t& + */ void setWindowFooterColor(const fb_pixel_t& color){ccw_col_footer = color;} - ///set font for footer buttons + + /** + * Sets font for footer buttons + * @param[in] font_type + * @li expects type Font* + */ void setWindowFooterFont(Font* font_type){ccw_button_font = font_type;} - ///returns a pointer to the internal left side bar object, use this to get access to left sidebar properities - CComponentsFrmChain* getLeftSidebarObject(){return ccw_left_sidebar;}; - ///returns a pointer to the internal right side bar object, use this to get access to right sidebar properities - CComponentsFrmChain* getRightSidebarObject(){return ccw_right_sidebar;}; - ///sets width of sidebars - void setWidthSidebar(const int& sidebar_width){ccw_w_sidebar = sidebar_width; initCCWItems();}; + /** + * Gets a pointer to the internal left side bar object, use this to get access to left sidebar properities + * @return CComponentsFrmChain* + */ + CComponentsFrmChain* getLeftSidebarObject(){return ccw_left_sidebar;} - ///sets current page, NOTE: this is simliar with setCurrentPage() known from basic class CComponentsForm, but here it is related only for window body object + /** + * Gets a pointer to the internal right side bar object, use this to get access to right sidebar properities + * @return CComponentsFrmChain* + */ + CComponentsFrmChain* getRightSidebarObject(){return ccw_right_sidebar;} + + /** + * Sets width of sidebars + * @param[in] sidebar_width + * @li expects type const int& + */ + void setWidthSidebar(const int& sidebar_width){ccw_w_sidebar = sidebar_width; initCCWItems();} + + /** + * Sets current page number + * @param[in] sidebar_width + * @li expects type const int& + * @note This is simliar to setCurrentPage() known from basic class CComponentsForm, but here it is related only for window body object. + */ void setCurrentPage(const u_int8_t& current_page); - ///get current page, NOTE: this is simliar with getCurrentPage() known from basic class CComponentsForm, but here it is related only for window body object + + /** + * Gets current page number + * @return CComponentsFrmChain* + * @note This simliar to getCurrentPage() known from basic class CComponentsForm, but here it is related only for window body object + */ u_int8_t getCurrentPage(); - ///paint window body items, this paints only the current page, body = page, current page is definied in body object, see setCurrentPage() + /** + * Paints window body items, this paints only the current page, body = page, current page is definied in body object, see setCurrentPage() + * @param[in] do_save_bg + * @li optional: expects type bool, default = CC_SAVE_SCREEN_NO (false), sets background save mode + */ void paintCurPage(bool do_save_bg = CC_SAVE_SCREEN_NO); - ///paint defined page of body, parameter number 0...n + + /** + * Paints defined page of body, parameter number 0...n + * @param[in] page_number + * @li expects type const u_int8_t& as page number + * @param[in] do_save_bg + * @li optional: expects type bool, default = CC_SAVE_SCREEN_NO (false), sets background save mode + */ void paintPage(const u_int8_t& page_number, bool do_save_bg = CC_SAVE_SCREEN_NO); - ///enable/disable page scroll, parameter1 default enabled for up/down keys, only for body! + + /** + * enable/disable page scroll + * @param[in] mode + * @li optional: expects type const int&, default enabled for up/down keys, only for body! + */ void enablePageScroll(const int& mode = PG_SCROLL_M_UP_DOWN_KEY); - ///set width of body scrollbar + /** + * Sets width of body scrollbar + * @param[in] crollbar_width + * @li expects type const int& + */ void setScrollBarWidth(const int& scrollbar_width); - ///refresh position and dimension and reinitialize elemenatary properties + /** + * Reinit position and dimensions and reinitialize mostly elemenatary properties + */ void Refresh(){initCCWItems();}; - ///paint all window items, this overwriting paint() from CComponentsForm + /** + * Paint window + * @param[in] do_save_bg + * @li optional: expects type bool, sets background save mode + */ void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); - ///adds additional exec key to current collection, default exit keys are CRCInput::RC_home and CRCInput::RC_setup + /** + * Adds an additional exec key to current collection, default exit keys are CRCInput::RC_home and CRCInput::RC_setup + * @param[in] key + * @li expects type const neutrino_msg_t& + * @see river/rcinput.h for possible keys + */ virtual void addExitKey(const neutrino_msg_t& key){getBodyObject()->addExitKey(key);} - ///remove all current exec keys from current collection, NOTE: use addExitKey() if new exec key is required + + /** + * Removes all current exec keys from current collection. + * @note use addExitKey() if new exec key is required + */ virtual void removeExitKeys(){getBodyObject()->removeExitKeys();} }; class CComponentsWindowMax : public CComponentsWindow { public: - ///simple constructor for CComponentsWindow, provides parameters for caption as string and icon, this shows a centered window based up current screen settings + /** + * Simple constructor for CComponentsWindow, this shows only a centered window based up current screen settings + * @see for other parameters take a look to CComponentsWindow base class above + * @param[in] caption + * @li expects type const std::string&, defines title of window header + * @see for other parameters take a look to CComponentsWindow base class above + */ CComponentsWindowMax( const std::string& caption, const std::string& iconname = "", CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, @@ -242,7 +443,13 @@ class CComponentsWindowMax : public CComponentsWindow fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); - ///simple constructor for CComponentsWindow, provides parameters for caption from locales and icon, this shows a centered window based up current screen settings + /** + * Simple constructor for CComponentsWindow, this shows only a centered window based up current screen settings + * @see for other parameters take a look to CComponentsWindow base class above + * @param[in] locale_text + * @li expects type neutrino_locale_t, defines title of window header + * @see for other parameters take a look to CComponentsWindow base class above + */ CComponentsWindowMax( neutrino_locale_t locale_caption, const std::string& iconname = "", CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, From 259ace12c277a20dd09a57ba6e143af026b57693 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 25 Feb 2017 21:58:16 +0100 Subject: [PATCH 14/20] CMovieBrowser: use percental calculated dimensions for progress window Useful for possible for different screen resolutions. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/11d8be5307342bdce81dd4ea6c868171566da716 Author: Thilo Graf Date: 2017-02-25 (Sat, 25 Feb 2017) ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index c28e5ed6c..72268adc4 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -3126,7 +3126,7 @@ void CMovieBrowser::loadMovies(bool doRefresh) { TRACE("[mb] loadMovies: \n"); - CProgressWindow loadBox((show_mode == MB_SHOW_YT) ? LOCALE_MOVIEPLAYER_YTPLAYBACK : LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES, 700, 150, NULL, show_mode == MB_SHOW_YT ? &ytparser.OnLoadVideoInfo : &OnLoadFile, &OnLoadDir); + CProgressWindow loadBox((show_mode == MB_SHOW_YT) ? LOCALE_MOVIEPLAYER_YTPLAYBACK : LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES, 50/*%*/, 25/*%*/, NULL, show_mode == MB_SHOW_YT ? &ytparser.OnLoadVideoInfo : &OnLoadFile, &OnLoadDir); loadBox.enableShadow(); loadBox.paint(); From 7696395d2222cf8ba19ecad288248f3a2eac303b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 25 Feb 2017 22:09:28 +0100 Subject: [PATCH 15/20] CProgressWindow: use percental calculated dimensions as default Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ed9edb5dada875be176ce53ea09804f692972aea Author: Thilo Graf Date: 2017-02-25 (Sat, 25 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/progresswindow.cpp | 2 -- src/gui/widget/progresswindow.h | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index f80d20de7..f8262f972 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -123,8 +123,6 @@ CProgressBar* CProgressWindow::getProgressItem() pBar->setColorFrame(COL_PROGRESSBAR_ACTIVE_PLUS_0); addWindowItem(pBar); - ccw_body->setHeight(y_tmp+OFFSET_INNER_MID); - return pBar; } diff --git a/src/gui/widget/progresswindow.h b/src/gui/widget/progresswindow.h index c50d8840d..10624dea8 100644 --- a/src/gui/widget/progresswindow.h +++ b/src/gui/widget/progresswindow.h @@ -28,8 +28,8 @@ #include #include "menue.h" -#define PW_MIN_WIDTH 700 -#define PW_MIN_HEIGHT 100 +#define PW_MIN_WIDTH 50 //% +#define PW_MIN_HEIGHT 25 //% class CProgressWindow : public CComponentsWindow, public CMenuTarget { From 8bf3e6c5b7b49880ef1b4e1a35bb542db3d27051 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 25 Feb 2017 23:13:30 +0100 Subject: [PATCH 16/20] hintbox.h: use calculated dimensions as default Useful for possible different screen resolutions. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/85fc37090e633f6efbbf137928208c77842786e8 Author: Thilo Graf Date: 2017-02-25 (Sat, 25 Feb 2017) ------------------ This commit was generated by Migit --- src/gui/widget/hintbox.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/widget/hintbox.h b/src/gui/widget/hintbox.h index 187752286..e7261babf 100644 --- a/src/gui/widget/hintbox.h +++ b/src/gui/widget/hintbox.h @@ -32,9 +32,10 @@ #include -#define HINTBOX_MIN_WIDTH 320 -#define HINTBOX_MIN_HEIGHT 125 -#define HINTBOX_MAX_HEIGHT 520 +#define HINTBOX_MIN_WIDTH CFrameBuffer::getInstance()->scale2Res(320) +#define HINTBOX_MIN_HEIGHT CFrameBuffer::getInstance()->scale2Res(125) +#define HINTBOX_MAX_HEIGHT CFrameBuffer::getInstance()->scale2Res(520) + #define HINTBOX_DEFAULT_TIMEOUT g_settings.timing[SNeutrinoSettings::TIMING_POPUP_MESSAGES] #define NO_TIMEOUT 0 #define DEFAULT_TIMEOUT -1 From 554118ac6500a1c6d7bcabaa99ab5d876558c5e4 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 26 Feb 2017 13:57:22 +0100 Subject: [PATCH 17/20] CBuildInfo: use percental calculated dimensions Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/04ba522dab3883148a0940a0e21c55b0f48db66e Author: Thilo Graf Date: 2017-02-26 (Sun, 26 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/buildinfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/buildinfo.cpp b/src/gui/buildinfo.cpp index 23f81f85b..50b480964 100644 --- a/src/gui/buildinfo.cpp +++ b/src/gui/buildinfo.cpp @@ -35,7 +35,7 @@ using namespace std; -CBuildInfo::CBuildInfo(bool show) : CComponentsWindow(0, 0, 700, 500, LOCALE_BUILDINFO_MENU, NEUTRINO_ICON_INFO) +CBuildInfo::CBuildInfo(bool show) : CComponentsWindow(0, 0, 90/*%*/, 90/*%*/, LOCALE_BUILDINFO_MENU, NEUTRINO_ICON_INFO) { initVarBuildInfo(); if (show) From 874b3bc88679a5afd708db877733c7c1978bf17a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 26 Feb 2017 13:58:31 +0100 Subject: [PATCH 18/20] CTextBox: use scaled base dimensions Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6b4e57ad73b377a9740c776f48d04439cd64d66a Author: Thilo Graf Date: 2017-02-26 (Sun, 26 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/textbox.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index f8ed60af4..b7fe4eccd 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -68,14 +68,14 @@ #endif #include -#define SCROLL_FRAME_WIDTH 10 -#define SCROLL_MARKER_BORDER 2 +#define SCROLL_FRAME_WIDTH SCROLLBAR_WIDTH +#define SCROLL_MARKER_BORDER OFFSET_INNER_MIN -#define MAX_WINDOW_WIDTH (g_settings.screen_EndX - g_settings.screen_StartX - 40) -#define MAX_WINDOW_HEIGHT (g_settings.screen_EndY - g_settings.screen_StartY - 40) +#define MAX_WINDOW_WIDTH (g_settings.screen_EndX - g_settings.screen_StartX - CFrameBuffer::getInstance()->scale2Res(40)) +#define MAX_WINDOW_HEIGHT (g_settings.screen_EndY - g_settings.screen_StartY - CFrameBuffer::getInstance()->scale2Res(40)) #define MIN_WINDOW_WIDTH ((g_settings.screen_EndX - g_settings.screen_StartX)>>1) -#define MIN_WINDOW_HEIGHT 40 +#define MIN_WINDOW_HEIGHT CFrameBuffer::getInstance()->scale2Res(40) CTextBox::CTextBox(const char * text, Font* font_text, const int pmode, const CBox* position, CFBWindow::color_t textBackgroundColor) From 8805626dbc84e949ae7d98a890c04aac3846509a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 26 Feb 2017 14:40:18 +0100 Subject: [PATCH 19/20] CHintBox: fix passed width parameter Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/820ea4db3b9ff3af13c2df962dd391c96afba875 Author: Thilo Graf Date: 2017-02-26 (Sun, 26 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/hintbox.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 45ef2b6ed..ff62b35a7 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -67,7 +67,7 @@ CHintBox::CHintBox( const neutrino_locale_t Caption, const char * const Picon, const int& header_buttons, const int& text_mode, - const int& indent): CComponentsWindow( 0, 0, width, + const int& indent): CComponentsWindow( 0, 0, Width, HINTBOX_MIN_HEIGHT, Caption, string(Icon == NULL ? "" : Icon), @@ -84,7 +84,7 @@ CHintBox::CHintBox( const char * const Caption, const char * const Picon, const int& header_buttons, const int& text_mode, - const int& indent):CComponentsWindow( 0, 0, width, + const int& indent):CComponentsWindow( 0, 0, Width, HINTBOX_MIN_HEIGHT, Caption, string(Icon == NULL ? "" : Icon), @@ -101,7 +101,7 @@ CHintBox::CHintBox( const neutrino_locale_t Caption, const char * const Picon, const int& header_buttons, const int& text_mode, - const int& indent):CComponentsWindow( 0, 0, width, + const int& indent):CComponentsWindow( 0, 0, Width, HINTBOX_MIN_HEIGHT, Caption, string(Icon == NULL ? "" : Icon), @@ -118,7 +118,7 @@ CHintBox::CHintBox( const char * const Caption, const char * const Picon, const int& header_buttons, const int& text_mode, - const int& indent):CComponentsWindow( 0, 0, width, + const int& indent):CComponentsWindow( 0, 0, Width, HINTBOX_MIN_HEIGHT, Caption, string(Icon == NULL ? "" : Icon), From 1a3ef52004950d394e2ea4665452fba78b6a8b85 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 26 Feb 2017 17:32:52 +0100 Subject: [PATCH 20/20] CHintBox: use OFFSET_INNER_MID as defaul value for W_RAME Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/17a9c691dacc7421827c63a09995e4905ddbf083 Author: Thilo Graf Date: 2017-02-26 (Sun, 26 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/hintbox.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/hintbox.h b/src/gui/widget/hintbox.h index e7261babf..9019228a6 100644 --- a/src/gui/widget/hintbox.h +++ b/src/gui/widget/hintbox.h @@ -40,7 +40,7 @@ #define NO_TIMEOUT 0 #define DEFAULT_TIMEOUT -1 //frame around hint container as indent -#define W_FRAME std::max(HINTBOX_MIN_WIDTH, HINTBOX_MIN_HEIGHT) * 2/100 +#define W_FRAME OFFSET_INNER_MID //frame color around hint/message box #define HINTBOX_DEFAULT_FRAME_COLOR COL_FRAME #define TIMEOUT_BAR_HEIGHT OFFSET_SHADOW/2