From 15b028d187f4b52ebeeac42f5d86ff5ceab81972 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Sat, 8 Apr 2017 15:47:38 +0200 Subject: [PATCH 1/8] - epgplus: fix detailsline; codeblock was removed by mistake --- src/gui/epgplus.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 5c84e62df..a782ea8b5 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -425,6 +425,14 @@ void EpgPlus::ChannelEntry::paint(bool isSelected, time_t _selectedTime) toggleColor = !toggleColor; } + // kill detailsline + if (detailsLine) + { + detailsLine->kill(); + delete detailsLine; + detailsLine = NULL; + } + // paint detailsline if (isSelected) { From c26e85cb554527e797dc06c652127880bd8c4053 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Sat, 8 Apr 2017 16:25:59 +0200 Subject: [PATCH 2/8] - epgplus: fix detailsline; --- src/gui/epgplus.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index a782ea8b5..3c82f4937 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -365,6 +365,7 @@ EpgPlus::ChannelEntry::~ChannelEntry() if (this->detailsLine) { + this->detailsLine->kill(); delete this->detailsLine; this->detailsLine = NULL; } From 0b44c162b40cfbb854199b878cd632e66c136fd0 Mon Sep 17 00:00:00 2001 From: Eric Loxat Date: Mon, 10 Apr 2017 10:26:21 +0200 Subject: [PATCH 3/8] - epgplus: bind display of channelnumbers to channelists's setting; fix position of channelentry --- src/gui/epgplus.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 3c82f4937..3a6c28e6e 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -329,7 +329,10 @@ EpgPlus::ChannelEntry::ChannelEntry(const CZapitChannel * pchannel, int pindex, { std::stringstream pdisplayName; //pdisplayName << pindex + 1 << " " << pchannel->getName(); - pdisplayName << pchannel->number << " " << pchannel->getName(); + if (g_settings.channellist_show_numbers) + pdisplayName << pchannel->number << " " << pchannel->getName(); + else + pdisplayName << pchannel->getName(); this->displayName = pdisplayName.str(); } @@ -580,7 +583,7 @@ void EpgPlus::createChannelEntries(int selectedChannelEntryIndex) CZapitChannel * channel = (*this->channelList)[i]; - ChannelEntry *channelEntry = new ChannelEntry(channel, i, this->frameBuffer, this->footer, this->bouquetList, this->channelsTableX + 2, yPosChannelEntry, this->channelsTableWidth); + ChannelEntry *channelEntry = new ChannelEntry(channel, i, this->frameBuffer, this->footer, this->bouquetList, this->channelsTableX, yPosChannelEntry, this->channelsTableWidth); //printf("Going to get getEventsServiceKey for %llx\n", (channel->getChannelID() & 0xFFFFFFFFFFFFULL)); CChannelEventList channelEventList; CEitManager::getInstance()->getEventsServiceKey(channel->getEpgID(), channelEventList); From 44a0ec422e104a0e03dfaeefeba91a09da4e04ad Mon Sep 17 00:00:00 2001 From: Eric Loxat Date: Mon, 10 Apr 2017 10:26:21 +0200 Subject: [PATCH 4/8] - epgplus: add progressbar for current event --- src/gui/epgplus.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 3a6c28e6e..098122057 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -198,7 +198,17 @@ void EpgPlus::TimeLine::paintMark(time_t _startTime, int pduration, int px, int this->clearMark(); // paint new mark - this->frameBuffer->paintBoxRel(px, this->y + this->font->getHeight(), + time_t azeit; + time(&azeit); + if ((azeit > _startTime) && (azeit < _startTime + pduration)) + { + CProgressBar pbbar = CProgressBar(px,this->y + this->font->getHeight(),pwidth,this->font->getHeight()); + pbbar.setValues((azeit - _startTime),pduration); + pbbar.setActiveColor(COL_MENUCONTENTSELECTED_PLUS_0); + pbbar.paint(); + } + else + this->frameBuffer->paintBoxRel(px, this->y + this->font->getHeight(), pwidth, this->font->getHeight() , COL_MENUCONTENTSELECTED_PLUS_0); // display start time before mark From 56302f9eb752e832341f111ed690ed785a0b8c24 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 10 Apr 2017 10:26:21 +0200 Subject: [PATCH 5/8] - epgplus: always show a progressbar in secondary timeline ... to avoid 'design changes' when cursor is moved left or right --- src/gui/epgplus.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 098122057..e4d4072c6 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -198,18 +198,20 @@ void EpgPlus::TimeLine::paintMark(time_t _startTime, int pduration, int px, int this->clearMark(); // paint new mark - time_t azeit; - time(&azeit); - if ((azeit > _startTime) && (azeit < _startTime + pduration)) + CProgressBar pbbar = CProgressBar(px, this->y + this->font->getHeight(), pwidth, this->font->getHeight()); + pbbar.setActiveColor(COL_MENUCONTENTSELECTED_PLUS_0); + + time_t currentTime; + time(¤tTime); + if ((currentTime > _startTime) && (currentTime < _startTime + pduration)) { - CProgressBar pbbar = CProgressBar(px,this->y + this->font->getHeight(),pwidth,this->font->getHeight()); - pbbar.setValues((azeit - _startTime),pduration); - pbbar.setActiveColor(COL_MENUCONTENTSELECTED_PLUS_0); - pbbar.paint(); + pbbar.setValues((currentTime - _startTime), pduration); } else - this->frameBuffer->paintBoxRel(px, this->y + this->font->getHeight(), - pwidth, this->font->getHeight() , COL_MENUCONTENTSELECTED_PLUS_0); + { + pbbar.setValues(0, pduration); + } + pbbar.paint(); // display start time before mark std::string timeStr = EpgPlus::getTimeString(_startTime, "%H:%M"); From 69e478c1955249c92f6583cc7ef420ec8e512bd9 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 10 Apr 2017 10:26:21 +0200 Subject: [PATCH 6/8] - epgplus: fix text offsets in secontary timeline --- src/gui/epgplus.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index e4d4072c6..f402b687d 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -220,21 +220,25 @@ void EpgPlus::TimeLine::paintMark(time_t _startTime, int pduration, int px, int this->font->RenderString(px - textWidth - OFFSET_INNER_MIN, this->y + this->font->getHeight() + this->font->getHeight(), textWidth, timeStr, COL_MENUCONTENT_TEXT); - // display end time after mark + // display end time timeStr = EpgPlus::getTimeString(_startTime + pduration, "%H:%M"); textWidth = font->getRenderWidth(timeStr); + int textX = 0; - if (px + pwidth + textWidth < this->x + this->width) + if (px + pwidth + textWidth + OFFSET_INNER_MIN < this->x + this->width) { - this->font->RenderString(px + pwidth + OFFSET_INNER_MIN, this->y + this->font->getHeight() + this->font->getHeight(), - textWidth, timeStr, COL_MENUCONTENT_TEXT); + // display end time after mark + textX = px + pwidth + OFFSET_INNER_MIN; } - else if (textWidth < pwidth - OFFSET_INNER_MID) + else if (textWidth < pwidth - 2*OFFSET_INNER_MIN) { - this->font->RenderString(px + pwidth - textWidth - OFFSET_INNER_MIN, this->y + this->font->getHeight() + this->font->getHeight(), - textWidth, timeStr, COL_MENUCONTENTSELECTED_TEXT); + // display end time before mark + textX = px + pwidth - textWidth - OFFSET_INNER_MIN; } + if (textX) + this->font->RenderString(textX, this->y + this->font->getHeight() + this->font->getHeight(), textWidth, timeStr, COL_MENUCONTENT_TEXT); + // paint the separation line if (separationLineThickness > 0) { From 5ae1a6b4591ffcae1f0f472efe9235c8d72cf3a7 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 10 Apr 2017 10:26:21 +0200 Subject: [PATCH 7/8] - epgplus: add clock and context button to header --- src/gui/epgplus.cpp | 21 ++++++++++++++++++--- src/gui/epgplus.h | 1 + 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index f402b687d..540c2ca87 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -87,10 +87,16 @@ EpgPlus::Header::Header(CFrameBuffer * pframeBuffer, int px, int py, int pwidth) this->x = px; this->y = py; this->width = pwidth; + this->header = NULL; } EpgPlus::Header::~Header() { + if (this->header) + { + delete this->header; + this->header = NULL; + } } void EpgPlus::Header::init() @@ -100,10 +106,19 @@ void EpgPlus::Header::init() void EpgPlus::Header::paint(const char * Name) { - std::string head = Name ? Name : g_Locale->getText(LOCALE_EPGPLUS_HEAD); + std::string headerCaption = Name ? Name : g_Locale->getText(LOCALE_EPGPLUS_HEAD); - CComponentsHeader _header(this->x, this->y, this->width, this->font->getHeight(), head); - _header.paint(CC_SAVE_SCREEN_NO); + if (this->header == NULL) + this->header = new CComponentsHeader(); + + if (this->header) + { + this->header->setDimensionsAll(this->x, this->y, this->width, this->font->getHeight()); + this->header->setCaption(headerCaption, CTextBox::NO_AUTO_LINEBREAK); + this->header->setContextButton(CComponentsHeader::CC_BTN_HELP); + this->header->enableClock(true, "%H:%M", "%H %M", true); + this->header->paint(CC_SAVE_SCREEN_NO); + } } int EpgPlus::Header::getUsedHeight() diff --git a/src/gui/epgplus.h b/src/gui/epgplus.h index 9efaef825..2b6494eda 100644 --- a/src/gui/epgplus.h +++ b/src/gui/epgplus.h @@ -95,6 +95,7 @@ class EpgPlus int width; static Font* font; + CComponentsHeader *header; }; From 8e8b95a932acfb9bbd9aaff8ade0bbffbcc13d1b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 10 Apr 2017 10:26:21 +0200 Subject: [PATCH 8/8] - epgplus: mark framebuffer pointer in header class as unused --- src/gui/epgplus.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 540c2ca87..6df2babfc 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -81,9 +81,9 @@ static int current_bouquet; Font *EpgPlus::Header::font = NULL; -EpgPlus::Header::Header(CFrameBuffer * pframeBuffer, int px, int py, int pwidth) +EpgPlus::Header::Header(CFrameBuffer * pframeBuffer __attribute__((unused)), int px, int py, int pwidth) { - this->frameBuffer = pframeBuffer; + //this->frameBuffer = pframeBuffer; this->x = px; this->y = py; this->width = pwidth;