From 418f8ad5e3ee6cccba55a7ea12334fa97b2cde0c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 23 Nov 2016 09:06:11 +0100 Subject: [PATCH 01/27] CRecordManager: add methode to get internal rec map Useful for access to current record data. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8ba357fcb21b874b41ded1085e355bb25a3084ac Author: Thilo Graf Date: 2016-11-23 (Wed, 23 Nov 2016) ------------------ This commit was generated by Migit --- src/driver/record.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/driver/record.h b/src/driver/record.h index 476f92de8..1683346b3 100644 --- a/src/driver/record.h +++ b/src/driver/record.h @@ -203,6 +203,7 @@ class CRecordManager : public CMenuTarget /*, public CChangeObserver*/ bool StopAutoRecord(bool lock = true); void StopAutoTimer(); bool CheckRecordingId_if_Timeshift(int recid); + recmap_t GetRecordMap()const{return recmap;} MI_MOVIE_INFO * GetMovieInfo(const t_channel_id channel_id, bool timeshift = true); const std::string GetFileName(const t_channel_id channel_id, bool timeshift = true); From 1d7894c3b8bd3d255a845ab1b67c80189924fc24 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 23 Nov 2016 10:04:50 +0100 Subject: [PATCH 02/27] CComponentsWindow: remove default values from internal init method Is not really required for this private member. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4e1a3a89dc9c122cc0584505dcf8e5783aeae06e Author: Thilo Graf Date: 2016-11-23 (Wed, 23 Nov 2016) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_window.cpp | 2 +- src/gui/components/cc_frm_window.h | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index 982219e1b..a7c84cba3 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -59,7 +59,7 @@ using namespace std; //sub class CComponentsWindow inherit from CComponentsForm CComponentsWindow::CComponentsWindow(CComponentsForm *parent) { - initVarWindow(0, 0, 800, 600, "", "", parent); + initVarWindow(0, 0, 800, 600, "", "", parent, CC_SHADOW_OFF, COL_FRAME_PLUS_0, COL_MENUCONTENT_PLUS_0, COL_SHADOW_PLUS_0); } CComponentsWindow::CComponentsWindow( const int& x_pos, const int& y_pos, const int& w, const int& h, diff --git a/src/gui/components/cc_frm_window.h b/src/gui/components/cc_frm_window.h index ca2fb296e..7b2f71796 100644 --- a/src/gui/components/cc_frm_window.h +++ b/src/gui/components/cc_frm_window.h @@ -107,14 +107,14 @@ class CComponentsWindow : public CComponentsForm ///initialze all window objects at once void initCCWItems(); ///initialize all attributes - void initVarWindow( const int& x_pos = CC_CENTERED, const int& y_pos = CC_CENTERED, const int& w = 0, const int& h = 0, - const std::string& caption = "", - const std::string& iconname = "", - CComponentsForm *parent = NULL, - int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_FRAME_PLUS_0, - fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, - fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); + void initVarWindow( const int& x_pos, const int& y_pos, const int& w, const int& h, + const std::string& caption, + const std::string& iconname, + CComponentsForm *parent, + int shadow_mode, + fb_pixel_t color_frame, + fb_pixel_t color_body, + fb_pixel_t color_shadow); ///initialize width and height void initWindowSize(); ///initialize position From 0455f9f69732532cea472c0a25c03ff83e7e4946 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 23 Nov 2016 10:33:58 +0100 Subject: [PATCH 03/27] CComponentsItem: fix possible negativ value for box radius If frame width > 0 and radius too small, we have an negative value. This should prevent this. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ee4a443c8a4c702b4a2da645fffb4ad3b772dd37 Author: Thilo Graf Date: 2016-11-23 (Wed, 23 Nov 2016) ------------------ This commit was generated by Migit --- src/gui/components/cc_item.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 10147f6cf..d695cbdf1 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -86,7 +86,7 @@ void CComponentsItem::paintInit(bool do_save_bg) sw = max(0, sw); //set current needed corner main box radius - int box_rad = corner_rad; + int box_rad = corner_type ? corner_rad : 0; //and ensure max main box radius < dimensions if (2*box_rad > dy) @@ -186,7 +186,7 @@ void CComponentsItem::paintInit(bool do_save_bg) {sh_ctr, CC_FBDATA_TYPE_SHADOW_BOX, sh_ctr_x-sw, sh_ctr_y-sw+th, sh_cdx, sh_cdy-sh_cdy_size_offset+sw, col_shadow_clean, box_rad, corner_type & CORNER_TOP_RIGHT, 0, NULL, NULL, NULL, false}, //main box - {true, CC_FBDATA_TYPE_BOX, ix+th, iy+th, dx-2*th, dy-2*th, col_body, box_rad-th, corner_type, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, ix+th, iy+th, dx-2*th, dy-2*th, col_body, max(0,box_rad-th), corner_type, 0, NULL, NULL, NULL, false}, //frame {true, CC_FBDATA_TYPE_FRAME, ix, iy, dx, dy, col_frame_cur, box_rad, corner_type, th, NULL, NULL, NULL, false} From 3019b1abdc78b969cfcc59c2aac3b775d0ca8298 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 24 Nov 2016 19:21:14 +0100 Subject: [PATCH 04/27] src/gui/widget/menue.cpp try to fix widget segfault menu with keyboard and background restore Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a8ea7c60d50d39087866df61df56881d44ebdb7e Author: Jacek Jendrzej Date: 2016-11-24 (Thu, 24 Nov 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 13 +++++++++---- src/gui/widget/menue.h | 2 ++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 3711cb1bd..8a2550ceb 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -622,6 +622,8 @@ void CMenuWidget::Init(const std::string &Icon, const int mwidth, const mn_widge fbutton_width = 0; fbutton_height = 0; nextShortcut = 1; + saveScreen_width = 0; + saveScreen_height = 0; } void CMenuWidget::move(int xoff, int yoff) @@ -1391,17 +1393,18 @@ void CMenuWidget::saveScreen() return; delete[] background; - - background = new fb_pixel_t [full_width * (full_height+fbutton_height)]; + saveScreen_height = full_height+fbutton_height; + saveScreen_width = full_width; + background = new fb_pixel_t [saveScreen_height * saveScreen_width]; if(background) - frameBuffer->SaveScreen(x /*-ConnectLineBox_Width*/, y, full_width, full_height + fbutton_height, background); + frameBuffer->SaveScreen(x /*-ConnectLineBox_Width*/, y, full_width, saveScreen_height, background); } void CMenuWidget::restoreScreen() { if(background) { if(savescreen) - frameBuffer->RestoreScreen(x /*-ConnectLineBox_Width*/, y, full_width, full_height + fbutton_height, background); + frameBuffer->RestoreScreen(x /*-ConnectLineBox_Width*/, y, saveScreen_width, saveScreen_height, background); } } @@ -1411,6 +1414,8 @@ void CMenuWidget::enableSaveScreen(bool enable) if (!enable && background) { delete[] background; background = NULL; + saveScreen_width = 0; + saveScreen_height = 0; } } diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index bc527ed68..61d6691b4 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -494,6 +494,8 @@ class CMenuWidget : public CMenuTarget, public CComponentsSignals CComponentsInfoBox *info_box; int hint_height; CComponentsHeader *header; + unsigned int saveScreen_width ; + unsigned int saveScreen_height; protected: std::string nameString; neutrino_locale_t name; From a85e6a2971500b40395ae9770bba66fb175053ea Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 24 Nov 2016 21:41:23 +0100 Subject: [PATCH 05/27] enable epg-scan while audioplayer, movieplayer, pictureviewer and upnp-browser runs Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a5bc693282bf38aa8848c5bd871bc8c80b2d71a1 Author: vanhofen Date: 2016-11-24 (Thu, 24 Nov 2016) Origin message was: ------------------ - enable epg-scan while audioplayer, movieplayer, pictureviewer and upnp-browser runs ------------------ This commit was generated by Migit --- src/gui/audioplayer.cpp | 6 +----- src/gui/movieplayer.cpp | 3 --- src/gui/pictureviewer.cpp | 6 ------ src/gui/upnpbrowser.cpp | 5 ----- 4 files changed, 1 insertion(+), 19 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index c96652ac9..151165907 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -293,9 +293,6 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_LastMode = CNeutrinoApp::getInstance()->getMode(); CNeutrinoApp::getInstance()->handleMsg( NeutrinoMessages::CHANGEMODE , NeutrinoMessages::mode_audio ); - // Stop sectionsd - g_Sectionsd->setPauseScanning(true); - puts("[audioplayer.cpp] executing " AUDIOPLAYER_START_SCRIPT "."); if (my_system(AUDIOPLAYER_START_SCRIPT) != 0) perror(AUDIOPLAYER_START_SCRIPT " failed"); @@ -314,8 +311,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) //g_Zapit->unlockPlayBack(); CZapit::getInstance()->EnablePlayback(true); - // Start Sectionsd - g_Sectionsd->setPauseScanning(false); + m_frameBuffer->stopFrame(); CNeutrinoApp::getInstance()->handleMsg( NeutrinoMessages::CHANGEMODE , m_LastMode ); g_RCInput->postMsg( NeutrinoMessages::SHOW_INFOBAR, 0 ); diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 960022af5..c16c21031 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -221,8 +221,6 @@ void CMoviePlayerGui::cutNeutrino() return; g_Zapit->lockPlayBack(); - if (!isWebTV) - g_Sectionsd->setPauseScanning(true); m_LastMode = (CNeutrinoApp::getInstance()->getMode() /*| NeutrinoMessages::norezap*/); if (isWebTV) @@ -245,7 +243,6 @@ void CMoviePlayerGui::restoreNeutrino() //g_Zapit->unlockPlayBack(); CZapit::getInstance()->EnablePlayback(true); - g_Sectionsd->setPauseScanning(false); printf("%s: restore mode %x\n", __func__, m_LastMode);fflush(stdout); #if 0 diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 7d09f898f..97e335fa1 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -197,9 +197,6 @@ int CPictureViewerGui::exec(CMenuTarget* parent, const std::string & actionKey) // blank background screen videoDecoder->setBlank(true); - - // Stop Sectionsd - g_Sectionsd->setPauseScanning(true); } // Save and Clear background @@ -217,9 +214,6 @@ int CPictureViewerGui::exec(CMenuTarget* parent, const std::string & actionKey) if (!audioplayer) { // !!! why? !!! //g_Zapit->unlockPlayBack(); CZapit::getInstance()->EnablePlayback(true); - - // Start Sectionsd - g_Sectionsd->setPauseScanning(false); } // Restore previous background diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 59221c059..92b90d749 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -183,9 +183,6 @@ int CUpnpBrowserGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/ // remember last mode m_LastMode=(CNeutrinoApp::getInstance()->getLastMode()); - // Stop sectionsd - g_Sectionsd->setPauseScanning(true); - m_deviceliststart=0; m_selecteddevice=0; timeout = 0; @@ -194,8 +191,6 @@ int CUpnpBrowserGui::exec(CMenuTarget* parent, const std::string & /*actionKey*/ stopAudio(); - // Start Sectionsd - g_Sectionsd->setPauseScanning(false); m_frameBuffer->stopFrame(); m_frameBuffer->Clear(); From ccd59e1d3acdab1dca044a74f39c093f667a064a Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 25 Nov 2016 16:45:26 +0100 Subject: [PATCH 06/27] supplement to 3019b1abdc78b969cfcc59c2aac3b775d0ca8298 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/91e0f8070b2578ce56b280b13daf942cfaf2a47b Author: Jacek Jendrzej Date: 2016-11-25 (Fri, 25 Nov 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 8 ++++++-- src/gui/widget/menue.h | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 8a2550ceb..d0c30166a 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1395,16 +1395,18 @@ void CMenuWidget::saveScreen() delete[] background; saveScreen_height = full_height+fbutton_height; saveScreen_width = full_width; + saveScreen_y = y; + saveScreen_x = x; background = new fb_pixel_t [saveScreen_height * saveScreen_width]; if(background) - frameBuffer->SaveScreen(x /*-ConnectLineBox_Width*/, y, full_width, saveScreen_height, background); + frameBuffer->SaveScreen(saveScreen_x /*-ConnectLineBox_Width*/, saveScreen_y, saveScreen_width, saveScreen_height, background); } void CMenuWidget::restoreScreen() { if(background) { if(savescreen) - frameBuffer->RestoreScreen(x /*-ConnectLineBox_Width*/, y, saveScreen_width, saveScreen_height, background); + frameBuffer->RestoreScreen(saveScreen_x /*-ConnectLineBox_Width*/, saveScreen_y, saveScreen_width, saveScreen_height, background); } } @@ -1416,6 +1418,8 @@ void CMenuWidget::enableSaveScreen(bool enable) background = NULL; saveScreen_width = 0; saveScreen_height = 0; + saveScreen_y = 0; + saveScreen_x = 0; } } diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index 61d6691b4..5da3cc3f5 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -496,6 +496,8 @@ class CMenuWidget : public CMenuTarget, public CComponentsSignals CComponentsHeader *header; unsigned int saveScreen_width ; unsigned int saveScreen_height; + unsigned int saveScreen_y; + unsigned int saveScreen_x; protected: std::string nameString; neutrino_locale_t name; From 9ebac10a5b9f96a448461ecb3efa9efd41067d05 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 25 Nov 2016 18:17:49 +0100 Subject: [PATCH 07/27] src/gui/widget/keyboard_input.cpp -add direkt digikey pressed Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/983d24cd516dcc965dd7333028c8d028ce39d618 Author: Jacek Jendrzej Date: 2016-11-25 (Fri, 25 Nov 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/keyboard_input.cpp | 20 ++++++++++++++++++++ src/gui/widget/keyboard_input.h | 2 ++ 2 files changed, 22 insertions(+) diff --git a/src/gui/widget/keyboard_input.cpp b/src/gui/widget/keyboard_input.cpp index 3ff38ab1a..92b5efaeb 100644 --- a/src/gui/widget/keyboard_input.cpp +++ b/src/gui/widget/keyboard_input.cpp @@ -502,6 +502,22 @@ void CKeyboardInput::keyBackspacePressed(void) } } +void CKeyboardInput::keyDigiPressed(const neutrino_msg_t key) +{ + int old_col = scol; + int old_srow = srow; + int digi = CRCInput::getNumericValue(key); + digi = (digi == 0) ? 10 : digi; + srow = 0; + scol = digi; + if (focus == FOCUS_KEY) + paintKey(old_srow, old_col); + + focus = FOCUS_KEY; + paintKey(srow, scol); + NormalKeyPressed(); +} + void CKeyboardInput::insertChar() { int item = inputSize -1; @@ -614,6 +630,10 @@ int CKeyboardInput::exec(CMenuTarget* parent, const std::string &) { switchLayout(); } + else if (CRCInput::isNumeric(msg)) + { + keyDigiPressed(msg); + } else if ((msg == CRCInput::RC_home) || (msg == CRCInput::RC_timeout)) { if ((inputString->getValue() != oldval) && diff --git a/src/gui/widget/keyboard_input.h b/src/gui/widget/keyboard_input.h index 1003e7f39..7af5c1c17 100644 --- a/src/gui/widget/keyboard_input.h +++ b/src/gui/widget/keyboard_input.h @@ -104,6 +104,8 @@ class CKeyboardInput : public CMenuTarget bool force_saveScreen; fb_pixel_t *pixBuf; + void keyDigiPressed(const neutrino_msg_t key); + virtual void init(); virtual void paint(); From 2d55123cb3d1ec267d41a1ea7726485c811e9340 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sun, 27 Nov 2016 21:11:00 +0100 Subject: [PATCH 08/27] CHintBox/CMsgBox: Add default icon for header (NEUTRINO_ICON_INFO) Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1d3a047f6b48bef4d036ea4f04f816d66af03787 Author: Michael Liebmann Date: 2016-11-27 (Sun, 27 Nov 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/hintbox.h | 13 +++++++------ src/gui/widget/msgbox.h | 8 ++++---- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/gui/widget/hintbox.h b/src/gui/widget/hintbox.h index 310aeb8b2..4afacb82a 100644 --- a/src/gui/widget/hintbox.h +++ b/src/gui/widget/hintbox.h @@ -44,6 +44,7 @@ #define TIMEOUT_BAR_HEIGHT OFFSET_SHADOW/2 #define DEFAULT_HINTBOX_TEXT_MODE (CTextBox::CENTER) +#define DEFAULT_HEADER_ICON NEUTRINO_ICON_INFO //! Sub class of CComponentsWindow. Shows a window as a hintbox with text and optional icon beside of text. /*! @@ -92,11 +93,11 @@ class CHintBox : public CComponentsWindow * @param[in] Width * @li optional: exepts type int, defines box width, default value = HINTBOX_MIN_WIDTH * @param[in] Icon - * @li optional: exepts type const char*, defines the icon name on the left side of titlebar, default = NULL (non Icon) + * @li optional: exepts type const char*, defines the icon name on the left side of titlebar, default = DEFAULT_HEADER_ICON * @param[in] Picon * @li optional: exepts type const char*, defines the picon name on the left side of message text, default = NULL (non Icon) * @param[in] header_buttons - * @li optional: exepts type int, defines the icon name on the left side of titlebar, default = 0 (non Icon) + * @li optional: exepts type int, defines the icon name on the right side of titlebar, default = 0 (non Icon) * @see class CComponentsWindow() * @param[in] text_mode * @li optional: exepts type int, defines the text modes for embedded text lines @@ -118,7 +119,7 @@ class CHintBox : public CComponentsWindow CHintBox( const neutrino_locale_t Caption, const char * const Text, const int Width = HINTBOX_MIN_WIDTH, - const char * const Icon = NULL, + const char * const Icon = DEFAULT_HEADER_ICON, const char * const Picon = NULL, const int& header_buttons = 0, const int& text_mode = DEFAULT_HINTBOX_TEXT_MODE, @@ -132,7 +133,7 @@ class CHintBox : public CComponentsWindow CHintBox( const char * const Caption, const char * const Text, const int Width = HINTBOX_MIN_WIDTH, - const char * const Icon = NULL, + const char * const Icon = DEFAULT_HEADER_ICON, const char * const Picon = NULL, const int& header_buttons = 0, const int& text_mode = DEFAULT_HINTBOX_TEXT_MODE, @@ -148,7 +149,7 @@ class CHintBox : public CComponentsWindow CHintBox( const neutrino_locale_t Caption, const neutrino_locale_t Text, const int Width = HINTBOX_MIN_WIDTH, - const char * const Icon = NULL, + const char * const Icon = DEFAULT_HEADER_ICON, const char * const Picon = NULL, const int& header_buttons = 0, const int& text_mode = DEFAULT_HINTBOX_TEXT_MODE, @@ -164,7 +165,7 @@ class CHintBox : public CComponentsWindow CHintBox( const char * const Caption, const neutrino_locale_t Text, const int Width = HINTBOX_MIN_WIDTH, - const char * const Icon = NULL, + const char * const Icon = DEFAULT_HEADER_ICON, const char * const Picon = NULL, const int& header_buttons = 0, const int& text_mode = DEFAULT_HINTBOX_TEXT_MODE, diff --git a/src/gui/widget/msgbox.h b/src/gui/widget/msgbox.h index cd0fd2a44..47abd9a54 100644 --- a/src/gui/widget/msgbox.h +++ b/src/gui/widget/msgbox.h @@ -125,7 +125,7 @@ class CMsgBox : public CHintBox * @param[in] Title * @li optional: exepts type const char*, default = NULL, this causes default title "Information" * @param[in] Icon - * @li optional: exepts type const char*, defines the icon name on the left side of titlebar, default = NULL (non Icon) + * @li optional: exepts type const char*, defines the icon name on the left side of titlebar, default = DEFAULT_HEADER_ICON * @param[in] Picon * @li optional: exepts type const char*, defines the picon name on the left side of message text, default = NULL (non Icon) * @param[in] Width @@ -165,7 +165,7 @@ class CMsgBox : public CHintBox */ CMsgBox(const char* Text, const char* Title = NULL, - const char* Icon = NULL, + const char* Icon = DEFAULT_HEADER_ICON, const char* Picon = NULL, const int& Width = MSGBOX_MIN_WIDTH, const int& Height = MSGBOX_MIN_HEIGHT, @@ -179,7 +179,7 @@ class CMsgBox : public CHintBox * @param[in] Title * @li optional: exepts type neutrino_locale_t with locale entry from /system/locals.h default = NONEXISTANT_LOCALE, this causes default title "Information" * @param[in] Icon - * @li optional: exepts type const char*, defines the icon name on the left side of titlebar, default = NULL (non Icon) + * @li optional: exepts type const char*, defines the icon name on the left side of titlebar, default = DEFAULT_HEADER_ICON * @param[in] Picon * @li optional: exepts type const char*, defines the picon name on the left side of message text, default = NULL (non Icon) * @param[in] Width @@ -219,7 +219,7 @@ class CMsgBox : public CHintBox */ CMsgBox(const char* Text, const neutrino_locale_t locale_Title = NONEXISTANT_LOCALE, - const char* Icon = NULL, + const char* Icon = DEFAULT_HEADER_ICON, const char* Picon = NULL, const int& Width = MSGBOX_MIN_WIDTH, const int& Height = MSGBOX_MIN_HEIGHT, From 1bb5942e063164fbd7d6704bcf2f414ca6627e21 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 28 Nov 2016 00:13:48 +0100 Subject: [PATCH 09/27] cc_frm_footer.h: use proven COL_SHADOW_PLUS_0 for button frames Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/02db4fe81ac110e6c032d4c77880d444fc8443a4 Author: vanhofen Date: 2016-11-28 (Mon, 28 Nov 2016) Origin message was: ------------------ - cc_frm_footer.h: use proven COL_SHADOW_PLUS_0 for button frames ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_footer.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index 4c5239d56..8f56a1003 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -158,8 +158,8 @@ class CComponentsFooter : public CComponentsHeader * @li optional: exepts type int, default = 2 */ void setSelectedButton(size_t item_id, - const fb_pixel_t& fr_col = COL_MENUCONTENTSELECTED_PLUS_2, - const fb_pixel_t& sel_fr_col = COL_MENUCONTENTSELECTED_PLUS_0, + const fb_pixel_t& fr_col = COL_SHADOW_PLUS_0, //NI + const fb_pixel_t& sel_fr_col = COL_SHADOW_PLUS_0, //NI const fb_pixel_t& bg_col = COL_MENUCONTENT_PLUS_0, const fb_pixel_t& sel_bg_col = COL_MENUCONTENTSELECTED_PLUS_0, const fb_pixel_t& text_col = COL_MENUCONTENT_TEXT, From 44ef21b006d33841024b4d15232908e85a9002fb Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 28 Nov 2016 21:18:00 +0100 Subject: [PATCH 10/27] CComponentsText: revert inheritition of CBox, useage as object It has shown, that the positioning and Dimensions calculations are not correct. CBox object must be embedded with frame properties. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9331c59b0e26a8915237faf816aec673169677a1 Author: Thilo Graf Date: 2016-11-28 (Mon, 28 Nov 2016) ------------------ This commit was generated by Migit --- src/gui/components/cc_item_text.cpp | 83 +++++++++++++++++------------ src/gui/components/cc_item_text.h | 8 ++- 2 files changed, 54 insertions(+), 37 deletions(-) diff --git a/src/gui/components/cc_item_text.cpp b/src/gui/components/cc_item_text.cpp index c851a49fa..bf52a4f33 100644 --- a/src/gui/components/cc_item_text.cpp +++ b/src/gui/components/cc_item_text.cpp @@ -86,10 +86,11 @@ void CComponentsText::initVarText( const int x_pos, const int y_pos, const int w ct_text_mode = mode; ct_text_style = font_style; - iX = x = x_old = x_pos; //TODO: equalize inhertited member names - iY = y = y_old = y_pos; - iWidth = width_old = width = w; - iHeight = height_old = height = h; + fr_thickness = 0; + x = x_old = x_pos; + y = y_old = y_pos; + width = width_old = w; + height = height_old = h; /* we need a minimal borderwith of 1px because the edge-smoothing (or fontrenderer?) otherwise will paint single pixels outside the @@ -103,7 +104,7 @@ void CComponentsText::initVarText( const int x_pos, const int y_pos, const int w col_frame = color_frame; col_body = color_body; col_shadow = color_shadow; - fr_thickness = 0; + ct_text_sent = false; ct_paint_textbg = false; ct_force_text_paint = false; @@ -114,6 +115,27 @@ void CComponentsText::initVarText( const int x_pos, const int y_pos, const int w } +void CComponentsText::initCBox() +{ + x = max(0, x); + y = max(0, y); + + int x_box = x + fr_thickness; + int y_box = y + fr_thickness; + + if (cc_parent){ + ct_box.iX = cc_xr; + ct_box.iY = cc_yr; + }else{ + ct_box.iX = x_box; + ct_box.iY = y_box; + } + + ct_box.iWidth = width - 2*fr_thickness; + ct_box.iHeight = height - 2*fr_thickness; +} + + void CComponentsText::initCCText() { //set default font, if is no font definied @@ -121,41 +143,32 @@ void CComponentsText::initCCText() ct_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]; //define height from font size - height = max(height, ct_font->getHeight()); - - //init CBox dimensions - iWidth = width-2*fr_thickness; - iHeight = height-2*fr_thickness; - - //using of real x/y values to paint textbox if this text object is bound in a parent form - if (cc_parent){ - int th_parent_fr = cc_parent->getFrameThickness(); - iX = cc_xr + (x <= th_parent_fr ? th_parent_fr : 0); - iY = cc_yr - (y <= th_parent_fr ? th_parent_fr : 0); - }else{ - iX = x; - iY = y; - } - iX += fr_thickness; - iY += fr_thickness; + int h_tmp = ct_font->getHeight(); + height = max(height, h_tmp-2*fr_thickness); + if (width == 0) + width = max(width, CTextBox::getMaxLineWidth(ct_text, ct_font)-2*fr_thickness); //init textbox + initCBox(); + if (ct_textbox == NULL) ct_textbox = new CTextBox(); - //set text box properties + //set text properties ct_textbox->setTextFont(ct_font); ct_textbox->setTextMode(ct_text_mode); - ct_textbox->setWindowPos(this); + ct_textbox->setTextColor(ct_col_text); + ct_textbox->enableUTF8(ct_utf8_encoded); + + //set text box properties + ct_textbox->setWindowPos(&ct_box); + ct_textbox->setWindowMaxDimensions(ct_box.iWidth, ct_box.iHeight); + ct_textbox->setWindowMinDimensions(ct_box.iWidth, ct_box.iHeight); ct_textbox->setTextBorderWidth(ct_text_Hborder, ct_text_Vborder); ct_textbox->enableBackgroundPaint(ct_paint_textbg && !cc_txt_save_screen); ct_textbox->setBackGroundColor(col_body); - ct_textbox->setBackGroundRadius(corner_rad-fr_thickness, corner_type); - ct_textbox->setTextColor(ct_col_text); - ct_textbox->setWindowMaxDimensions(iWidth, iHeight); - ct_textbox->setWindowMinDimensions(iWidth, iHeight); + ct_textbox->setBackGroundRadius(0/*(corner_type ? corner_rad-fr_thickness : 0), corner_type*/); ct_textbox->enableSaveScreen(cc_txt_save_screen && !ct_paint_textbg); - ct_textbox->enableUTF8(ct_utf8_encoded); //observe behavior of parent form if available bool force_text_paint = ct_force_text_paint; @@ -169,7 +182,7 @@ void CComponentsText::initCCText() #endif //send text to CTextBox object, but force text paint text if force_text_paint option is enabled //this is managed by CTextBox object itself - ct_text_sent = ct_textbox->setText(&ct_text, this->iWidth, force_text_paint); + ct_text_sent = ct_textbox->setText(&ct_text, ct_box.iWidth, force_text_paint); //set current text status, needed by textChanged() if (ct_text_sent){ @@ -180,7 +193,7 @@ void CComponentsText::initCCText() //ensure clean font rendering on transparency background ct_textbox->setTextRenderModeFullBG(!paint_bg); -// dprintf(DEBUG_NORMAL, "[CComponentsText] [%s - %d] init text: %s [x %d x_old %d, y %d y_old %d, w %d, h %d]\n", __func__, __LINE__, ct_text.c_str(), this->x, x_old, this->y, y_old, this->iWidth, this->iHeight); +// dprintf(DEBUG_NORMAL, "[CComponentsText] [%s - %d] ct_text = %s, x = %d , x_old = %d , y = %d , y_old = %d , \nct_box.iWidth = %d , ct_box.iHeight = %d , width = %d , height = %d, corner_rad = %d\n", __func__, __LINE__, ct_text.c_str(), x, x_old, y, y_old, ct_box.iWidth, ct_box.iHeight, width, height, corner_rad); } void CComponentsText::clearCCText() @@ -287,25 +300,25 @@ void CComponentsText::hide() void CComponentsText::setXPos(const int& xpos) { CCDraw::setXPos(xpos); - iX = x; + initCBox(); } void CComponentsText::setYPos(const int& ypos) { CCDraw::setYPos(ypos); - iY = y; + initCBox(); } void CComponentsText::setHeight(const int& h) { CCDraw::setHeight(h); - iHeight = height; + initCBox(); } void CComponentsText::setWidth(const int& w) { CCDraw::setWidth(w); - iWidth = width; + initCBox(); } //small helper to remove excessiv linbreaks diff --git a/src/gui/components/cc_item_text.h b/src/gui/components/cc_item_text.h index dd26f02ad..7bd5f6372 100644 --- a/src/gui/components/cc_item_text.h +++ b/src/gui/components/cc_item_text.h @@ -40,11 +40,12 @@ Handling of text parts based up CTextBox attributes and methodes. CComponentsText provides a interface to the embedded CTextBox object. */ -class CComponentsText : public CCTextScreen, public CComponentsItem, public CBox +class CComponentsText : public CCTextScreen, public CComponentsItem { protected: ///object: CTextBox object CTextBox * ct_textbox; + CBox ct_box; ///object: Fontrenderer object Font * ct_font; ///property: font style @@ -96,6 +97,9 @@ class CComponentsText : public CCTextScreen, public CComponentsItem, public CBox ///initialize all required attributes for text and send to the CTextBox object void initCCText(); + ///init internal CBox object required by CTextBox object + void initCBox(); + ///paint CCItem backckrond (if paint_bg=true), apply initCCText() and send paint() to the CTextBox object void paintText(bool do_save_bg = CC_SAVE_SCREEN_YES); public: @@ -105,7 +109,7 @@ class CComponentsText : public CCTextScreen, public CComponentsItem, public CBox FONT_STYLE_ITALIC = 2 }; - CComponentsText( const int x_pos = 10, const int y_pos = 10, const int w = 150, const int h = 50, + CComponentsText( const int x_pos = 10, const int y_pos = 10, const int w = 0, const int h = 0, std::string text = "", const int mode = CTextBox::AUTO_WIDTH, Font* font_text = NULL, From 65c220e0c1c10fa2841e3a4ee637f4600b4fa048 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 27 Nov 2016 16:46:51 +0100 Subject: [PATCH 11/27] CComponentsExtTextForm: rework class overloading class CComponentsExtTextFormLocalized is not required. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/31bfb1b383e657e9914a72560919d9cc5a12264d Author: Thilo Graf Date: 2016-11-27 (Sun, 27 Nov 2016) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_ext_text.cpp | 54 ++++++++++++++++---------- src/gui/components/cc_frm_ext_text.h | 33 ++++++++-------- src/gui/test_menu.cpp | 2 +- 3 files changed, 51 insertions(+), 38 deletions(-) diff --git a/src/gui/components/cc_frm_ext_text.cpp b/src/gui/components/cc_frm_ext_text.cpp index 81354cc6c..645410ead 100644 --- a/src/gui/components/cc_frm_ext_text.cpp +++ b/src/gui/components/cc_frm_ext_text.cpp @@ -34,6 +34,13 @@ using namespace std; +CComponentsExtTextForm::CComponentsExtTextForm(CComponentsForm* parent) +{ + Font* t_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]; + initVarExtTextForm(0, 0, 300, t_font->getHeight(), "", "", t_font, parent, CC_SHADOW_OFF, COL_MENUCONTENTINACTIVE_TEXT, COL_MENUCONTENT_TEXT, COL_FRAME_PLUS_0, COL_MENUCONTENT_PLUS_0, COL_SHADOW_PLUS_0); + initCCTextItems(); +} + CComponentsExtTextForm::CComponentsExtTextForm( const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& label_text, const std::string& text, Font* font_text, @@ -47,20 +54,19 @@ CComponentsExtTextForm::CComponentsExtTextForm( const int& x_pos, const int& y_p initCCTextItems(); } -CComponentsExtTextFormLocalized::CComponentsExtTextFormLocalized(const int& x_pos, const int& y_pos, const int& w, const int& h, - const neutrino_locale_t& locale_label_text, const neutrino_locale_t& locale_text, - Font* font_text, - CComponentsForm* parent, - int shadow_mode, - fb_pixel_t label_color, - fb_pixel_t text_color, - fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) - : CComponentsExtTextForm( x_pos, y_pos, w, h, - g_Locale->getText(locale_label_text), g_Locale->getText(locale_text), - font_text, - parent, - shadow_mode, - label_color, text_color, color_frame, color_body, color_shadow){}; +CComponentsExtTextForm::CComponentsExtTextForm( const int& x_pos, const int& y_pos, const int& w, const int& h, + neutrino_locale_t l_text, const std::string& text, + Font* font_text, + CComponentsForm* parent, + int shadow_mode, + fb_pixel_t label_color, + fb_pixel_t text_color, + fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) +{ + initVarExtTextForm(x_pos, y_pos, w, h, (string)g_Locale->getText(l_text), text, font_text, parent, shadow_mode, label_color, text_color, color_frame, color_body, color_shadow); + initCCTextItems(); +} + void CComponentsExtTextForm::initVarExtTextForm(const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& label_text, const std::string& text, @@ -81,9 +87,13 @@ void CComponentsExtTextForm::initVarExtTextForm(const int& x_pos, const int& y_p ccx_percent_label_w = DEF_LABEL_WIDTH_PERCENT; ccx_label_width = ccx_percent_label_w * width/100; ccx_text_width = width-ccx_label_width; - + height = h; - + if (height == 0) + height = DEF_HEIGHT; + + y_text = 0; + ccx_label_text = label_text; ccx_text = text; shadow = shadow_mode; @@ -95,8 +105,11 @@ void CComponentsExtTextForm::initVarExtTextForm(const int& x_pos, const int& y_p ccx_label_obj = NULL; ccx_text_obj = NULL; corner_type = 0; - int dx = 0, dy = DEF_HEIGHT; - ccx_font = font_text == NULL ? *(CNeutrinoFonts::getInstance()->getDynFont(dx, dy)) : g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]; + ccx_font = font_text; + if (ccx_font == NULL){ + int dx = 0, dy = height; + ccx_font = *(CNeutrinoFonts::getInstance()->getDynFont(dx, dy)); + } ccx_label_align = ccx_text_align = CTextBox::NO_AUTO_LINEBREAK; initParent(parent); @@ -120,9 +133,10 @@ void CComponentsExtTextForm::initLabel() //set properties if (ccx_label_obj){ ccx_label_width = (ccx_percent_label_w * width/100); + y_text = height/2 - height-2*fr_thickness; ccx_label_obj->setText(ccx_label_text, ccx_label_align, ccx_font); ccx_label_obj->setTextColor(ccx_label_color); - ccx_label_obj->setDimensionsAll(0, 0, ccx_label_width-2*fr_thickness, height-2*fr_thickness); + ccx_label_obj->setDimensionsAll(0, y_text, ccx_label_width-2*fr_thickness, height-2*fr_thickness); ccx_label_obj->setCorner(this->corner_rad, CORNER_LEFT); } } @@ -146,7 +160,7 @@ void CComponentsExtTextForm::initText() ccx_text_width = width-ccx_label_obj->getWidth(); ccx_text_obj->setText(ccx_text, ccx_text_align, ccx_font); ccx_text_obj->setTextColor(ccx_text_color); - ccx_text_obj->setDimensionsAll(CC_APPEND, 0, ccx_text_width-2*fr_thickness, height-2*fr_thickness); + ccx_text_obj->setDimensionsAll(ccx_label_obj->getWidth(), y_text, ccx_text_width-2*fr_thickness, height-2*fr_thickness); ccx_text_obj->setCorner(this->corner_rad, CORNER_RIGHT); } } diff --git a/src/gui/components/cc_frm_ext_text.h b/src/gui/components/cc_frm_ext_text.h index aa148599f..837eb8c18 100644 --- a/src/gui/components/cc_frm_ext_text.h +++ b/src/gui/components/cc_frm_ext_text.h @@ -51,6 +51,8 @@ class CComponentsExtTextForm : public CComponentsForm, public CCTextScreen Font* ccx_font; ///property: percentage val of label width related to full width, causes fit of text automatically into the available remaining size of item, see also setLabelWidthPercent() uint8_t ccx_percent_label_w; + ///centered y position of label and text + int y_text; ///object: label object CComponentsLabel *ccx_label_obj; @@ -79,7 +81,9 @@ class CComponentsExtTextForm : public CComponentsForm, public CCTextScreen public: ///advanced constructor for CComponentsExtTextForm, provides parameters for the most required properties, and caption as string - CComponentsExtTextForm( const int& x_pos = 1, const int& y_pos = 1, const int& w = 300, const int& h = 48, + CComponentsExtTextForm(CComponentsForm* parent = NULL); + + CComponentsExtTextForm( const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& label_text = "", const std::string& text = "", Font* font_text = NULL, CComponentsForm *parent = NULL, @@ -89,6 +93,17 @@ class CComponentsExtTextForm : public CComponentsForm, public CCTextScreen fb_pixel_t color_frame = COL_FRAME_PLUS_0, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); + + CComponentsExtTextForm( const int& x_pos, const int& y_pos, const int& w, const int& h, + neutrino_locale_t l_text = NONEXISTANT_LOCALE, const std::string& text = "", + Font* font_text = NULL, + CComponentsForm *parent = NULL, + int shadow_mode = CC_SHADOW_OFF, + fb_pixel_t label_color = COL_MENUCONTENTINACTIVE_TEXT, + fb_pixel_t text_color = COL_MENUCONTENT_TEXT, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, + fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); // ~CComponentsExtTextForm(); //inherited from CComponentsForm ///assigns texts for label and text, parameter as string, parameter Font is optional for required font type, default font is dependently from defined item height @@ -142,20 +157,4 @@ class CComponentsExtTextForm : public CComponentsForm, public CCTextScreen void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); }; -class CComponentsExtTextFormLocalized : public CComponentsExtTextForm -{ - public: - ///advanced constructor for CComponentsExtTextForm, provides parameters for the most required properties, and caption as locales - CComponentsExtTextFormLocalized(const int& x_pos = 1, const int& y_pos = 1, const int& w = 300, const int& h = 48, - const neutrino_locale_t& locale_label_text = NONEXISTANT_LOCALE, const neutrino_locale_t& locale_text = NONEXISTANT_LOCALE, - Font* font_text = NULL, - CComponentsForm *parent = NULL, - int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t label_color = COL_MENUCONTENTINACTIVE_TEXT, - fb_pixel_t text_color = COL_MENUCONTENT_TEXT, - fb_pixel_t color_frame = COL_FRAME_PLUS_0, - fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, - fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); -}; - #endif diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index c461a9afe..cd4b5116c 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -559,7 +559,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) else if (actionKey == "text_ext"){ if (text_ext == NULL) text_ext = new CComponentsExtTextForm(); - text_ext->setDimensionsAll(10, 20, 300, 48); + text_ext->setDimensionsAll(10, 20, 300, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight()); text_ext->setLabelAndText("Label", "Text for demo", g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]); text_ext->setFrameThickness(2); // text_ext->setLabelWidthPercent(15/*%*/); From 3725e8b62818260f6e168a466e6ae1565216b7ca Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 27 Nov 2016 21:11:47 +0100 Subject: [PATCH 12/27] CBuildInfo: add missing default font Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/04be1424a768f8bf005bae2292d9bd40ce5e51c8 Author: Thilo Graf Date: 2016-11-27 (Sun, 27 Nov 2016) ------------------ 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 3cc94094a..782edc07e 100644 --- a/src/gui/buildinfo.cpp +++ b/src/gui/buildinfo.cpp @@ -45,7 +45,7 @@ void CBuildInfo::initVarBuildInfo() { setCenterPos(); - font = NULL; + font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]; setWindowHeaderButtons(CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT); InitInfoItems(); From 43ff7f2cb8f1b5c5436cf689783d1bc40ed0f48f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 27 Nov 2016 21:42:25 +0100 Subject: [PATCH 13/27] CTextBox: use CORNER_NONE as default corner mode CORNER_ALL is not the same like CORNER_NONE. Could cause problems in the evaluation. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8142ed47cc8e42c1e2b316023b81bec673c9d9c9 Author: Thilo Graf Date: 2016-11-27 (Sun, 27 Nov 2016) ------------------ 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 41ca9e7dc..c1c17ce60 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -186,7 +186,7 @@ void CTextBox::initVar(void) m_nPaintBackground = true; m_SaveScreen = false; m_nBgRadius = m_old_nBgRadius = 0; - m_nBgRadiusType = m_old_nBgRadiusType = CORNER_ALL; + m_nBgRadiusType = m_old_nBgRadiusType = CORNER_NONE; m_cLineArray.clear(); @@ -292,7 +292,7 @@ void CTextBox::initFramesRel(void) m_cFrameTextRel.iX = 0; m_cFrameTextRel.iY = 0; - m_cFrameTextRel.iHeight = m_cFrame.iHeight ; + m_cFrameTextRel.iHeight = m_cFrame.iHeight ; if(m_nMode & SCROLL) { @@ -583,7 +583,7 @@ void CTextBox::refreshText(void) if( frameBuffer == NULL) return; - //TRACE("[CTextBox] m_nCurrentLine: %d, m_nNrOfLines %d, m_cLineArray[m_nCurrentLine]: %s\r\n",m_nCurrentLine, m_nNrOfLines, m_cLineArray[m_nCurrentLine].c_str()); + //TRACE("[CTextBox] m_nCurrentLine: %d, m_nNrOfLines %d, m_cLineArray[m_nCurrentLine]: %s m_nBgRadius: %d\r\n",m_nCurrentLine, m_nNrOfLines, m_cLineArray[m_nCurrentLine].c_str(), m_nBgRadius, m_nBgRadiusType); //bg variables int ax = m_cFrameTextRel.iX+m_cFrame.iX; @@ -688,7 +688,7 @@ void CTextBox::refreshText(void) y += m_nFontTextHeight + ((m_cFrameTextRel.iHeight - m_nFontTextHeight * lines) >> 1); #ifdef VISUAL_DEBUG - frameBuffer->paintBoxRel(m_cFrame.iX, m_cFrame.iY, m_cFrame.iWidth, m_cFrame.iHeight, COL_GREEN); + frameBuffer->paintBoxRel(m_cFrame.iX, m_cFrame.iY, m_cFrame.iWidth, m_cFrame.iHeight, COL_GREEN, m_nBgRadius, m_nBgRadiusType); #endif for(i = m_nCurrentLine; i < m_nNrOfLines && i < m_nCurrentLine + m_nLinesPerPage; i++) @@ -710,7 +710,7 @@ void CTextBox::refreshText(void) #ifdef VISUAL_DEBUG int th = m_nFontTextHeight; - frameBuffer->paintBoxRel(tx, ty-th, tw, th, COL_RED); + frameBuffer->paintBoxRel(tx, ty-th, tw, th, COL_RED, m_nBgRadius, m_nBgRadiusType); #endif //TRACE("[CTextBox] %s Line %d m_cFrame.iX %d m_cFrameTextRel.iX %d\r\n", __FUNCTION__, __LINE__, m_cFrame.iX, m_cFrameTextRel.iX); m_pcFontText->RenderString(tx, ty, tw, m_cLineArray[i].c_str(), m_textColor, 0, m_renderMode | (m_utf8_encoded) ? Font::IS_UTF8 : 0); From 10c17a365b0e8a5580669bed4697ca57d9662905 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 27 Nov 2016 16:50:41 +0100 Subject: [PATCH 14/27] CImageInfo: remove CC_APPEND Should not be used in the future. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9b039f45bc5ad980b445348452b52e7a10be7ec0 Author: Thilo Graf Date: 2016-11-27 (Sun, 27 Nov 2016) ------------------ This commit was generated by Migit --- src/gui/imageinfo.cpp | 17 ++++++++--------- src/gui/imageinfo.h | 2 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index feda1034f..6f946a3ab 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -72,7 +72,7 @@ void CImageInfo::Init(void) item_offset = 10; item_font = NULL; item_height = 0; - + y_tmp = 0; license_txt = ""; v_info.clear(); config.loadConfig(VERSION_FILE); @@ -351,8 +351,9 @@ void CImageInfo::InitInfos() cc_info->setWidth(cc_win->getWidth() - cc_tv->getWidth() - 2*item_offset); //create label and text items + y_tmp = 0; for (size_t i=0; igetWidth(), 0, g_Locale->getText(v_info[i].caption), v_info[i].info_text); + CComponentsExtTextForm *item = new CComponentsExtTextForm(1, y_tmp, cc_info->getWidth(), 0, g_Locale->getText(v_info[i].caption), v_info[i].info_text); item->setLabelWidthPercent(20); if (!item_font){ @@ -363,16 +364,13 @@ void CImageInfo::InitInfos() item->setHeight(item_height); cc_info->setHeight(v_info.size()*item_height); - if ((i == 0) && (item->getYPos() == CC_APPEND)) - item->setYPos(1); - //add ext-text object to window body if (!item->isAdded()) cc_info->addCCItem(item); //add an offset before homepage and license and at the end if (v_info[i].caption == LOCALE_IMAGEINFO_CREATOR || v_info[i].caption == LOCALE_IMAGEINFO_FORUM){ - CComponentsShapeSquare *spacer = new CComponentsShapeSquare(1, CC_APPEND, 1, item_offset); + CComponentsShapeSquare *spacer = new CComponentsShapeSquare(1, y_tmp+=item_offset, 1, item_offset); //spacer ist not visible! spacer->allowPaint(false); cc_info->addCCItem(spacer); @@ -380,6 +378,7 @@ void CImageInfo::InitInfos() int tmp_h = cc_info->getHeight(); cc_info->setHeight(tmp_h + item_offset); } + y_tmp += item->getHeight(); } } @@ -414,7 +413,7 @@ void CImageInfo::InitInfoText(const std::string& text) Font * caption_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]; int caption_height = caption_font->getHeight(); if (cc_sub_caption == NULL) - cc_sub_caption = new CComponentsLabel(cc_info->getXPos(), CC_APPEND, cc_info->getWidth(), caption_height, + 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); if (!cc_sub_caption->isAdded()) cc_win->addWindowItem(cc_sub_caption); @@ -423,9 +422,9 @@ void CImageInfo::InitInfoText(const std::string& text) int h_txt = h_body - item_offset - cc_info->getHeight() - cc_sub_caption->getHeight() - item_offset; if (cc_lic == NULL) - cc_lic = new CComponentsInfoBox(CC_CENTERED, CC_APPEND, w_body-2*item_offset, h_txt); + cc_lic = new CComponentsInfoBox(CC_CENTERED, y_tmp+=cc_sub_caption->getHeight(), w_body-2*item_offset, h_txt); cc_lic->setSpaceOffset(1); - cc_lic->setText(text, CTextBox::TOP | CTextBox::AUTO_WIDTH | CTextBox::SCROLL, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]); + cc_lic->setText(text, CTextBox::TOP | CTextBox::AUTO_WIDTH | CTextBox::SCROLL, item_font); cc_lic->doPaintTextBoxBg(true); //add text to container diff --git a/src/gui/imageinfo.h b/src/gui/imageinfo.h index a243866b4..9d6e399f8 100644 --- a/src/gui/imageinfo.h +++ b/src/gui/imageinfo.h @@ -50,7 +50,7 @@ class CImageInfo : public CMenuTarget std::string license_txt; Font* item_font; int item_height; - + int y_tmp; std::vector v_info; void Clean(); From 192655ed15b78514708004b03b33d5e4caa8d37d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 27 Nov 2016 14:29:50 +0100 Subject: [PATCH 15/27] CComponentsFooter: disable gradient for footers This is not really completly implemented for footer at the momemnt, because button objects are still not prepared or tuned for that. If it is enabled, currently it could occur unintentionally background behavior eg.: flickereffects or background display errors in button objects. NOTE: anyway users can enable gradient in theme files and could override this setting. Now here it is globally disabled for footers. If it works right, it will be enabled in future. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/427b65813d9f0df6b05b18407ae70ca966ddd482 Author: Thilo Graf Date: 2016-11-27 (Sun, 27 Nov 2016) Origin message was: ------------------ CComponentsFooter: disable gradient for footers This is not really completly implemented for footer at the momemnt, because button objects are still not prepared or tuned for that. If it is enabled, currently it could occur unintentionally background behavior eg.: flickereffects or background display errors in button objects. NOTE: anyway users can enable gradient in theme files and could override this setting. Now here it is globally disabled for footers. If it works right, it will be enabled in future. ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_footer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 4a1cbfc4e..df899c306 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -79,7 +79,7 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const col_frame = color_frame; col_body = color_body; col_shadow = color_shadow; - cc_body_gradient_enable = cc_body_gradient_enable_old = g_settings.theme.menu_ButtonBar_gradient; //TODO: not complete implemented at the moment + cc_body_gradient_enable = cc_body_gradient_enable_old = CC_COLGRAD_OFF/*g_settings.theme.menu_ButtonBar_gradient*/; //TODO: not complete implemented at the moment cc_body_gradient_direction = CFrameBuffer::gradientVertical; cc_body_gradient_mode = CColorGradient::gradientDark2Light; btn_auto_frame_col = false; From 2dfeba10f0b5308a0c15cf42c206ad10c28a4dca Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 29 Nov 2016 16:13:47 +0100 Subject: [PATCH 16/27] CComponentsFooter: fix wrong text color with single button in footers * remove size compare If only one button exists, possible new text color would be ignored and wrong Text color was visible with one item. This behavior was observed in message boxes with single buttons (eg OK, or Cancel). Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8bf6b7fb3a5203d734ebabbb79dd19b59736322f Author: Thilo Graf Date: 2016-11-29 (Tue, 29 Nov 2016) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_footer.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index df899c306..9874a122b 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -362,8 +362,7 @@ void CComponentsFooter::setSelectedButton(size_t item_id, sel_col = sel_fr_col; //TODO: make it configurable chain->setSelectedItem(item_id, sel_col, fr_col, sel_bg_col, bg_col, frame_width, sel_frame_width); - if (chain->size() > 1) - getSelectedButtonObject()->setButtonTextColor(sel_text_col); + getSelectedButtonObject()->setButtonTextColor(sel_text_col); } } From fae59af605b03c93f2a79f6aee1c4dfe54424ff7 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 29 Nov 2016 16:31:44 +0100 Subject: [PATCH 17/27] CMsgBox: reduce flicker effects with single button Disabled refresh avoids unnecessary repaints with possible flicker effects on pressed navi keys. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d632d6658163365a9ce0f6e1047b9171f03005d7 Author: Thilo Graf Date: 2016-11-29 (Tue, 29 Nov 2016) ------------------ This commit was generated by Migit --- src/gui/widget/msgbox.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index e2edcdeed..51480afa1 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -288,15 +288,19 @@ int CMsgBox::exec() mb_show_button = ccw_footer->getSelectedButtonObject()->getButtonAlias(); } selected = ccw_footer->getSelectedButton(); - refreshFoot(); - //refresh timeout on any pressed navi key! This resets current timeout end to the initial value + //***refresh buttons only if we have more than one button, this avoids unnecessary repaints with possible flicker effects*** + if (ccw_footer->getButtonChainObject()->size()>1) + refreshFoot(); + + //***refresh timeout on any pressed navi key! This resets current timeout end to initial value*** if (timeout > 0){ timeout_pb->setValues(0, timeout); timeoutEnd = CRCInput::calcTimeoutEnd(timeout); } dprintf(DEBUG_INFO, "\033[32m[CMsgBox] [%s - %d] result = %d, mb_show_button = %d\033[0m\n", __func__, __LINE__, result, mb_show_button); } + //***action buttons without preselection*** for (size_t i = 0; i< ccw_footer->getButtonChainObject()->size(); i++){ CComponentsButton* btn_action = static_cast(ccw_footer->getButtonChainObject()->getCCItem(i)); From b60a4f9ab798ea3faf5e01f2b9aa15097a7896a0 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 30 Nov 2016 09:17:04 +0100 Subject: [PATCH 18/27] bouqueteditor: fix icon alignment Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/8c2301472bbf08463390d843b6e484bc77bb7308 Author: vanhofen Date: 2016-11-30 (Wed, 30 Nov 2016) Origin message was: ------------------ - bouqueteditor: fix icon alignment ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/bedit/bouqueteditor_bouquets.cpp | 32 ++++++++++++++-------- src/gui/bedit/bouqueteditor_channels.cpp | 10 +++---- src/gui/bedit/bouqueteditor_chanselect.cpp | 10 +++---- 3 files changed, 31 insertions(+), 21 deletions(-) diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index f09ad4a66..9c7017a46 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -97,22 +97,22 @@ void CBEBouquetWidget::paintItem(int pos) if (current < Bouquets->size()) { if ((i_selected) && (state == beMoving)) - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x + 5, ypos, iheight); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x + OFFSET_INNER_MID, ypos, iheight); if ((*Bouquets)[current]->bHidden) - frameBuffer->paintIcon(NEUTRINO_ICON_HIDDEN, x + 26, ypos, iheight); + frameBuffer->paintIcon(NEUTRINO_ICON_HIDDEN, x + OFFSET_INNER_MID + iconoffset, ypos, iheight); if ((*Bouquets)[current]->bLocked != g_settings.parentallock_defaultlocked) - frameBuffer->paintIcon(NEUTRINO_ICON_LOCK, x + 18 + iconoffset, ypos, iheight); + frameBuffer->paintIcon(NEUTRINO_ICON_LOCK, x + OFFSET_INNER_MID + 2*iconoffset, ypos, iheight); if (!(*Bouquets)[current]->tvChannels.empty() ) { - frameBuffer->paintIcon(NEUTRINO_ICON_VIDEO, x + 20 + 2*iconoffset - 2, ypos, iheight); + frameBuffer->paintIcon(NEUTRINO_ICON_VIDEO, x + OFFSET_INNER_MID + 3*iconoffset, ypos, iheight); } if (!(*Bouquets)[current]->radioChannels.empty()) { - frameBuffer->paintIcon(NEUTRINO_ICON_AUDIO, x + 20+ 3*iconoffset - 4, ypos, iheight); + frameBuffer->paintIcon(NEUTRINO_ICON_AUDIO, x + OFFSET_INNER_MID + 4*iconoffset, ypos, iheight); } - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x +20 + 4*iconoffset, ypos + iheight - (iheight-fheight)/2, width-iconoffset-20, (*Bouquets)[current]->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : (*Bouquets)[current]->Name, color); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + 2*OFFSET_INNER_MID + 5*iconoffset, ypos + iheight - (iheight-fheight)/2, width - 3*OFFSET_INNER_MID - 5*iconoffset, (*Bouquets)[current]->bFav ? g_Locale->getText(LOCALE_FAVORITES_BOUQUETNAME) : (*Bouquets)[current]->Name, color); } } @@ -203,21 +203,31 @@ int CBEBouquetWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* int icol_w, icol_h; frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_YELLOW, &icol_w, &icol_h); - iheight = std::max(fheight, icol_h+2); + iheight = std::max(fheight, icol_h + OFFSET_INNER_MIN); iconoffset = std::max(iconoffset, icol_w); frameBuffer->getIconSize(NEUTRINO_ICON_LOCK, &icol_w, &icol_h); - iheight = std::max(iheight, icol_h+2); + iheight = std::max(fheight, icol_h + OFFSET_INNER_MIN); iconoffset = std::max(iconoffset, icol_w); frameBuffer->getIconSize(NEUTRINO_ICON_HIDDEN, &icol_w, &icol_h); - iheight = std::max(iheight, icol_h+2); + iheight = std::max(fheight, icol_h + OFFSET_INNER_MIN); + iconoffset = std::max(iconoffset, icol_w); + + frameBuffer->getIconSize(NEUTRINO_ICON_VIDEO, &icol_w, &icol_h); + iheight = std::max(fheight, icol_h + OFFSET_INNER_MIN); + iconoffset = std::max(iconoffset, icol_w); + + frameBuffer->getIconSize(NEUTRINO_ICON_AUDIO, &icol_w, &icol_h); + iheight = std::max(fheight, icol_h + OFFSET_INNER_MIN); iconoffset = std::max(iconoffset, icol_w); width = frameBuffer->getScreenWidthRel(); height = frameBuffer->getScreenHeightRel() - ButtonHeight; - listmaxshow = (height-theight-0)/iheight; - height = theight+0+listmaxshow*iheight; // recalc height + + listmaxshow = (height-theight)/iheight; + height = theight+listmaxshow*iheight; // recalc height + x = getScreenStartX(width); y = getScreenStartY(height + ButtonHeight); diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 38310c319..03f3776d8 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -125,19 +125,19 @@ void CBEChannelWidget::paintItem(int pos) frameBuffer->paintBoxRel(x, ypos, width- 15, iheight, bgcolor, i_radius); if ((current == selected) && (state == beMoving)) { - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x + 5, ypos, iheight); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x + OFFSET_INNER_MID, ypos, iheight); } if (current < Channels->size()) { if ((*Channels)[current]->bLocked) { - frameBuffer->paintIcon(NEUTRINO_ICON_LOCK, x + 22, ypos, iheight); + frameBuffer->paintIcon(NEUTRINO_ICON_LOCK, x + OFFSET_INNER_MID + iconoffset, ypos, iheight); } //g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 5+ numwidth+ 10, ypos+ fheight, width- numwidth- 20- 15, (*Channels)[current]->getName(), color); //FIXME numwidth ? we not show chan numbers - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 22 + iconoffset, ypos + iheight - (iheight-fheight)/2, width- iconoffset- 20, (*Channels)[current]->getName(), color); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + 2*OFFSET_INNER_MID + 2*iconoffset, ypos + iheight - (iheight-fheight)/2, width - 3*OFFSET_INNER_MID - 2*iconoffset, (*Channels)[current]->getName(), color); if((*Channels)[current]->scrambled) - frameBuffer->paintIcon(NEUTRINO_ICON_SCRAMBLED, x+width- 15 - 28, ypos, fheight); + frameBuffer->paintIcon(NEUTRINO_ICON_SCRAMBLED, x + width - 15 - OFFSET_INNER_MID - iconoffset, ypos, fheight); else if (!(*Channels)[current]->getUrl().empty()) - frameBuffer->paintIcon(NEUTRINO_ICON_STREAMING, x+width- 15 - 28, ypos, fheight); + frameBuffer->paintIcon(NEUTRINO_ICON_STREAMING, x + width - 15 - OFFSET_INNER_MID - iconoffset, ypos, fheight); } } diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp index 79896b0b1..c60372450 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.cpp +++ b/src/gui/bedit/bouqueteditor_chanselect.cpp @@ -135,15 +135,15 @@ void CBEChannelSelectWidget::paintItem(uint32_t itemNr, int paintNr, bool pselec if(itemNr < getItemCount()) { if( isChannelInBouquet(itemNr)) - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, x+10, ypos, iheight); + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_GREEN, x + OFFSET_INNER_MID, ypos, iheight); else - frameBuffer->paintBoxRel(x+10, ypos, iconoffset, iheight, bgcolor); + frameBuffer->paintBoxRel(x + OFFSET_INNER_MID, ypos, iconoffset, iheight, bgcolor); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + 20 + iconoffset, ypos + iheight - (iheight-fheight)/2, width - 20 - iconoffset, Channels[itemNr]->getName(), color); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + 2*OFFSET_INNER_MID + 2*iconoffset, ypos + iheight - (iheight-fheight)/2, width - 3*OFFSET_INNER_MID - 2*iconoffset, Channels[itemNr]->getName(), color); if(Channels[itemNr]->scrambled) - frameBuffer->paintIcon(NEUTRINO_ICON_SCRAMBLED, x+width- 15 - 28, ypos, fheight); + frameBuffer->paintIcon(NEUTRINO_ICON_SCRAMBLED, x + width - 15 - OFFSET_INNER_MID - iconoffset, ypos, fheight); else if (!Channels[itemNr]->getUrl().empty()) - frameBuffer->paintIcon(NEUTRINO_ICON_STREAMING, x+width- 15 - 28, ypos, fheight); + frameBuffer->paintIcon(NEUTRINO_ICON_STREAMING, x + width - 15 - OFFSET_INNER_MID - iconoffset, ypos, fheight); } } From b74fcf66763c05fbf82988e716b0b68943681729 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 1 Dec 2016 14:26:39 +0100 Subject: [PATCH 19/27] lua: Fix InfoFunc for displaying information in the movieplayer - Fix for commit 7c29c4029ee1fe61a4776070c5963fd9aa508fd1 - Set Lua api version to 1.66 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1aee964c14809a4008e5ad8ed8f26c984ec2e580 Author: Michael Liebmann Date: 2016-12-01 (Thu, 01 Dec 2016) ------------------ This commit was generated by Migit --- src/gui/lua/lua_api_version.h | 2 +- src/gui/movieplayer.cpp | 54 +++++++++++++++++++++-------------- 2 files changed, 34 insertions(+), 22 deletions(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 9c36a6594..8e72db293 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 65 +#define LUA_API_VERSION_MINOR 66 diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index c16c21031..3680a5573 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1524,13 +1524,38 @@ void CMoviePlayerGui::PlayFileLoop(void) SetPosition(1000 * (hh * 3600 + mm * 60 + ss), true); } else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) { - if (fromInfoviewer) - { - g_EpgData->show_mp(p_movie_info,GetPosition(),GetDuration()); - fromInfoviewer = false; +#ifdef ENABLE_LUA + if (isLuaPlay && haveLuaInfoFunc) { + CTimeOSD::mode m_mode = FileTime.getMode(); + bool restore = FileTime.IsVisible(); + if (restore) + FileTime.kill(); + CInfoClock::getInstance()->enableInfoClock(false); + + int xres = 0, yres = 0, aspectRatio = 0, framerate = -1; + if (!videoDecoder->getBlank()) { + videoDecoder->getPictureInfo(xres, yres, framerate); + if (yres == 1088) + yres = 1080; + aspectRatio = videoDecoder->getAspectRatio(); + } + CLuaInstVideo::getInstance()->execLuaInfoFunc(luaState, xres, yres, aspectRatio, framerate); + + CInfoClock::getInstance()->enableInfoClock(true); + if (restore) { + FileTime.setMode(m_mode); + FileTime.update(position, duration); + } + + } else { +#endif + if (fromInfoviewer) { + g_EpgData->show_mp(p_movie_info,GetPosition(),GetDuration()); + fromInfoviewer = false; + } + else + callInfoViewer(); } - else - callInfoViewer(); update_lcd = true; clearSubtitle(); } else if (timeshift != TSHIFT_MODE_OFF && (msg == CRCInput::RC_text || msg == CRCInput::RC_epg || msg == NeutrinoMessages::SHOW_EPG)) { @@ -2139,27 +2164,14 @@ void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/) cMovieInfo.saveMovieInfo(*p_movie_info); /* save immediately in xml file */ } } - } else if (msg == NeutrinoMessages::SHOW_EPG && (p_movie_info || (isLuaPlay && haveLuaInfoFunc))) { + } else if (msg == NeutrinoMessages::SHOW_EPG && p_movie_info) { CTimeOSD::mode m_mode = FileTime.getMode(); bool restore = FileTime.IsVisible(); if (restore) FileTime.kill(); CInfoClock::getInstance()->enableInfoClock(false); - if (isLuaPlay && haveLuaInfoFunc) { - int xres = 0, yres = 0, aspectRatio = 0, framerate = -1; - if (!videoDecoder->getBlank()) { - videoDecoder->getPictureInfo(xres, yres, framerate); - if (yres == 1088) - yres = 1080; - aspectRatio = videoDecoder->getAspectRatio(); - } -#ifdef ENABLE_LUA - CLuaInstVideo::getInstance()->execLuaInfoFunc(luaState, xres, yres, aspectRatio, framerate); -#endif - } - else if (p_movie_info) - g_EpgData->show_mp(p_movie_info, position, duration); + g_EpgData->show_mp(p_movie_info, position, duration); CInfoClock::getInstance()->enableInfoClock(true); if (restore) { From 376eabfd9e503132453214e3989a16e74dcaeedf Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 1 Dec 2016 18:21:47 +0100 Subject: [PATCH 20/27] CLuaInstCCText: Add various script functions getLines() getLines(test) setDimensionsAll(x, y, w, h) - Set Lua api version to 1.67 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/15766815439862c17a81ef158d473fc5040ae682 Author: Michael Liebmann Date: 2016-12-01 (Thu, 01 Dec 2016) ------------------ This commit was generated by Migit --- src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/lua_cc_text.cpp | 60 ++++++++++++++++++++++++++++++----- src/gui/lua/lua_cc_text.h | 2 ++ 3 files changed, 55 insertions(+), 9 deletions(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 8e72db293..28aa21d52 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 66 +#define LUA_API_VERSION_MINOR 67 diff --git a/src/gui/lua/lua_cc_text.cpp b/src/gui/lua/lua_cc_text.cpp index 7e1ea5d36..461164e1a 100644 --- a/src/gui/lua/lua_cc_text.cpp +++ b/src/gui/lua/lua_cc_text.cpp @@ -54,14 +54,16 @@ CLuaCCText *CLuaInstCCText::CCTextCheck(lua_State *L, int n) void CLuaInstCCText::CCTextRegister(lua_State *L) { luaL_Reg meth[] = { - { "new", CLuaInstCCText::CCTextNew }, - { "paint", CLuaInstCCText::CCTextPaint }, - { "hide", CLuaInstCCText::CCTextHide }, - { "setText", CLuaInstCCText::CCTextSetText }, - { "scroll", CLuaInstCCText::CCTextScroll }, - { "setCenterPos", CLuaInstCCText::CCTextSetCenterPos }, - { "enableUTF8", CLuaInstCCText::CCTextEnableUTF8 }, - { "__gc", CLuaInstCCText::CCTextDelete }, + { "new", CLuaInstCCText::CCTextNew }, + { "paint", CLuaInstCCText::CCTextPaint }, + { "hide", CLuaInstCCText::CCTextHide }, + { "setText", CLuaInstCCText::CCTextSetText }, + { "getLines", CLuaInstCCText::CCTextGetLines }, + { "scroll", CLuaInstCCText::CCTextScroll }, + { "setCenterPos", CLuaInstCCText::CCTextSetCenterPos }, + { "enableUTF8", CLuaInstCCText::CCTextEnableUTF8 }, + { "setDimensionsAll", CLuaInstCCText::CCTextSetDimensionsAll }, + { "__gc", CLuaInstCCText::CCTextDelete }, { NULL, NULL } }; @@ -214,6 +216,26 @@ int CLuaInstCCText::CCTextSetText(lua_State *L) return 0; } +int CLuaInstCCText::CCTextGetLines(lua_State *L) +{ + CLuaCCText *D = CCTextCheck(L, 1); + if (!D) return 0; + + lua_Integer lines = 0; + if (lua_gettop(L) == 2) { + const char* Text = luaL_checkstring(L, 2); + lines = (lua_Integer)CTextBox::getLines(Text); + } + else { + CTextBox* ctb = D->ct->getCTextBoxObject(); + if (ctb) + lines = (lua_Integer)ctb->getLines(); + } + + lua_pushinteger(L, lines); + return 1; +} + int CLuaInstCCText::CCTextScroll(lua_State *L) { lua_assert(lua_istable(L,1)); @@ -273,6 +295,28 @@ int CLuaInstCCText::CCTextEnableUTF8(lua_State *L) return 0; } +int CLuaInstCCText::CCTextSetDimensionsAll(lua_State *L) +{ + CLuaCCText *D = CCTextCheck(L, 1); + if (!D) return 0; + lua_Integer x = luaL_checkint(L, 2); + lua_Integer y = luaL_checkint(L, 3); + lua_Integer w = luaL_checkint(L, 4); + lua_Integer h = luaL_checkint(L, 5); + if(x>-1 && y > -1 && w > 1 && h > 1){ + if (h > (lua_Integer)CFrameBuffer::getInstance()->getScreenHeight()) + h = (lua_Integer)CFrameBuffer::getInstance()->getScreenHeight(); + if (w > (lua_Integer)CFrameBuffer::getInstance()->getScreenWidth()) + w = (lua_Integer)CFrameBuffer::getInstance()->getScreenWidth(); + if(x > w) + x = 0; + if(y > h) + y = 0; + D->ct->setDimensionsAll(x,y,w,h); + } + return 0; +} + int CLuaInstCCText::CCTextDelete(lua_State *L) { LUA_DEBUG("CLuaInstCCText::%s %d\n", __func__, lua_gettop(L)); diff --git a/src/gui/lua/lua_cc_text.h b/src/gui/lua/lua_cc_text.h index 67728e533..c0f31d639 100644 --- a/src/gui/lua/lua_cc_text.h +++ b/src/gui/lua/lua_cc_text.h @@ -47,9 +47,11 @@ class CLuaInstCCText static int CCTextPaint(lua_State *L); static int CCTextHide(lua_State *L); static int CCTextSetText(lua_State *L); + static int CCTextGetLines(lua_State *L); static int CCTextScroll(lua_State *L); static int CCTextSetCenterPos(lua_State *L); static int CCTextEnableUTF8(lua_State *L); + static int CCTextSetDimensionsAll(lua_State *L); static int CCTextDelete(lua_State *L); }; From 90dc3d43a99ea59fa2c9f482fcbfe641762d9ee0 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 1 Dec 2016 21:59:36 +0100 Subject: [PATCH 21/27] infoviewer: move ICON_CA to the left Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/716e64b10c629f382f9ab5cebcf1aa817b352c25 Author: vanhofen Date: 2016-12-01 (Thu, 01 Dec 2016) Origin message was: ------------------ - infoviewer: move ICON_CA to the left ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/infoviewer_bb.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/infoviewer_bb.h b/src/gui/infoviewer_bb.h index c65d8226e..d7645291f 100644 --- a/src/gui/infoviewer_bb.h +++ b/src/gui/infoviewer_bb.h @@ -69,8 +69,8 @@ class CInfoViewerBB ICON_DD = 3, ICON_16_9 = 4, ICON_RES = 5, - ICON_CA = 6, - ICON_TUNER = 7, + ICON_TUNER = 6, //NI + ICON_CA = 7, //NI; ICON_CA should always be the last in this enum ICON_MAX = 8 }; From 7ed170cf118bcbe11c17fa7ec4b35c03f33ce604 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 1 Dec 2016 22:32:35 +0100 Subject: [PATCH 22/27] CComponentsWindow: fix window body color Color parameter was not passed to body. Parameters in constructor and setters had no effect. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c1ec746321dfccfdb81eae0191f248e4768f293f Author: Thilo Graf Date: 2016-12-01 (Thu, 01 Dec 2016) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_window.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index a7c84cba3..451d74be3 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -297,6 +297,7 @@ void CComponentsWindow::initBody() ccw_body->setDimensionsAll(x_body, h_header, w_body, h_body); ccw_body->doPaintBg(true); + ccw_body->setColorBody(col_body); //handle corner behavior if (!ccw_show_header) From 57de23f12a43c2e368628b768b01106e92ce969b Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 2 Dec 2016 00:15:57 +0100 Subject: [PATCH 23/27] CLuaInstVideo::PlayFile: Infoviewer was not displayed when InfoFunc was set - Fix commit b74fcf66763c05fbf82988e716b0b68943681729 - Set Lua api version to 1.68 Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/e92df63a4ab2dfa9e90a7729a39cfeab70bfc462 Author: Michael Liebmann Date: 2016-12-02 (Fri, 02 Dec 2016) ------------------ This commit was generated by Migit --- src/gui/lua/lua_api_version.h | 2 +- src/gui/movieplayer.cpp | 51 ++++++++++++++++++----------------- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 28aa21d52..54fa105fa 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 67 +#define LUA_API_VERSION_MINOR 68 diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 3680a5573..e6c5b24c4 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1524,38 +1524,41 @@ void CMoviePlayerGui::PlayFileLoop(void) SetPosition(1000 * (hh * 3600 + mm * 60 + ss), true); } else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) { + if (fromInfoviewer) { #ifdef ENABLE_LUA - if (isLuaPlay && haveLuaInfoFunc) { - CTimeOSD::mode m_mode = FileTime.getMode(); - bool restore = FileTime.IsVisible(); - if (restore) - FileTime.kill(); - CInfoClock::getInstance()->enableInfoClock(false); + if (isLuaPlay && haveLuaInfoFunc) { + CTimeOSD::mode m_mode = FileTime.getMode(); + bool restore = FileTime.IsVisible(); + if (restore) + FileTime.kill(); + CInfoClock::getInstance()->enableInfoClock(false); - int xres = 0, yres = 0, aspectRatio = 0, framerate = -1; - if (!videoDecoder->getBlank()) { - videoDecoder->getPictureInfo(xres, yres, framerate); - if (yres == 1088) - yres = 1080; - aspectRatio = videoDecoder->getAspectRatio(); + int xres = 0, yres = 0, aspectRatio = 0, framerate = -1; + if (!videoDecoder->getBlank()) { + videoDecoder->getPictureInfo(xres, yres, framerate); + if (yres == 1088) + yres = 1080; + aspectRatio = videoDecoder->getAspectRatio(); + } + CLuaInstVideo::getInstance()->execLuaInfoFunc(luaState, xres, yres, aspectRatio, framerate); + fromInfoviewer = false; + + CInfoClock::getInstance()->enableInfoClock(true); + if (restore) { + FileTime.setMode(m_mode); + FileTime.update(position, duration); + } } - CLuaInstVideo::getInstance()->execLuaInfoFunc(luaState, xres, yres, aspectRatio, framerate); - - CInfoClock::getInstance()->enableInfoClock(true); - if (restore) { - FileTime.setMode(m_mode); - FileTime.update(position, duration); - } - - } else { + else { #endif - if (fromInfoviewer) { g_EpgData->show_mp(p_movie_info,GetPosition(),GetDuration()); fromInfoviewer = false; +#ifdef ENABLE_LUA } - else - callInfoViewer(); +#endif } + else + callInfoViewer(); update_lcd = true; clearSubtitle(); } else if (timeshift != TSHIFT_MODE_OFF && (msg == CRCInput::RC_text || msg == CRCInput::RC_epg || msg == NeutrinoMessages::SHOW_EPG)) { From 8dbecf498061adc2a9cb61464bc6d5c3839c1b68 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 2 Dec 2016 00:16:05 +0100 Subject: [PATCH 24/27] MoviePlayer: Disable InfoClock and FileTime when view movieinfo Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/47ffc7586a41fdcfaee31006cb9fc01757c7bb25 Author: Michael Liebmann Date: 2016-12-02 (Fri, 02 Dec 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/movieplayer.cpp | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index e6c5b24c4..a09f6dfe3 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1525,14 +1525,13 @@ void CMoviePlayerGui::PlayFileLoop(void) } else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) { if (fromInfoviewer) { + CTimeOSD::mode m_mode = FileTime.getMode(); + bool restore = FileTime.IsVisible(); + if (restore) + FileTime.kill(); + CInfoClock::getInstance()->enableInfoClock(false); #ifdef ENABLE_LUA if (isLuaPlay && haveLuaInfoFunc) { - CTimeOSD::mode m_mode = FileTime.getMode(); - bool restore = FileTime.IsVisible(); - if (restore) - FileTime.kill(); - CInfoClock::getInstance()->enableInfoClock(false); - int xres = 0, yres = 0, aspectRatio = 0, framerate = -1; if (!videoDecoder->getBlank()) { videoDecoder->getPictureInfo(xres, yres, framerate); @@ -1541,21 +1540,19 @@ void CMoviePlayerGui::PlayFileLoop(void) aspectRatio = videoDecoder->getAspectRatio(); } CLuaInstVideo::getInstance()->execLuaInfoFunc(luaState, xres, yres, aspectRatio, framerate); - fromInfoviewer = false; - - CInfoClock::getInstance()->enableInfoClock(true); - if (restore) { - FileTime.setMode(m_mode); - FileTime.update(position, duration); - } } else { #endif g_EpgData->show_mp(p_movie_info,GetPosition(),GetDuration()); - fromInfoviewer = false; #ifdef ENABLE_LUA } #endif + fromInfoviewer = false; + CInfoClock::getInstance()->enableInfoClock(true); + if (restore) { + FileTime.setMode(m_mode); + FileTime.update(position, duration); + } } else callInfoViewer(); From 4590bd464414d8aad7b78afb76dd1684ccfc795d Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 2 Dec 2016 00:33:59 +0100 Subject: [PATCH 25/27] MoviePlayer: Disable NI InfoIcons when view movieinfo Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c05351c8d8ccacfa8800033c62c33967115bc7a9 Author: Michael Liebmann Date: 2016-12-02 (Fri, 02 Dec 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/movieplayer.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 4f58c5e7a..65b7603b2 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1566,6 +1566,7 @@ void CMoviePlayerGui::PlayFileLoop(void) if (restore) FileTime.kill(); CInfoClock::getInstance()->enableInfoClock(false); + InfoIcons->enableInfoIcons(false); //NI InfoIcons #ifdef ENABLE_LUA if (isLuaPlay && haveLuaInfoFunc) { int xres = 0, yres = 0, aspectRatio = 0, framerate = -1; @@ -1585,6 +1586,7 @@ void CMoviePlayerGui::PlayFileLoop(void) #endif fromInfoviewer = false; CInfoClock::getInstance()->enableInfoClock(true); + InfoIcons->enableInfoIcons(true); //NI InfoIcons if (restore) { FileTime.setMode(m_mode); FileTime.update(position, duration); From 48cc63df9e6338af27c024c5d96907e7e863d79d Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 1 Dec 2016 22:04:40 +0100 Subject: [PATCH 26/27] Message Timeouts: add possibilty to change timeout for static messages Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9607957e07974b64423b9e3fb6c87266723d0c83 Author: vanhofen Date: 2016-12-01 (Thu, 01 Dec 2016) ------------------ This commit was generated by Migit --- src/gui/widget/msgbox.cpp | 2 +- src/gui/widget/msgbox.h | 1 + src/system/locals.h | 1 + src/system/locals_intern.h | 1 + src/system/settings.h | 4 +++- 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 51480afa1..151a0cc73 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -238,7 +238,7 @@ int CMsgBox::exec() ccw_footer->getSelectedButtonObject()->setButtonAlias(mb_show_button); int selected = ccw_footer->getSelectedButton(); if (timeout == NO_TIMEOUT) - timeout = 0; + timeout = MSGBOX_DEFAULT_TIMEOUT; uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(timeout); diff --git a/src/gui/widget/msgbox.h b/src/gui/widget/msgbox.h index 47abd9a54..5c81dfb33 100644 --- a/src/gui/widget/msgbox.h +++ b/src/gui/widget/msgbox.h @@ -38,6 +38,7 @@ #define MSGBOX_MIN_WIDTH HINTBOX_MIN_WIDTH #define MSGBOX_MIN_HEIGHT HINTBOX_MIN_HEIGHT + 75 +#define MSGBOX_DEFAULT_TIMEOUT g_settings.timing[SNeutrinoSettings::TIMING_STATIC_MESSAGES] #define DEFAULT_MSGBOX_TEXT_MODE (CMsgBox::CENTER | CMsgBox::AUTO_WIDTH | CMsgBox::AUTO_HIGH) //! Sub class of CHintBox. Shows a window as a messagebox diff --git a/src/system/locals.h b/src/system/locals.h index 5621aa1e5..d638c71c3 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -2434,6 +2434,7 @@ typedef enum LOCALE_TIMING_MENU, LOCALE_TIMING_NUMERICZAP, LOCALE_TIMING_POPUP_MESSAGES, + LOCALE_TIMING_STATIC_MESSAGES, LOCALE_TIMING_VOLUMEBAR, LOCALE_TMDB_API_KEY, LOCALE_TMDB_ENABLED, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 875066c28..ef44b6316 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -2434,6 +2434,7 @@ const char * locale_real_names[] = "timing.menu", "timing.numericzap", "timing.popup_messages", + "timing.static_messages", "timing.volumebar", "tmdb.api_key", "tmdb.enabled", diff --git a/src/system/settings.h b/src/system/settings.h index fbb47ee6e..488bf97a2 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -406,6 +406,7 @@ struct SNeutrinoSettings TIMING_FILEBROWSER = 7, TIMING_NUMERICZAP = 8, TIMING_POPUP_MESSAGES = 9, + TIMING_STATIC_MESSAGES = 10, TIMING_SETTING_COUNT }; @@ -875,7 +876,8 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO { 3, LOCALE_TIMING_VOLUMEBAR }, { 60, LOCALE_TIMING_FILEBROWSER }, { 3, LOCALE_TIMING_NUMERICZAP }, - { 6, LOCALE_TIMING_POPUP_MESSAGES} + { 6, LOCALE_TIMING_POPUP_MESSAGES}, + { 0, LOCALE_TIMING_STATIC_MESSAGES} }; // lcdd From 4f2116df43854b8b96560b7d8430c469d1c9d58c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 2 Dec 2016 21:31:04 +0100 Subject: [PATCH 27/27] Messages: add localized osd timeout option for interactive/static messages TODO: add locales for hints Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d6ecaf855b97468e20fe31681b261b0f23798c1a Author: Thilo Graf Date: 2016-12-02 (Fri, 02 Dec 2016) ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 4 +++- data/locale/english.locale | 2 ++ data/locale/nederlands.locale | 3 +++ data/locale/slovak.locale | 3 +++ src/gui/osd_setup.cpp | 2 +- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + src/system/settings.h | 23 ++++++++++++----------- 8 files changed, 26 insertions(+), 13 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index fe07f8f8d..31f290f1b 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1433,7 +1433,8 @@ menu.hint_streaminfo Aktuelle Sender-Informationen über PIDs, SNR-Verhältnis, menu.hint_subchannel_pos Wählen Sie die Anzeigeposition der Unterkanäle aus menu.hint_sw_update System aktualisieren, Image sichern und wiederherstellen menu.hint_theme Wählen Sie ein vordefiniertes Farbschema, speichern oder laden Sie ihre eigenen Farbschemata -menu.hint_timeouts Gibt an, nach welcher Zeit in Sekunden die Menüs oder Infofenster sich automatisch schließen (0 deaktiviert) +menu.hint_timeouts Anzeigedauer für Menüs oder Infofenster, die sich automatisch schließen (0 deaktiviert) +menu.hint_timeouts_static_messages Anzeigedauer für bestimmte Meldungen mit Benutzerinteraktion menu.hint_timer_followscreenings Zeige Terminauswahl mit Folge-Events zur Timerprogrammierung menu.hint_timers Hinzufügen, entfernen und bearbeiten geplanter Aufnahmen oder anderer Timer menu.hint_timezone Wählen Sie ihre Zeitzone aus @@ -2407,6 +2408,7 @@ timing.infobar_radio Infobar (Radiobetrieb) timing.menu Menü timing.numericzap Umschalten mit Zifferntasten timing.popup_messages Popup Meldungen +timing.static_messages Interaktive Meldungen timing.volumebar Lautstärkeanzeige tmdb.api_key TMDb API Schlüssel tmdb.enabled TMDb-Unterstützung diff --git a/data/locale/english.locale b/data/locale/english.locale index fec3ec423..0772e7e91 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1434,6 +1434,7 @@ menu.hint_subchannel_pos Select subchannels menu position menu.hint_sw_update Update software menu.hint_theme Select pre-defined color theme\nSave or load theme from files menu.hint_timeouts Configure time to hide GUI windows\nin seconds +menu.hint_timeouts_static_messages Timeout for specific messages with user interaction menu.hint_timer_followscreenings Show selection with followscreenings for timer programming menu.hint_timers Add/Remove/Edit scheduled\nrecording, reminders etc. menu.hint_timezone Select your timezone @@ -2407,6 +2408,7 @@ timing.infobar_radio Infobar (radio mode) timing.menu Menu timing.numericzap Numeric Zap timing.popup_messages Popup messages +timing.static_messages Interactive messages timing.volumebar Volume bar tmdb.api_key TMDb API key tmdb.enabled TMDb support diff --git a/data/locale/nederlands.locale b/data/locale/nederlands.locale index 092ca0fb3..6450a1866 100644 --- a/data/locale/nederlands.locale +++ b/data/locale/nederlands.locale @@ -1326,6 +1326,7 @@ menu.hint_subchannel_pos Selecteer menu positie van subkanalen menu.hint_sw_update Update software menu.hint_theme Select voorgedefinieerde thema\n Opslaan of laad thema van bestand menu.hint_timeouts Verberg gebruikers interface na bepaald aantal seconden. +menu.hint_timeouts_static_messages Timeout for specific messages with user interaction menu.hint_timers Toevoegen/Verplaats/Bewerk \ngeplande opnames of timers etc. menu.hint_timezone Selecteer uw tijdzone menu.hint_tools Start tools @@ -2201,6 +2202,8 @@ timing.infobar_radio Infobalk (radio modus) timing.menu Menu timing.numericzap Numeriek Zap timing.volumebar Volume balk +timing.popup_messages Popup messages +timing.static_messages Interactive messages tmdb.read_data Zoeken TMDB data... unicable.lnb Invoer Unicable unicable.qrg Unicable Frequentie diff --git a/data/locale/slovak.locale b/data/locale/slovak.locale index c3f774481..194fb3a84 100644 --- a/data/locale/slovak.locale +++ b/data/locale/slovak.locale @@ -1433,6 +1433,7 @@ menu.hint_subchannel_pos Pozícia menu výberu sub-kanálov menu.hint_sw_update Aktualizácia software menu.hint_theme Výber prednastavených farebných vzhľadov\nUloženie alebo nahranie vzhľadu zo súborov menu.hint_timeouts Konfigurácia času zmiznutia GUI okien\nv sekundách +menu.hint_timeouts_static_messages Timeout for specific messages with user interaction menu.hint_timers Pridanie/Odstránenie/Upravenie plánovaného\nnahrávania, pripomienky atď. menu.hint_timezone Výber časového pásma menu.hint_tmdb_api_key Vložte váš TMDb API kľúč. Neuvedením údajov sa vypne podpora TMDb @@ -2402,6 +2403,8 @@ timing.infobar_radio Stavový riadok (rádio mód) timing.menu Ponuka timing.numericzap Prepínanie číslami timing.volumebar Ukazateľ hlasitosti +timing.popup_messages Popup messages +timing.static_messages Interactive messages tmdb.api_key TMDb API kľúč tmdb.enabled TMDb podpora tmdb.read_data Vyhľadávanie údajov TMDB... diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index aa2403342..aa7e0f0a3 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -1016,7 +1016,7 @@ void COsdSetup::showOsdTimeoutSetup(CMenuWidget* menu_timeout) { CMenuOptionNumberChooser *ch = new CMenuOptionNumberChooser(timing_setting[i].name, &g_settings.timing[i], true, 0, 180); ch->setNumberFormat(nf); - ch->setHint("", LOCALE_MENU_HINT_OSD_TIMING); + ch->setHint("", timing_setting[i].hint); menu_timeout->addItem(ch); } diff --git a/src/system/locals.h b/src/system/locals.h index d638c71c3..94681d367 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1461,6 +1461,7 @@ typedef enum LOCALE_MENU_HINT_SW_UPDATE, LOCALE_MENU_HINT_THEME, LOCALE_MENU_HINT_TIMEOUTS, + LOCALE_MENU_HINT_TIMEOUTS_STATIC_MESSAGES, LOCALE_MENU_HINT_TIMER_FOLLOWSCREENINGS, LOCALE_MENU_HINT_TIMERS, LOCALE_MENU_HINT_TIMEZONE, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index ef44b6316..46b5a0ba0 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1461,6 +1461,7 @@ const char * locale_real_names[] = "menu.hint_sw_update", "menu.hint_theme", "menu.hint_timeouts", + "menu.hint_timeouts_static_messages", "menu.hint_timer_followscreenings", "menu.hint_timers", "menu.hint_timezone", diff --git a/src/system/settings.h b/src/system/settings.h index 488bf97a2..9ae0e8049 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -863,21 +863,22 @@ typedef struct time_settings_t { const int default_timing; const neutrino_locale_t name; + const neutrino_locale_t hint; } time_settings_struct_t; const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_COUNT] = { - { 0, LOCALE_TIMING_MENU }, - { 60, LOCALE_TIMING_CHANLIST }, - { 240, LOCALE_TIMING_EPG }, - { 6, LOCALE_TIMING_INFOBAR }, - { 0, LOCALE_TIMING_INFOBAR_RADIO }, - { 6, LOCALE_TIMING_INFOBAR_MOVIEPLAYER}, - { 3, LOCALE_TIMING_VOLUMEBAR }, - { 60, LOCALE_TIMING_FILEBROWSER }, - { 3, LOCALE_TIMING_NUMERICZAP }, - { 6, LOCALE_TIMING_POPUP_MESSAGES}, - { 0, LOCALE_TIMING_STATIC_MESSAGES} + { 0, LOCALE_TIMING_MENU, LOCALE_MENU_HINT_OSD_TIMING},//TODO: add hint locales + { 60, LOCALE_TIMING_CHANLIST, LOCALE_MENU_HINT_OSD_TIMING}, + { 240, LOCALE_TIMING_EPG, LOCALE_MENU_HINT_OSD_TIMING}, + { 6, LOCALE_TIMING_INFOBAR, LOCALE_MENU_HINT_OSD_TIMING}, + { 0, LOCALE_TIMING_INFOBAR_RADIO, LOCALE_MENU_HINT_OSD_TIMING}, + { 6, LOCALE_TIMING_INFOBAR_MOVIEPLAYER, LOCALE_MENU_HINT_OSD_TIMING}, + { 3, LOCALE_TIMING_VOLUMEBAR, LOCALE_MENU_HINT_OSD_TIMING}, + { 60, LOCALE_TIMING_FILEBROWSER, LOCALE_MENU_HINT_OSD_TIMING}, + { 3, LOCALE_TIMING_NUMERICZAP, LOCALE_MENU_HINT_OSD_TIMING}, + { 6, LOCALE_TIMING_POPUP_MESSAGES, LOCALE_MENU_HINT_OSD_TIMING}, + { 60, LOCALE_TIMING_STATIC_MESSAGES, LOCALE_MENU_HINT_TIMEOUTS_STATIC_MESSAGES} }; // lcdd