Followscreenings: add enumeration for a better readability

Origin commit data
------------------
Commit: 141d198b29
Author: Thilo Graf <dbt@novatux.de>
Date: 2017-06-07 (Wed, 07 Jun 2017)
This commit is contained in:
2017-06-07 14:17:12 +02:00
committed by Michael Liebmann
parent ff97eee187
commit 707c74df83
4 changed files with 17 additions and 2 deletions

View File

@@ -67,7 +67,7 @@ CChannelEventList *CFollowScreenings::getFollowScreenings(void)
continue; continue;
followlist.push_back(*e); followlist.push_back(*e);
if (followlist.size() == 1 && !g_settings.timer_followscreenings) if (followlist.size() == 1 && g_settings.timer_followscreenings == FOLLOWSCREENINGS_OFF)
break; break;
} }
} }

View File

@@ -59,6 +59,12 @@ class CFollowScreenings : public CMenuTarget
std::vector<CMenuForwarder *> forwarders; std::vector<CMenuForwarder *> forwarders;
void updateRightIcon(int i, time_t start, unsigned int duration); void updateRightIcon(int i, time_t start, unsigned int duration);
public: public:
enum
{
FOLLOWSCREENINGS_OFF = 0,
FOLLOWSCREENINGS_ON = 1,
};
CFollowScreenings(const t_channel_id Channel_id, time_t Starttime, time_t Stoptime, const std::string &Title, uint64_t EpgID=0, CFollowScreenings(const t_channel_id Channel_id, time_t Starttime, time_t Stoptime, const std::string &Title, uint64_t EpgID=0,
unsigned char Apids=TIMERD_APIDS_STD, bool Safety=false, std::string RecDir="", CChannelEventList *Evtlist=NULL) : CMenuTarget () { unsigned char Apids=TIMERD_APIDS_STD, bool Safety=false, std::string RecDir="", CChannelEventList *Evtlist=NULL) : CMenuTarget () {
this->channel_id = Channel_id; this->channel_id = Channel_id;

View File

@@ -41,6 +41,7 @@
#include "record_setup.h" #include "record_setup.h"
#include <gui/filebrowser.h> #include <gui/filebrowser.h>
#include <gui/followscreenings.h>
#include <gui/widget/icons.h> #include <gui/widget/icons.h>
#include <gui/widget/msgbox.h> #include <gui/widget/msgbox.h>
@@ -173,6 +174,13 @@ const CMenuOptionChooser::keyval END_OF_RECORDING[END_OF_RECORDING_COUNT] =
{1, LOCALE_RECORDINGMENU_END_OF_RECORDING_EPG} {1, LOCALE_RECORDINGMENU_END_OF_RECORDING_EPG}
}; };
const CMenuOptionChooser::keyval timer_followscreenings_options[] =
{
{CFollowScreenings::FOLLOWSCREENINGS_OFF ,LOCALE_OPTIONS_OFF },
{CFollowScreenings::FOLLOWSCREENINGS_ON ,LOCALE_OPTIONS_ON }
};
size_t timer_followscreenings_options_count = sizeof(timer_followscreenings_options)/sizeof(CMenuOptionChooser::keyval);
int CRecordSetup::showRecordSetup() int CRecordSetup::showRecordSetup()
{ {
CMenuForwarder * mf; CMenuForwarder * mf;

View File

@@ -77,6 +77,7 @@
#include "gui/eventlist.h" #include "gui/eventlist.h"
#include "gui/favorites.h" #include "gui/favorites.h"
#include "gui/filebrowser.h" #include "gui/filebrowser.h"
#include "gui/followscreenings.h"
#include "gui/hdd_menu.h" #include "gui/hdd_menu.h"
#include "gui/infoviewer.h" #include "gui/infoviewer.h"
#include "gui/mediaplayer.h" #include "gui/mediaplayer.h"
@@ -500,7 +501,7 @@ int CNeutrinoApp::loadSetup(const char * fname)
g_settings.timer_remotebox_ip.push_back(timer_rb); g_settings.timer_remotebox_ip.push_back(timer_rb);
} }
} }
g_settings.timer_followscreenings = configfile.getInt32( "timer_followscreenings", 1 ); g_settings.timer_followscreenings = configfile.getInt32( "timer_followscreenings", CFollowScreenings::FOLLOWSCREENINGS_ON );
g_settings.infobar_sat_display = configfile.getBool("infobar_sat_display" , true ); g_settings.infobar_sat_display = configfile.getBool("infobar_sat_display" , true );
g_settings.infobar_show_channeldesc = configfile.getBool("infobar_show_channeldesc" , false ); g_settings.infobar_show_channeldesc = configfile.getBool("infobar_show_channeldesc" , false );