From 57fbc9c2155a3e508227e84a50714cc067e353c7 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 29 Jan 2016 14:49:24 +0100 Subject: [PATCH 1/6] use fstream in copyfile function Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b320878b93d5399c915271405dc15fbef89ecfc2 Author: Jacek Jendrzej Date: 2016-01-29 (Fri, 29 Jan 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/zapit/include/zapit/getservices.h | 2 +- src/zapit/src/getservices.cpp | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/zapit/include/zapit/getservices.h b/src/zapit/include/zapit/getservices.h index 2aa4616c2..780b525c0 100644 --- a/src/zapit/include/zapit/getservices.h +++ b/src/zapit/include/zapit/getservices.h @@ -107,7 +107,7 @@ class CServiceManager ~CServiceManager(); static CServiceManager * getInstance(); - static void CopyFile(char * from, char * to); + static void CopyFile(const char * from, const char * to); bool InitSatPosition(t_satellite_position position, const char * name = NULL, bool force = false, delivery_system_t delsys = DVB_S, uint16_t nid = 0); bool LoadServices(bool only_current); diff --git a/src/zapit/src/getservices.cpp b/src/zapit/src/getservices.cpp index 3918082a9..0c7052283 100644 --- a/src/zapit/src/getservices.cpp +++ b/src/zapit/src/getservices.cpp @@ -33,6 +33,7 @@ #include #include #include +#include //#define SAVE_DEBUG @@ -968,13 +969,18 @@ do_current: return true; } -void CServiceManager::CopyFile(char * from, char * to) +void CServiceManager::CopyFile(const char * from, const char * to) { - char cmd[256] = "cp -f "; - strcat(cmd, from); - strcat(cmd, " "); - strcat(cmd, to); - system(cmd); + std::ifstream in(from, std::ios::in | std::ios::binary); + if(in.good()){ + std::ofstream out(to, std::ios::out | std::ios::binary); + if(out.good()){ + out << in.rdbuf(); + out.close(); + } + in.close(); + remove(from); + } sync(); } From 403d33158d48f9d0f644cdfb43bb8923855d0300 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 14 Jan 2016 20:26:35 +0100 Subject: [PATCH 2/6] CInfoViewer: use gradient settings for infobar text box too Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/2207019bfd81ea5598d118167de72cce8ad2c7b2 Author: Thilo Graf Date: 2016-01-14 (Thu, 14 Jan 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/infoviewer.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 26bd0dd1c..ae4e3792d 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1998,6 +1998,7 @@ void CInfoViewer::showInfoFile() infobar_txt->setTextColor(COL_INFOBAR_TEXT); infobar_txt->setColorBody(COL_INFOBAR_PLUS_0); infobar_txt->doPaintTextBoxBg(false); + infobar_txt->enableColBodyGradient(g_settings.theme.infobar_gradient_top, g_settings.theme.infobar_gradient_top ? COL_INFOBAR_PLUS_0 : header->getColorBody(), g_settings.theme.infobar_gradient_top_direction); //paint info, don't save background, if already painted, global hide is also done by killTitle() bool save_bg = !infobar_txt->isPainted(); From ca241faf59ccc15d362fa4f77286f53732bca767 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 28 Jan 2016 21:02:52 +0100 Subject: [PATCH 3/6] CComponentsItem: add missing parameter to kill() member Was not passed to parent methode. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/65de6dee9f4b448db4c428412973d34889bf1106 Author: Thilo Graf Date: 2016-01-28 (Thu, 28 Jan 2016) ------------------ This commit was generated by Migit --- src/gui/components/cc_item.cpp | 8 ++++---- src/gui/components/cc_item.h | 24 ++++++++++++++++++++---- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 0f8b32963..2f36f262c 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -127,15 +127,15 @@ void CComponentsItem::paintInit(bool do_save_bg) } //erase or paint over rendered objects -void CComponentsItem::kill(const fb_pixel_t& bg_color, bool ignore_parent) +void CComponentsItem::kill(const fb_pixel_t& bg_color, bool ignore_parent, const int& fblayer_type) { if(cc_parent == NULL){ - CComponents::kill(bg_color, this->corner_rad); + CComponents::kill(bg_color, this->corner_rad, fblayer_type); }else{ if(ignore_parent) - CComponents::kill(bg_color, this->corner_rad); + CComponents::kill(bg_color, this->corner_rad, fblayer_type); else - CComponents::kill(cc_parent->getColorBody(), cc_parent->getCornerRadius()); + CComponents::kill(cc_parent->getColorBody(), cc_parent->getCornerRadius(), fblayer_type); } } diff --git a/src/gui/components/cc_item.h b/src/gui/components/cc_item.h index a3a713429..30fbf0442 100644 --- a/src/gui/components/cc_item.h +++ b/src/gui/components/cc_item.h @@ -79,10 +79,26 @@ class CComponentsItem : public CComponents ///set or unset focus of item, stand alone items without parent have always set focus to true, inside of a parent form object, always the last added item has focus virtual void setFocus(bool focus); - ///erase or paint over rendered objects without restore of background, it's similar to paintBackgroundBoxRel() known - ///from CFrameBuffer but with possiblity to define color, default color is 0 (empty background) - ///NOTE: Items with parent binding use the parent background color as default! Set parameter 'ignore_parent=true' to ignore parent background color! - virtual void kill(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, bool ignore_parent = false); + /**Erase or paint over rendered objects without restore of background, it's similar to paintBackgroundBoxRel() known + * from CFrameBuffer but with possiblity to define color, default color is COL_BACKGROUND_PLUS_0 (empty background) + * + * @return void + * + * @param[in] bg_color optional, color, default color is current screen + * @param[in] ignore_parent optional, default = false, defines the behavior inside a form, if item is embedded current background color is used instead blank screen + * @param[in] fblayer_type optional, defines layer that to remove, default all layers (cc_fbdata_t) will remove + * possible layer types are: + * @li CC_FBDATA_TYPE_BGSCREEN, + * @li CC_FBDATA_TYPE_BOX, + * @li CC_FBDATA_TYPE_SHADOW_BOX, + * @li CC_FBDATA_TYPE_FRAME, + * @li CC_FBDATA_TYPE_BACKGROUND, + * @see + * cc_types.h + * gui/color.h + * driver/framebuffer.h + */ + virtual void kill(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, bool ignore_parent = false, const int& fblayer_type = CC_FBDATA_TYPES); ///get the current item type, see attribute cc_item_type above virtual int getItemType(); From 0598782edae6f94ec600c2ec7c4feb631c64a49b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 28 Jan 2016 21:12:46 +0100 Subject: [PATCH 4/6] CCDraw: try to fix is_painted property after used kill() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/be1f555e3724c322eef7dca5b3e593312811578c Author: Thilo Graf Date: 2016-01-28 (Thu, 28 Jan 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/components/cc_draw.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index b744caaff..2e6d85fdd 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -676,7 +676,7 @@ void CCDraw::kill(const fb_pixel_t& bg_color, const int& corner_radius, const in } } - if (fblayer_type == CC_FBDATA_TYPE_BOX){ + if (fblayer_type == CC_FBDATA_TYPES){ firstPaint = true; is_painted = false; } From 8372065c10da6fe8858c13cb3704e1ac1fe67e5e Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 29 Jan 2016 10:13:52 +0100 Subject: [PATCH 5/6] CCDraw: Set cc_gradient_bg_cleanup to true Except menu headers: Disable cleanup when save screen is disabled Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6c72fe94bce069ddda0655d5365ae221ecb79717 Author: Michael Liebmann Date: 2016-01-29 (Fri, 29 Jan 2016) Origin message was: ------------------ CCDraw: Set cc_gradient_bg_cleanup to true Except menu headers: Disable cleanup when save screen is disabled ------------------ This commit was generated by Migit --- src/gui/channellist.cpp | 1 - src/gui/components/cc_draw.cpp | 2 +- src/gui/epgplus.cpp | 1 - src/gui/epgview.cpp | 1 - src/gui/infoviewer.cpp | 2 -- src/gui/infoviewer_bb.cpp | 1 - src/gui/widget/menue.cpp | 1 - 7 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index b61ee8883..17655dc91 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2066,7 +2066,6 @@ void CChannelList::paintHead() } header->setDimensionsAll(x, y, full_width, theight); - header->enableGradientBgCleanUp(); if (bouquet && bouquet->zapitBouquet && bouquet->zapitBouquet->bLocked != g_settings.parentallock_defaultlocked) header->setIcon(NEUTRINO_ICON_LOCK); diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 2e6d85fdd..c81b0c6eb 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -71,7 +71,7 @@ CCDraw::CCDraw() : COSDFader(g_settings.theme.menu_Content_alpha) cc_body_gradient_saturation = 0xC0; cc_body_gradient_direction = cc_body_gradient_direction_old = CFrameBuffer::gradientVertical; - cc_gradient_bg_cleanup = false; + cc_gradient_bg_cleanup = true; v_fbdata.clear(); } diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index b6ba031e5..bf91e3088 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -127,7 +127,6 @@ void EpgPlus::Header::paint(const char * Name) std::string head = Name ? Name : g_Locale->getText (LOCALE_EPGPLUS_HEAD); CComponentsHeader header(this->x, this->y, this->width, this->font->getHeight()+4, head); - header.enableGradientBgCleanUp(); header.paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index dd901dc87..97deca924 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -646,7 +646,6 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start headerPic = new CComponentsPicture(sx+10, sy + (header_h-logo_h)/2, logo_w, logo_h, lname); headerPic->doPaintBg(false); } - header->enableGradientBgCleanUp(); std::string textAll = (!text2.empty()) ? text1 + "\n" + text2 : text1; headerText = new CComponentsText(sx+15+pic_offx, sy, ox-15-pic_offx, header_h, textAll, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]); headerText->doPaintBg(false); diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index ae4e3792d..db49ed63f 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -422,7 +422,6 @@ void CInfoViewer::paintHead() header->setColorBody(g_settings.theme.infobar_gradient_top ? COL_MENUHEAD_PLUS_0 : COL_INFOBAR_PLUS_0); header->enableColBodyGradient(g_settings.theme.infobar_gradient_top, COL_INFOBAR_PLUS_0, g_settings.theme.infobar_gradient_top_direction); clock->setColorBody(header->getColorBody()); - header->enableGradientBgCleanUp(); header->paint(CC_SAVE_SCREEN_NO); header_height = header->getHeight(); @@ -458,7 +457,6 @@ void CInfoViewer::paintBody() body->setColorBody(g_settings.theme.infobar_gradient_body ? COL_MENUHEAD_PLUS_0 : COL_INFOBAR_PLUS_0); body->enableColBodyGradient(g_settings.theme.infobar_gradient_body, COL_INFOBAR_PLUS_0, g_settings.theme.infobar_gradient_body_direction); - body->enableGradientBgCleanUp(); body->paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 3673ca78e..37bddb429 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -498,7 +498,6 @@ void CInfoViewerBB::paintFoot(int w) foot->setColorBody(COL_INFOBAR_BUTTONS_BACKGROUND); foot->enableColBodyGradient(g_settings.theme.infobar_gradient_bottom, COL_INFOBAR_PLUS_0, g_settings.theme.infobar_gradient_bottom_direction); foot->setCorner(RADIUS_LARGE, CORNER_BOTTOM); - foot->enableGradientBgCleanUp(); foot->paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 40c4141c9..8a021fc9a 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1482,7 +1482,6 @@ void CMenuWidget::paintHint(int pos) info_box->enableShadow(); info_box->setPicture(item->hintIcon ? item->hintIcon : ""); info_box->enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_INFOBAR_SHADOW_PLUS_1, g_settings.theme.menu_Hint_gradient_direction);// COL_INFOBAR_SHADOW_PLUS_1 is default footer color - info_box->enableGradientBgCleanUp(); //paint result if (details_line) From c115466fbaeee287ad599336c81dc4c7d889af02 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Fri, 29 Jan 2016 15:15:48 +0100 Subject: [PATCH 6/6] CInfoViewer::show_Data: Avoid overwriting button text Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/73ec7e9671c1938a970904b8a7abf375572d6310 Author: Michael Liebmann Date: 2016-01-29 (Fri, 29 Jan 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/infoviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index db49ed63f..b43ef64be 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1813,7 +1813,7 @@ void CInfoViewer::show_Data (bool calledFromEvent) frameBuffer->paintBackgroundBoxRel (BoxEndX - 108, posy, 112, height2); } #endif - infoViewerBB->showBBButtons(); + infoViewerBB->showBBButtons(calledFromEvent); } if ((info_CurrentNext.flags & CSectionsdClient::epgflags::not_broadcast) ||