From c341a635d9b0c4dfdd5e2f6ab25f9d94f53ac795 Mon Sep 17 00:00:00 2001 From: louis Date: Tue, 30 Jun 2015 17:55:17 +0200 Subject: made default time before a switchtimer switches configurable --- HISTORY | 1 + config.c | 4 +++- config.h | 1 + detailview.c | 2 +- po/de_DE.po | 5 ++++- recmenu.c | 5 +++-- recmenus.c | 2 +- setup.c | 2 ++ switchtimer.c | 2 +- switchtimer.h | 1 + tvguidengosd.c | 2 -- 11 files changed, 18 insertions(+), 9 deletions(-) diff --git a/HISTORY b/HISTORY index 82f3441..6d937ce 100644 --- a/HISTORY +++ b/HISTORY @@ -52,3 +52,4 @@ Version 0.1.6 - fixed bug that menuitem number is not calculated correctly if recording menu scrolls +- made default time before a switchtimer switches configurable diff --git a/config.c b/config.c index 46cb3b9..b5aaabb 100644 --- a/config.c +++ b/config.c @@ -42,6 +42,7 @@ cTVGuideConfig::cTVGuideConfig(void) { favStartChannel = 0; favStopChannel = 0; useSubtitleRerun = 1; + switchMinsBefore = 2; } bool cTVGuideConfig::SetupParse(const char *Name, const char *Value) { @@ -83,7 +84,8 @@ bool cTVGuideConfig::SetupParse(const char *Name, const char *Value) { else if (!strcasecmp(Name, "favLimitChannels")) favLimitChannels = atoi(Value); else if (!strcasecmp(Name, "favStartChannel")) favStartChannel = atoi(Value); else if (!strcasecmp(Name, "favStopChannel")) favStopChannel = atoi(Value); + else if (!strcasecmp(Name, "switchMinsBefore")) switchMinsBefore = atoi(Value); else return false; return true; -} +} \ No newline at end of file diff --git a/config.h b/config.h index 1cd7484..c9b48d0 100644 --- a/config.h +++ b/config.h @@ -77,6 +77,7 @@ public: int favStartChannel; int favStopChannel; int useSubtitleRerun; + int switchMinsBefore; bool SetupParse(const char *Name, const char *Value); }; diff --git a/detailview.c b/detailview.c index 2ed44c0..ad8a7b1 100644 --- a/detailview.c +++ b/detailview.c @@ -632,4 +632,4 @@ void cDetailView::SetEpgPictures(int eventId) { tabs->AddStringToken(path.str(), ""); } } -} +} \ No newline at end of file diff --git a/po/de_DE.po b/po/de_DE.po index e45e50c..8dcde82 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-tvguideng 0.0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-06-26 13:48+0200\n" +"POT-Creation-Date: 2015-06-30 17:27+0200\n" "PO-Revision-Date: 2015-03-08 17:49+0200\n" "Last-Translator: Louis\n" "Language-Team: \n" @@ -605,3 +605,6 @@ msgstr "Benutzerdef. Zeit 4 in Favoriten benutzen" msgid "Limit channels in favorites" msgstr "Kanäle in Favoriten beschränken" + +msgid "Minutes a switchtimer switches before start of a show" +msgstr "Minuten vor Beginn einer Sendung, zu der ein Switchtimer umschaltet" diff --git a/recmenu.c b/recmenu.c index a5070ec..26724ed 100644 --- a/recmenu.c +++ b/recmenu.c @@ -151,8 +151,9 @@ void cRecMenu::AddFooter(cRecMenuItem *footer) { int cRecMenu::GetNumActive(void) { int num = 0; for (cRecMenuItem *current = menuItems.First(); current; current = menuItems.Next(current)) { - if (current == active) + if (current == active) { return num; + } num++; } return 0; @@ -504,4 +505,4 @@ void cRecMenu::DrawFooter(void) { active = footer; recMenuGrid->SetCurrent(footer->Id(), true); } -} +} \ No newline at end of file diff --git a/recmenus.c b/recmenus.c index e6cdff2..1a7d867 100644 --- a/recmenus.c +++ b/recmenus.c @@ -738,7 +738,7 @@ cRecMenuSearchTimerNothingFound::cRecMenuSearchTimerNothingFound(string searchSt // --- cRecMenuSwitchTimer --------------------------------------------------------- cRecMenuSwitchTimer::cRecMenuSwitchTimer(void) { SetMenuWidth(60); - switchMinsBefore = 2; + switchMinsBefore = config.switchMinsBefore; announceOnly = 0; AddHeader(new cRecMenuItemInfo(tr("Configure Options for Switchtimer"))); diff --git a/setup.c b/setup.c index d512fa7..04d46b1 100644 --- a/setup.c +++ b/setup.c @@ -86,6 +86,7 @@ void cTvGuideSetup::Setup(void) { Add(new cMenuEditChanItem(tr("Start Channel"), &tmpConfig.favStartChannel)); Add(new cMenuEditChanItem(tr("Stop Channel"), &tmpConfig.favStopChannel)); } + Add(new cMenuEditIntItem(tr("Minutes a switchtimer switches before start of a show"), &tmpConfig.switchMinsBefore, 0, 10)); SetCurrent(Get(current)); Display(); @@ -130,6 +131,7 @@ void cTvGuideSetup::Store(void) { SetupStore("favLimitChannels", config.favLimitChannels); SetupStore("favStartChannel", config.favStartChannel); SetupStore("favStopChannel", config.favStopChannel); + SetupStore("switchMinsBefore", config.switchMinsBefore); } eOSState cTvGuideSetup::ProcessKey(eKeys Key) { diff --git a/switchtimer.c b/switchtimer.c index f56c469..79e0bce 100644 --- a/switchtimer.c +++ b/switchtimer.c @@ -6,7 +6,7 @@ cSwitchTimers SwitchTimers; cSwitchTimer::cSwitchTimer(void) { eventID = 0; startTime = 0; - switchMinsBefore = 2; + switchMinsBefore = config.switchMinsBefore; announceOnly = 0; } diff --git a/switchtimer.h b/switchtimer.h index 09ebe88..eea468f 100644 --- a/switchtimer.h +++ b/switchtimer.h @@ -2,6 +2,7 @@ #define __TVGUIDE_SWITCHTIMER_H #include +#include "config.h" class cSwitchTimer : public cListObject { public: diff --git a/tvguidengosd.c b/tvguidengosd.c index a59e092..59ea707 100644 --- a/tvguidengosd.c +++ b/tvguidengosd.c @@ -458,8 +458,6 @@ void cTVGuideOSD::CreateSwitchTimer(const cEvent *e) { if (SwitchTimers.EventInSwitchList(e)) return; cSwitchTimer st; - st.switchMinsBefore = 2; - st.announceOnly = 0; cRecManager recManager; recManager.SetEPGSearchPlugin(); recManager.CreateSwitchTimer(e, st); -- cgit v1.2.3