From fcd5fc1c9c8eb062d96e4c888f16e568801229d6 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 3 Aug 2016 11:12:45 +0200 Subject: [PATCH 1/2] epgview: rework buttonbar logic Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/999d61f9230195d059cbfcb7649dd1c3f0b608fb Author: vanhofen Date: 2016-08-03 (Wed, 03 Aug 2016) Origin message was: ------------------ - epgview: rework buttonbar logic --- src/gui/epgview.cpp | 53 ++++++++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 20 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 5251fe627..63387dc2e 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -1319,13 +1319,24 @@ int CEpgData::FollowScreenings (const t_channel_id /*channel_id*/, const std::st // -- 2002-05-13 rasc // -const struct button_label EpgButtons[] = +#define EpgButtonsMax 4 +const struct button_label EpgButtons[][EpgButtonsMax] = { - { NEUTRINO_ICON_BUTTON_RED , LOCALE_TIMERBAR_RECORDEVENT }, - { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_TIMERBAR_CHANNELSWITCH }, - { NEUTRINO_ICON_BUTTON_INFO_SMALL , LOCALE_CHANNELLIST_ADDITIONAL }, - { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_EPGVIEWER_MORE_SCREENINGS_SHORT } - + { // full view + { NEUTRINO_ICON_BUTTON_RED, LOCALE_TIMERBAR_RECORDEVENT }, + { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_TIMERBAR_CHANNELSWITCH }, + { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_EPGVIEWER_MORE_SCREENINGS_SHORT }, + { NEUTRINO_ICON_BUTTON_INFO_SMALL, LOCALE_CHANNELLIST_ADDITIONAL } + }, + { // w/o followscreenings + { NEUTRINO_ICON_BUTTON_RED, LOCALE_TIMERBAR_RECORDEVENT }, + { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_TIMERBAR_CHANNELSWITCH }, + { NEUTRINO_ICON_BUTTON_INFO_SMALL, LOCALE_CHANNELLIST_ADDITIONAL } + }, + { // movieplayer mode + { NEUTRINO_ICON_BUTTON_RED, LOCALE_EPG_SAVING }, + { NEUTRINO_ICON_BUTTON_INFO_SMALL, LOCALE_CHANNELLIST_ADDITIONAL } + } }; void CEpgData::showTimerEventBar (bool pshow, bool adzap, bool mp_info) @@ -1356,20 +1367,22 @@ void CEpgData::showTimerEventBar (bool pshow, bool adzap, bool mp_info) adzap_button += " " + to_string(g_settings.adzap_zapBackPeriod / 60) + " "; adzap_button += g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); } - if (!mp_info && g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) - ::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 4:3, EpgButtons, aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 1); - else if (mp_info){ - const struct button_label Button[] = - { - { NEUTRINO_ICON_BUTTON_RED , LOCALE_EPG_SAVING }, - { NEUTRINO_ICON_BUTTON_INFO_SMALL , LOCALE_CHANNELLIST_ADDITIONAL } - }; - if (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"){ - ::paintButtons(x , y, 0, 2, Button, aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, NULL, 1); - } - }else - ::paintButtons(x, y, 0, (has_follow_screenings && !call_fromfollowlist) ? 3:2, &EpgButtons[1], aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 0); - + bool tmdb = (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); + bool fscr = (has_follow_screenings && !call_fromfollowlist); + if (mp_info) + ::paintButtons(x, y, 0, tmdb ? 2 : 1, EpgButtons[2], aw, h); + else + { + int c = EpgButtonsMax; + if (!tmdb) + c--; // reduce tmdb button + if (!fscr) + c--; // reduce blue button + if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) + ::paintButtons(x, y, 0, c, EpgButtons[fscr ? 0 : 1], aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 1); + else + ::paintButtons(x, y, 0, c, &EpgButtons[fscr ? 0 : 1][1], aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 0); + } #if 0 // Button: Timer Record & Channelswitch if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) From 6c5c467f76a841cd719b6fcb6a00392285182553 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 3 Aug 2016 12:19:52 +0200 Subject: [PATCH 2/2] epgview: cleanup from unused code Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/be2a5bcbb55062d12da7a51a5fb9b4cc256b1466 Author: vanhofen Date: 2016-08-03 (Wed, 03 Aug 2016) Origin message was: ------------------ - epgview: cleanup from unused code --- src/gui/epgview.cpp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 63387dc2e..4d1691c28 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -1383,19 +1383,6 @@ void CEpgData::showTimerEventBar (bool pshow, bool adzap, bool mp_info) else ::paintButtons(x, y, 0, c, &EpgButtons[fscr ? 0 : 1][1], aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, adzap ? adzap_button.c_str() : NULL, 0); } -#if 0 - // Button: Timer Record & Channelswitch - if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF) - { - pos = 0; - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_RED, x+8+cellwidth*pos, y+h_offset ); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+29+cellwidth*pos, y+h-h_offset, w-30, g_Locale->getText(LOCALE_TIMERBAR_RECORDEVENT), COL_INFOBAR_TEXT); - } - // Button: Timer Channelswitch - pos = 2; - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x+8+cellwidth*pos, y+h_offset ); - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->RenderString(x+29+cellwidth*pos, y+h-h_offset, w-30, g_Locale->getText(LOCALE_TIMERBAR_CHANNELSWITCH), COL_INFOBAR_TEXT); -#endif } // -- EPG Data Viewer Menu Handler Class