Channelgroup in cRecMenuSearchTimerEdit

This commit is contained in:
kamel5 2019-04-09 18:25:58 +02:00
parent 333a3d397f
commit 6e83787437
14 changed files with 160 additions and 25 deletions

View File

@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-tvguide 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2019-04-07 14:23+0200\n"
"POT-Creation-Date: 2019-04-12 14:35+0200\n"
"PO-Revision-Date: 2013-09-21 17:49+0200\n"
"Last-Translator: My friend <Sampep> Thanks David <Gabychan> <gbonich@gmail.com>\n"
"Language-Team: \n"
@ -366,6 +366,9 @@ msgstr "Inicia canal"
msgid "Stop Channel"
msgstr "Atura canal"
msgid "Channel Group"
msgstr ""
msgid "Start after"
msgstr "Comença després"
@ -525,6 +528,12 @@ msgstr "coincidència exacta"
msgid "regular expression"
msgstr "expressió regular"
msgid "Interval"
msgstr ""
msgid "only FTA"
msgstr ""
msgid "General Settings"
msgstr "Preferències"

View File

@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-tvguide 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2019-04-07 14:23+0200\n"
"POT-Creation-Date: 2019-04-12 14:35+0200\n"
"PO-Revision-Date: 2012-08-25 17:49+0200\n"
"Last-Translator: Horst\n"
"Language-Team: \n"
@ -363,6 +363,9 @@ msgstr "Startkanal"
msgid "Stop Channel"
msgstr "Stopkanal"
msgid "Channel Group"
msgstr "Kanalgruppe"
msgid "Start after"
msgstr "Beginn nach"
@ -522,6 +525,12 @@ msgstr "exakt"
msgid "regular expression"
msgstr "Regulärer Ausdruck"
msgid "Interval"
msgstr "Bereich"
msgid "only FTA"
msgstr "ohne PayTV"
msgid "General Settings"
msgstr "Allgemeine Einstellungen"

View File

@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-tvguide 0.0.1\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2019-04-07 14:23+0200\n"
"POT-Creation-Date: 2019-04-12 14:35+0200\n"
"PO-Revision-Date: 2012-08-25 17:49+0200\n"
"Last-Translator: fiveten_59\n"
"Language-Team: \n"
@ -363,6 +363,9 @@ msgstr "Avvia il Canale"
msgid "Stop Channel"
msgstr "Ferma il Canale"
msgid "Channel Group"
msgstr ""
msgid "Start after"
msgstr "Avvia dopo"
@ -522,6 +525,12 @@ msgstr "exakt"
msgid "regular expression"
msgstr "Regulärer Ausdruck"
msgid "Interval"
msgstr ""
msgid "only FTA"
msgstr ""
msgid "General Settings"
msgstr "Allgemeine Einstellungen"

View File

@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-tvguide 1.0.0\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2019-04-07 14:23+0200\n"
"POT-Creation-Date: 2019-04-12 14:35+0200\n"
"PO-Revision-Date: 2013-09-25 17:49+0400\n"
"Last-Translator: AmiD, ilya\n"
"Language-Team: Russia-Cherepovets(wm.amid@gmail.com)\n"
@ -363,6 +363,9 @@ msgstr "С канала"
msgid "Stop Channel"
msgstr "По канал"
msgid "Channel Group"
msgstr ""
msgid "Start after"
msgstr "С"
@ -522,6 +525,12 @@ msgstr "точное совпадение"
msgid "regular expression"
msgstr "регулярные выражения"
msgid "Interval"
msgstr ""
msgid "only FTA"
msgstr ""
msgid "General Settings"
msgstr "Основные настройки"

View File

@ -3,7 +3,7 @@ msgid ""
msgstr ""
"Project-Id-Version: vdr-tvguide 1.1.0\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2019-04-07 14:23+0200\n"
"POT-Creation-Date: 2019-04-12 14:35+0200\n"
"PO-Revision-Date: 2013-09-15 00:12+0100\n"
"Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n"
"Language-Team: \n"
@ -363,6 +363,9 @@ msgstr "Od kan
msgid "Stop Channel"
msgstr "Po kanál"
msgid "Channel Group"
msgstr ""
msgid "Start after"
msgstr "Zaèiatok po"
@ -522,6 +525,12 @@ msgstr "presn
msgid "regular expression"
msgstr "regulárny výraz"
msgid "Interval"
msgstr ""
msgid "only FTA"
msgstr ""
msgid "General Settings"
msgstr "V¹eobecné nastavenia"

