- followscreenings: fix CFollowScreenings::FOLLOWSCREENINGS_ALWAYS

* add enumeration for a better readability

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2017-05-30 10:11:39 +02:00
committed by Thilo Graf
parent 67b4fec5a6
commit 752e2171c7
3 changed files with 10 additions and 8 deletions

View File

@@ -92,7 +92,7 @@ int CFollowScreenings::exec(CMenuTarget* /*parent*/, const std::string & actionK
if (i->eventType == CTimerd::TIMER_RECORD) {
if (channel_id == i->channel_id && e->startTime == i->epg_starttime) {
Timer.removeTimerEvent(i->eventID);
if (!forwarders.empty() && (followlist.size() > 1 || g_settings.timer_followscreenings == 2 /*always*/))
if (!forwarders.empty() && (followlist.size() > 1 || g_settings.timer_followscreenings == FOLLOWSCREENINGS_ALWAYS))
forwarders[ix]->iconName_Info_right = "";
#if 0
else
@@ -113,9 +113,9 @@ int CFollowScreenings::exec(CMenuTarget* /*parent*/, const std::string & actionK
e->startTime, e->startTime - (ANNOUNCETIME + 120 ), apids, true, e->startTime - (ANNOUNCETIME + 120) > time(NULL), recDir, true) == -1) {
//FIXME -- no error handling, but this shouldn't happen ...
} else {
if (!forwarders.empty() && (followlist.size() > 1 || g_settings.timer_followscreenings == 2 /*always*/))
if (!forwarders.empty() && (followlist.size() > 1 || g_settings.timer_followscreenings == FOLLOWSCREENINGS_ALWAYS))
forwarders[ix]->iconName_Info_right = NEUTRINO_ICON_REC;
else if (g_settings.timer_followscreenings != 2 /*always*/)
else if (g_settings.timer_followscreenings != FOLLOWSCREENINGS_ALWAYS) //NI
ShowMsg(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG,
CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_INFO);
return menu_return::RETURN_REPAINT;
@@ -156,11 +156,12 @@ void CFollowScreenings::show()
getFollowScreenings();
if (followlist.size() == 1 && g_settings.timer_followscreenings < 2 /*always*/) {
if (followlist.size() == 1 && g_settings.timer_followscreenings != FOLLOWSCREENINGS_ALWAYS)
{
snprintf(actionstr, sizeof(actionstr), "%lu", followlist.front().startTime);
exec(NULL, actionstr);
}
else if (followlist.size() > 1)
else if (followlist.size() > 1 || g_settings.timer_followscreenings == FOLLOWSCREENINGS_ALWAYS)
{
CMenuWidget m(LOCALE_EPGVIEWER_SELECT_SCREENING, NEUTRINO_ICON_SETTINGS);
const char *icon = NEUTRINO_ICON_BUTTON_RED;

View File

@@ -62,6 +62,7 @@ class CFollowScreenings : public CMenuTarget
{
FOLLOWSCREENINGS_OFF = 0,
FOLLOWSCREENINGS_ON = 1,
FOLLOWSCREENINGS_ALWAYS = 2
};
CFollowScreenings(const t_channel_id Channel_id, time_t Starttime, time_t Stoptime, const std::string &Title, uint64_t EpgID=0,

View File

@@ -177,9 +177,9 @@ const CMenuOptionChooser::keyval END_OF_RECORDING[END_OF_RECORDING_COUNT] =
const CMenuOptionChooser::keyval timer_followscreenings_options[] =
{
{0, LOCALE_OPTIONS_OFF},
{1, LOCALE_OPTIONS_ON},
{2, LOCALE_OPTIONS_ALWAYS}
{CFollowScreenings::FOLLOWSCREENINGS_OFF , LOCALE_OPTIONS_OFF },
{CFollowScreenings::FOLLOWSCREENINGS_ON , LOCALE_OPTIONS_ON },
{CFollowScreenings::FOLLOWSCREENINGS_ALWAYS , LOCALE_OPTIONS_ALWAYS}
};
size_t timer_followscreenings_options_count = sizeof(timer_followscreenings_options)/sizeof(CMenuOptionChooser::keyval);