From 37234bb5848ca6c2a9eed914e1ea10e0bc5f97b4 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 1 Feb 2017 09:10:06 +0100 Subject: [PATCH 1/8] CRecordManager: remove static error messages Static message window expects user interaction but in this case user could be absent. and recordings could be running out of control. These messages are only warnings and "to slow" warning is optional. To avoid uncontrolled behavior of recordings, it should be enough to use messages with simple timeout. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3387bcf2c4f0de54abea7f5cb3067d84b1af3716 Author: Thilo Graf Date: 2017-02-01 (Wed, 01 Feb 2017) ------------------ This commit was generated by Migit --- src/driver/record.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index f76cecf3b..12b62c13f 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -1325,10 +1325,10 @@ int CRecordManager::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data if ((have_err & REC_STATUS_OVERFLOW) && error_display) { error_display = false; warn_display = false; - DisplayErrorMessage(g_Locale->getText(LOCALE_STREAMING_OVERFLOW)); + ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_STREAMING_OVERFLOW, 700, 60, NEUTRINO_ICON_ERROR, NULL, CComponentsHeader::CC_BTN_EXIT); } else if (g_settings.recording_slow_warning && warn_display) { warn_display = false; - DisplayErrorMessage(g_Locale->getText(LOCALE_STREAMING_SLOW)); + ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_STREAMING_SLOW, 700, 60, NEUTRINO_ICON_ERROR, NULL, CComponentsHeader::CC_BTN_EXIT); } } return messages_return::handled; From 6128b4766d783864f74b0384e99a3ef32e201e51 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 1 Feb 2017 09:36:28 +0100 Subject: [PATCH 2/8] CRecordManager: revert warn message for stream overflow It's an error not a warning! Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/721f85deba24584e987f4dfabf395cccdd00b820 Author: Thilo Graf Date: 2017-02-01 (Wed, 01 Feb 2017) ------------------ This commit was generated by Migit --- src/driver/record.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 12b62c13f..517ecff64 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -1325,7 +1325,7 @@ int CRecordManager::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data if ((have_err & REC_STATUS_OVERFLOW) && error_display) { error_display = false; warn_display = false; - ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_STREAMING_OVERFLOW, 700, 60, NEUTRINO_ICON_ERROR, NULL, CComponentsHeader::CC_BTN_EXIT); + DisplayErrorMessage(g_Locale->getText(LOCALE_STREAMING_OVERFLOW)); } else if (g_settings.recording_slow_warning && warn_display) { warn_display = false; ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_STREAMING_SLOW, 700, 60, NEUTRINO_ICON_ERROR, NULL, CComponentsHeader::CC_BTN_EXIT); From 7a62d18bf44f0c77d7c55fc1c7ccb2e2fc6168e2 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 1 Feb 2017 11:34:00 +0100 Subject: [PATCH 3/8] Messages: add timeout parameter for error and info messages I'm not sure if it is a good idea to set a global timeout for all error messages. This should be decided for respective cases. Timeout for info messages should not be a problem. The default timeout is set here as global. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b8dabf2bf96075705d8ef5e0a56a5e5a5b569633 Author: Thilo Graf Date: 2017-02-01 (Wed, 01 Feb 2017) ------------------ This commit was generated by Migit --- src/gui/widget/msgbox.cpp | 24 ++++++++++++------------ src/gui/widget/msgbox.h | 12 ++++++------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index dc5b0b50c..25deb70f8 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -542,32 +542,32 @@ int ShowMsg( const std::string & Title, return (result); } -void DisplayErrorMessage(const char * const ErrorMsg, const neutrino_locale_t& caption, const int& Text_mode) +void DisplayErrorMessage(const char * const ErrorMsg, const neutrino_locale_t& caption, const int &Timeout , const int& Text_mode) { - ShowMsg(caption, ErrorMsg, CMsgBox::mbrCancel, CMsgBox::mbBack, NEUTRINO_ICON_ERROR, 500, NO_TIMEOUT, false, Text_mode, COL_RED); + ShowMsg(caption, ErrorMsg, CMsgBox::mbrCancel, CMsgBox::mbBack, NEUTRINO_ICON_ERROR, 500, Timeout, false, Text_mode, COL_RED); } -void DisplayErrorMessage(const char * const ErrorMsg, const std::string& caption, const int& Text_mode) +void DisplayErrorMessage(const char * const ErrorMsg, const std::string& caption, const int &Timeout , const int& Text_mode) { - ShowMsg(caption, ErrorMsg, CMsgBox::mbrCancel, CMsgBox::mbBack, NEUTRINO_ICON_ERROR, 500, NO_TIMEOUT, false, Text_mode, COL_RED); + ShowMsg(caption, ErrorMsg, CMsgBox::mbrCancel, CMsgBox::mbBack, NEUTRINO_ICON_ERROR, 500, Timeout, false, Text_mode, COL_RED); } -void DisplayErrorMessage(const char * const ErrorMsg, const int& Text_mode) +void DisplayErrorMessage(const char * const ErrorMsg, const int &Timeout, const int& Text_mode) { - DisplayErrorMessage(ErrorMsg, LOCALE_MESSAGEBOX_ERROR, Text_mode); + DisplayErrorMessage(ErrorMsg, LOCALE_MESSAGEBOX_ERROR, Timeout, Text_mode); } -void DisplayInfoMessage(const char * const InfoMsg, const neutrino_locale_t& caption, const int& Text_mode, fb_pixel_t color_frame) +void DisplayInfoMessage(const char * const InfoMsg, const neutrino_locale_t& caption, const int& Timeout, const int& Text_mode, fb_pixel_t color_frame) { - ShowMsg(caption, InfoMsg, CMsgBox::mbrBack, CMsgBox::mbOk, NEUTRINO_ICON_INFO, 500, NO_TIMEOUT, false, Text_mode, color_frame); + ShowMsg(caption, InfoMsg, CMsgBox::mbrBack, CMsgBox::mbOk, NEUTRINO_ICON_INFO, 500, Timeout, false, Text_mode, color_frame); } -void DisplayInfoMessage(const char * const InfoMsg, const std::string& caption, const int& Text_mode, fb_pixel_t color_frame) +void DisplayInfoMessage(const char * const InfoMsg, const std::string& caption, const int& Timeout, const int& Text_mode, fb_pixel_t color_frame) { - ShowMsg(caption, InfoMsg, CMsgBox::mbrBack, CMsgBox::mbOk, NEUTRINO_ICON_INFO, 500, NO_TIMEOUT, false, Text_mode, color_frame); + ShowMsg(caption, InfoMsg, CMsgBox::mbrBack, CMsgBox::mbOk, NEUTRINO_ICON_INFO, 500, Timeout, false, Text_mode, color_frame); } -void DisplayInfoMessage(const char * const InfoMsg, const int& Text_mode, fb_pixel_t color_frame) +void DisplayInfoMessage(const char * const InfoMsg, const int& Timeout, const int& Text_mode, fb_pixel_t color_frame) { - DisplayInfoMessage(InfoMsg, LOCALE_MESSAGEBOX_INFO, Text_mode, color_frame); + DisplayInfoMessage(InfoMsg, LOCALE_MESSAGEBOX_INFO, Timeout, Text_mode, color_frame); } diff --git a/src/gui/widget/msgbox.h b/src/gui/widget/msgbox.h index f15060973..dcca0b8a7 100644 --- a/src/gui/widget/msgbox.h +++ b/src/gui/widget/msgbox.h @@ -403,10 +403,10 @@ int ShowMsg( const std::string & Title, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 -void DisplayErrorMessage(const char * const ErrorMsg, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE); // UTF-8 -void DisplayErrorMessage(const char * const ErrorMsg, const neutrino_locale_t& caption, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE); // UTF-8 -void DisplayErrorMessage(const char * const ErrorMsg, const std::string& caption, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE); // UTF-8 -void DisplayInfoMessage(const char * const InfoMsg, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = COL_DARK_GRAY); // UTF-8 -void DisplayInfoMessage(const char * const InfoMsg, const neutrino_locale_t& caption, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = COL_DARK_GRAY); // UTF-8 -void DisplayInfoMessage(const char * const InfoMsg, const std::string& caption, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = COL_DARK_GRAY); // UTF-8 +void DisplayErrorMessage(const char * const ErrorMsg, const int& Timeout = NO_TIMEOUT, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE); // UTF-8 +void DisplayErrorMessage(const char * const ErrorMsg, const neutrino_locale_t& caption, const int& Timeout = NO_TIMEOUT, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE); // UTF-8 +void DisplayErrorMessage(const char * const ErrorMsg, const std::string& caption, const int& Timeout = NO_TIMEOUT, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE); // UTF-8 +void DisplayInfoMessage(const char * const InfoMsg, const int& Timeout = DEFAULT_TIMEOUT, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = COL_DARK_GRAY); // UTF-8 +void DisplayInfoMessage(const char * const InfoMsg, const neutrino_locale_t& caption, const int& Timeout = DEFAULT_TIMEOUT, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = COL_DARK_GRAY); // UTF-8 +void DisplayInfoMessage(const char * const InfoMsg, const std::string& caption, const int& Timeout = DEFAULT_TIMEOUT, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = COL_DARK_GRAY); // UTF-8 #endif From 995e202c5bef8736a4bbaa071786069779a50917 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 1 Feb 2017 20:38:04 +0100 Subject: [PATCH 4/8] try to fix loop rezap with lua script Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4fcea5bfd5348ffeb1d3b1bcde4e75352c806cae Author: Jacek Jendrzej Date: 2017-02-01 (Wed, 01 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/zapit/src/zapit.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index c9febc2d4..3d7242db0 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -515,6 +515,11 @@ bool CZapit::ZapIt(const t_channel_id channel_id, bool forupdate, bool startplay if (IS_WEBTV(newchannel->getChannelID()) && !newchannel->getUrl().empty()) { dvbsub_stop(); + if (current_channel->getChannelID() == newchannel->getChannelID() && !newchannel->getScriptName().empty()){ + INFO("[zapit] stop rezap to channel %s id %" PRIx64 ")", newchannel->getName().c_str(), newchannel->getChannelID()); + return true; + } + if (!IS_WEBTV(live_channel_id)) CCamManager::getInstance()->Stop(live_channel_id, CCamManager::PLAY); From 1a8a9fef62cfe33f023f407debb5a33c91660fa9 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 2 Feb 2017 09:33:20 +0100 Subject: [PATCH 5/8] Revert "CChannelList: ensure repaint of new header content" This reverts commit 339167a5077406f688be07543decf183c2c889a3. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/296aa5b9011a75bfeca84238ebff4fa7d17957d2 Author: Thilo Graf Date: 2017-02-02 (Thu, 02 Feb 2017) ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 1f7ffbb7d..efa09a771 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2168,9 +2168,7 @@ void CChannelList::paintHead() else logo_off = 10; - if (header->isPainted()) //clean up background of header for new contents - header->kill(header->getColorBody(), -1, CC_FBDATA_TYPES, false); - header->paint0(); + header->paint(CC_SAVE_SCREEN_NO); } CComponentsHeader* CChannelList::getHeaderObject() From 2a4bac952c537267d3e29e5c41d2972cb3aaa09e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 2 Feb 2017 09:34:45 +0100 Subject: [PATCH 6/8] Revert "CMenuWidget: ensure repaint of all header content if it is already painted" This reverts commit dff5ceee103a8d3d284d199d34c00c40ba20d066. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/a2f9d4b462916d9514817c928b2fa270f552d0b5 Author: Thilo Graf Date: 2017-02-02 (Thu, 02 Feb 2017) ------------------ This commit was generated by Migit --- src/gui/widget/menue.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 3f5039f7d..cb83c00f5 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1257,8 +1257,6 @@ void CMenuWidget::paint() header->setCaptionColor(COL_MENUHEAD_TEXT); header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0); header->enableGradientBgCleanUp(savescreen); - if (header->isPainted()) - header->kill(header->getColorBody()); header->paint(CC_SAVE_SCREEN_NO); // paint body shadow From 5605780dafc1aabc567ee16a20a7d86a6847c023 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 2 Feb 2017 10:58:31 +0100 Subject: [PATCH 7/8] CComponentsSignals: add signal OnBeforeRePaint Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/be8588a4a5c73e0618f9280c8ae3cd3ca475fcd5 Author: Thilo Graf Date: 2017-02-02 (Thu, 02 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_signals.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/components/cc_signals.h b/src/gui/components/cc_signals.h index da6a6d8b2..c3c60727e 100644 --- a/src/gui/components/cc_signals.h +++ b/src/gui/components/cc_signals.h @@ -113,6 +113,8 @@ class CComponentsSignals : public sigc::trackable ///signal on before paint() sigc::signal OnBeforePaint; + ///signal on before repaint, means: paint() is already done and item paint() is called again + sigc::signal OnBeforeRePaint; ///signal on after paint() sigc::signal OnAfterPaint; From 53f75282ce92eaa5975e5879b84870190eea996a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 2 Feb 2017 11:00:47 +0100 Subject: [PATCH 8/8] Forms/header/clock: implement slot into OnBeforeRePaint Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1c217b404ff25f08d50cfc897d1f39942b071871 Author: Thilo Graf Date: 2017-02-02 (Thu, 02 Feb 2017) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_frm.cpp | 3 +++ src/gui/components/cc_frm.h | 4 +++- src/gui/components/cc_frm_clock.cpp | 4 ++-- src/gui/components/cc_frm_ext_text.cpp | 4 ++-- src/gui/components/cc_frm_header.cpp | 14 +++++++------- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 626fdff67..19843a5b9 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -344,6 +344,9 @@ void CComponentsForm::paintForm(bool do_save_bg) void CComponentsForm::paint(bool do_save_bg) { + if(is_painted) + OnBeforeRePaint(); + OnBeforePaint(); paintForm(do_save_bg); } diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index 56ad077c6..b9cab7934 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -68,7 +68,9 @@ class CComponentsForm : public CComponentsItem ///force repaint of all possible text items void forceItemsPaint(bool force); ///slot for background paint event, reserved for forceItemsPaint() - sigc::slot0 sl_repaint; + sigc::slot0 sl_items_repaint; + ///slot for repaint event, reserved for actions before repaint if paint() already was done. + sigc::slot0 sl_form_repaint; public: CComponentsForm( const int x_pos = 0, const int y_pos = 0, const int w = 800, const int h = 600, diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index c3995318d..fcce3647e 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -101,7 +101,7 @@ CComponentsFrmClock::CComponentsFrmClock( const int& x_pos, cl_sl_show = sigc::mem_fun0(*this, &CComponentsFrmClock::ShowTime); //init slot to ensure paint segments after painted background - sl_repaint = sigc::bind<0>(sigc::mem_fun1(*this, &CComponentsFrmClock::forceItemsPaint), true); + sl_items_repaint = sigc::bind(sigc::mem_fun(*this, &CComponentsFrmClock::forceItemsPaint), true); //run clock already if required if (activ) @@ -304,7 +304,7 @@ void CComponentsFrmClock::initCCLockItems() if(!OnAfterPaintBg.empty()) OnAfterPaintBg.clear(); //init slot to handle repaint of segments if background was repainted - OnAfterPaintBg.connect(sl_repaint); + OnAfterPaintBg.connect(sl_items_repaint); } diff --git a/src/gui/components/cc_frm_ext_text.cpp b/src/gui/components/cc_frm_ext_text.cpp index 3abf816f4..420ea2775 100644 --- a/src/gui/components/cc_frm_ext_text.cpp +++ b/src/gui/components/cc_frm_ext_text.cpp @@ -115,7 +115,7 @@ void CComponentsExtTextForm::initVarExtTextForm(const int& x_pos, const int& y_p ccx_label_align = ccx_text_align = CTextBox::NO_AUTO_LINEBREAK; //init slot to ensure paint text items after painted background - sl_repaint = sigc::bind<0>(sigc::mem_fun1(*this, &CComponentsExtTextForm::forceItemsPaint), true); + sl_items_repaint = sigc::bind(sigc::mem_fun(*this, &CComponentsExtTextForm::forceItemsPaint), true); initParent(parent); @@ -226,7 +226,7 @@ void CComponentsExtTextForm::initCCTextItems() if(!OnAfterPaintBg.empty()) OnAfterPaintBg.clear(); //init slot to handle repaint of text if background was repainted - OnAfterPaintBg.connect(sl_repaint); + OnAfterPaintBg.connect(sl_items_repaint); } void CComponentsExtTextForm::setLabelWidthPercent(const uint8_t& percent_val) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 4c21bd560..8a56e24ad 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -136,8 +136,13 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const cch_cl_sec_format = cch_cl_format; cch_cl_enable_run = false; - //init slot to ensure paint segments after painted background - sl_repaint = sigc::bind<0>(sigc::mem_fun1(*this, &CComponentsHeader::forceItemsPaint), true); + //init slot to ensure paint items after painted background + sl_items_repaint = sigc::bind(sigc::mem_fun(*this, &CComponentsHeader::forceItemsPaint), true); + OnAfterPaintBg.connect(sl_items_repaint); + + //init slot before re paint of header, paint() is already done + sl_form_repaint = sigc::bind(sigc::mem_fun(*this, &CComponentsHeader::kill), col_body, -1, CC_FBDATA_TYPES, false); + OnBeforeRePaint.connect(sl_form_repaint); addContextButton(buttons); initCCItems(); @@ -523,11 +528,6 @@ void CComponentsHeader::initCaption() */ //height = max(height, cch_text_obj->getHeight()); } - - if(!OnAfterPaintBg.empty()) - OnAfterPaintBg.clear(); - //init slot to handle repaint of text if background was repainted - OnAfterPaintBg.connect(sl_repaint); } void CComponentsHeader::initCCItems()