From ae97c4e3985532180cfde87829c31783042aacd4 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 10 Feb 2017 01:32:51 +0100 Subject: [PATCH 1/8] CProgressWindow: allow variable max value, allow define dimensions Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/547238bfdd9457311f49fac7692ccc88f4be8ca5 Author: Thilo Graf Date: 2017-02-10 (Fri, 10 Feb 2017) --- src/gui/widget/progresswindow.cpp | 20 ++++++++++---------- src/gui/widget/progresswindow.h | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index f7c84e024..b077cf2f0 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -33,8 +33,8 @@ #include #include -CProgressWindow::CProgressWindow(CComponentsForm *parent) -: CComponentsWindow(0, 0, 700, 200, string(), NEUTRINO_ICON_INFO, parent, CC_SHADOW_ON) +CProgressWindow::CProgressWindow(CComponentsForm *parent, const int &dx, const int &dy) +: CComponentsWindow(0, 0, dx, dy, string(), NEUTRINO_ICON_INFO, parent, CC_SHADOW_ON) { Init(); } @@ -48,7 +48,7 @@ void CProgressWindow::Init() int x_item = 10; int y_item = 10; - setWidthP(75); + int w_item = width-2*x_item; int h_item = 14; int h_pbar = 20; @@ -86,7 +86,7 @@ void CProgressWindow::Init() y_item += 2*h_pbar; h_height = ccw_head->getHeight(); - height = y_item + h_height; + height = max(height, y_item + h_height); setCenterPos(); } @@ -121,7 +121,7 @@ void CProgressWindow::fitItems() } } -void CProgressWindow::showStatus(const unsigned int prog) +void CProgressWindow::showStatus(const unsigned int prog, const unsigned int max) { if (global_progress == prog) return; @@ -132,17 +132,17 @@ void CProgressWindow::showStatus(const unsigned int prog) global_bar->setHeight(g_height + g_height/2); } - showGlobalStatus(prog); + showGlobalStatus(prog, max); } -void CProgressWindow::showGlobalStatus(const unsigned int prog) +void CProgressWindow::showGlobalStatus(const unsigned int prog, const unsigned int max) { if (global_progress == prog) return; global_bar->allowPaint(true); global_progress = prog; - global_bar->setValues(prog, 100); + global_bar->setValues(prog, (int)max); global_bar->paint(false); #ifdef VFD_UPDATE @@ -150,14 +150,14 @@ void CProgressWindow::showGlobalStatus(const unsigned int prog) #endif // VFD_UPDATE } -void CProgressWindow::showLocalStatus(const unsigned int prog) +void CProgressWindow::showLocalStatus(const unsigned int prog, const unsigned int max) { if (local_progress == prog) return; local_bar->allowPaint(true); local_progress = prog; - local_bar->setValues(prog, 100); + local_bar->setValues(prog, (int)max); local_bar->paint(false); #ifdef VFD_UPDATE diff --git a/src/gui/widget/progresswindow.h b/src/gui/widget/progresswindow.h index 6b8ff9e72..eaa8f8c63 100644 --- a/src/gui/widget/progresswindow.h +++ b/src/gui/widget/progresswindow.h @@ -43,16 +43,16 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget public: - CProgressWindow(CComponentsForm *parent = NULL); + CProgressWindow(CComponentsForm *parent = NULL, const int &dx = 700, const int &dy = 200); void setTitle(const neutrino_locale_t title); virtual void hide(); virtual int exec( CMenuTarget* parent, const std::string & actionKey ); - void showStatus(const unsigned int prog); - void showGlobalStatus(const unsigned int prog); + void showStatus(const unsigned int prog, const unsigned int max = 100); + void showGlobalStatus(const unsigned int prog, const unsigned int max = 100); unsigned int getGlobalStatus(void); - void showLocalStatus(const unsigned int prog); + void showLocalStatus(const unsigned int prog, const unsigned int max = 100); void showStatusMessageUTF(const std::string & text); // UTF-8 void paint(bool do_save_bg = true); void setTitle(const std::string & title); From a1598cb703a45414de3038b9cf974bead92d0bd1 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 10 Feb 2017 10:04:40 +0100 Subject: [PATCH 2/8] CProgressWindow: add possibility to show progress via signal Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/842c8e79bbd3bda05919093b5c95a76eb3313f14 Author: Thilo Graf Date: 2017-02-10 (Fri, 10 Feb 2017) --- src/gui/widget/progresswindow.cpp | 46 +++++++++++++++++++++++++------ src/gui/widget/progresswindow.h | 25 +++++++++++++---- 2 files changed, 58 insertions(+), 13 deletions(-) diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index b077cf2f0..1d2c5f0d5 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -33,14 +33,39 @@ #include #include -CProgressWindow::CProgressWindow(CComponentsForm *parent, const int &dx, const int &dy) -: CComponentsWindow(0, 0, dx, dy, string(), NEUTRINO_ICON_INFO, parent, CC_SHADOW_ON) +CProgressWindow::CProgressWindow(CComponentsForm *parent, + const int &dx, + const int &dy, + sigc::signal *statusSignal, + sigc::signal *localSignal, + sigc::signal *globalSignal) + : CComponentsWindow(0, 0, dx, dy, string(), NEUTRINO_ICON_INFO, parent, CC_SHADOW_ON) { - Init(); + Init(statusSignal, localSignal, globalSignal); } -void CProgressWindow::Init() +CProgressWindow::CProgressWindow(const neutrino_locale_t title, + const int &dx, + const int &dy, + sigc::signal *statusSignal, + sigc::signal *localSignal, + sigc::signal *globalSignal) + : CComponentsWindow(0, 0, dx, dy, g_Locale->getText(title), NEUTRINO_ICON_INFO, NULL, CC_SHADOW_ON) { + Init(statusSignal, localSignal, globalSignal); +} + +void CProgressWindow::Init( sigc::signal *statusSignal, + sigc::signal *localSignal, + sigc::signal *globalSignal) +{ + if (statusSignal) + *statusSignal->connect(sigc::mem_fun(*this, &CProgressWindow::showStatus)); + if (localSignal) + *localSignal->connect(sigc::mem_fun(*this, &CProgressWindow::showLocalStatus)); + if (globalSignal) + *globalSignal->connect(sigc::mem_fun(*this, &CProgressWindow::showGlobalStatus)); + global_progress = local_progress = 100; showFooter(false); @@ -60,6 +85,7 @@ void CProgressWindow::Init() status_txt->setDimensionsAll(x_item, y_item, w_item, h_txt); status_txt->setColorBody(col_body); status_txt->doPaintTextBoxBg(true); + status_txt->doPaintBg(false); addWindowItem(status_txt); y_item += h_txt + 10; @@ -121,7 +147,7 @@ void CProgressWindow::fitItems() } } -void CProgressWindow::showStatus(const unsigned int prog, const unsigned int max) +void CProgressWindow::showStatus(const unsigned int prog, const unsigned int max, const std::string &statusText) { if (global_progress == prog) return; @@ -132,10 +158,10 @@ void CProgressWindow::showStatus(const unsigned int prog, const unsigned int max global_bar->setHeight(g_height + g_height/2); } - showGlobalStatus(prog, max); + showGlobalStatus(prog, max, statusText); } -void CProgressWindow::showGlobalStatus(const unsigned int prog, const unsigned int max) +void CProgressWindow::showGlobalStatus(const unsigned int prog, const unsigned int max, const std::string &statusText) { if (global_progress == prog) return; @@ -143,6 +169,8 @@ void CProgressWindow::showGlobalStatus(const unsigned int prog, const unsigned i global_bar->allowPaint(true); global_progress = prog; global_bar->setValues(prog, (int)max); + if (!statusText.empty()) + showStatusMessageUTF(statusText); global_bar->paint(false); #ifdef VFD_UPDATE @@ -150,7 +178,7 @@ void CProgressWindow::showGlobalStatus(const unsigned int prog, const unsigned i #endif // VFD_UPDATE } -void CProgressWindow::showLocalStatus(const unsigned int prog, const unsigned int max) +void CProgressWindow::showLocalStatus(const unsigned int prog, const unsigned int max, const std::string &statusText) { if (local_progress == prog) return; @@ -158,6 +186,8 @@ void CProgressWindow::showLocalStatus(const unsigned int prog, const unsigned in local_bar->allowPaint(true); local_progress = prog; local_bar->setValues(prog, (int)max); + if (!statusText.empty()) + showStatusMessageUTF(statusText); local_bar->paint(false); #ifdef VFD_UPDATE diff --git a/src/gui/widget/progresswindow.h b/src/gui/widget/progresswindow.h index eaa8f8c63..18d4c9273 100644 --- a/src/gui/widget/progresswindow.h +++ b/src/gui/widget/progresswindow.h @@ -38,21 +38,36 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget unsigned int local_progress; int w_bar_frame; int h_height; - void Init(); + void Init( sigc::signal *statusSignal, + sigc::signal *localSignal, + sigc::signal *globalSignal); void fitItems(); public: - CProgressWindow(CComponentsForm *parent = NULL, const int &dx = 700, const int &dy = 200); + CProgressWindow(CComponentsForm *parent = NULL, + const int &dx = 700, + const int &dy = 200, + sigc::signal *status_Signal = NULL, + sigc::signal *localSignal = NULL, + sigc::signal *globalSignal = NULL); + + CProgressWindow(const neutrino_locale_t title, + const int &dx = 700, + const int &dy = 200, + sigc::signal *status_Signal = NULL, + sigc::signal *localSignal = NULL, + sigc::signal *globalSignal = NULL); + void setTitle(const neutrino_locale_t title); virtual void hide(); virtual int exec( CMenuTarget* parent, const std::string & actionKey ); - void showStatus(const unsigned int prog, const unsigned int max = 100); - void showGlobalStatus(const unsigned int prog, const unsigned int max = 100); + void showStatus(const unsigned int prog, const unsigned int max = 100, const std::string &statusText = std::string()); + void showLocalStatus(const unsigned int prog, const unsigned int max = 100, const std::string &statusText = std::string()); + void showGlobalStatus(const unsigned int prog, const unsigned int max = 100, const std::string &statusText = std::string()); unsigned int getGlobalStatus(void); - void showLocalStatus(const unsigned int prog, const unsigned int max = 100); void showStatusMessageUTF(const std::string & text); // UTF-8 void paint(bool do_save_bg = true); void setTitle(const std::string & title); From 36958f4e7ebd84adc3148ff7c01751aa9028402b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 10 Feb 2017 13:00:41 +0100 Subject: [PATCH 3/8] CProgressWindow: use using namespace for std and sigc Makes more clearly Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a3c93f423690812d5996f3ffdce169c7cbddf320 Author: Thilo Graf Date: 2017-02-10 (Fri, 10 Feb 2017) --- src/gui/widget/progresswindow.cpp | 38 ++++++++++++++++--------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index 1d2c5f0d5..564df2204 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -32,13 +32,15 @@ #include #include +using namespace sigc; +using namespace std; CProgressWindow::CProgressWindow(CComponentsForm *parent, const int &dx, const int &dy, - sigc::signal *statusSignal, - sigc::signal *localSignal, - sigc::signal *globalSignal) + signal *statusSignal, + signal *localSignal, + signal *globalSignal) : CComponentsWindow(0, 0, dx, dy, string(), NEUTRINO_ICON_INFO, parent, CC_SHADOW_ON) { Init(statusSignal, localSignal, globalSignal); @@ -47,24 +49,24 @@ CProgressWindow::CProgressWindow(CComponentsForm *parent, CProgressWindow::CProgressWindow(const neutrino_locale_t title, const int &dx, const int &dy, - sigc::signal *statusSignal, - sigc::signal *localSignal, - sigc::signal *globalSignal) + signal *statusSignal, + signal *localSignal, + signal *globalSignal) : CComponentsWindow(0, 0, dx, dy, g_Locale->getText(title), NEUTRINO_ICON_INFO, NULL, CC_SHADOW_ON) { Init(statusSignal, localSignal, globalSignal); } -void CProgressWindow::Init( sigc::signal *statusSignal, - sigc::signal *localSignal, - sigc::signal *globalSignal) +void CProgressWindow::Init( signal *statusSignal, + signal *localSignal, + signal *globalSignal) { if (statusSignal) - *statusSignal->connect(sigc::mem_fun(*this, &CProgressWindow::showStatus)); + *statusSignal->connect(mem_fun(*this, &CProgressWindow::showStatus)); if (localSignal) - *localSignal->connect(sigc::mem_fun(*this, &CProgressWindow::showLocalStatus)); + *localSignal->connect(mem_fun(*this, &CProgressWindow::showLocalStatus)); if (globalSignal) - *globalSignal->connect(sigc::mem_fun(*this, &CProgressWindow::showGlobalStatus)); + *globalSignal->connect(mem_fun(*this, &CProgressWindow::showGlobalStatus)); global_progress = local_progress = 100; @@ -126,7 +128,7 @@ void CProgressWindow::setTitle(const neutrino_locale_t title) #endif // VFD_UPDATE } -void CProgressWindow::setTitle(const std::string & title) +void CProgressWindow::setTitle(const string & title) { setWindowCaption(title); @@ -147,7 +149,7 @@ void CProgressWindow::fitItems() } } -void CProgressWindow::showStatus(const unsigned int prog, const unsigned int max, const std::string &statusText) +void CProgressWindow::showStatus(const unsigned int prog, const unsigned int max, const string &statusText) { if (global_progress == prog) return; @@ -161,7 +163,7 @@ void CProgressWindow::showStatus(const unsigned int prog, const unsigned int max showGlobalStatus(prog, max, statusText); } -void CProgressWindow::showGlobalStatus(const unsigned int prog, const unsigned int max, const std::string &statusText) +void CProgressWindow::showGlobalStatus(const unsigned int prog, const unsigned int max, const string &statusText) { if (global_progress == prog) return; @@ -178,7 +180,7 @@ void CProgressWindow::showGlobalStatus(const unsigned int prog, const unsigned i #endif // VFD_UPDATE } -void CProgressWindow::showLocalStatus(const unsigned int prog, const unsigned int max, const std::string &statusText) +void CProgressWindow::showLocalStatus(const unsigned int prog, const unsigned int max, const string &statusText) { if (local_progress == prog) return; @@ -197,7 +199,7 @@ void CProgressWindow::showLocalStatus(const unsigned int prog, const unsigned in #endif // VFD_UPDATE } -void CProgressWindow::showStatusMessageUTF(const std::string & text) +void CProgressWindow::showStatusMessageUTF(const string & text) { string txt = text; int w_txt = status_txt->getWidth(); @@ -222,7 +224,7 @@ void CProgressWindow::hide() CComponentsWindow::hide(); } -int CProgressWindow::exec(CMenuTarget* parent, const std::string & /*actionKey*/) +int CProgressWindow::exec(CMenuTarget* parent, const string & /*actionKey*/) { if(parent) { From 14f4e34218893c08cfe8bcd59446e77f018c70a9 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 10 Feb 2017 19:10:15 +0100 Subject: [PATCH 4/8] CProgressWindow: add documentation for Doxygen Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/45e77707f0fe880b2036c5e269619c17d200e3f8 Author: Thilo Graf Date: 2017-02-10 (Fri, 10 Feb 2017) --- src/gui/widget/progresswindow.cpp | 2 +- src/gui/widget/progresswindow.h | 156 +++++++++++++++++++++++++++++- 2 files changed, 154 insertions(+), 4 deletions(-) diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index 564df2204..84c74e15d 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -3,7 +3,7 @@ Copyright (C) 2001 by Steffen Hehn 'McClean' Implementation of CComponent Window class. - Copyright (C) 2014 Thilo Graf 'dbt' + Copyright (C) 2014-2017 Thilo Graf 'dbt' License: GPL diff --git a/src/gui/widget/progresswindow.h b/src/gui/widget/progresswindow.h index 18d4c9273..811b5714a 100644 --- a/src/gui/widget/progresswindow.h +++ b/src/gui/widget/progresswindow.h @@ -3,7 +3,7 @@ Copyright (C) 2001 by Steffen Hehn 'McClean' Implementation of CComponent Window class. - Copyright (C) 2014 Thilo Graf 'dbt' + Copyright (C) 2014-2017 Thilo Graf 'dbt' License: GPL @@ -44,7 +44,92 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget void fitItems(); public: - + /**CProgressWindow Constructor + * @param[in] parent + * @li optional: expects type CComponentsForm * as possible parent object, default = NULL + * @param[in] dx + * @li optional: expects type const &int, width of window, default = 0, auto size with declared default values + * @param[in] dy + * @li optional: expects type const &int, height of window, default = 0, auto size with declared default values + * @param[in] status_Signal + * @li optional: expects type sigc::signal, defines an optional signal container for + * current changing values. + * @param[in] localSignal + * @li optional: expects type sigc::signal, defines an optional signal container for + * current changing local values. + * @param[in] globalSignal + * @li optional: expects type sigc::signal, defines an optional signal container for + * current changing global values. + * + * @example + * void CFooClass::DoCount{ + * //Usage with classic init inside method: + * + * //Create a CProgressWindow object + * CProgressWindow progress; + * + * //set possible properties, eg. like here we dont't need a header + * status.showHeader(false); + * + * //paint window + * status.paint(); + * + * //set possible properties, like current status text + * status.showStatusMessageUTF("test progress"); + * + * //set current progress, call functions, methods or use a while, next loop or what ever + * status.showStatus(25) + * + * //finally remove window from screen + * status.hide(); + * } + * + * //That's it. Until now these steps are a classical way inside neutrino, but you can use proress window with signals too. + * //Working with signals have the advantage that the implementation could be more compactly, because + * //complex constructions within the classes are usually unnecessary, + * //beacuse of the signals can be installed where they directly take the required values. See next example: + * + * class CFooClass + * { + * //Usage with signals: + * //declare a signal eg. in header file + * private: + * //other members... + * sigc::signal OnProgress; + * //other members... + * public: + * //other members... + * void DoAnything(); + * //other members... + * }; + * + * //add the OnProgress signal into a counter methode + * void CFooClass::DoCount{ + * size_t max = 10 + * for (size_t i = 0; i < max; i++){ + * OnProgress(i, max, "Test"); + * } + * } + * + * void CFooClass::DoAnything{ + * //inside of methode which calls the progress define a CProgressWindow object and the counter method: + * //...any code + * CProgressWindow progress(NULL, 500, 150, &OnProgress); + * //paint window + * progress.paint(); // paint() + * + * //... + * + * DoCount(); + * + * //... + * + * //finally remove window from screen + * progress.hide(); + * } + * @note + * 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, @@ -52,6 +137,12 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget sigc::signal *localSignal = NULL, sigc::signal *globalSignal = NULL); + /**CProgressWindow Constructor + * @param[in] title + * @li expects type neutrino_locale_t as window title + * + * @see For other arguments and examples, see related constructor(s) + */ CProgressWindow(const neutrino_locale_t title, const int &dx = 700, const int &dy = 200, @@ -59,18 +150,77 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget sigc::signal *localSignal = NULL, sigc::signal *globalSignal = NULL); + /**Sets titel of window + * @param[in] title + * @li expects type neutrino_locale_t as window title + */ void setTitle(const neutrino_locale_t title); + + /**Sets titel of window + * @param[in] title + * @li expects type std::string as window title + */ + void setTitle(const std::string & title); + + /** + * Remove window from screen, restores background. + */ virtual void hide(); + /** + * Executes the exec contents. In this case it will paint the window and remove possible parents from screen + * @param[in] parent + * @li optional: expects type CMenuTarget* + * @param[in] actionKey + * @li optional: without effect + * @return int = menu_return::RETURN_REPAINT + */ virtual int exec( CMenuTarget* parent, const std::string & actionKey ); + /** + * Sets current progress value and show progress in window. + * @param[in] prog + * @li expects type unsigned int, describes current progress value + * @param[in] max + * @li optional: expects type unsigned int, describes maximal progress value, default = 100 + * @param[in] statusText + * @li optional: expects type std::string, describes current status text, default = empty + */ void showStatus(const unsigned int prog, const unsigned int max = 100, const std::string &statusText = std::string()); + + /** + * Sets current local progressbar value and show progress in window. + * @note For other arguments take a look to related method showStatus() + * @see showStatus() + */ void showLocalStatus(const unsigned int prog, const unsigned int max = 100, const std::string &statusText = std::string()); + + /** + * Sets current global progressbar value and show progress in window. + * @note For other arguments take a look to related method showStatus() + * @see showStatus() + */ void showGlobalStatus(const unsigned int prog, const unsigned int max = 100, const std::string &statusText = std::string()); + + /** + * Gets current progress value + * @return unsigned int + */ unsigned int getGlobalStatus(void); + + /** + * Sets current progress value and show progress in window. + * @param[in] text + * @li expects type std::string, describes current status text + */ void showStatusMessageUTF(const std::string & text); // UTF-8 + + /** + * Paint window + * @param[in] do_save_bg + * @li optional: expects type bool, sets background save mode + */ void paint(bool do_save_bg = true); - void setTitle(const std::string & title); }; From edc6080ebf8d60422a54d66896e5c7a40c92b779 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 10 Feb 2017 19:12:10 +0100 Subject: [PATCH 5/8] CMovieBrowser: visualize progress during load movies TODO: youtube load Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a907afdc7c19f8b5c80254ac7b2489cf9f8f2c97 Author: Thilo Graf Date: 2017-02-10 (Fri, 10 Feb 2017) --- src/gui/moviebrowser/mb.cpp | 6 ++++-- src/gui/moviebrowser/mb.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 9e08c01c5..fb80bebd7 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -2874,7 +2874,7 @@ bool CMovieBrowser::loadTsFileNamesFromDir(const std::string & dirname) CFileList flist; if (readDir(dirname, &flist) == true) { - for (unsigned int i = 0; i < flist.size(); i++) + for (size_t i = 0; i < flist.size(); i++) { if (S_ISDIR(flist[i].Mode)) { if (m_settings.ts_only || !CFileBrowser::checkBD(flist[i])) { @@ -2885,6 +2885,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)); } //result = true; } @@ -3123,7 +3124,8 @@ void CMovieBrowser::loadMovies(bool doRefresh) { TRACE("[mb] loadMovies: \n"); - CHintBox loadBox((show_mode == MB_SHOW_YT) ? LOCALE_MOVIEPLAYER_YTPLAYBACK : LOCALE_MOVIEBROWSER_HEAD, g_Locale->getText(LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES)); + CProgressWindow loadBox((show_mode == MB_SHOW_YT) ? LOCALE_MOVIEPLAYER_YTPLAYBACK : LOCALE_MOVIEBROWSER_HEAD, 500, 150, &OnLoadFile); + loadBox.enableShadow(); loadBox.paint(); if (show_mode == MB_SHOW_YT) { diff --git a/src/gui/moviebrowser/mb.h b/src/gui/moviebrowser/mb.h index 9dee3dbee..3f29afdea 100644 --- a/src/gui/moviebrowser/mb.h +++ b/src/gui/moviebrowser/mb.h @@ -362,6 +362,7 @@ class CMovieBrowser : public CMenuTarget void clearSelection(); bool supportedExtension(CFile &file); bool addFile(CFile &file, int dirItNr); + sigc::signal OnLoadFile; }; // I tried a lot to use the menu.cpp as ListBox selection, and I got three solution which are all garbage. From 78e96b7b5a73dd81adec4eae310f8163e6503111 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 13 Feb 2017 08:47:55 +0100 Subject: [PATCH 6/8] CImageInfo: fix y position of infotext Minitv was not considered. When font size very small, infotext could be overlapping with minitv window. This should fix this. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2727e3f7f0532aed803f4e01662ee269a022007e Author: Thilo Graf Date: 2017-02-13 (Mon, 13 Feb 2017) --- src/gui/imageinfo.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index 99a3cace5..15dd92544 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -414,6 +414,7 @@ void CImageInfo::InitInfoText(const std::string& text) //add a caption for info contents Font * caption_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]; int caption_height = caption_font->getHeight(); + y_tmp = max(y_tmp, cc_tv->getYPos()+cc_tv->getHeight()); if (cc_sub_caption == NULL) cc_sub_caption = new CComponentsLabel(cc_info->getXPos(), y_tmp, cc_info->getWidth(), caption_height, g_Locale->getText(LOCALE_IMAGEINFO_LICENSE), CTextBox::AUTO_WIDTH, item_font); From e662a4fa4e12d22e1d26a23670e12e362f6f22c9 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 13 Feb 2017 10:03:38 +0100 Subject: [PATCH 7/8] cYTFeedParser: add signal OnLoadVideoInfo Required for visualized progress display. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0aa261d911dcf499dd44755fe5393ff07e6f70af Author: Thilo Graf Date: 2017-02-13 (Mon, 13 Feb 2017) --- src/system/ytparser.cpp | 1 + src/system/ytparser.h | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/system/ytparser.cpp b/src/system/ytparser.cpp index 928df3afe..3c558ee1b 100644 --- a/src/system/ytparser.cpp +++ b/src/system/ytparser.cpp @@ -323,6 +323,7 @@ bool cYTFeedParser::parseFeedJSON(std::string &answer) Json::Value elements = root["items"]; for(unsigned int i=0; igetText(LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES)); #ifdef DEBUG_PARSER printf("=========================================================\n"); printf("Element %d in elements\n", i); diff --git a/src/system/ytparser.h b/src/system/ytparser.h index adb30ba67..c54c2239b 100644 --- a/src/system/ytparser.h +++ b/src/system/ytparser.h @@ -27,7 +27,7 @@ #include #include #include - +#include #include #include @@ -155,6 +155,8 @@ class cYTFeedParser void SetMaxResults(int count) { max_results = count; } void SetConcurrentDownloads(int count) { concurrent_downloads = count; } void SetThumbnailDir(std::string &_thumbnail_dir); + + sigc::signal OnLoadVideoInfo; }; #endif From 68b4639ac9ea8bad662bfc2c8d1f6160c850d011 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 13 Feb 2017 10:05:34 +0100 Subject: [PATCH 8/8] CMovieBrowser: vizualize progress for loading of youtube vidoes Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/690ac7c428e67e5f28dd908266ed524153148948 Author: Thilo Graf Date: 2017-02-13 (Mon, 13 Feb 2017) --- 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 fb80bebd7..b6d49b888 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -3124,7 +3124,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, &OnLoadFile); + CProgressWindow loadBox((show_mode == MB_SHOW_YT) ? LOCALE_MOVIEPLAYER_YTPLAYBACK : LOCALE_MOVIEBROWSER_HEAD, 500, 150, show_mode == MB_SHOW_YT ? &ytparser.OnLoadVideoInfo : &OnLoadFile); loadBox.enableShadow(); loadBox.paint();