summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2014-01-14 18:00:32 +0100
committerlouis <louis.braun@gmx.de>2014-01-14 18:00:32 +0100
commita8b7c9543477fddb42e7a2bac38a0d139c7de962 (patch)
tree9c681eb0de7fd584f8e50683ffb8aabc0fa716f4
parentd0651a4a507bbd633b30105f1fa01abe1172b311 (diff)
downloadvdr-plugin-tvguide-a8b7c9543477fddb42e7a2bac38a0d139c7de962.tar.gz
vdr-plugin-tvguide-a8b7c9543477fddb42e7a2bac38a0d139c7de962.tar.bz2
Favorites menu with EPG Search favorite timers with blue key
-rw-r--r--HISTORY1
-rw-r--r--config.c2
-rw-r--r--config.h6
-rw-r--r--footer.c21
-rw-r--r--footer.h2
-rw-r--r--po/ca_ES.po17
-rwxr-xr-xpo/de_DE.po17
-rw-r--r--po/ru_RU.po17
-rw-r--r--po/sk_SK.po17
-rw-r--r--recmanager.c20
-rw-r--r--recmanager.h1
-rw-r--r--recmenuitem.c80
-rw-r--r--recmenuitem.h21
-rw-r--r--recmenumanager.c17
-rw-r--r--recmenumanager.h1
-rw-r--r--recmenus.c52
-rw-r--r--recmenus.h18
-rw-r--r--searchtimer.h2
-rw-r--r--setup.c3
-rw-r--r--setup.h2
-rw-r--r--tvguideosd.c28
21 files changed, 325 insertions, 20 deletions
diff --git a/HISTORY b/HISTORY
index adaf768..99a5f35 100644
--- a/HISTORY
+++ b/HISTORY
@@ -105,3 +105,4 @@ Version 1.1.0
- completely refactored recording menu
- restructured detailöed EPG View that tv frame and status buttons
are displayed
+- Favorites menu with EPG Search favorite timers with blue key
diff --git a/config.c b/config.c
index 885693e..837d5c5 100644
--- a/config.c
+++ b/config.c
@@ -28,7 +28,7 @@ cTvguideConfig::cTvguideConfig() {
hugeStepHours = 24;
channelJumpMode = eNumJump;
jumpChannels = 0;
- blueKeyMode = 0;
+ blueKeyMode = eBlueKeySwitch;
closeOnSwitch = 1;
numkeyMode = 0;
useRemoteTimers = 0;
diff --git a/config.h b/config.h
index 07427d6..3411e8b 100644
--- a/config.h
+++ b/config.h
@@ -30,6 +30,12 @@ enum {
eStyleFlat
};
+enum {
+ eBlueKeySwitch,
+ eBlueKeyEPG,
+ eBlueKeyFavorites
+};
+
class cTvguideConfig {
private:
public:
diff --git a/footer.c b/footer.c
index aa4b12e..3e7b445 100644
--- a/footer.c
+++ b/footer.c
@@ -45,12 +45,21 @@ void cFooter::drawYellowButton(const char *text) {
DrawButton(cuttedText.c_str(), theme.Color(clrButtonYellow), theme.Color(clrButtonYellowBorder), oeButtonYellow, positionButtons[2]);
}
-void cFooter::drawBlueButton() {
+void cFooter::drawBlueButton(bool detailedEPG) {
cString text;
- if (tvguideConfig.blueKeyMode == 0)
+ if (tvguideConfig.blueKeyMode == eBlueKeySwitch)
text = tr("Switch to Channel");
- else if (tvguideConfig.blueKeyMode == 1)
- text = tr("Detailed EPG");
+ else if (tvguideConfig.blueKeyMode == eBlueKeyEPG) {
+ if (!detailedEPG)
+ text = tr("Detailed EPG");
+ else
+ text = tr("Close detailed EPG");
+ } else if (tvguideConfig.blueKeyMode == eBlueKeyFavorites) {
+ if (!detailedEPG)
+ text = tr("Favorites");
+ else
+ text = tr("Switch to Channel");
+ }
DrawButton(*text, theme.Color(clrButtonBlue), theme.Color(clrButtonBlueBorder), oeButtonBlue, positionButtons[3]);
}
@@ -68,6 +77,10 @@ void cFooter::UpdateGroupButtons(const cChannel *channel, bool force) {
void cFooter::SetDetailedViewMode(void) {
ClearButton(positionButtons[1]);
ClearButton(positionButtons[2]);
+ if (tvguideConfig.blueKeyMode != eBlueKeySwitch) {
+ ClearButton(positionButtons[3]);
+ drawBlueButton(true);
+ }
}
void cFooter::LeaveDetailedViewMode(const cChannel *channel) {
diff --git a/footer.h b/footer.h
index 56aef7f..82b1e81 100644
--- a/footer.h
+++ b/footer.h
@@ -24,7 +24,7 @@ public:
void drawGreenButton(const char *text);
void drawYellowButton();
void drawYellowButton(const char *text);
- void drawBlueButton();
+ void drawBlueButton(bool detailedEPG = false);
void UpdateGroupButtons(const cChannel *channel, bool force = false);
void SetDetailedViewMode(void);
void LeaveDetailedViewMode(const cChannel *channel);
diff --git a/po/ca_ES.po b/po/ca_ES.po
index ed93314..0bcb159 100644
--- a/po/ca_ES.po
+++ b/po/ca_ES.po
@@ -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: 2014-01-12 16:23+0100\n"
+"POT-Creation-Date: 2014-01-14 17:00+0100\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"
@@ -45,6 +45,12 @@ msgstr "Canvia al canal"
msgid "Detailed EPG"
msgstr "EPG Detallat"
+msgid "Close detailed EPG"
+msgstr ""
+
+msgid "Favorites"
+msgstr ""
+
msgid "images"
msgstr ""
@@ -327,6 +333,9 @@ msgstr ""
msgid "Avoid Repeats"
msgstr ""
+msgid "Use in Favorites"
+msgstr ""
+
msgid "Hide advanced Options"
msgstr ""
@@ -474,6 +483,9 @@ msgstr "per"
msgid "No recordings found for"
msgstr "No s'han trobat gravacions per"
+msgid "No Favorites available"
+msgstr ""
+
msgid "whole term must appear"
msgstr "expressió completa"
@@ -513,6 +525,9 @@ msgstr "Blau: Canvi de canal, OK: EPG detallat"
msgid "Blue: Detailed EPG, Ok: Channel Switch"
msgstr "Blau: EPG detallat, OK: Canvi de canal"
+msgid "Blue: Favorites / Switch, Ok: Detailed EPG"
+msgstr ""
+
msgid "Timely Jump"
msgstr ""
diff --git a/po/de_DE.po b/po/de_DE.po
index 468fc4e..90ac008 100755
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -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: 2014-01-12 16:23+0100\n"
+"POT-Creation-Date: 2014-01-14 17:00+0100\n"
"PO-Revision-Date: 2012-08-25 17:49+0200\n"
"Last-Translator: Horst\n"
"Language-Team: \n"
@@ -42,6 +42,12 @@ msgstr "Umschalten"
msgid "Detailed EPG"
msgstr "Detailiertes EPG"
+msgid "Close detailed EPG"
+msgstr "Det. EPG schließen"
+
+msgid "Favorites"
+msgstr "Favoriten"
+
msgid "images"
msgstr "Bilder"
@@ -324,6 +330,9 @@ msgstr "VPS benutzen"
msgid "Avoid Repeats"
msgstr "Wiederholungen vermeiden"
+msgid "Use in Favorites"
+msgstr "Als Favorit benutzen"
+
msgid "Hide advanced Options"
msgstr "Erweiterte Optionen ausblenden"
@@ -471,6 +480,9 @@ msgstr "für"
msgid "No recordings found for"
msgstr "Keine Aufnahmen gefunden für"
+msgid "No Favorites available"
+msgstr "Keine Favoriten verfügbar"
+
msgid "whole term must appear"
msgstr "vollständiger Ausdruck"
@@ -510,6 +522,9 @@ msgstr "Blau: Umschalten, OK: Detailiertes EPG"
msgid "Blue: Detailed EPG, Ok: Channel Switch"
msgstr "Blau: Detailiertes EPG, OK: Umschalten"
+msgid "Blue: Favorites / Switch, Ok: Detailed EPG"
+msgstr "Blau: Favoriten / Umschalten, OK: Det. EPG"
+
msgid "Timely Jump"
msgstr "Zeitsprung"
diff --git a/po/ru_RU.po b/po/ru_RU.po
index fd2e18f..1eeb7d9 100644
--- a/po/ru_RU.po
+++ b/po/ru_RU.po
@@ -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: 2014-01-12 16:23+0100\n"
+"POT-Creation-Date: 2014-01-14 17:00+0100\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"
@@ -42,6 +42,12 @@ msgstr "Переключиться"
msgid "Detailed EPG"
msgstr "Подробный EPG"
+msgid "Close detailed EPG"
+msgstr ""
+
+msgid "Favorites"
+msgstr ""
+
msgid "images"
msgstr ""
@@ -324,6 +330,9 @@ msgstr ""
msgid "Avoid Repeats"
msgstr ""
+msgid "Use in Favorites"
+msgstr ""
+
msgid "Hide advanced Options"
msgstr ""
@@ -471,6 +480,9 @@ msgstr "для"
msgid "No recordings found for"
msgstr "Не найдено записей:"
+msgid "No Favorites available"
+msgstr ""
+
msgid "whole term must appear"
msgstr "фраза"
@@ -510,6 +522,9 @@ msgstr "Синяя: Переключить канал, OK: Подробный EP
msgid "Blue: Detailed EPG, Ok: Channel Switch"
msgstr "Синяя: Подробный EPG, OK: Переключить канал"
+msgid "Blue: Favorites / Switch, Ok: Detailed EPG"
+msgstr ""
+
msgid "Timely Jump"
msgstr ""
diff --git a/po/sk_SK.po b/po/sk_SK.po
index a257203..d2baeba 100644
--- a/po/sk_SK.po
+++ b/po/sk_SK.po
@@ -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: 2014-01-12 16:23+0100\n"
+"POT-Creation-Date: 2014-01-14 17:00+0100\n"
"PO-Revision-Date: 2013-09-15 00:12+0100\n"
"Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n"
"Language-Team: \n"
@@ -42,6 +42,12 @@ msgstr "Prepn na kanl"
msgid "Detailed EPG"
msgstr "Podrobn EPG"
+msgid "Close detailed EPG"
+msgstr ""
+
+msgid "Favorites"
+msgstr ""
+
msgid "images"
msgstr ""
@@ -324,6 +330,9 @@ msgstr ""
msgid "Avoid Repeats"
msgstr ""
+msgid "Use in Favorites"
+msgstr ""
+
msgid "Hide advanced Options"
msgstr ""
@@ -471,6 +480,9 @@ msgstr "pre"
msgid "No recordings found for"
msgstr "Nenali sa nahrvky s nzvom "
+msgid "No Favorites available"
+msgstr ""
+
msgid "whole term must appear"
msgstr "kompletn vraz"
@@ -510,6 +522,9 @@ msgstr "Modr: Prepn kanl, OK: Podrobn EPG"
msgid "Blue: Detailed EPG, Ok: Channel Switch"
msgstr "Modr: podrobn EPG, OK: prepn kanl"
+msgid "Blue: Favorites / Switch, Ok: Detailed EPG"
+msgstr ""
+
msgid "Timely Jump"
msgstr ""
diff --git a/recmanager.c b/recmanager.c
index 9539334..c5cd9fb 100644
--- a/recmanager.c
+++ b/recmanager.c
@@ -574,3 +574,23 @@ const cEvent **cRecManager::LoadReruns(const cEvent *event, int &numResults) {
}
return NULL;
}
+
+void cRecManager::GetFavorites(std::vector<cTVGuideSearchTimer> *favorites) {
+ 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> searchTimerList;
+ searchTimerList = epgSearch->handler->SearchTimerList();
+ for(std::list<std::string>::iterator it = searchTimerList.begin(); it != searchTimerList.end(); it++) {
+ cTVGuideSearchTimer timer;
+ timer.SetEPGSearchString(it->c_str());
+ if (timer.Parse()) {
+ if (timer.UseInFavorites())
+ favorites->push_back(timer);
+ }
+ }
+ }
+
+}
diff --git a/recmanager.h b/recmanager.h
index 55d71f2..fd505f5 100644
--- a/recmanager.h
+++ b/recmanager.h
@@ -54,6 +54,7 @@ public:
void DeleteSwitchTimer(const cEvent *event);
cRecording **SearchForRecordings(std::string searchString, int &numResults);
const cEvent **LoadReruns(const cEvent *event, int &numResults);
+ void GetFavorites(std::vector<cTVGuideSearchTimer> *favorites);
virtual ~cRecManager (void);
};
diff --git a/recmenuitem.c b/recmenuitem.c
index f7d485e..24a0166 100644
--- a/recmenuitem.c
+++ b/recmenuitem.c
@@ -2658,3 +2658,83 @@ eRecMenuState cRecMenuItemSearchTimer::ProcessKey(eKeys Key) {
}
return rmsNotConsumed;
}
+
+// --- cRecMenuItemFavorite -------------------------------------------------------
+cRecMenuItemFavorite::cRecMenuItemFavorite(cTVGuideSearchTimer favorite,
+ eRecMenuState action1,
+ bool active) {
+ this->favorite = favorite;
+ this->action = action1;
+ pixmapText = NULL;
+ pixmapIcons = NULL;
+ selectable = true;
+ this->active = active;
+ height = 2 * font->Height();;
+}
+
+cRecMenuItemFavorite::~cRecMenuItemFavorite(void) {
+ if (pixmapText)
+ osdManager.releasePixmap(pixmapText);
+ if (pixmapIcons)
+ osdManager.releasePixmap(pixmapIcons);
+}
+
+void cRecMenuItemFavorite::SetPixmaps(void) {
+ if (!pixmap) {
+ pixmap = osdManager.requestPixmap(4, cRect(x, y, width, height));
+ pixmapText = osdManager.requestPixmap(5, cRect(x, y, width, height));
+ pixmapIcons = osdManager.requestPixmap(6, cRect(x, y, width, height));
+ } else {
+ pixmap->SetViewPort(cRect(x, y, width, height));
+ pixmapText->SetViewPort(cRect(x, y, width, height));
+ pixmapIcons->SetViewPort(cRect(x, y, width, height));
+ }
+}
+
+void cRecMenuItemFavorite::Draw(void) {
+ int textX = DrawIcons();
+ if (!drawn) {
+ pixmapText->Fill(clrTransparent);
+ textX += 20;
+ cString label = cString::sprintf("\"%s\"", favorite.SearchString().c_str());
+ pixmapText->DrawText(cPoint(textX, (height - fontLarge->Height())/2), *label, colorText, clrTransparent, fontLarge);
+ drawn = true;
+ }
+}
+
+void cRecMenuItemFavorite::Hide(void) {
+ if (pixmap) pixmap->SetLayer(-1);
+ if (pixmapText) pixmapText->SetLayer(-1);
+ if (pixmapIcons) pixmapIcons->SetLayer(-1);
+}
+
+void cRecMenuItemFavorite::Show(void) {
+ if (pixmap) pixmap->SetLayer(4);
+ if (pixmapText) pixmapText->SetLayer(5);
+ if (pixmapIcons) pixmapIcons->SetLayer(6);
+}
+
+int cRecMenuItemFavorite::DrawIcons(void) {
+ pixmapIcons->Fill(clrTransparent);
+ int iconsX = 10;
+ int iconSize = height / 2;
+ int iconY = (height - iconSize) / 2;
+ std::string iconSearch;
+ iconSearch = active ? "search_active" : "search_inactive" ;
+ cImage *imgSearch = imgCache.GetIcon(iconSearch, iconSize, iconSize);
+ if (imgSearch) {
+ pixmapIcons->DrawImage(cPoint(iconsX, iconY), *imgSearch);
+ iconsX += iconSize + 10;
+ }
+ return iconsX;
+}
+
+eRecMenuState cRecMenuItemFavorite::ProcessKey(eKeys Key) {
+ switch (Key & ~k_Repeat) {
+ case kOk:
+ return action;
+ default:
+ break;
+ }
+ return rmsNotConsumed;
+} \ No newline at end of file
diff --git a/recmenuitem.h b/recmenuitem.h
index 1b14d36..68d08aa 100644
--- a/recmenuitem.h
+++ b/recmenuitem.h
@@ -605,4 +605,25 @@ public:
eRecMenuState ProcessKey(eKeys Key);
};
+// --- cRecMenuItemFavorite -------------------------------------------------------
+class cRecMenuItemFavorite : public cRecMenuItem {
+private:
+ cTVGuideSearchTimer favorite;
+ eRecMenuState action1;
+ cPixmap *pixmapText;
+ cPixmap *pixmapIcons;
+ int DrawIcons(void);
+public:
+ cRecMenuItemFavorite(cTVGuideSearchTimer favorite,
+ eRecMenuState action1,
+ bool active);
+ virtual ~cRecMenuItemFavorite(void);
+ void SetPixmaps(void);
+ void Hide(void);
+ void Show(void);
+ void Draw(void);
+ cTVGuideSearchTimer GetFavorite(void) { return favorite; };
+ eRecMenuState ProcessKey(eKeys Key);
+};
+
#endif //__TVGUIDE_RECMENUITEM_H \ No newline at end of file
diff --git a/recmenumanager.c b/recmenumanager.c
index 10d420f..da6af92 100644
--- a/recmenumanager.c
+++ b/recmenumanager.c
@@ -39,6 +39,19 @@ void cRecMenuManager::Start(const cEvent *event) {
osdManager.flush();
}
+void cRecMenuManager::StartFavorites(void) {
+ active = true;
+ activeMenuBuffer = NULL;
+ detailViewActive = false;
+ SetBackground();
+ std::vector<cTVGuideSearchTimer> favorites;
+ recManager->GetFavorites(&favorites);
+ activeMenu = new cRecMenuFavorites(favorites);
+ activeMenu->Display();
+ osdManager.flush();
+}
+
+
void cRecMenuManager::Close(void) {
event = NULL;
active = false;
@@ -299,7 +312,7 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
activeMenu->Display();
break; }
case rmsSearchTimerTest: {
- //caller: cRecMenuSearchTimerEdit, cRecMenuSearchTimerTemplatesCreate, rmsSearchTimers
+ //caller: cRecMenuSearchTimerEdit, cRecMenuSearchTimerTemplatesCreate, cRecMenuSearchTimers, cRecMenuFavorites
//show results of currently choosen search timer
cTVGuideSearchTimer searchTimer;
if (cRecMenuSearchTimerEdit *menu = dynamic_cast<cRecMenuSearchTimerEdit*>(activeMenu)) {
@@ -311,6 +324,8 @@ eOSState cRecMenuManager::StateMachine(eRecMenuState nextState) {
TVGuideEPGSearchTemplate tmpl = menu->GetTemplate();
searchTimer.SetTemplate(tmpl.templValue);
searchTimer.Parse(true);
+ } else if (cRecMenuFavorites *menu = dynamic_cast<cRecMenuFavorites*>(activeMenu)) {
+ searchTimer = menu->GetFavorite();
} else break;
int numSearchResults = 0;
std::string searchString = searchTimer.BuildSearchString();
diff --git a/recmenumanager.h b/recmenumanager.h
index d40a0fe..030b6bd 100644
--- a/recmenumanager.h
+++ b/recmenumanager.h
@@ -31,6 +31,7 @@ public:
void SetFooter(cFooter *footer) { this->footer = footer; };
bool isActive(void) { return active; };
void Start(const cEvent *event);
+ void StartFavorites(void);
void Close(void);
eOSState StateMachine(eRecMenuState nextState);
eOSState ProcessKey(eKeys Key);
diff --git a/recmenus.c b/recmenus.c
index 27a5152..338083a 100644
--- a/recmenus.c
+++ b/recmenus.c
@@ -701,6 +701,7 @@ cRecMenuSearchTimerEdit::cRecMenuSearchTimerEdit(cTVGuideSearchTimer searchTimer
compareTitle = searchTimer.CompareTitle();
compareSubtitle = searchTimer.CompareSubtitle();
compareSummary = searchTimer.CompareSummary();
+ useInFavorites = searchTimer.UseInFavorites();
SetWidthPercent(70);
cString infoText;
@@ -769,6 +770,7 @@ void cRecMenuSearchTimerEdit::InitMenuItems(void) {
mainMenuItems.push_back(new cRecMenuItemInt(tr("Time margin for stop in minutes"), marginStop, 0, 30, false, &marginStop, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemBool(tr("Use VPS"), useVPS, false, false, &useVPS, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemBool(tr("Avoid Repeats"), avoidRepeats, true, false, &avoidRepeats, rmsSearchTimerSave));
+ mainMenuItems.push_back(new cRecMenuItemBool(tr("Use in Favorites"), useInFavorites, false, false, &useInFavorites, rmsSearchTimerSave));
mainMenuItems.push_back(new cRecMenuItemButton(tr("Hide advanced Options"), rmsSearchTimerEdit, false));
}
mainMenuItems.push_back(new cRecMenuItemButton(tr("Display Results for Search Timer"), rmsSearchTimerTest, false));
@@ -871,6 +873,7 @@ cTVGuideSearchTimer cRecMenuSearchTimerEdit::GetSearchTimer(void) {
searchTimer.SetCompareSubtitle(compareSubtitle);
searchTimer.SetCompareSummary(compareSummary);
}
+ searchTimer.SetUseInFavorites(useInFavorites);
return searchTimer;
}
@@ -1439,4 +1442,53 @@ eRecMenuState cRecMenuTimeline::ProcessKey(eKeys Key) {
state = cRecMenu::ProcessKey(Key);
}
return state;
+}
+
+/******************************************************************************************
+* Favorites
+******************************************************************************************/
+
+// --- cRecMenuFavorites ---------------------------------------------------------
+
+cRecMenuFavorites::cRecMenuFavorites(std::vector<cTVGuideSearchTimer> favorites) {
+ this->favorites = favorites;
+ numFavorites = favorites.size();
+ SetWidthPercent(70);
+ cString header;
+ if (numFavorites > 0) {
+ header = tr("Favorites");
+ } else {
+ header = tr("No Favorites available");
+ }
+ cRecMenuItemInfo *headerItem = new cRecMenuItemInfo(*header, true);
+ headerItem->CalculateHeight(width - 2 * border);
+ SetHeader(headerItem);
+
+ for (int i = 0; i < numFavorites; i++) {
+ AddMenuItemInitial(new cRecMenuItemFavorite(favorites[i], rmsSearchTimerTest, (i==0)?true:false));
+ }
+
+ cRecMenuItem *button = new cRecMenuItemButton(tr("Close"), rmsClose, (numFavorites==0)?true:false);
+ SetFooter(button);
+ CalculateHeight();
+ CreatePixmap();
+ Arrange();
+}
+
+cRecMenuFavorites::~cRecMenuFavorites(void) {
+}
+
+cRecMenuItem *cRecMenuFavorites::GetMenuItem(int number) {
+ if (number > -1 && number < numFavorites)
+ return new cRecMenuItemFavorite(favorites[number], rmsSearchTimerTest, false);
+ return NULL;
+}
+
+int cRecMenuFavorites::GetTotalNumMenuItems(void) {
+ return numFavorites;
+}
+
+cTVGuideSearchTimer cRecMenuFavorites::GetFavorite(void) {
+ cRecMenuItemFavorite *activeItem = dynamic_cast<cRecMenuItemFavorite*>(GetActiveMenuItem());
+ return activeItem->GetFavorite();
} \ No newline at end of file
diff --git a/recmenus.h b/recmenus.h
index 334b95b..1c92505 100644
--- a/recmenus.h
+++ b/recmenus.h
@@ -244,6 +244,7 @@ private:
bool compareTitle;
bool compareSubtitle;
bool compareSummary;
+ bool useInFavorites;
void InitMenuItems(void);
void AddSubMenu(std::vector<cRecMenuItem*> *subMenu);
public:
@@ -458,4 +459,21 @@ public:
cTimer *GetTimer(void);
};
+/******************************************************************************************
+* Favorites
+******************************************************************************************/
+
+// --- cRecMenuFavorites ---------------------------------------------------------
+class cRecMenuFavorites: public cRecMenu {
+private:
+ std::vector<cTVGuideSearchTimer> favorites;
+ int numFavorites;
+public:
+ cRecMenuFavorites(std::vector<cTVGuideSearchTimer> favorites);
+ cRecMenuItem *GetMenuItem(int number);
+ int GetTotalNumMenuItems(void);
+ cTVGuideSearchTimer GetFavorite(void);
+ virtual ~cRecMenuFavorites(void);
+};
+
#endif //__TVGUIDE_RECMENUS_H \ No newline at end of file
diff --git a/searchtimer.h b/searchtimer.h
index fe0bb43..eb345f8 100644
--- a/searchtimer.h
+++ b/searchtimer.h
@@ -95,6 +95,7 @@ public:
bool CompareTitle(void) { return compareTitle; };
bool CompareSubtitle(void) { return compareSubtitle; };
bool CompareSummary(void) { return compareSummary; };
+ bool UseInFavorites(void) { return useInFavorites; };
//SETTER
void SetSearchString(std::string searchString) { this->searchString = searchString; };
void SetActive(bool active) { useAsSearchTimer = active; };
@@ -120,6 +121,7 @@ public:
void SetCompareTitle(bool compareTitle) { this->compareTitle = compareTitle; };
void SetCompareSubtitle(bool compareSubtitle) { this->compareSubtitle = compareSubtitle; };
void SetCompareSummary(bool compareSummary) { this->compareSummary = compareSummary; };
+ void SetUseInFavorites(bool useInFavorites) { this->useInFavorites = useInFavorites; };
//COMMON
int GetNumTimers(void);
int GetNumRecordings(void);
diff --git a/setup.c b/setup.c
index 4a70be3..cc01b1c 100644
--- a/setup.c
+++ b/setup.c
@@ -165,6 +165,7 @@ cMenuSetupGeneral::cMenuSetupGeneral(cTvguideConfig* data) : cMenuSetupSubMenu(
jumpMode[1] = tr("previous / next channel group");
blueMode[0] = tr("Blue: Channel Switch, Ok: Detailed EPG");
blueMode[1] = tr("Blue: Detailed EPG, Ok: Channel Switch");
+ blueMode[2] = tr("Blue: Favorites / Switch, Ok: Detailed EPG");
numMode[0] = tr("Timely Jump");
numMode[1] = tr("Jump to specific channel");
useSubtitleRerunTexts[0] = tr("never");
@@ -187,7 +188,7 @@ void cMenuSetupGeneral::Set(void) {
Add(new cMenuEditBoolItem(tr("Rounded Corners"), &tmpTvguideConfig->roundedCorners));
Add(new cMenuEditStraItem(tr("Channel Jump Mode (Keys Green / Yellow)"), &tmpTvguideConfig->channelJumpMode, 2, jumpMode));
- Add(new cMenuEditStraItem(tr("Keys Blue and OK"), &tmpTvguideConfig->blueKeyMode, 2, blueMode));
+ Add(new cMenuEditStraItem(tr("Keys Blue and OK"), &tmpTvguideConfig->blueKeyMode, 3, blueMode));
Add(new cMenuEditBoolItem(tr("Close TVGuide after channel switch"), &tmpTvguideConfig->closeOnSwitch));
Add(new cMenuEditStraItem(tr("Functionality of numeric Keys"), &tmpTvguideConfig->numkeyMode, 2, numMode));
Add(new cMenuEditBoolItem(tr("Hide last Channel Group"), &tmpTvguideConfig->hideLastGroup));
diff --git a/setup.h b/setup.h
index 6eef9df..9a5c47c 100644
--- a/setup.h
+++ b/setup.h
@@ -34,7 +34,7 @@ class cMenuSetupGeneral : public cMenuSetupSubMenu {
cThemes themes;
const char * timeFormatItems[2];
const char * jumpMode[2];
- const char * blueMode[2];
+ const char * blueMode[3];
const char * numMode[2];
const char *useSubtitleRerunTexts[3];
void Set(void);
diff --git a/tvguideosd.c b/tvguideosd.c
index 77d2477..da170db 100644
--- a/tvguideosd.c
+++ b/tvguideosd.c
@@ -108,7 +108,7 @@ void cTvGuideOsd::drawOsd() {
footer->drawGreenButton();
footer->drawYellowButton();
}
- footer->drawBlueButton();
+ footer->drawBlueButton(false);
osdManager.flush();
readChannels(newStartChannel);
drawGridsChannelJump(offset);
@@ -500,19 +500,23 @@ void cTvGuideOsd::processKeyYellow() {
}
eOSState cTvGuideOsd::processKeyBlue() {
- if (tvguideConfig.blueKeyMode == 0) {
+ if (tvguideConfig.blueKeyMode == eBlueKeySwitch) {
return ChannelSwitch();
- } else if (tvguideConfig.blueKeyMode == 1) {
+ } else if (tvguideConfig.blueKeyMode == eBlueKeyEPG) {
DetailedEPG();
+ } else if (tvguideConfig.blueKeyMode == eBlueKeyFavorites) {
+ recMenuManager->StartFavorites();
}
return osContinue;
}
eOSState cTvGuideOsd::processKeyOk() {
- if (tvguideConfig.blueKeyMode == 0) {
+ if (tvguideConfig.blueKeyMode == eBlueKeySwitch) {
DetailedEPG();
- } else if (tvguideConfig.blueKeyMode == 1) {
+ } else if (tvguideConfig.blueKeyMode == eBlueKeyEPG) {
return ChannelSwitch();
+ } else if (tvguideConfig.blueKeyMode == eBlueKeyFavorites) {
+ DetailedEPG();
}
return osContinue;
}
@@ -656,11 +660,21 @@ eOSState cTvGuideOsd::ProcessKey(eKeys Key) {
detailView = NULL;
detailViewActive = false;
processKeyRed();
- } else if (((Key & ~k_Repeat) == kBlue) && (tvguideConfig.blueKeyMode == 0)) {
+ } else if ((Key & ~k_Repeat) == kBlue) {
+ delete detailView;
+ detailView = NULL;
+ detailViewActive = false;
+ if ((tvguideConfig.blueKeyMode == eBlueKeySwitch) || (tvguideConfig.blueKeyMode == eBlueKeyFavorites))
+ state = ChannelSwitch();
+ else {
+ osdManager.flush();
+ state = osContinue;
+ }
+ } else if ((Key & ~k_Repeat) == kOk && (tvguideConfig.blueKeyMode = eBlueKeyEPG)) {
delete detailView;
detailView = NULL;
detailViewActive = false;
- state = processKeyBlue();
+ state = ChannelSwitch();
} else {
state = detailView->ProcessKey(Key);
if (state == osEnd) {