View File

@ -495,6 +495,22 @@ void cRecManager::GetSearchTimers(std::vector<cTVGuideSearchTimer> *searchTimer)
std::sort(searchTimer->begin(), searchTimer->end());
}
void cRecManager::GetChannelGroups(std::vector<std::string> *channelGroups) {
if (!epgSearchAvailable) {
return;
}
Epgsearch_services_v1_1 *epgSearch = new Epgsearch_services_v1_1;
if (epgSearchPlugin->Service("Epgsearch-services-v1.1", epgSearch)) {
std::list<std::string> channelGroupList;
channelGroupList = epgSearch->handler->ChanGrpList();
for (std::list<std::string>::iterator it = channelGroupList.begin(); it != channelGroupList.end(); it++) {
channelGroups->push_back(*it);
}
}
std::sort(channelGroups->begin(), channelGroups->end());
}
int cRecManager::CreateSearchTimer(std::string epgSearchString) {
int timerID = -1;
if (!epgSearchAvailable)

View File

@ -46,6 +46,7 @@ public:
const cEvent **PerformSearch(Epgsearch_searchresults_v1_0 data, int &numResults);
void ReadEPGSearchTemplates(std::vector<TVGuideEPGSearchTemplate> *epgTemplates);
void GetSearchTimers(std::vector<cTVGuideSearchTimer> *timers);
void GetChannelGroups(std::vector<std::string> *channelGroups);
int CreateSearchTimer(std::string epgSearchString);
bool SaveSearchTimer(cTVGuideSearchTimer *searchTimer);
void DeleteSearchTimer(cTVGuideSearchTimer *searchTimer, bool delTimers);

View File

@ -493,7 +493,8 @@ cRecMenuItemSelect::cRecMenuItemSelect(cString text,
int initialVal,
bool active,
int *callback,
eRecMenuState action) {
eRecMenuState action,
bool refresh) {
selectable = true;
this->text = text;
strings = Strings;
@ -504,6 +505,7 @@ cRecMenuItemSelect::cRecMenuItemSelect(cString text,
this->currentVal = initialVal;
this->active = active;
this->callback = callback;
this->refresh = refresh;
this->action = action;
height = 3 * font->Height() / 2;
pixmapVal = NULL;
@ -571,6 +573,9 @@ eRecMenuState cRecMenuItemSelect::ProcessKey(eKeys Key) {
if (callback)
*callback = currentVal;
DrawValue();
if (refresh)
return rmsRefresh;
else
return rmsConsumed;
break;
case kRight:
@ -578,6 +583,9 @@ eRecMenuState cRecMenuItemSelect::ProcessKey(eKeys Key) {
if (callback)
*callback = currentVal;
DrawValue();
if (refresh)
return rmsRefresh;
else
return rmsConsumed;
break;
case kOk:

View File

@ -247,6 +247,7 @@ private:
cString text;
int currentVal;
int *callback;
bool refresh;
std::vector<std::string> strings;
int numValues;
cPixmap *pixmapVal;
@ -257,7 +258,8 @@ public:
int initialVal,
bool active = false,
int *callback = NULL,
eRecMenuState action = rmsNotConsumed);
eRecMenuState action = rmsNotConsumed,
bool refresh = false);
virtual ~cRecMenuItemSelect(void);
void SetPixmaps(void);
void Hide(void);

View File

@ -311,7 +311,9 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
if (epgSearchTemplates.size() > 0) {
activeMenu = new cRecMenuSearchTimerTemplates(searchTimer, epgSearchTemplates);
} else {
activeMenu = new cRecMenuSearchTimerEdit(searchTimer, false);
std::vector<std::string> channelGroups;
recManager->GetChannelGroups(&channelGroups);
activeMenu = new cRecMenuSearchTimerEdit(searchTimer, false, channelGroups);
}
}
activeMenu->Display();
@ -329,12 +331,14 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
searchTimer = menu->GetSearchTimer();
} else if (cRecMenuSearchTimerEdit *menu = dynamic_cast<cRecMenuSearchTimerEdit*>(activeMenu)) {
searchTimer = menu->GetSearchTimer();
advancedOptions = (nextState == rmsSearchTimerEditAdvanced)?true:false;
advancedOptions = (nextState == rmsSearchTimerEditAdvanced) ? true : false;
} else if (cRecMenuSearchTimerTemplates *menu = dynamic_cast<cRecMenuSearchTimerTemplates*>(activeMenu)) {
searchTimer = menu->GetSearchTimer();
} else break;
delete activeMenu;
activeMenu = new cRecMenuSearchTimerEdit(searchTimer, advancedOptions);
std::vector<std::string> channelGroups;
recManager->GetChannelGroups(&channelGroups);
activeMenu = new cRecMenuSearchTimerEdit(searchTimer, advancedOptions, channelGroups);
activeMenu->Display();
break; }
case rmsSearchTimerTest: {

View File

@ -722,10 +722,11 @@ int cRecMenuSearchTimers::GetTotalNumMenuItems(void) {
}
// --- cRecMenuSearchTimerEdit ---------------------------------------------------------
cRecMenuSearchTimerEdit::cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer, bool advancedOptions) {
cRecMenuSearchTimerEdit::cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer, bool advancedOptions, std::vector<std::string> channelGroups) {
deleteMenuItems = false;
this->advancedOptions = advancedOptions;
this->searchTimer = searchTimer;
this->channelGroups = channelGroups;
strncpy(searchString, searchTimer.SearchString().c_str(), TEXTINPUTLENGTH);
timerActive = searchTimer.Active();
mode = searchTimer.SearchMode();
@ -735,6 +736,8 @@ cRecMenuSearchTimerEdit::cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer
useChannel = searchTimer.UseChannel();
startChannel = searchTimer.StartChannel();
stopChannel = searchTimer.StopChannel();
channelGroup = searchTimer.ChannelGroup();
channelgroupIndex = -1;
useTime = searchTimer.UseTime();
startTime = searchTimer.StartTime();
stopTime = searchTimer.StopTime();
@ -780,6 +783,10 @@ cRecMenuSearchTimerEdit::~cRecMenuSearchTimerEdit(void) {
delete *it;
}
useChannelSubMenu.clear();
for (std::vector<cRecMenuItem*>::iterator it = useGroupSubMenu.begin(); it != useGroupSubMenu.end(); it++) {
delete *it;
}
useGroupSubMenu.clear();
for (std::vector<cRecMenuItem*>::iterator it = useTimeSubMenu.begin(); it != useTimeSubMenu.end(); it++) {
delete *it;
}
@ -795,22 +802,45 @@ cRecMenuSearchTimerEdit::~cRecMenuSearchTimerEdit(void) {
currentMenuItems.clear();
}
int cRecMenuSearchTimerEdit::SplitChannelGroups(std::vector<std::string> *channelGroups, std::vector<std::string> *channelgroups) {
int i = 0;
int j = 0;
for (std::vector<std::string>::iterator it = channelGroups->begin(); it != channelGroups->end(); it++) {
std::string a = *it;
splitstring s(a.c_str());
std::vector<std::string> value = s.split('|', 0);
dsyslog ("%s %s %d %s\n", __FILE__, __func__, __LINE__, s.c_str());
std::vector<std::string>::iterator ito = value.begin();
channelgroups->push_back(*ito);
std::string b = *ito;
if (b.compare(channelGroup) == 0)
j = i;
i++;
}
return j;
}
void cRecMenuSearchTimerEdit::InitMenuItems(void) {
dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
useChannelPos = 6;
useTimePos = 7;
useDayOfWeekPos = 8;
avoidRepeatsPos = 14;
mainMenuItems.push_back(new cRecMenuItemText(tr("Search String"), searchString, TEXTINPUTLENGTH, false, searchString));
mainMenuItems.push_back(new cRecMenuItemBool(tr("Active"), timerActive, false, false, &timerActive, rmsSearchTimerSave));
std::vector<std::string> searchModes;
searchTimer.GetSearchModes(&searchModes);
std::vector<std::string> useChannelModes;
searchTimer.GetUseChannelModes(&useChannelModes);
channelgroupIndex = SplitChannelGroups(&channelGroups, &channelgroups);
mainMenuItems.push_back(new cRecMenuItemText(tr("Search String"), searchString, TEXTINPUTLENGTH, false, searchString));
mainMenuItems.push_back(new cRecMenuItemBool(tr("Active"), timerActive, false, false, &timerActive, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemSelect(tr("Search Mode"), searchModes, mode, false, &mode, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemBool(tr("Use Title"), useTitle, false, false, &useTitle, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemBool(tr("Use Subtitle"), useSubtitle, false, false, &useSubtitle, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemBool(tr("Use Description"), useDescription, false, false, &useDescription, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemBool(tr("Limit Channels"), useChannel, true, false, &useChannel, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemSelect(tr("Limit Channels"), useChannelModes, useChannel, false, &useChannel, rmsSearchTimerSave, true));
mainMenuItems.push_back(new cRecMenuItemBool(tr("Use Time"), useTime, true, false, &useTime, rmsSearchTimerSave));
if (!advancedOptions) {
mainMenuItems.push_back(new cRecMenuItemButton(tr("Display advanced Options"), rmsSearchTimerEditAdvanced, false));
@ -842,6 +872,8 @@ void cRecMenuSearchTimerEdit::InitMenuItems(void) {
useChannelSubMenu.push_back(new cRecMenuItemChannelChooser(tr("Stop Channel"), Channels.GetByNumber(stopChannel), false, &stopChannel, rmsSearchTimerSave));
#endif
useGroupSubMenu.push_back(new cRecMenuItemSelect(tr("Channel Group"), channelgroups, channelgroupIndex, false, &channelgroupIndex, rmsSearchTimerSave));
useTimeSubMenu.push_back(new cRecMenuItemTime(tr("Start after"), startTime, false, &startTime, rmsSearchTimerSave));
useTimeSubMenu.push_back(new cRecMenuItemTime(tr("Start before"), stopTime, false, &stopTime, rmsSearchTimerSave));
@ -856,6 +888,7 @@ void cRecMenuSearchTimerEdit::InitMenuItems(void) {
void cRecMenuSearchTimerEdit::CreateMenuItems(void) {
dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
bool reDraw = false;
if (GetCurrentNumMenuItems() > 0) {
InitMenu(false);
@ -867,8 +900,10 @@ void cRecMenuSearchTimerEdit::CreateMenuItems(void) {
for (int i = 0; i < numMainMenuItems; i++) {
currentMenuItems.push_back(mainMenuItems[i]);
if ((i == useChannelPos) && useChannel)
if ((i == useChannelPos) && (useChannel == 1))
AddSubMenu(&useChannelSubMenu);
else if ((i == useChannelPos) && (useChannel == 2) && (channelgroups.size() > 0))
AddSubMenu(&useGroupSubMenu);
else if ((i == useTimePos) && useTime)
AddSubMenu(&useTimeSubMenu);
else if (advancedOptions && (i == useDayOfWeekPos) && useDayOfWeek)
@ -901,17 +936,26 @@ void cRecMenuSearchTimerEdit::AddSubMenu(std::vector<cRecMenuItem*> *subMenu) {
cTVGuideSearchTimer cRecMenuSearchTimerEdit::GetSearchTimer(void) {
dsyslog ("%s %s %d\n", __FILE__, __func__, __LINE__);
searchTimer.SetSearchString(searchString);
searchTimer.SetActive(timerActive);
searchTimer.SetSearchMode(mode);
searchTimer.SetUseTitle(useTitle);
searchTimer.SetUseSubtitle(useSubtitle);
searchTimer.SetUseDesription(useDescription);
searchTimer.SetUseChannel(useChannel);
if (useChannel) {
if (useChannel == 1) {
searchTimer.SetStartChannel(startChannel);
searchTimer.SetStopChannel(stopChannel);
}
if (useChannel == 2) {
if (channelgroups.size() > 0) {
std::string & channelGroup = channelgroups[channelgroupIndex];
searchTimer.SetChannelGroup(channelGroup);
} else {
useChannel = 0;
}
}
searchTimer.SetUseChannel(useChannel);
searchTimer.SetUseTime(useTime);
if (useTime) {
searchTimer.SetStartTime(startTime);

View File

@ -209,8 +209,10 @@ class cRecMenuSearchTimerEdit: public cRecMenu {
private:
bool advancedOptions;
cTVGuideSearchTimer searchTimer;
std::vector<std::string> channelGroups;
std::vector<cRecMenuItem*> mainMenuItems;
std::vector<cRecMenuItem*> useChannelSubMenu;
std::vector<cRecMenuItem*> useGroupSubMenu;
std::vector<cRecMenuItem*> useTimeSubMenu;
std::vector<cRecMenuItem*> useDayOfWeekSubMenu;
std::vector<cRecMenuItem*> avoidRepeatSubMenu;
@ -226,9 +228,12 @@ private:
bool useTitle;
bool useSubtitle;
bool useDescription;
bool useChannel;
int useChannel;
int startChannel;
int stopChannel;
std::string channelGroup;
std::vector<std::string> channelgroups;
int channelgroupIndex;
bool useTime;
int startTime;
int stopTime;
@ -249,8 +254,9 @@ private:
bool useInFavorites;
void InitMenuItems(void);
void AddSubMenu(std::vector<cRecMenuItem*> *subMenu);
int SplitChannelGroups(std::vector<std::string> *channelGroups, std::vector<std::string> *channelgroups);
public:
cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer, bool advancedOptions);
cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer, bool advancedOptions, std::vector<std::string> channelGroups);
void CreateMenuItems(void);
virtual ~cRecMenuSearchTimerEdit(void);
cTVGuideSearchTimer GetSearchTimer(void);

View File

@ -577,7 +577,6 @@ void cTVGuideSearchTimer::GetSearchModes(std::vector<std::string> *searchModes)
searchModes->push_back(tr("regular expression"));
}
void cTVGuideSearchTimer::Dump(void) {
esyslog("tvguide searchtimer: strTimer: %s", strTimer.c_str());
esyslog("tvguide searchtimer: ID: %d", ID);
@ -617,3 +616,10 @@ void cTVGuideSearchTimer::SetStopChannel(int stopChannel)
channelMax = Channels.GetByNumber(stopChannel);
#endif
};
void cTVGuideSearchTimer::GetUseChannelModes(std::vector<std::string> *useChannelModes) {
useChannelModes->push_back(tr("No"));
useChannelModes->push_back(tr("Interval"));
useChannelModes->push_back(tr("Channel Group"));
useChannelModes->push_back(tr("only FTA"));
}

View File

@ -82,9 +82,10 @@ public:
bool UseSubtitle(void) { return useSubtitle; };
bool UseDescription(void) { return useDescription; };
int SearchMode(void) { return mode; };
bool UseChannel(void) { return useChannel; };
int UseChannel(void) { return useChannel; };
int StartChannel(void) { return (channelMin)?channelMin->Number():0; };
int StopChannel(void) { return (channelMax)?channelMax->Number():0; };
std::string ChannelGroup(void) { return channelGroup; };
bool UseTime(void) { return useTime; };
int StartTime(void) { return startTime; };
int StopTime(void) { return stopTime; };
@ -110,9 +111,10 @@ public:
void SetUseTitle(bool useTitle) { this->useTitle = useTitle; };
void SetUseSubtitle(bool useSubtitle) { this->useSubtitle = useSubtitle; };
void SetUseDesription(bool useDescription) { this->useDescription = useDescription; };
void SetUseChannel(bool useChannel) { this->useChannel = useChannel; };
void SetUseChannel(int useChannel) { this->useChannel = useChannel; };
void SetStartChannel(int startChannel);
void SetStopChannel(int stopChannel);
void SetChannelGroup(std::string channelGroup) { this->channelGroup = channelGroup; };
void SetUseTime(bool useTime) { this->useTime = useTime; };
void SetStartTime(int startTime) { this->startTime = startTime; };
void SetStopTime(int stopTime) { this->stopTime = stopTime; };
@ -135,6 +137,7 @@ public:
int GetNumTimers(void);
int GetNumRecordings(void);
void GetSearchModes(std::vector<std::string> *searchModes);
void GetUseChannelModes(std::vector<std::string> *useChannelModes);
void Dump(void);
};