From ff599e4cda1755e54f1de55a4d7faf5095568691 Mon Sep 17 00:00:00 2001 From: kamel5 Date: Fri, 22 Mar 2019 13:52:26 +0100 Subject: [PATCH] Add "switchMinsBefore" to setup menu --- config.c | 4 +++- config.h | 3 ++- recmenus.c | 2 +- setup.c | 2 ++ switchtimer.c | 4 ++-- switchtimer.h | 1 + 6 files changed, 11 insertions(+), 5 deletions(-) diff --git a/config.c b/config.c index 76d01c7..0cf17a9 100644 --- a/config.c +++ b/config.c @@ -64,6 +64,7 @@ cTvguideConfig::cTvguideConfig() { favLimitChannels = 0; favStartChannel = 0; favStopChannel = 0; + switchMinsBefore = 2; fontIndex = 0; fontNameDefault = "VDRSymbols Sans:Book"; FontButtonDelta = 0; @@ -299,6 +300,7 @@ bool cTvguideConfig::SetupParse(const char *Name, const char *Value) { else if (strcmp(Name, "favLimitChannels") == 0) favLimitChannels = atoi(Value); else if (strcmp(Name, "favStartChannel") == 0) favStartChannel = atoi(Value); else if (strcmp(Name, "favStopChannel") == 0) favStopChannel = atoi(Value); + else if (strcmp(Name, "switchMinsBefore") == 0) switchMinsBefore = atoi(Value); else if (strcmp(Name, "fontIndex") == 0) fontIndex = atoi(Value); else if (strcmp(Name, "FontButtonDelta") == 0) FontButtonDelta = atoi(Value); else if (strcmp(Name, "FontDetailViewDelta") == 0) FontDetailViewDelta = atoi(Value); @@ -331,4 +333,4 @@ bool cTvguideConfig::SetupParse(const char *Name, const char *Value) { else if (strcmp(Name, "limitLogoCache") == 0) limitLogoCache = atoi(Value); else return false; return true; -} \ No newline at end of file +} diff --git a/config.h b/config.h index 7ebb49f..70842e0 100644 --- a/config.h +++ b/config.h @@ -118,6 +118,7 @@ class cTvguideConfig { int favLimitChannels; int favStartChannel; int favStopChannel; + int switchMinsBefore; int fontIndex; const char *fontNameDefault; int FontButtonDelta; @@ -252,4 +253,4 @@ THEME_CLR(theme, clrRecMenuTimelineBack, 0xFF828282); THEME_CLR(theme, clrRecMenuTimelineActive, 0xFF3F3F3F); THEME_CLR(theme, clrRecMenuTimelineConflict, 0x30FF0000); THEME_CLR(theme, clrRecMenuTimelineConflictOverlap, 0x90FF0000); -#endif //__TVGUIDE_CONFIG_H \ No newline at end of file +#endif //__TVGUIDE_CONFIG_H diff --git a/recmenus.c b/recmenus.c index c6ee217..0559aed 100644 --- a/recmenus.c +++ b/recmenus.c @@ -1109,7 +1109,7 @@ cRecMenuSearchTimerNothingFound::cRecMenuSearchTimerNothingFound(std::string sea // --- cRecMenuSwitchTimer --------------------------------------------------------- cRecMenuSwitchTimer::cRecMenuSwitchTimer(void) { - switchMinsBefore = 2; + switchMinsBefore = tvguideConfig.switchMinsBefore; announceOnly = 0; SetWidthPercent(60); diff --git a/setup.c b/setup.c index c58af4d..d4e0761 100644 --- a/setup.c +++ b/setup.c @@ -121,6 +121,7 @@ void cTvguideSetup::Store(void) { SetupStore("favLimitChannels", tvguideConfig.favLimitChannels); SetupStore("favStartChannel", tvguideConfig.favStartChannel); SetupStore("favStopChannel", tvguideConfig.favStopChannel); + SetupStore("switchMinsBefore", tvguideConfig.switchMinsBefore); SetupStore("fontIndex", tvguideConfig.fontIndex); SetupStore("FontButtonDelta", tvguideConfig.FontButtonDelta); SetupStore("FontDetailViewDelta", tvguideConfig.FontDetailViewDelta); @@ -419,6 +420,7 @@ void cMenuSetupFavorites::Set(void) { Add(new cMenuEditChanItem(tr("Start Channel"), &tmpTvguideConfig->favStartChannel)); Add(new cMenuEditChanItem(tr("Stop Channel"), &tmpTvguideConfig->favStopChannel)); } + Add(new cMenuEditIntItem(tr("Minutes a switchtimer switches before start of a show"), &tmpTvguideConfig->switchMinsBefore, 0, 10)); SetCurrent(Get(currentItem)); diff --git a/switchtimer.c b/switchtimer.c index 3a45f79..73ac24b 100644 --- a/switchtimer.c +++ b/switchtimer.c @@ -6,14 +6,14 @@ cSwitchTimers SwitchTimers; cSwitchTimer::cSwitchTimer(void) { eventID = 0; startTime = 0; - switchMinsBefore = 2; + switchMinsBefore = tvguideConfig.switchMinsBefore; announceOnly = 0; } cSwitchTimer::cSwitchTimer(const cEvent* Event) { eventID = 0; startTime = 0; - switchMinsBefore = 2; + switchMinsBefore = tvguideConfig.switchMinsBefore; announceOnly = 0; if (Event) { eventID = Event->EventID(); diff --git a/switchtimer.h b/switchtimer.h index b661fdd..708a544 100644 --- a/switchtimer.h +++ b/switchtimer.h @@ -2,6 +2,7 @@ #define __TVGUIDE_SWITCHTIMER_H #include +#include "config.h" class cSwitchTimer : public cListObject { public: