From 7741cb2a3ec56384e240a8ab1bf935f4fe76adda Mon Sep 17 00:00:00 2001 From: Marc Szymkowiak Date: Mon, 9 Jan 2017 19:39:30 +0100 Subject: [PATCH] add entry to load saved epg data manual Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9b2a0d44146f2516d93e8e9cb30451e522b64f71 Author: Marc Szymkowiak Date: 2017-01-09 (Mon, 09 Jan 2017) --- data/locale/deutsch.locale | 2 ++ data/locale/english.locale | 2 ++ src/gui/miscsettings_menu.cpp | 14 ++++++++++++++ src/gui/miscsettings_menu.h | 3 ++- src/system/locals.h | 2 ++ src/system/locals_intern.h | 2 ++ 6 files changed, 24 insertions(+), 1 deletion(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 96b9a5525..ad5fe2adf 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1042,6 +1042,7 @@ menu.hint_epg_max_events Maxiale Anzahl der Events im Zwischenspeicher menu.hint_epg_old_events Veraltete EPG-Daten werden nach dieser Zeit (in Stunden) verworfen menu.hint_epg_read Liest nach einem Neustart die EPG-Daten von einem externen Datenträger wieder ein menu.hint_epg_read_frequently Liest die EPG-Daten in regelmäßigen Abständen von einem externen Datenträger +menu.hint_epg_read_now Liest die EPG-Daten von einem externen Datenträger ein menu.hint_epg_save Speichert die EPG-Daten beim Herunterfahren auf einem externen Datenträger menu.hint_epg_save_frequently Speichert die EPG-Daten in regelmäßigen Abständen auf einem externen Datenträger menu.hint_epg_save_mode Speichert die EPG-Daten nur für Sender, die in die Favoriten aufgenommen sind @@ -1518,6 +1519,7 @@ miscsettings.epg_old_events_hint1 Wie lange abgelaufene EPG-Daten aufheben? miscsettings.epg_old_events_hint2 Angabe in Stunden miscsettings.epg_read Gespeicherte EPG-Daten einlesen miscsettings.epg_read_frequently EPG regelmäßig einlesen +miscsettings.epg_read_now Gespeichterte EPG-Daten jetzt einlesen miscsettings.epg_save EPG zwischenspeichern miscsettings.epg_save_frequently EPG regelmäßig speichern miscsettings.epg_save_mode Nur Favoriten diff --git a/data/locale/english.locale b/data/locale/english.locale index 4ff1c72e3..5b3f6e6e4 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1042,6 +1042,7 @@ menu.hint_epg_max_events Maximum events to cache. After reaching limit\nEPG cach menu.hint_epg_old_events Hours after event end time to consider\nevent old and remove it from cache menu.hint_epg_read Read saved EPG data after boot from an external device menu.hint_epg_read_frequently Read cached EPG data in frequently intervals from an external device +menu.hint_epg_read_now Read saved EPG data from an external device menu.hint_epg_save Save cached EPG data to an external device menu.hint_epg_save_frequently Save cached EPG data in frequently intervals to an external device menu.hint_epg_save_mode Cache EPG only for channels present in favorite bouquets @@ -1518,6 +1519,7 @@ miscsettings.epg_old_events_hint1 How long will EPG-Data be stored after they ti miscsettings.epg_old_events_hint2 Set in hours miscsettings.epg_read Restore EPG on boot miscsettings.epg_read_frequently Restore EPG frequently +miscsettings.epg_read_now Restore EPG now miscsettings.epg_save Save EPG on shutdown miscsettings.epg_save_frequently Save EPG frequently miscsettings.epg_save_mode Favorites only diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index 49bafb4bd..176629ac6 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -58,6 +58,8 @@ #include #include +#include + extern CPlugins * g_PluginList; extern cVideo *videoDecoder; @@ -69,6 +71,7 @@ CMiscMenue::CMiscMenue() epg_save_standby = NULL; epg_save_frequently = NULL; epg_read = NULL; + epg_read_now = NULL; epg_read_frequently = NULL; epg_dir = NULL; } @@ -141,6 +144,12 @@ int CMiscMenue::exec(CMenuTarget* parent, const std::string &actionKey) { return showMiscSettingsMenuOnlineServices(); } + else if(actionKey == "epg_read_now") + { + printf("Reading epg cache from %s....\n", g_settings.epg_dir.c_str()); + g_Sectionsd->readSIfromXML(g_settings.epg_dir.c_str()); + return menu_return::RETURN_REPAINT; + } return showMiscSettingsMenu(); } @@ -422,6 +431,9 @@ void CMiscMenue::showMiscSettingsMenuEpg(CMenuWidget *ms_epg) epg_dir = new CMenuForwarder(LOCALE_MISCSETTINGS_EPG_DIR, (g_settings.epg_save || g_settings.epg_read), g_settings.epg_dir, this, "epgdir"); epg_dir->setHint("", LOCALE_MENU_HINT_EPG_DIR); + epg_read_now = new CMenuForwarder(LOCALE_MISCSETTINGS_EPG_READ_NOW, g_settings.epg_read, NULL, this, "epg_read_now"); + epg_read_now->setHint("", LOCALE_MENU_HINT_EPG_READ_NOW); + epg_cache = to_string(g_settings.epg_cache); if (epg_cache.length() < 2) epg_cache.insert(0, 2 - epg_cache.length(), ' '); @@ -468,6 +480,7 @@ void CMiscMenue::showMiscSettingsMenuEpg(CMenuWidget *ms_epg) ms_epg->addItem(epg_read); ms_epg->addItem(epg_read_frequently); ms_epg->addItem(epg_dir); + ms_epg->addItem(epg_read_now); ms_epg->addItem(GenericMenuSeparatorLine); ms_epg->addItem(mf); ms_epg->addItem(mf1); @@ -641,6 +654,7 @@ bool CMiscMenue::changeNotify(const neutrino_locale_t OptionName, void * /*data* else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_EPG_READ)) { epg_read_frequently->setActive(g_settings.epg_read); + epg_read_now->setActive(g_settings.epg_read); epg_dir->setActive(g_settings.epg_read || g_settings.epg_save); CNeutrinoApp::getInstance()->SendSectionsdConfig(); diff --git a/src/gui/miscsettings_menu.h b/src/gui/miscsettings_menu.h index b8bbaa1a7..61e01b561 100644 --- a/src/gui/miscsettings_menu.h +++ b/src/gui/miscsettings_menu.h @@ -36,7 +36,7 @@ //#define CPU_FREQ class CMiscMenue : public CMenuTarget, CChangeObserver -{ +{ private: CFanControlNotifier *fanNotifier; CSectionsdConfigNotifier* sectionsdConfigNotifier; @@ -51,6 +51,7 @@ class CMiscMenue : public CMenuTarget, CChangeObserver CMenuOptionChooser * youtube_onoff; CMenuOptionChooser * shoutcast_onoff; CMenuForwarder * epg_dir; + CMenuForwarder * epg_read_now; int width; std::string epg_cache; std::string epg_extendedcache; diff --git a/src/system/locals.h b/src/system/locals.h index 9bc970415..18546341d 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1069,6 +1069,7 @@ typedef enum LOCALE_MENU_HINT_EPG_OLD_EVENTS, LOCALE_MENU_HINT_EPG_READ, LOCALE_MENU_HINT_EPG_READ_FREQUENTLY, + LOCALE_MENU_HINT_EPG_READ_NOW, LOCALE_MENU_HINT_EPG_SAVE, LOCALE_MENU_HINT_EPG_SAVE_FREQUENTLY, LOCALE_MENU_HINT_EPG_SAVE_MODE, @@ -1545,6 +1546,7 @@ typedef enum LOCALE_MISCSETTINGS_EPG_OLD_EVENTS_HINT2, LOCALE_MISCSETTINGS_EPG_READ, LOCALE_MISCSETTINGS_EPG_READ_FREQUENTLY, + LOCALE_MISCSETTINGS_EPG_READ_NOW, LOCALE_MISCSETTINGS_EPG_SAVE, LOCALE_MISCSETTINGS_EPG_SAVE_FREQUENTLY, LOCALE_MISCSETTINGS_EPG_SAVE_MODE, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 2ec577772..f2d76e08d 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1069,6 +1069,7 @@ const char * locale_real_names[] = "menu.hint_epg_old_events", "menu.hint_epg_read", "menu.hint_epg_read_frequently", + "menu.hint_epg_read_now", "menu.hint_epg_save", "menu.hint_epg_save_frequently", "menu.hint_epg_save_mode", @@ -1545,6 +1546,7 @@ const char * locale_real_names[] = "miscsettings.epg_old_events_hint2", "miscsettings.epg_read", "miscsettings.epg_read_frequently", + "miscsettings.epg_read_now", "miscsettings.epg_save", "miscsettings.epg_save_frequently", "miscsettings.epg_save_mode",