diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index f49fef1af..9d2f1a47b 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2074,7 +2074,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 b744caaff..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(); } @@ -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; } 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(); diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 34e1b7ee6..a65234f23 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 b698c6c31..62c5e2952 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -655,7 +655,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 e963a42f0..24cf27734 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -425,7 +425,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(); @@ -461,7 +460,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); } @@ -1822,7 +1820,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) || @@ -2005,6 +2003,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(); diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 2cf1f66a4..570d2e038 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 c006c27e2..b43c98c92 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1481,7 +1481,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) 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 c7ae0f909..579b34de4 100644 --- a/src/zapit/src/getservices.cpp +++ b/src/zapit/src/getservices.cpp @@ -33,6 +33,7 @@ #include #include #include +#include //#define SAVE_DEBUG @@ -974,14 +975,19 @@ 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); - // sync(); + 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(); } void CServiceManager::WriteSatHeader(FILE * fd, sat_config_t &config)