diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 2db967ba5..f6b29c1f1 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -954,8 +954,9 @@ menu.hint_epg_extendedcache Maximum in Stunden, die die EPG-Daten bzw. die Event menu.hint_epg_fonts Ändern Sie die Schriftgrößen der EPG-Details 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_save Speichert die EPG-Daten auf einem externen Datenträger und läd es von dort nach einen Neustart -menu.hint_epg_save_standby Speichert die EPG-Daten auch im Standby-Modus +menu.hint_epg_read Liest nach einem Neustart die EPG-Daten von einem externen Datenträger wieder ein +menu.hint_epg_save Speichert die EPG-Daten beim Herunterfahren auf einem externen Datenträger +menu.hint_epg_save_standby Speichert die EPG-Daten auch, wenn in den Standby-Modus geschalten wird menu.hint_epg_scan Zu scannende Bouquets wählen. Aktuelles Bouquet beim Umschalten, markierte Bouquets oder alle Favoriten menu.hint_epg_scan_mode Aktivieren Sie den Hintergrundscan der EPG-Daten, wenn ein freier Tuner vorhanden ist menu.hint_event_textcolor Ändern Sie die Farbe für farbige Events in der Kanalliste und der Infobar @@ -1387,6 +1388,7 @@ miscsettings.epg_max_events_hint2 Standard 6000, 0 (ohne Limit) miscsettings.epg_old_events EPG verwerfen nach (Std.) 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_save EPG zwischenspeichern miscsettings.epg_save_standby EPG speichern in Standby-Modus miscsettings.epg_scan Hintergrundscan EPG diff --git a/data/locale/english.locale b/data/locale/english.locale index bee72c1cd..1aeed4f70 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -954,7 +954,8 @@ menu.hint_epg_extendedcache Maximum hours to cache extended\nevents descriptions menu.hint_epg_fonts Change EPG details window font sizes menu.hint_epg_max_events Maximum events to cache. After reaching limit\nEPG cache will remove future events menu.hint_epg_old_events Hours after event end time to consider\nevent old and remove it from cache -menu.hint_epg_save Save cached EPG to harddisk or usb flash\nand load it after boot +menu.hint_epg_read Read saved EPG data after boot from an external device +menu.hint_epg_save Save cached EPG data to an external device menu.hint_epg_save_standby Save EPG on soft standby mode menu.hint_epg_scan Select bouquets to scan epg, current on zap,\nall or selected favorites menu.hint_epg_scan_mode Enable background epg scan using free tuner @@ -1387,8 +1388,9 @@ miscsettings.epg_max_events_hint2 normaly 6000, 0 to disable limit miscsettings.epg_old_events EPG remove after (std.) miscsettings.epg_old_events_hint1 How long will EPG-Data be stored after they timed out? miscsettings.epg_old_events_hint2 Set in hours -miscsettings.epg_save Save/Restore epg on reboot -miscsettings.epg_save_standby Save epg on soft standby +miscsettings.epg_read Restore EPG on boot +miscsettings.epg_save Save EPG on shutdown +miscsettings.epg_save_standby Save EPG on soft standby miscsettings.epg_scan EPG scan mode miscsettings.epg_scan_always Always miscsettings.epg_scan_bouquets EPG scan bouquets diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index 03633f486..6626ca77a 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -63,11 +63,31 @@ extern cVideo *videoDecoder; CMiscMenue::CMiscMenue() { width = w_max (40, 10); + + epg_save = NULL; + epg_save_standby = NULL; + epg_read = NULL; + epg_dir = NULL; } CMiscMenue::~CMiscMenue() { - + if (epg_save) { + delete epg_save; + epg_save = NULL; + } + if (epg_save_standby) { + delete epg_save_standby; + epg_save_standby = NULL; + } + if (epg_read) { + delete epg_read; + epg_read = NULL; + } + if (epg_dir) { + delete epg_dir; + epg_dir = NULL; + } } int CMiscMenue::exec(CMenuTarget* parent, const std::string &actionKey) @@ -276,7 +296,6 @@ int CMiscMenue::showMiscSettingsMenu() delete fanNotifier; delete sectionsdConfigNotifier; - delete miscEpgNotifier; delete miscEpgScanNotifier; return res; } @@ -390,8 +409,17 @@ void CMiscMenue::showMiscSettingsMenuEpg(CMenuWidget *ms_epg) ms_epg->addIntroItems(LOCALE_MISCSETTINGS_EPG_HEAD); ms_epg->addKey(CRCInput::RC_info, this, "info"); - CMenuOptionChooser * mc1 = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SAVE_STANDBY, &g_settings.epg_save_standby, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.epg_save); - mc1->setHint("", LOCALE_MENU_HINT_EPG_SAVE_STANDBY); + epg_save = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SAVE, &g_settings.epg_save, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this); + epg_save->setHint("", LOCALE_MENU_HINT_EPG_SAVE); + + epg_save_standby = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SAVE_STANDBY, &g_settings.epg_save_standby, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.epg_save); + epg_save_standby->setHint("", LOCALE_MENU_HINT_EPG_SAVE_STANDBY); + + epg_read = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_READ, &g_settings.epg_read, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this); + epg_read->setHint("", LOCALE_MENU_HINT_EPG_READ); + + 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_cache = to_string(g_settings.epg_cache); if (epg_cache.length() < 2) @@ -421,16 +449,6 @@ void CMiscMenue::showMiscSettingsMenuEpg(CMenuWidget *ms_epg) CMenuForwarder * mf3 = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_MAX_EVENTS, true, epg_max_events, miscSettings_epg_max_events); mf3->setHint("", LOCALE_MENU_HINT_EPG_MAX_EVENTS); - CMenuForwarder * mf4 = new CMenuForwarder(LOCALE_MISCSETTINGS_EPG_DIR, g_settings.epg_save, g_settings.epg_dir, this, "epgdir"); - mf4->setHint("", LOCALE_MENU_HINT_EPG_DIR); - - miscEpgNotifier = new COnOffNotifier(); - miscEpgNotifier->addItem(mc1); - miscEpgNotifier->addItem(mf4); - - CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SAVE, &g_settings.epg_save, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true,miscEpgNotifier); - mc->setHint("", LOCALE_MENU_HINT_EPG_SAVE); - CMenuOptionChooser * mc2 = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SCAN_BOUQUETS, &g_settings.epg_scan, EPG_SCAN_OPTIONS, EPG_SCAN_OPTION_COUNT, g_settings.epg_scan_mode != CEpgScan::MODE_OFF); mc2->setHint("", LOCALE_MENU_HINT_EPG_SCAN); @@ -442,9 +460,10 @@ void CMiscMenue::showMiscSettingsMenuEpg(CMenuWidget *ms_epg) CFEManager::getInstance()->getEnabledCount() > 1 ? EPG_SCAN_MODE_OPTION_COUNT : 2, true, miscEpgScanNotifier); mc3->setHint("", LOCALE_MENU_HINT_EPG_SCAN_MODE); - ms_epg->addItem(mc); - ms_epg->addItem(mc1); - ms_epg->addItem(mf4); + ms_epg->addItem(epg_save); + ms_epg->addItem(epg_save_standby); + ms_epg->addItem(epg_read); + ms_epg->addItem(epg_dir); ms_epg->addItem(GenericMenuSeparatorLine); ms_epg->addItem(mf); ms_epg->addItem(mf1); @@ -541,6 +560,8 @@ void CMiscMenue::showMiscSettingsMenuCPUFreq(CMenuWidget *ms_cpu) bool CMiscMenue::changeNotify(const neutrino_locale_t OptionName, void * /*data*/) { + int ret = menu_return::RETURN_NONE; + if (ARE_LOCALES_EQUAL(OptionName, LOCALE_VIDEOMENU_HDMI_CEC)) { printf("[neutrino CEC Settings] %s set CEC settings...\n", __FUNCTION__); @@ -555,6 +576,19 @@ bool CMiscMenue::changeNotify(const neutrino_locale_t OptionName, void * /*data* videoDecoder->SetCECAutoView(g_settings.hdmi_cec_view_on == 1); videoDecoder->SetCECMode((VIDEO_HDMI_CEC_MODE)g_settings.hdmi_cec_mode); } + else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_EPG_SAVE)) + { + if (g_settings.epg_save) + g_settings.epg_read = true; + epg_save_standby->setActive(g_settings.epg_save); + epg_dir->setActive(g_settings.epg_save || g_settings.epg_read); - return false; + ret = menu_return::RETURN_REPAINT; + } + else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_EPG_READ)) + { + epg_dir->setActive(g_settings.epg_save || g_settings.epg_read); + } + + return ret; } diff --git a/src/gui/miscsettings_menu.h b/src/gui/miscsettings_menu.h index 8958c0aae..6e82d409d 100644 --- a/src/gui/miscsettings_menu.h +++ b/src/gui/miscsettings_menu.h @@ -41,8 +41,11 @@ class CMiscMenue : public CMenuTarget, CChangeObserver CFanControlNotifier *fanNotifier; CSectionsdConfigNotifier* sectionsdConfigNotifier; //COnOffNotifier* miscNotifier; - COnOffNotifier* miscEpgNotifier; COnOffNotifier* miscEpgScanNotifier; + CMenuOptionChooser * epg_save; + CMenuOptionChooser * epg_save_standby; + CMenuOptionChooser * epg_read; + CMenuForwarder * epg_dir; int width; std::string epg_cache; std::string epg_extendedcache; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index cc3efef22..5cd71037b 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -512,6 +512,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.epg_save = configfile.getBool("epg_save", false); g_settings.epg_save_standby = configfile.getBool("epg_save_standby", true); + g_settings.epg_read = configfile.getBool("epg_read", g_settings.epg_save); g_settings.epg_scan = configfile.getInt32("epg_scan", CEpgScan::SCAN_CURRENT); g_settings.epg_scan_mode = configfile.getInt32("epg_scan_mode", CEpgScan::MODE_OFF); // backward-compatible check @@ -1018,6 +1019,7 @@ void CNeutrinoApp::saveSetup(const char * fname) // epg configfile.setBool("epg_save", g_settings.epg_save); configfile.setBool("epg_save_standby", g_settings.epg_save_standby); + configfile.setBool("epg_read", g_settings.epg_read); configfile.setInt32("epg_scan", g_settings.epg_scan); configfile.setInt32("epg_scan_mode", g_settings.epg_scan_mode); configfile.setInt32("epg_cache_time" ,g_settings.epg_cache ); @@ -1690,7 +1692,7 @@ void CNeutrinoApp::InitZapper() struct stat my_stat; g_InfoViewer->start(); - if (g_settings.epg_save){ + if (g_settings.epg_read) { if(stat(g_settings.epg_dir.c_str(), &my_stat) == 0) g_Sectionsd->readSIfromXML(g_settings.epg_dir.c_str()); } diff --git a/src/system/locals.h b/src/system/locals.h index 25932f0e7..2a5cf0779 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -981,6 +981,7 @@ typedef enum LOCALE_MENU_HINT_EPG_FONTS, LOCALE_MENU_HINT_EPG_MAX_EVENTS, LOCALE_MENU_HINT_EPG_OLD_EVENTS, + LOCALE_MENU_HINT_EPG_READ, LOCALE_MENU_HINT_EPG_SAVE, LOCALE_MENU_HINT_EPG_SAVE_STANDBY, LOCALE_MENU_HINT_EPG_SCAN, @@ -1414,6 +1415,7 @@ typedef enum LOCALE_MISCSETTINGS_EPG_OLD_EVENTS, LOCALE_MISCSETTINGS_EPG_OLD_EVENTS_HINT1, LOCALE_MISCSETTINGS_EPG_OLD_EVENTS_HINT2, + LOCALE_MISCSETTINGS_EPG_READ, LOCALE_MISCSETTINGS_EPG_SAVE, LOCALE_MISCSETTINGS_EPG_SAVE_STANDBY, LOCALE_MISCSETTINGS_EPG_SCAN, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 0d50f7579..0121fb3ca 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -981,6 +981,7 @@ const char * locale_real_names[] = "menu.hint_epg_fonts", "menu.hint_epg_max_events", "menu.hint_epg_old_events", + "menu.hint_epg_read", "menu.hint_epg_save", "menu.hint_epg_save_standby", "menu.hint_epg_scan", @@ -1414,6 +1415,7 @@ const char * locale_real_names[] = "miscsettings.epg_old_events", "miscsettings.epg_old_events_hint1", "miscsettings.epg_old_events_hint2", + "miscsettings.epg_read", "miscsettings.epg_save", "miscsettings.epg_save_standby", "miscsettings.epg_scan", diff --git a/src/system/settings.h b/src/system/settings.h index a1e325bd7..c4c3e468b 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -219,6 +219,7 @@ struct SNeutrinoSettings // EPG int epg_save; int epg_save_standby; + int epg_read; int epg_cache; int epg_old_events; int epg_max_events;