mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
epgview: change and simplify button logic; ...
this avoids annoying "button-jumps" while navigating through events
Origin commit data
------------------
Commit: 998dce9010
Author: vanhofen <vanhofen@gmx.de>
Date: 2018-01-19 (Fri, 19 Jan 2018)
Origin message was:
------------------
- epgview: change and simplify button logic; ...
this avoids annoying "button-jumps" while navigating through events
This commit is contained in:
@@ -1566,31 +1566,23 @@ void CEpgData::showProgressBar()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
#define TV_BUTTONS 0
|
||||||
// -- Just display or hide TimerEventbar
|
#define MP_BUTTONS 1
|
||||||
// -- 2002-05-13 rasc
|
struct button_label EpgButtons[][5] =
|
||||||
//
|
|
||||||
|
|
||||||
#define EpgButtonsMax 5 //NI
|
|
||||||
struct button_label EpgButtons[][EpgButtonsMax] =
|
|
||||||
{
|
{
|
||||||
{ // full view
|
{
|
||||||
|
// TV_BUTTONS
|
||||||
{ NEUTRINO_ICON_BUTTON_RED, LOCALE_TIMERBAR_RECORDEVENT },
|
{ NEUTRINO_ICON_BUTTON_RED, LOCALE_TIMERBAR_RECORDEVENT },
|
||||||
{ NEUTRINO_ICON_BUTTON_GREEN, LOCALE_IMDB_INFO }, //NI
|
{ NEUTRINO_ICON_BUTTON_GREEN, LOCALE_IMDB_INFO },
|
||||||
{ NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_TIMERBAR_CHANNELSWITCH },
|
{ NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_TIMERBAR_CHANNELSWITCH },
|
||||||
{ NEUTRINO_ICON_BUTTON_BLUE, LOCALE_EPGVIEWER_MORE_SCREENINGS_SHORT },
|
{ NEUTRINO_ICON_BUTTON_BLUE, LOCALE_EPGVIEWER_MORE_SCREENINGS_SHORT },
|
||||||
{ NEUTRINO_ICON_BUTTON_0, LOCALE_TMDB_INFO } //NI
|
{ NEUTRINO_ICON_BUTTON_0, LOCALE_TMDB_INFO }
|
||||||
},
|
},
|
||||||
{ // w/o followscreenings
|
{
|
||||||
{ NEUTRINO_ICON_BUTTON_RED, LOCALE_TIMERBAR_RECORDEVENT },
|
// MP_BUTTONS
|
||||||
{ NEUTRINO_ICON_BUTTON_GREEN, LOCALE_IMDB_INFO }, //NI
|
|
||||||
{ NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_TIMERBAR_CHANNELSWITCH },
|
|
||||||
{ NEUTRINO_ICON_BUTTON_0, LOCALE_TMDB_INFO } //NI
|
|
||||||
},
|
|
||||||
{ // movieplayer mode
|
|
||||||
{ NEUTRINO_ICON_BUTTON_RED, LOCALE_EPG_SAVING },
|
{ NEUTRINO_ICON_BUTTON_RED, LOCALE_EPG_SAVING },
|
||||||
{ NEUTRINO_ICON_BUTTON_GREEN, LOCALE_IMDB_INFO }, //NI
|
{ NEUTRINO_ICON_BUTTON_GREEN, LOCALE_IMDB_INFO },
|
||||||
{ NEUTRINO_ICON_BUTTON_0, LOCALE_TMDB_INFO } //NI
|
{ NEUTRINO_ICON_BUTTON_0, LOCALE_TMDB_INFO }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1615,6 +1607,9 @@ void CEpgData::showTimerEventBar (bool pshow, bool adzap, bool mp_info)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int UsedButtons = mp_info ? MP_BUTTONS : TV_BUTTONS;
|
||||||
|
int MaxButtons = mp_info ? 3 : 5; //TODO: auto-calc from struct
|
||||||
|
|
||||||
std::string adzap_button;
|
std::string adzap_button;
|
||||||
if (adzap)
|
if (adzap)
|
||||||
{
|
{
|
||||||
@@ -1622,32 +1617,48 @@ void CEpgData::showTimerEventBar (bool pshow, bool adzap, bool mp_info)
|
|||||||
adzap_button += " " + to_string(g_settings.adzap_zapBackPeriod / 60) + " ";
|
adzap_button += " " + to_string(g_settings.adzap_zapBackPeriod / 60) + " ";
|
||||||
adzap_button += g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE);
|
adzap_button += g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE);
|
||||||
}
|
}
|
||||||
bool tmdb = g_settings.tmdb_enabled;
|
|
||||||
bool fscr = (has_follow_screenings && !call_fromfollowlist);
|
|
||||||
//NI
|
//NI
|
||||||
if (imdb_active)
|
if (imdb_active)
|
||||||
{
|
{
|
||||||
EpgButtons[mp_info ? 2 : (fscr ? 0 : 1)][1].button = (imdb->gotPoster()) ? NEUTRINO_ICON_BUTTON_GREEN : NEUTRINO_ICON_BUTTON_DUMMY_SMALL;
|
EpgButtons[UsedButtons][1].button = (imdb->gotPoster()) ? NEUTRINO_ICON_BUTTON_GREEN : NEUTRINO_ICON_BUTTON_DUMMY_SMALL;
|
||||||
EpgButtons[mp_info ? 2 : (fscr ? 0 : 1)][1].locale = LOCALE_IMDB_INFO_SAVE;
|
EpgButtons[UsedButtons][1].locale = LOCALE_IMDB_INFO_SAVE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
EpgButtons[mp_info ? 2 : (fscr ? 0 : 1)][1].button = NEUTRINO_ICON_BUTTON_GREEN;
|
EpgButtons[UsedButtons][1].button = NEUTRINO_ICON_BUTTON_GREEN;
|
||||||
EpgButtons[mp_info ? 2 : (fscr ? 0 : 1)][1].locale = LOCALE_IMDB_INFO;
|
EpgButtons[UsedButtons][1].locale = LOCALE_IMDB_INFO;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mp_info)
|
if (mp_info)
|
||||||
::paintButtons(x, y, w, tmdb ? 3 : 2, EpgButtons[2], w, h); //NI
|
{
|
||||||
|
if (!g_settings.tmdb_enabled)
|
||||||
|
{
|
||||||
|
// disable tmdb button
|
||||||
|
EpgButtons[MP_BUTTONS][2].button = NEUTRINO_ICON_BUTTON_DUMMY_SMALL;
|
||||||
|
}
|
||||||
|
|
||||||
|
::paintButtons(x, y, w, MaxButtons, EpgButtons[MP_BUTTONS], w, h);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int c = EpgButtonsMax;
|
bool fscr = (has_follow_screenings && !call_fromfollowlist);
|
||||||
if (!tmdb)
|
|
||||||
c--; // reduce tmdb button
|
|
||||||
if (!fscr)
|
if (!fscr)
|
||||||
c--; // reduce blue button
|
{
|
||||||
|
// disable followscreenings button
|
||||||
|
EpgButtons[TV_BUTTONS][3].button = NEUTRINO_ICON_BUTTON_DUMMY_SMALL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!g_settings.tmdb_enabled)
|
||||||
|
{
|
||||||
|
// disable tmdb button
|
||||||
|
EpgButtons[TV_BUTTONS][4].button = NEUTRINO_ICON_BUTTON_DUMMY_SMALL;
|
||||||
|
}
|
||||||
|
|
||||||
if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF)
|
if (g_settings.recording_type != CNeutrinoApp::RECORDING_OFF)
|
||||||
::paintButtons(x, y, w, c, EpgButtons[fscr ? 0 : 1], w, h, "", false, COL_MENUFOOT_TEXT, adzap ? adzap_button.c_str() : NULL, 2); //NI
|
::paintButtons(x, y, w, MaxButtons, EpgButtons[TV_BUTTONS], w, h, "", false, COL_MENUFOOT_TEXT, adzap ? adzap_button.c_str() : NULL, 2);
|
||||||
else
|
else // don't show recording button
|
||||||
::paintButtons(x, y, w, c, &EpgButtons[fscr ? 0 : 1][1], w, h, "", false, COL_MENUFOOT_TEXT, adzap ? adzap_button.c_str() : NULL, 1); //NI
|
::paintButtons(x, y, w, MaxButtons, &EpgButtons[TV_BUTTONS][1], w, h, "", false, COL_MENUFOOT_TEXT, adzap ? adzap_button.c_str() : NULL, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user