diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 700671861..d33c048fa 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1674,6 +1674,7 @@ 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_read_frequently EPG regelmäßig 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 1771eae83..e64bace7c 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1674,6 +1674,7 @@ 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_read Restore EPG on boot +miscsettings.epg_read_frequently Restore EPG frequently miscsettings.epg_save Save EPG on shutdown miscsettings.epg_save_frequently Save EPG frequently miscsettings.epg_save_mode Favorites only diff --git a/lib/sectionsdclient/sectionsdMsg.h b/lib/sectionsdclient/sectionsdMsg.h index 9b6b666a4..440feabae 100644 --- a/lib/sectionsdclient/sectionsdMsg.h +++ b/lib/sectionsdclient/sectionsdMsg.h @@ -102,6 +102,7 @@ struct sectionsd // std::string network_ntpserver; // std::string epg_dir; int epg_save_frequently; + int epg_read_frequently; }; }; diff --git a/lib/sectionsdclient/sectionsdclient.cpp b/lib/sectionsdclient/sectionsdclient.cpp index e4dcee4e5..c6be1fac2 100644 --- a/lib/sectionsdclient/sectionsdclient.cpp +++ b/lib/sectionsdclient/sectionsdclient.cpp @@ -207,6 +207,7 @@ void CSectionsdClient::setConfig(const epg_config config) msg->network_ntpenable = config.network_ntpenable; msg->epg_extendedcache = config.epg_extendedcache; msg->epg_save_frequently= config.epg_save_frequently; + msg->epg_read_frequently= config.epg_read_frequently; // config.network_ntpserver: strcpy(&pData[sizeof(sectionsd::commandSetConfig)], config.network_ntpserver.c_str()); // config.epg_dir: diff --git a/lib/sectionsdclient/sectionsdclient.h b/lib/sectionsdclient/sectionsdclient.h index 1f70b01f2..c827d83b5 100644 --- a/lib/sectionsdclient/sectionsdclient.h +++ b/lib/sectionsdclient/sectionsdclient.h @@ -163,6 +163,7 @@ class CSectionsdClient : private CBasicClient int epg_extendedcache; std::string network_ntpserver; int epg_save_frequently; + int epg_read_frequently; std::string epg_dir; } epg_config; diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 532b61a0c..72f39fe75 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -72,7 +72,7 @@ static bool notify_complete = false; /* period to clean cached sections and force restart sections read */ #define META_HOUSEKEEPING_COUNT (24 * 60 * 60) / HOUSEKEEPING_SLEEP // meta housekeeping after XX housekeepings - every 24h - #define STANDBY_HOUSEKEEPING_COUNT (60 * 60) / HOUSEKEEPING_SLEEP -#define EPG_SAVE_FREQUENTLY_COUNT (60 * 60) / HOUSEKEEPING_SLEEP +#define EPG_SERVICE_FREQUENTLY_COUNT (60 * 60) / HOUSEKEEPING_SLEEP // Timeout bei tcp/ip connections in ms #define READ_TIMEOUT_IN_SECONDS 2 @@ -85,6 +85,7 @@ static bool notify_complete = false; #define TIMEOUTS_EIT_VERSION_WAIT (2 * CHECK_RESTART_DMX_AFTER_TIMEOUTS) static unsigned int epg_save_frequently; +static unsigned int epg_read_frequently; static long secondsToCache; long int secondsExtendedTextCache = 0; static long oldEventsAre; @@ -1126,6 +1127,8 @@ static void commandSetConfig(int connfd, char *data, const unsigned /*dataLength secondsExtendedTextCache = (long)(pmsg->epg_extendedcache)*60L*60L; max_events = pmsg->epg_max_events; epg_save_frequently = pmsg->epg_save_frequently; + epg_read_frequently = pmsg->epg_read_frequently; + unlockEvents(); bool time_wakeup = false; @@ -2095,7 +2098,7 @@ static void *houseKeepingThread(void *) removeOldEvents(oldEventsAre); // alte Events ecount++; - if (ecount == EPG_SAVE_FREQUENTLY_COUNT) + if (ecount == EPG_SERVICE_FREQUENTLY_COUNT) { if (epg_save_frequently > 0) { @@ -2108,6 +2111,22 @@ static void *houseKeepingThread(void *) } writeEventsToFile(d.c_str()); } + if (epg_read_frequently > 0) + { + pthread_t thrInsert; + pthread_attr_t attr; + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + std::string d = epg_dir + "/"; + + printf("[%s]: %s\n",__func__,d.c_str()); + + if (pthread_create (&thrInsert, &attr, insertEventsfromFile, (void *)d.c_str() )) + { + perror("sectionsd: pthread_create()"); + } + pthread_attr_destroy(&attr); + } ecount = 0; } @@ -2165,6 +2184,7 @@ bool CEitManager::Start() oldEventsAre = config.epg_old_events*60L*60L; //hours max_events = config.epg_max_events; epg_save_frequently = config.epg_save_frequently; + epg_read_frequently = config.epg_read_frequently; if (find_executable("ntpdate").empty()){ ntp_system_cmd_prefix = find_executable("ntpd"); diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index 28223aa4a..f09ad4a66 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -502,18 +502,16 @@ std::string CBEBouquetWidget::inputName(const char * const defaultName, const ne void CBEBouquetWidget::saveChanges() { - CHintBox* hintBox= new CHintBox(LOCALE_BOUQUETEDITOR_NAME, g_Locale->getText(LOCALE_BOUQUETEDITOR_SAVINGCHANGES), 480); // UTF-8 - hintBox->paint(); + CHintBox hintBox(LOCALE_BOUQUETEDITOR_NAME, g_Locale->getText(LOCALE_BOUQUETEDITOR_SAVINGCHANGES), 480); // UTF-8 + hintBox.paint(); g_Zapit->saveBouquets(); - hintBox->hide(); - delete hintBox; + hintBox.hide(); } void CBEBouquetWidget::discardChanges() { - CHintBox* hintBox= new CHintBox(LOCALE_BOUQUETEDITOR_NAME, g_Locale->getText(LOCALE_BOUQUETEDITOR_DISCARDINGCHANGES), 480); // UTF-8 - hintBox->paint(); + CHintBox hintBox(LOCALE_BOUQUETEDITOR_NAME, g_Locale->getText(LOCALE_BOUQUETEDITOR_DISCARDINGCHANGES), 480); // UTF-8 + hintBox.paint(); g_Zapit->restoreBouquets(); - hintBox->hide(); - delete hintBox; + hintBox.hide(); } diff --git a/src/gui/favorites.cpp b/src/gui/favorites.cpp index 041cf35d1..6214ad0f7 100644 --- a/src/gui/favorites.cpp +++ b/src/gui/favorites.cpp @@ -127,14 +127,13 @@ int CFavorites::exec(CMenuTarget* parent, const std::string & actionKey) } #endif - CHintBox* hintBox = new CHintBox(LOCALE_FAVORITES_BOUQUETNAME, g_Locale->getText(LOCALE_FAVORITES_ADDCHANNEL), 380); // UTF-8 + CHintBox hintBox(LOCALE_FAVORITES_BOUQUETNAME, g_Locale->getText(LOCALE_FAVORITES_ADDCHANNEL), 380); // UTF-8 if(!show_list) - hintBox->paint(); + hintBox.paint(); status = addChannelToFavorites(show_list); - hintBox->hide(); - delete hintBox; + hintBox.hide(); // -- Display result diff --git a/src/gui/hdd_menu.cpp b/src/gui/hdd_menu.cpp index 1775073b1..3a886560c 100644 --- a/src/gui/hdd_menu.cpp +++ b/src/gui/hdd_menu.cpp @@ -342,8 +342,8 @@ bool CHDDMenuHandler::waitfordev(std::string dev, int maxwait) void CHDDMenuHandler::showHint(std::string &message) { - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, message.c_str()); - hintBox->paint(); + CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, message.c_str()); + hintBox.paint(); uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(3); neutrino_msg_t msg; @@ -361,7 +361,7 @@ void CHDDMenuHandler::showHint(std::string &message) else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) break; } - delete hintBox; + hintBox.hide(); } void CHDDMenuHandler::setRecordPath(std::string &dev) @@ -493,8 +493,8 @@ int CHDDMenuHandler::exec(CMenuTarget* parent, const std::string &actionkey) if (actionkey[0] == 'm') { for (std::vector::iterator it = hdd_list.begin(); it != hdd_list.end(); ++it) { if (it->devname == dev) { - CHintBox * hintbox = new CHintBox(it->mounted ? LOCALE_HDD_UMOUNT : LOCALE_HDD_MOUNT, it->devname.c_str()); - hintbox->paint(); + CHintBox hintbox(it->mounted ? LOCALE_HDD_UMOUNT : LOCALE_HDD_MOUNT, it->devname.c_str()); + hintbox.paint(); if (it->mounted) umount_dev(it->devname); else @@ -502,7 +502,7 @@ int CHDDMenuHandler::exec(CMenuTarget* parent, const std::string &actionkey) it->mounted = is_mounted(it->devname.c_str()); it->cmf->setOption(it->mounted ? umount : mount); - delete hintbox; + hintbox.hide(); return menu_return::RETURN_REPAINT; } } diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index e6ce615ca..49bafb4bd 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -69,6 +69,7 @@ CMiscMenue::CMiscMenue() epg_save_standby = NULL; epg_save_frequently = NULL; epg_read = NULL; + epg_read_frequently = NULL; epg_dir = NULL; } @@ -409,12 +410,15 @@ void CMiscMenue::showMiscSettingsMenuEpg(CMenuWidget *ms_epg) 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_save_frequently = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SAVE_FREQUENTLY, &g_settings.epg_save_frequently, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.epg_save, sectionsdConfigNotifier); + epg_save_frequently = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SAVE_FREQUENTLY, &g_settings.epg_save_frequently, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.epg_save, this); epg_save_frequently->setHint("", LOCALE_MENU_HINT_EPG_SAVE_FREQUENTLY); 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_read_frequently = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_READ_FREQUENTLY, &g_settings.epg_read_frequently, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, g_settings.epg_read, this); + epg_read_frequently->setHint("", LOCALE_MENU_HINT_EPG_READ_FREQUENTLY); + 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); @@ -462,6 +466,7 @@ void CMiscMenue::showMiscSettingsMenuEpg(CMenuWidget *ms_epg) ms_epg->addItem(epg_save_standby); ms_epg->addItem(epg_save_frequently); ms_epg->addItem(epg_read); + ms_epg->addItem(epg_read_frequently); ms_epg->addItem(epg_dir); ms_epg->addItem(GenericMenuSeparatorLine); ms_epg->addItem(mf); @@ -635,7 +640,28 @@ bool CMiscMenue::changeNotify(const neutrino_locale_t OptionName, void * /*data* } else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_EPG_READ)) { - epg_dir->setActive(g_settings.epg_save || g_settings.epg_read); + epg_read_frequently->setActive(g_settings.epg_read); + epg_dir->setActive(g_settings.epg_read || g_settings.epg_save); + + CNeutrinoApp::getInstance()->SendSectionsdConfig(); + + ret = menu_return::RETURN_REPAINT; + } + else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_EPG_READ_FREQUENTLY)) + { + g_settings.epg_read_frequently = g_settings.epg_read ? g_settings.epg_read_frequently : 0; + + CNeutrinoApp::getInstance()->SendSectionsdConfig(); + + ret = menu_return::RETURN_REPAINT; + } + else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_EPG_SAVE_FREQUENTLY)) + { + g_settings.epg_save_frequently = g_settings.epg_save ? g_settings.epg_save_frequently : 0; + + CNeutrinoApp::getInstance()->SendSectionsdConfig(); + + ret = menu_return::RETURN_REPAINT; } else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_MISCSETTINGS_EPG_SCAN)) { diff --git a/src/gui/miscsettings_menu.h b/src/gui/miscsettings_menu.h index 8e5848ef8..b8bbaa1a7 100644 --- a/src/gui/miscsettings_menu.h +++ b/src/gui/miscsettings_menu.h @@ -45,6 +45,7 @@ class CMiscMenue : public CMenuTarget, CChangeObserver CMenuOptionChooser * epg_save_standby; CMenuOptionChooser * epg_save_frequently; CMenuOptionChooser * epg_read; + CMenuOptionChooser * epg_read_frequently; CMenuOptionChooser * epg_scan; CMenuOptionChooser * tmdb_onoff; CMenuOptionChooser * youtube_onoff; diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index d599937be..1908f2ba1 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -926,11 +926,11 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) bool onefile = (actionKey == "copy_onefile"); if ((show_mode == MB_SHOW_RECORDS) && (ShowMsg(LOCALE_MESSAGEBOX_INFO, onefile ? LOCALE_MOVIEBROWSER_COPY : LOCALE_MOVIEBROWSER_COPIES, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo) == CMsgBox::mbrYes)) { - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_COPYING); - hintBox->paint(); - sleep(1); - hintBox->hide(); - delete hintBox; + CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_COPYING); + hintBox.paint(); + sleep(1); //??? + hintBox.hide(); + framebuffer->paintBackground(); // clear screen CMovieCut mc; bool res = mc.copyMovie(m_movieSelectionHandler, onefile); @@ -951,11 +951,11 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) #endif if ((show_mode == MB_SHOW_RECORDS) && (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_CUT, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo) == CMsgBox::mbrYes)) { - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_CUTTING); - hintBox->paint(); - sleep(1); - hintBox->hide(); - delete hintBox; + CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_CUTTING); + hintBox.paint(); + sleep(1); //??? + hintBox.hide(); + framebuffer->paintBackground(); // clear screen CMovieCut mc; bool res = mc.cutMovie(m_movieSelectionHandler); @@ -979,12 +979,12 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) { if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_TRUNCATE, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo) == CMsgBox::mbrYes) { - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_TRUNCATING); - hintBox->paint(); + CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_TRUNCATING); + hintBox.paint(); CMovieCut mc; bool res = mc.truncateMovie(m_movieSelectionHandler); - hintBox->hide(); - delete hintBox; + hintBox.hide(); + g_RCInput->clearRCMsg(); if (!res) ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_MOVIEBROWSER_TRUNCATE_FAILED, CMsgBox::mbrCancel, CMsgBox::mbCancel, NEUTRINO_ICON_ERROR); @@ -1111,7 +1111,7 @@ int CMovieBrowser::exec(const char* path) snprintf(buf, sizeof(buf), format, m_movieSelectionHandler->file.Name.c_str()); CHintBox hintBox(LOCALE_MOVIEBROWSER_YT_CACHE, buf); hintBox.paint(); - sleep(1); + sleep(1); //??? hintBox.hide(); } } @@ -2505,8 +2505,8 @@ bool CMovieBrowser::onDeleteFile(MI_MOVIE_INFO *movieinfo, bool skipAsk) std::string msg = formatDeleteMsg(movieinfo, msgFont, msgBoxWidth); if ((skipAsk || !movieinfo->delAsk) || (ShowMsg(LOCALE_FILEBROWSER_DELETE, msg, CMsgBox::mbrYes, CMsgBox::mbYes|CMsgBox::mbNo, NULL, msgBoxWidth)==CMsgBox::mbrYes)) { - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_MOVIEBROWSER_DELETE_INFO)); - hintBox->paint(); + CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_MOVIEBROWSER_DELETE_INFO)); + hintBox.paint(); delFile(movieinfo->file); std::string cover_file = getScreenshotName(movieinfo->file.Name, S_ISDIR(movieinfo->file.Mode)); @@ -2517,7 +2517,7 @@ bool CMovieBrowser::onDeleteFile(MI_MOVIE_INFO *movieinfo, bool skipAsk) if (m_movieInfo.convertTs2XmlName(file_xml.Name)) unlink(file_xml.Name.c_str()); - delete hintBox; + hintBox.hide(); g_RCInput->clearRCMsg(); TRACE("List size: %d\n", (int)m_vMovieInfo.size()); @@ -4021,7 +4021,7 @@ int CYTCacheSelectorTarget::exec(CMenuTarget* /*parent*/, const std::string & ac snprintf(buf, sizeof(buf), format, movieBrowser->yt_failed[selected - movieBrowser->yt_failed_offset].file.Name.c_str()); CHintBox hintBox(LOCALE_MOVIEBROWSER_YT_CACHE, buf); hintBox.paint(); - sleep(1); + sleep(1); //??? hintBox.hide(); } } else diff --git a/src/gui/network_setup.cpp b/src/gui/network_setup.cpp index e07853fc1..bca1e993c 100644 --- a/src/gui/network_setup.cpp +++ b/src/gui/network_setup.cpp @@ -584,15 +584,14 @@ void CNetworkSetup::applyNetworkSettings() if (!checkForIP()) return; - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_NETWORKMENU_APPLY_SETTINGS)); // UTF-8 - hintBox->paint(); + CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_NETWORKMENU_APPLY_SETTINGS)); // UTF-8 + hintBox.paint(); networkConfig->stopNetwork(); saveNetworkSettings(); networkConfig->startNetwork(); - hintBox->hide(); - delete hintBox; + hintBox.hide(); } //open a message dialog with buttons, diff --git a/src/gui/opkg_manager.cpp b/src/gui/opkg_manager.cpp index b3df893e8..7c38b5f99 100644 --- a/src/gui/opkg_manager.cpp +++ b/src/gui/opkg_manager.cpp @@ -491,10 +491,10 @@ bool COPKGManager::checkUpdates(const std::string & package_name, bool show_prog int COPKGManager::doUpdate() { - CHintBox *hb = new CHintBox(LOCALE_MESSAGEBOX_INFO, LOCALE_OPKG_UPDATE_CHECK); - hb->paint(); + CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, LOCALE_OPKG_UPDATE_CHECK); + hintBox.paint(); int r = execCmd(pkg_types[OM_UPDATE], CShellWindow::QUIET); - delete hb; + hintBox.hide(); if (r) { string msg = string(g_Locale->getText(LOCALE_OPKG_FAILURE_UPDATE)); msg += '\n' + tmp_str; diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index a4aa2599b..17017c48f 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -1488,11 +1488,11 @@ void CScanSetup::addScanMenuFastScan(CMenuWidget *fast_ScanMenu) int CScanSetup::showFastscanDiseqcSetup() { - CHintBox * hintbox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_SATSETUP_FASTSCAN_AUTO_DISEQC_WAIT)); - hintbox->paint(); + CHintBox hintbox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_SATSETUP_FASTSCAN_AUTO_DISEQC_WAIT)); + hintbox.paint(); CServiceScan::getInstance()->TestDiseqcConfig(scansettings.fast_op); - delete hintbox; + hintbox.hide(); CMenuWidget * sat_setup = new CMenuWidget(LOCALE_SATSETUP_DISEQC_INPUT, NEUTRINO_ICON_SETTINGS, width); sat_setup->addIntroItems(); diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 64035b72c..c461a9afe 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -494,6 +494,39 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) form->paint(); return res; } + else if (actionKey == "form_blink_item"){ + if (form == NULL){ + form = new CComponentsForm(); + form->setColorBody(COL_DARK_GRAY); + form->setDimensionsAll(100, 100, 250, 100); + form->setFrameThickness(2); + form->setColorFrame(COL_WHITE); + //form->doPaintBg(false); + + CComponentsPicture *ptmp = new CComponentsPicture(10, 10, NEUTRINO_ICON_HINT_INFO); + ptmp->doPaintBg(false); + ptmp->SetTransparent(CFrameBuffer::TM_BLACK); + form->addCCItem(ptmp); + + CComponentsText *text = new CComponentsText(80, 30, 100, 50, "Info"); + text->doPaintBg(false); + form->addCCItem(text); + + form->paint0(); + ptmp->kill(); + } + + if (static_cast(form->getCCItem(0))-> paintBlink(500000, true)){ + ShowHint("Testmenu: Blink","Testmenu: Blinking embedded image ...", 700, 10); + } + if (form->getCCItem(0)->cancelBlink()){ + ShowHint("Testmenu: Blink","Testmenu: Blinking embedded image stopped ...", 700, 2); + } + + form->kill(); + delete form; form = NULL; + return res; + } else if (actionKey == "text"){ if (txt == NULL) txt = new CComponentsText(); @@ -968,6 +1001,7 @@ void CTestMenu::showCCTests(CMenuWidget *widget) widget->addItem(new CMenuForwarder("Picture", true, NULL, this, "picture")); widget->addItem(new CMenuForwarder("Channel-Logo", true, NULL, this, "channellogo")); widget->addItem(new CMenuForwarder("Form", true, NULL, this, "form")); + widget->addItem(new CMenuForwarder("Form with blinking item", true, NULL, this, "form_blink_item")); widget->addItem(new CMenuForwarder("Text", true, NULL, this, "text")); widget->addItem(new CMenuForwarder("Blinking Text", true, NULL, this, "blinking_text")); widget->addItem(new CMenuForwarder("Header", true, NULL, this, "header")); diff --git a/src/gui/tmdb.cpp b/src/gui/tmdb.cpp index 0b8556440..e4e65b70a 100644 --- a/src/gui/tmdb.cpp +++ b/src/gui/tmdb.cpp @@ -63,18 +63,15 @@ cTmdb::cTmdb(std::string epgtitle) key = g_settings.tmdb_api_key; #endif - CHintBox* box = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_TMDB_READ_DATA)); - box->paint(); + CHintBox hintbox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_TMDB_READ_DATA)); + hintbox.paint(); std::string lang = Lang2ISO639_1(g_settings.language); GetMovieDetails(lang); if ((minfo.result < 1 || minfo.overview.empty()) && lang != "en") GetMovieDetails("en"); - if (box != NULL) { - box->hide(); - delete box; - } + hintbox.hide(); } cTmdb::~cTmdb() diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index a76f01748..7c0575fde 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -249,19 +249,19 @@ bool CUpnpBrowserGui::discoverDevices() if (!m_devices.empty()) return true; - CHintBox *scanBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_UPNPBROWSER_SCANNING)); // UTF-8 - scanBox->paint(); + CHintBox hintbox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_UPNPBROWSER_SCANNING)); // UTF-8 + hintbox.paint(); try { m_devices = m_socket->Discover("urn:schemas-upnp-org:service:ContentDirectory:1"); } catch (std::runtime_error error) { - delete scanBox; + hintbox.hide(); DisplayErrorMessage(error.what()); return false; } - delete scanBox; + hintbox.hide(); if (m_devices.empty()) { DisplayInfoMessage(g_Locale->getText(LOCALE_UPNPBROWSER_NOSERVERS)); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 60c300d06..d0634f179 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -612,8 +612,9 @@ 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_save_frequently = configfile.getInt32("epg_save_frequently", false); + g_settings.epg_save_frequently = configfile.getInt32("epg_save_frequently", 0); g_settings.epg_read = configfile.getBool("epg_read", g_settings.epg_save); + g_settings.epg_read_frequently = configfile.getInt32("epg_read_frequently", 0); 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 @@ -1254,6 +1255,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setBool("epg_save_standby", g_settings.epg_save_standby); configfile.setInt32("epg_save_frequently", g_settings.epg_save_frequently); configfile.setBool("epg_read", g_settings.epg_read); + configfile.setInt32("epg_read_frequently", g_settings.epg_read_frequently); configfile.setInt32("epg_scan", g_settings.epg_scan); configfile.setInt32("epg_scan_mode", g_settings.epg_scan_mode); configfile.setInt32("epg_save_mode", g_settings.epg_save_mode); @@ -1957,6 +1959,7 @@ void CNeutrinoApp::MakeSectionsdConfig(CSectionsdClient::epg_config& config) config.epg_max_events = g_settings.epg_max_events; config.epg_extendedcache = g_settings.epg_extendedcache; config.epg_save_frequently = g_settings.epg_save ? g_settings.epg_save_frequently : 0; + config.epg_read_frequently = g_settings.epg_read ? g_settings.epg_read_frequently : 0; config.epg_dir = g_settings.epg_dir; config.network_ntpserver = g_settings.network_ntpserver; config.network_ntprefresh = atoi(g_settings.network_ntprefresh.c_str()); @@ -1975,6 +1978,7 @@ void CNeutrinoApp::InitZapper() struct stat my_stat; g_InfoViewer->start(); + SendSectionsdConfig(); 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()); @@ -2380,6 +2384,7 @@ TIMER_STOP("################################## after all ####################### //flash.enableNotify(false); flash.exec(NULL, "inet"); } + hintBox->hide(); delete hintBox; } RealRun(); @@ -4259,8 +4264,8 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) returnval = menu_return::RETURN_EXIT_ALL; } else if(actionKey=="savesettings") { - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_MAINSETTINGS_SAVESETTINGSNOW_HINT)); // UTF-8 - hintBox->paint(); + CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_MAINSETTINGS_SAVESETTINGSNOW_HINT)); // UTF-8 + hintBox.paint(); saveSetup(NEUTRINO_SETTINGS_FILE); @@ -4272,20 +4277,18 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) //g_Sectionsd->setEventsAreOldInMinutes((unsigned short) (g_settings.epg_old_hours*60)); //g_Sectionsd->setHoursToCache((unsigned short) (g_settings.epg_cache_days*24)); - hintBox->hide(); - delete hintBox; + hintBox.hide(); } else if(actionKey=="recording") { setupRecordingDevice(); } else if(actionKey=="reloadplugins") { - CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_SERVICEMENU_GETPLUGINS_HINT)); - hintBox->paint(); + CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_SERVICEMENU_GETPLUGINS_HINT)); + hintBox.paint(); g_PluginList->loadPlugins(); - hintBox->hide(); - delete hintBox; + hintBox.hide(); } //NI else if (actionKey=="restarttuner") @@ -4978,7 +4981,9 @@ void CNeutrinoApp::CheckFastScan(bool standby, bool reload) scanSettings.fst_version = CServiceScan::getInstance()->GetFstVersion(); scanSettings.saveSettings(NEUTRINO_SCAN_SETTINGS_FILE); } - delete fhintbox; + if (fhintbox){ + fhintbox->hide(); delete fhintbox; + } if (standby) CVFD::getInstance()->setMode(CVFD::MODE_STANDBY); } diff --git a/src/system/locals.h b/src/system/locals.h index 07d848805..d683d966c 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1177,6 +1177,7 @@ typedef enum LOCALE_MENU_HINT_EPG_MAX_EVENTS, LOCALE_MENU_HINT_EPG_OLD_EVENTS, LOCALE_MENU_HINT_EPG_READ, + LOCALE_MENU_HINT_EPG_READ_FREQUENTLY, LOCALE_MENU_HINT_EPG_SAVE, LOCALE_MENU_HINT_EPG_SAVE_FREQUENTLY, LOCALE_MENU_HINT_EPG_SAVE_MODE, @@ -1701,6 +1702,7 @@ typedef enum LOCALE_MISCSETTINGS_EPG_OLD_EVENTS_HINT1, LOCALE_MISCSETTINGS_EPG_OLD_EVENTS_HINT2, LOCALE_MISCSETTINGS_EPG_READ, + LOCALE_MISCSETTINGS_EPG_READ_FREQUENTLY, 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 830c94c34..ebd126d70 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1177,6 +1177,7 @@ const char * locale_real_names[] = "menu.hint_epg_max_events", "menu.hint_epg_old_events", "menu.hint_epg_read", + "menu.hint_epg_read_frequently", "menu.hint_epg_save", "menu.hint_epg_save_frequently", "menu.hint_epg_save_mode", @@ -1701,6 +1702,7 @@ const char * locale_real_names[] = "miscsettings.epg_old_events_hint1", "miscsettings.epg_old_events_hint2", "miscsettings.epg_read", + "miscsettings.epg_read_frequently", "miscsettings.epg_save", "miscsettings.epg_save_frequently", "miscsettings.epg_save_mode", diff --git a/src/system/settings.h b/src/system/settings.h index 16efd620b..615462c7e 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -284,6 +284,7 @@ struct SNeutrinoSettings int epg_save_standby; int epg_save_frequently; int epg_read; + int epg_read_frequently; int epg_cache; int epg_old_events; int epg_max_events;