diff --git a/data/cables.xml b/data/cables.xml index 9bfecff6e..777088793 100644 --- a/data/cables.xml +++ b/data/cables.xml @@ -25,6 +25,7 @@ + @@ -223,13 +224,12 @@ - - - - - + + + + + - @@ -255,12 +255,12 @@ - - - + + + diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am index 4dd2afa5f..b8b41539d 100644 --- a/data/icons/Makefile.am +++ b/data/icons/Makefile.am @@ -46,6 +46,10 @@ install_DATA += \ bookmarkmanager.png \ border_lr.png \ border_ul.png \ + btn_backward.png \ + btn_forward.png \ + btn_pause.png \ + btn_play.png \ btn_record_active.png \ btn_record_inactive.png \ btn_stop.png \ @@ -94,6 +98,7 @@ install_DATA += \ hint_keys.png \ hint_language.png \ hint_manage.png \ + hint_mb.png \ hint_media.png \ hint_movie.png \ hint_network.png \ diff --git a/data/icons/border_lr.png b/data/icons/border_lr.png index 450d5b6f5..69205da35 100644 Binary files a/data/icons/border_lr.png and b/data/icons/border_lr.png differ diff --git a/data/icons/border_ul.png b/data/icons/border_ul.png index 31000bbc7..f69959d76 100644 Binary files a/data/icons/border_ul.png and b/data/icons/border_ul.png differ diff --git a/data/icons/btn_backward.png b/data/icons/btn_backward.png new file mode 100644 index 000000000..962e71c84 Binary files /dev/null and b/data/icons/btn_backward.png differ diff --git a/data/icons/btn_forward.png b/data/icons/btn_forward.png new file mode 100644 index 000000000..cad43950b Binary files /dev/null and b/data/icons/btn_forward.png differ diff --git a/data/icons/btn_pause.png b/data/icons/btn_pause.png new file mode 100644 index 000000000..c18fafa40 Binary files /dev/null and b/data/icons/btn_pause.png differ diff --git a/data/icons/btn_play.png b/data/icons/btn_play.png new file mode 100644 index 000000000..e1baa70ca Binary files /dev/null and b/data/icons/btn_play.png differ diff --git a/data/icons/btn_record_active.png b/data/icons/btn_record_active.png index 68abcabfe..7d4b26252 100644 Binary files a/data/icons/btn_record_active.png and b/data/icons/btn_record_active.png differ diff --git a/data/icons/btn_record_inactive.png b/data/icons/btn_record_inactive.png index bcb79cb8f..54c109af7 100644 Binary files a/data/icons/btn_record_inactive.png and b/data/icons/btn_record_inactive.png differ diff --git a/data/icons/btn_stop.png b/data/icons/btn_stop.png index fa8ceeb6a..319ed8d9d 100644 Binary files a/data/icons/btn_stop.png and b/data/icons/btn_stop.png differ diff --git a/data/icons/hint_mb.png b/data/icons/hint_mb.png new file mode 100644 index 000000000..1bb508a8b Binary files /dev/null and b/data/icons/hint_mb.png differ diff --git a/data/icons/mounted.png b/data/icons/mounted.png index 7be710bc9..c730d0f54 100644 Binary files a/data/icons/mounted.png and b/data/icons/mounted.png differ diff --git a/data/icons/not_mounted.png b/data/icons/not_mounted.png index b394ba62b..30f909884 100644 Binary files a/data/icons/not_mounted.png and b/data/icons/not_mounted.png differ diff --git a/data/icons/numericpad.png b/data/icons/numericpad.png index 101b57842..ca445e4e4 100644 Binary files a/data/icons/numericpad.png and b/data/icons/numericpad.png differ diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 38651925f..f1bb962c6 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -211,6 +211,7 @@ channellist.foot_freq Tuning-Parameter channellist.foot_next Nachfolgesendung channellist.foot_off aus channellist.foot_sort_alpha Sortiert[alpha] +channellist.foot_sort_chnum Sortiert[nummer] channellist.foot_sort_freq Sortiert[freq] channellist.foot_sort_sat Sortiert[sat] channellist.head Alle Kanäle @@ -485,6 +486,7 @@ flashupdate.settings Update-Einstellungen flashupdate.squashfs.noversion Bei Updates werden Versionsüberprüfungen derzeit nur über Web-Updates unterstützt.\nWollen Sie das ausgewählte Image wirklich installieren? flashupdate.titlereadflash Flash auslesen flashupdate.titlewriteflash Flash schreiben +flashupdate.update_with_settings_del_skipped Ordner [%s] kann nicht gelöscht werden. Eintrag wird übersprungen. flashupdate.update_with_settings_processed Image wird bearbeitet... flashupdate.update_with_settings_skipped Ordner [%s] kann nicht gesichert werden. Eintrag wird übersprungen. flashupdate.update_with_settings_successfully Settingsübernahme erfolgreich.\nDas Image kann jetzt geflasht werden. @@ -749,6 +751,7 @@ menu.hint_epg_fonts Ändern Sie für die EPG-Details die Schriftgrößen menu.hint_epg_max_events Maximum an Events im Zwischenspeicher. Nach Erreichen der\nGrenze werden EPG-Daten für zukünftige gelöscht menu.hint_epg_old_events EPG im Speicher behalten in Stunden,\nauch wenn es veraltet ist menu.hint_epg_save Speichert die EPG-Daten auf einer Harddisk oder USB-Stick\nund läd es nach einen Neustart +menu.hint_epg_save_standby Speichert die EPG-Daten in Bereitschaft Modus menu.hint_event_textcolor Ändern Sie die Event-Farbe für farbige Event-Optionen in Kanalliste und Infobar menu.hint_eventlist_fonts Ändern Sie in der Event-Liste die Schriftgrößen menu.hint_extended Energiespar-, EPG-Speicher- / Lade-Optionen,\nHDMI-CEC, Startkanal, Zap-Optionen @@ -1032,11 +1035,12 @@ menu.hint_shutdown_rcdelay Aktiviert den Deep-Standby, wenn der Powerknopf\nlän menu.hint_shutdown_real Aktivieren des Soft-Standby-Modus, wenn diese Option\ndeaktiviert ist, geht die Box in den Deep-Standby menu.hint_sleeptimer Zeitschaltuhr auf Ihrer Box aktivieren.\nDie Box geht dann in den Standby-Modus menu.hint_soft_restart Neustarten von Neutrino-HD ohne zu Rebooten -menu.hint_softupdate_check Im Internet oder lokal nach verfügbaren Updates suchen +menu.hint_softupdate_check Im Internet nach verfügbaren Updates suchen, herunterladen und installieren +menu.hint_softupdate_check_local Lokal nach verfügbaren Updates suchen und installieren menu.hint_softupdate_expert Einzelne Partitionen aus dem Flash lesen / in den Flash schreiben menu.hint_softupdate_expert_read Einzelne Partitionen (U-Boot, Splash, Kernel, SystemFS) aus dem Flash lesen menu.hint_softupdate_expert_write Einzelne Partitionen (Splash, Kernel, SystemFS) in den Flash schreiben -menu.hint_softupdate_settings Den Updatemodus, das lokale Verzeichnis und die Konfigurationsdatei festlegen +menu.hint_softupdate_settings Das lokale Update-Verzeichnis und die Konfigurationsdatei festlegen menu.hint_start_tostandby Aktiviert den Standby-Modus nach dem starten der Box menu.hint_streaminfo Aktuelle Sender-Informationen: PIDs, SNR-Verhältnis\nBitrate grafisch menu.hint_subchannel_pos Hier können Sie die Anzeigeposition der Untertitel auswählen @@ -1100,6 +1104,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_save EPG zwischenspeichern +miscsettings.epg_save_standby EPG speichern in Standby-Modus miscsettings.general Allgemein miscsettings.head Erweitert miscsettings.infobar Infobar @@ -1166,6 +1171,7 @@ motorcontrol.store Speichere Motorposition (a) motorcontrol.timed_mode Zeitgesteuerter Schrittweitenmodus motorcontrol.user_menu Benutzermenü motorcontrol.west_limit Setze westliches (soft) Limit +moviebrowser.ask_rec_to_delete Das Löschen des Films beendet auch die laufende Aufnahme!\n[%s]\nTrotzdem fortsetzen? moviebrowser.book_add Lesezeichen setzen moviebrowser.book_clear_all Lösche alle moviebrowser.book_head Markierungen @@ -1183,6 +1189,7 @@ moviebrowser.browser_row_head Spalten Einstellungen moviebrowser.browser_row_item Spalteninfo moviebrowser.browser_row_nr Anzahl Spalten moviebrowser.browser_row_width Spaltenbreite [% der Gesamtbreite] +moviebrowser.delete_info Lösche Dateien, bitte warten... moviebrowser.dir Pfad moviebrowser.dir_head Zusätzliche Verzeichnisse moviebrowser.edit_book Bookmark Ändern @@ -1445,6 +1452,12 @@ pictureviewer.help20 Sortierung andern pictureviewer.help21 Bild unskaliert einlesen pictureviewer.help22 Modus verlassen pictureviewer.help3 Sortierung andern +pictureviewer.help30 Audioplayer-Modus +pictureviewer.help31 Startet die Wiedergabe +pictureviewer.help32 Pausiert die Wiedergabe +pictureviewer.help33 Stoppt die Wiedergabe +pictureviewer.help34 nächster Titel +pictureviewer.help35 vorheriger Titel pictureviewer.help4 Bild unskaliert einlesen pictureviewer.help5 Diashow-Modus pictureviewer.help6 vorheriges Bild diff --git a/data/locale/english.locale b/data/locale/english.locale index f6d2c6811..9d929447f 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -211,6 +211,7 @@ channellist.foot_freq Sat/Freq Info channellist.foot_next next Event channellist.foot_off off channellist.foot_sort_alpha sorted[alpha] +channellist.foot_sort_chnum sorted[number] channellist.foot_sort_freq sorted[freq] channellist.foot_sort_sat sorted[sat] channellist.head All Services @@ -485,6 +486,7 @@ flashupdate.settings Update settings flashupdate.squashfs.noversion SquashFS version checks are currently only supported when updating over the web.\nAre you sure that you wish to install this image? flashupdate.titlereadflash Reading Flash flashupdate.titlewriteflash Writing Flash +flashupdate.update_with_settings_del_skipped Folder [%s] can not be deleted. Entry is skipped. flashupdate.update_with_settings_processed Image is being processed... flashupdate.update_with_settings_skipped Folder [%s] can not be saved. Entry is skipped. flashupdate.update_with_settings_successfully Setting takeover successfully.\nThe image can now be flashed. @@ -749,6 +751,7 @@ 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_save_standby Save EPG on soft standby mode menu.hint_event_textcolor Change event color for colored-event options\nin channel list and infobar menu.hint_eventlist_fonts Change event list font sizes menu.hint_extended Power saving, EPG save/load options\nHDMI-CEC, Start channel, zap options @@ -1032,11 +1035,12 @@ menu.hint_shutdown_rcdelay Enable deep-standby, if power button\npressed more th menu.hint_shutdown_real Enable soft-standby mode\nIf disabled, power button put box to deep-standby menu.hint_sleeptimer Set timer to put your box\nin sleep mode menu.hint_soft_restart Restart Neutrino-HD without reboot -menu.hint_softupdate_check In the Internet or local check for available updates +menu.hint_softupdate_check Check online update, download and flash firmware +menu.hint_softupdate_check_local Select and flash firmware from local file menu.hint_softupdate_expert Separate partitions from the flash read / write to the flash menu.hint_softupdate_expert_read Separate partitions (U-Boot, Splash, Kernel, SystemFS) from the flash read menu.hint_softupdate_expert_write Separate partitions (Splash, Kernel, SystemFS) write to the flash -menu.hint_softupdate_settings Update mode, the local directory and the configuration file to set +menu.hint_softupdate_settings The local update directory and the configuration file to set menu.hint_start_tostandby Enter standby mode after boot menu.hint_streaminfo Current channel info: pids, signal and noise ratio\nBitrate graphs menu.hint_subchannel_pos Select subchannels menu position @@ -1100,6 +1104,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_save Save/Restore epg on reboot +miscsettings.epg_save_standby Save epg on soft standby miscsettings.general General miscsettings.head Extended settings miscsettings.infobar Infobar @@ -1166,6 +1171,7 @@ motorcontrol.store Store Motor Position (a) motorcontrol.timed_mode Timed Step Mode motorcontrol.user_menu User menu motorcontrol.west_limit Set West (soft) Limit +moviebrowser.ask_rec_to_delete Deletion of movie stops current recording!\n[%s]\nContinue anyway? moviebrowser.book_add Add bookmark moviebrowser.book_clear_all Clear all moviebrowser.book_head Bookmarks @@ -1183,6 +1189,7 @@ moviebrowser.browser_row_head Row settings moviebrowser.browser_row_item Row item moviebrowser.browser_row_nr Number of rows moviebrowser.browser_row_width Row width (% of screenwidth) +moviebrowser.delete_info Delete files, please wait... moviebrowser.dir Path moviebrowser.dir_head Additional paths moviebrowser.edit_book Bookmark change @@ -1445,6 +1452,12 @@ pictureviewer.help20 change sort order pictureviewer.help21 reread image (no scaling) pictureviewer.help22 exit pictureviewer.help3 change sort order +pictureviewer.help30 audioplayer mode +pictureviewer.help31 starts the playback +pictureviewer.help32 pauses the playback +pictureviewer.help33 stops the playback +pictureviewer.help34 next title +pictureviewer.help35 previous title pictureviewer.help4 do not scale picture pictureviewer.help5 diashow mode pictureviewer.help6 previous image diff --git a/data/settingsupdate.conf b/data/settingsupdate.conf index 795e0025b..45eafcac9 100644 --- a/data/settingsupdate.conf +++ b/data/settingsupdate.conf @@ -3,8 +3,8 @@ #:LogFile=/tmp/update.log -## Mögliche Einträge: -#==================== +## Mögliche Einträge für Sicherungen: +#==================================== # ganzes Verzeichnis #------------------- # /var/etc @@ -22,7 +22,29 @@ #------------------------------------------------------------------------------------------------ ## Sicherungen +/etc/hostname +/etc/hosts /etc/network +/etc/resolv.conf /etc/wpa_supplicant.conf /var/etc /var/tuxbox/config + +#---------------------------------------------------------------------------------------- +## von der Sicherung auszuschließende Dateien, gekennzeichnet durch ein vorangestelltes - +#---------------------------------------------------------------------------------------- +-/var/etc/update.urls +-/var/tuxbox/config/cables.xml +-/var/tuxbox/config/encoding.conf +-/var/tuxbox/config/providermap.xml +-/var/tuxbox/config/radio-stations.xml +-/var/tuxbox/config/satellites.xml +-/var/tuxbox/config/settingsupdate.conf +-/var/tuxbox/config/tobackup.conf + +#---------------------------------------------------------------------------- +## nach der Sicherung aus dem neuen Image zu löschende Dateien/Verzeichnisse, +## gekennzeichnet durch ein vorangestelltes ~ +# z.B. +# ~/share/tuxbox/neutrino/themes/Classic.theme +#---------------------------------------------------------------------------- diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 116feb8b6..070c24fab 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -1217,7 +1217,7 @@ printf("[neutrino] CSectionsdClient::EVT_GOT_CN_EPG\n"); (trkey == RC_plus ) || (trkey == RC_minus ) || (trkey == RC_page_down ) || (trkey == RC_page_up ) || ((bAllowRepeatLR) && ((trkey == RC_left ) || (trkey == RC_right))) || - ((trkey == RC_standby) && (cs_get_revision() > 7)) ) + (g_settings.shutdown_real_rcdelay && ((trkey == RC_standby) && (cs_get_revision() > 7))) ) { #ifdef ENABLE_REPEAT_CHECK if (rc_last_repeat_key != ev.code) { diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 93403f3fa..86baeec8e 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -1650,18 +1650,18 @@ void CRecordManager::RestoreNeutrino(void) g_Sectionsd->setPauseScanning(false); } -bool CRecordManager::IsFileRecord(std::string file) +CRecordInstance* CRecordManager::getRecordInstance(std::string file) { mutex.lock(); for(recmap_iterator_t it = recmap.begin(); it != recmap.end(); it++) { CRecordInstance * inst = it->second; if ((((std::string)inst->GetFileName()) + ".ts") == file) { mutex.unlock(); - return true; + return inst; } } mutex.unlock(); - return false; + return NULL; } #if 0 diff --git a/src/driver/record.h b/src/driver/record.h index ac5ebc311..b8ee4be99 100644 --- a/src/driver/record.h +++ b/src/driver/record.h @@ -218,7 +218,7 @@ class CRecordManager : public CMenuTarget /*, public CChangeObserver*/ int GetRecordCount() { return recmap.size(); }; void StartTimeshift(); int GetRecordMode(const t_channel_id channel_id=0); - bool IsFileRecord(std::string file); + CRecordInstance* getRecordInstance(std::string file); // old code #if 0 bool IsTimeshift(t_channel_id channel_id=0); diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index 0e3142c5c..1b0e7f15b 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -127,7 +127,7 @@ bool CStreamInstance::Send(ssize_t r) if (ret != r) { if (r < 0) perror("send"); - printf("send err, fd %d: %d\n", *it, r); + printf("send err, fd %d: (%d from %d)\n", *it, ret, r); } } mutex.unlock(); @@ -346,8 +346,8 @@ bool CStreamManager::Parse(int fd, stream_pids_t &pids, t_channel_id &chid) } } } - if(CRecordManager::getInstance()->RecordingStatus(tmpid)) { - printf("CStreamManager::Parse: channel %llx recorded, aborting..\n", tmpid); + if(CRecordManager::getInstance()->RecordingStatus(chid)) { + printf("CStreamManager::Parse: channel %llx recorded, aborting..\n", chid); return false; } #endif diff --git a/src/eitd/xmlutil.cpp b/src/eitd/xmlutil.cpp index c57cfa023..b700011f3 100644 --- a/src/eitd/xmlutil.cpp +++ b/src/eitd/xmlutil.cpp @@ -334,16 +334,18 @@ void *insertEventsfromFile(void * data) std::string(xmlGetAttribute(node, "string"))); node = node->xmlNextNode; } -#ifdef USE_ITEM_DESCRIPTION while (xmlGetNextOccurence(node, "item") != NULL) { +#ifdef USE_ITEM_DESCRIPTION e.item = std::string(xmlGetAttribute(node, "string")); +#endif node = node->xmlNextNode; } while (xmlGetNextOccurence(node, "item_description") != NULL) { +#ifdef USE_ITEM_DESCRIPTION e.itemDescription = std::string(xmlGetAttribute(node, "string")); +#endif node = node->xmlNextNode; } -#endif while (xmlGetNextOccurence(node, "extended_text") != NULL) { e.appendExtendedText( std::string(ZapitTools::UTF8_to_Latin1(xmlGetAttribute(node, "lang"))), std::string(xmlGetAttribute(node, "string"))); diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index c7e82d9ba..13f2184df 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -325,7 +325,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) if (my_system(AUDIOPLAYER_START_SCRIPT) != 0) perror("Datei " AUDIOPLAYER_START_SCRIPT " fehlt.Bitte erstellen, wenn gebraucht.\nFile " AUDIOPLAYER_START_SCRIPT " not found. Please create if needed.\n"); - show(); + int res = show(); // Restore previous background if (usedBackground) @@ -346,8 +346,7 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) CNeutrinoApp::getInstance()->StartSubtitles(); - // always exit all - return menu_return::RETURN_EXIT_ALL; + return res; } //------------------------------------------------------------------------ @@ -359,7 +358,7 @@ int CAudioPlayerGui::show() int pic_index = 0; - int ret = -1; + int ret = menu_return::RETURN_REPAINT; CVFD::getInstance()->setMode(CVFD::MODE_AUDIO); paintLCD(); @@ -878,8 +877,11 @@ int CAudioPlayerGui::show() msg == NeutrinoMessages::SHUTDOWN || msg == NeutrinoMessages::SLEEPTIMER) { + if(msg != NeutrinoMessages::RECORD_START ) + ret = menu_return::RETURN_EXIT_ALL; // Exit for Record/Zapto Timers loop = false; + g_RCInput->postMsg(msg, data); } else if (msg == NeutrinoMessages::EVT_TIMER) @@ -890,6 +892,7 @@ int CAudioPlayerGui::show() { if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) { + ret = menu_return::RETURN_EXIT_ALL; loop = false; } // update mute icon diff --git a/src/gui/audioplayer.h b/src/gui/audioplayer.h index 6a73378e3..daba3d8a9 100644 --- a/src/gui/audioplayer.h +++ b/src/gui/audioplayer.h @@ -159,9 +159,6 @@ class CAudioPlayerGui : public CMenuTarget CFileFilter audiofilefilter; void paintItemID3DetailsLine (int pos); void clearItemID3DetailsLine (); - void play(unsigned int pos); - void stop(); - void pause(); void ff(unsigned int seconds=0); void rev(unsigned int seconds=0); int getNext(); @@ -248,8 +245,6 @@ class CAudioPlayerGui : public CMenuTarget bool openSCbrowser(void); bool clearPlaylist(void); bool shufflePlaylist(void); - bool playNext(bool allow_rotate = false); - bool playPrev(bool allow_rotate = false); bool pictureviewer; @@ -260,6 +255,12 @@ class CAudioPlayerGui : public CMenuTarget int exec(CMenuTarget* parent, const std::string & actionKey); void wantNextPlay(); + void pause(); + void play(unsigned int pos); + void stop(); + bool playNext(bool allow_rotate = false); + bool playPrev(bool allow_rotate = false); + int getAdioPayerM_currend() {return m_current;} }; diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 92c7f50d3..eaf0a8bfb 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -223,6 +223,11 @@ void CChannelList::SortTP(void) sort(chanlist.begin(), chanlist.end(), CmpChannelByFreq()); } +void CChannelList::SortChNumber(void) +{ + sort(chanlist.begin(), chanlist.end(), CmpChannelByChNum()); +} + CZapitChannel* CChannelList::getChannel(int number) { for (uint32_t i=0; i< chanlist.size(); i++) { @@ -814,8 +819,8 @@ int CChannelList::show() int mode = CNeutrinoApp::getInstance()->GetChannelMode(); if(mode != LIST_MODE_FAV) { g_settings.channellist_sort_mode++; - if(g_settings.channellist_sort_mode > 2) - g_settings.channellist_sort_mode = 0; + if(g_settings.channellist_sort_mode > SORT_MAX-1) + g_settings.channellist_sort_mode = SORT_ALPHA; CNeutrinoApp::getInstance()->SetChannelMode(mode); paintHead(); // update button bar paint(); @@ -1631,7 +1636,7 @@ void CChannelList::paintButtonBar(bool is_current) struct button_label Button[num_buttons]; const neutrino_locale_t button_ids[] = {LOCALE_INFOVIEWER_NOW,LOCALE_INFOVIEWER_NEXT,LOCALE_MAINMENU_RECORDING,LOCALE_MAINMENU_RECORDING_STOP,NONEXISTANT_LOCALE, - LOCALE_CHANNELLIST_FOOT_SORT_ALPHA,LOCALE_CHANNELLIST_FOOT_SORT_FREQ,LOCALE_CHANNELLIST_FOOT_SORT_SAT}; + LOCALE_CHANNELLIST_FOOT_SORT_ALPHA,LOCALE_CHANNELLIST_FOOT_SORT_FREQ,LOCALE_CHANNELLIST_FOOT_SORT_SAT,LOCALE_CHANNELLIST_FOOT_SORT_CHNUM}; const std::vector buttonID_rest (button_ids, button_ids + sizeof(button_ids) / sizeof(neutrino_locale_t) ); for (int i = 0;i @@ -73,6 +73,9 @@ CExtUpdate::CExtUpdate() fLogfile = "/tmp/update.log"; mountPkt = "/tmp/image_mount"; FileHelpers = NULL; + copyList.clear(); + blackList.clear(); + deleteList.clear(); } CExtUpdate::~CExtUpdate() @@ -81,6 +84,9 @@ CExtUpdate::~CExtUpdate() delete[] MTDBuf; if(FileHelpers) delete[] FileHelpers; + copyList.clear(); + blackList.clear(); + deleteList.clear(); } CExtUpdate* CExtUpdate::getInstance() @@ -118,6 +124,7 @@ bool CExtUpdate::ErrorReset(bool modus, const std::string & msg1, const std::str } if(hintBox) hintBox->hide(); + sync(); return false; } @@ -148,7 +155,6 @@ bool CExtUpdate::applySettings(const std::string & filename, int mode) return false; } } - ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_SUCCESSFULLY), CMessageBox::mbrOk, CMessageBox::mbOk, NEUTRINO_ICON_INFO); WRITE_UPDATE_LOG("\n"); WRITE_UPDATE_LOG("##### Settings taken. #####\n"); if (mode == MODE_EXPERT) @@ -159,10 +165,10 @@ bool CExtUpdate::applySettings(const std::string & filename, int mode) bool CExtUpdate::isMtdramLoad() { - char buf[256] = ""; bool ret = false; FILE* f = fopen("/proc/modules", "r"); if (f) { + char buf[256] = ""; while(fgets(buf, sizeof(buf), f) != NULL) { if (strstr(buf, "mtdram") != NULL) { ret = true; @@ -294,7 +300,8 @@ bool CExtUpdate::applySettings() if (res) return ErrorReset(RESET_UNLOAD, "mount error"); - readBackupList(mountPkt); + if (!readBackupList(mountPkt)) + return ErrorReset(0, "error readBackupList"); res = umount(mountPkt.c_str()); if (res) @@ -336,6 +343,7 @@ bool CExtUpdate::applySettings() if(hintBox) hintBox->hide(); + sync(); return true; } @@ -359,7 +367,6 @@ bool CExtUpdate::copyFileList(const std::string & fileList, const std::string & struct dirent **namelist; std::string fList = fileList, dst; static struct stat FileInfo; - char buf[PATH_MAX]; size_t pos = fileList.find_last_of("/"); fList = fileList.substr(0, pos); @@ -373,6 +380,7 @@ bool CExtUpdate::copyFileList(const std::string & fileList, const std::string & std::string dName = namelist[n]->d_name; if (lstat((fList+"/"+dName).c_str(), &FileInfo) != -1) { if (S_ISLNK(FileInfo.st_mode)) { + char buf[PATH_MAX]; int len = readlink((fList+"/"+dName).c_str(), buf, sizeof(buf)-1); if (len != -1) { buf[len] = '\0'; @@ -383,7 +391,8 @@ bool CExtUpdate::copyFileList(const std::string & fileList, const std::string & else if (S_ISREG(FileInfo.st_mode)) { WRITE_UPDATE_LOG("copy %s => %s\n", (fList+"/"+dName).c_str(), (dst+"/"+dName).c_str()); - if (!FileHelpers->copyFile((fList+"/"+dName).c_str(), (dst+"/"+dName).c_str(), FileInfo.st_mode & 0x0FFF)) + std::string save = (isBlacklistEntry(fList+"/"+dName)) ? ".save" : ""; + if (!FileHelpers->copyFile((fList+"/"+dName).c_str(), (dst + "/" + dName + save).c_str(), FileInfo.st_mode & 0x0FFF)) return ErrorReset(0, "copyFile error"); } } @@ -395,6 +404,40 @@ bool CExtUpdate::copyFileList(const std::string & fileList, const std::string & return true; } +bool CExtUpdate::deleteFileList(const std::string & fileList) +{ + Wildcard = ""; + struct dirent **namelist; + std::string fList = fileList; + static struct stat FileInfo; + + size_t pos = fileList.find_last_of("/"); + fList = fileList.substr(0, pos); + Wildcard = fileList.substr(pos+1); + + int n = scandir(fList.c_str(), &namelist, fileSelect, 0); + if (n > 0) { + while (n--) { + std::string dName = namelist[n]->d_name; + if (lstat((fList+"/"+dName).c_str(), &FileInfo) != -1) { + if (S_ISDIR(FileInfo.st_mode)) { + // Directory + WRITE_UPDATE_LOG("delete directory: %s\n", (fList+"/"+dName).c_str()); + FileHelpers->removeDir((fList+"/"+dName).c_str()); + } + else if (S_ISREG(FileInfo.st_mode)) { + // File + WRITE_UPDATE_LOG("delete file: %s\n", (fList+"/"+dName).c_str()); + unlink((fList+"/"+dName).c_str()); + } + } + free(namelist[n]); + } + free(namelist); + } + return true; +} + bool CExtUpdate::findConfigEntry(std::string & line, std::string find) { if (line.find("#:" + find + "=") == 0) { @@ -424,6 +467,32 @@ bool CExtUpdate::readConfig(const std::string & line) return true; } +bool CExtUpdate::isBlacklistEntry(const std::string & file) +{ + for(vector::iterator it = blackList.begin(); it != blackList.end(); ++it) { + if (*it == file) { + DBG_MSG("BlacklistEntry %s\n", (*it).c_str()); + WRITE_UPDATE_LOG("BlacklistEntry: %s\n", (*it).c_str()); + return true; + } + } + return false; +} + +bool CExtUpdate::checkSpecialFolders(std::string line, bool copy) +{ + if ((line == "/") || (line == "/*") || (line == "/*.*") || (line.find("/dev") == 0) || (line.find("/proc") == 0) || + (line.find("/sys") == 0) || (line.find("/mnt") == 0) || (line.find("/tmp") == 0)) { + char buf[PATH_MAX]; + neutrino_locale_t msg = (copy) ? LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_SKIPPED : LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_DEL_SKIPPED; + snprintf(buf, sizeof(buf), g_Locale->getText(msg), line.c_str()); + WRITE_UPDATE_LOG("%s%s", buf, "\n"); + ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, buf, CMessageBox::mbrOk, CMessageBox::mbOk, NEUTRINO_ICON_INFO); + return true; + } + return false; +} + bool CExtUpdate::readBackupList(const std::string & dstPath) { char buf[PATH_MAX]; @@ -452,12 +521,20 @@ bool CExtUpdate::readBackupList(const std::string & dstPath) if (fz.__pos == 0) return ErrorReset(RESET_F1, "backuplist filesize is 0"); size_t pos; + std::string line; + + // read blacklist and config vars + copyList.clear(); + blackList.clear(); + deleteList.clear(); while(fgets(buf, sizeof(buf), f1) != NULL) { - std::string line = buf; + std::string tmpLine; + line = buf; line = trim(line); - // remove comments + // ignore comments if (line.find_first_of("#") == 0) { - if (line.find_first_of(":") == 1) { // config vars + // config vars + if (line.find_first_of(":") == 1) { if (line.length() > 1) readConfig(line); } @@ -468,14 +545,39 @@ bool CExtUpdate::readBackupList(const std::string & dstPath) line = line.substr(0, pos); line = trim(line); } - // special folders - else if ((line == "/") || (line == "/*") || (line == "/*.*") || (line.find("/dev") == 0) || (line.find("/proc") == 0) || - (line.find("/sys") == 0) || (line.find("/mnt") == 0) || (line.find("/tmp") == 0)) { - snprintf(buf, sizeof(buf), g_Locale->getText(LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_SKIPPED), line.c_str()); - WRITE_UPDATE_LOG("%s%s", buf, "\n"); - ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, buf, CMessageBox::mbrOk, CMessageBox::mbOk, NEUTRINO_ICON_INFO); - continue; + // find blackList entry + if (line.find_first_of("-") == 0) { + tmpLine = line.substr(1); + if ((tmpLine.length() > 1) && (lstat(tmpLine.c_str(), &FileInfo) != -1)) { + if (S_ISREG(FileInfo.st_mode)) + blackList.push_back(tmpLine); + } } + // find deleteList entry + else if (line.find_first_of("~") == 0) { + tmpLine = line.substr(1); + if (checkSpecialFolders(tmpLine, false)) + continue; + tmpLine = dstPath + tmpLine; + if (line.length() > 2) + deleteList.push_back(tmpLine); + } + // find copyList entry + else { + tmpLine = (line.find_first_of("+") == 0) ? line.substr(1) : line; // '+' add entry = default + if (checkSpecialFolders(tmpLine, true)) + continue; + if (tmpLine.length() > 1) + copyList.push_back(tmpLine); + } + } + fclose(f1); + + // read copyList + vector::iterator it; + for(it = copyList.begin(); it != copyList.end(); ++it) { + line = *it; + line = trim(line); // remove '/' from line end size_t len = line.length(); pos = line.find_last_of("/"); @@ -501,7 +603,8 @@ bool CExtUpdate::readBackupList(const std::string & dstPath) WRITE_UPDATE_LOG("\n"); WRITE_UPDATE_LOG("file: %s => %s\n", line.c_str(), dst.c_str()); WRITE_UPDATE_LOG("--------------------\n"); - if (!FileHelpers->copyFile(line.c_str(), dst.c_str(), FileInfo.st_mode & 0x0FFF)) + std::string save = (isBlacklistEntry(line)) ? ".save" : ""; + if (!FileHelpers->copyFile(line.c_str(), (dst + save).c_str(), FileInfo.st_mode & 0x0FFF)) return ErrorReset(0, "copyFile error"); } else if (S_ISDIR(FileInfo.st_mode)) { @@ -510,14 +613,35 @@ bool CExtUpdate::readBackupList(const std::string & dstPath) WRITE_UPDATE_LOG("\n"); WRITE_UPDATE_LOG("directory: %s => %s\n", line.c_str(), dst.c_str()); WRITE_UPDATE_LOG("--------------------\n"); - FileHelpers->copyDir(line.c_str(), dst.c_str()); + FileHelpers->copyDir(line.c_str(), dst.c_str(), true); } } } } - fclose(f1); + // read DeleteList + for(it = deleteList.begin(); it != deleteList.end(); ++it) { + line = *it; + if (lstat(line.c_str(), &FileInfo) != -1) { + if ((line.find("*") != std::string::npos) || (line.find("?") != std::string::npos)) { + // Wildcards + WRITE_UPDATE_LOG("delete file list: %s\n", line.c_str()); + deleteFileList(line.c_str()); + } + else if (S_ISREG(FileInfo.st_mode)) { + // File + WRITE_UPDATE_LOG("delete file: %s\n", line.c_str()); + unlink(line.c_str()); + } + else if (S_ISDIR(FileInfo.st_mode)){ + // Directory + WRITE_UPDATE_LOG("delete directory: %s\n", line.c_str()); + FileHelpers->removeDir(line.c_str()); + } + } + } + sync(); return true; } diff --git a/src/gui/ext_update.h b/src/gui/ext_update.h index 9f0ee6744..e0291641b 100644 --- a/src/gui/ext_update.h +++ b/src/gui/ext_update.h @@ -54,13 +54,16 @@ class CExtUpdate std::string backupList, defaultBackup; std::string mountPkt; CFileHelpers* FileHelpers; + std::vector copyList, blackList, deleteList; bool applySettings(void); bool readBackupList(const std::string & dstPath); bool copyFileList(const std::string & fileList, const std::string & dstPath); + bool deleteFileList(const std::string & fileList); bool readConfig(const std::string & Config); bool findConfigEntry(std::string & line, std::string find); bool isMtdramLoad(); + bool checkSpecialFolders(std::string line, bool copy); FILE * fUpdate; char updateLogBuf[1024]; @@ -80,6 +83,7 @@ class CExtUpdate bool applySettings(const std::string & filename, int mode); bool ErrorReset(bool modus, const std::string & msg1="", const std::string & msg2=""); + bool isBlacklistEntry(const std::string & file); }; diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 18d431de1..09cef99fa 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -838,6 +838,7 @@ bool CFileBrowser::exec(const char * const dirname) neutrino_msg_data_t data; bool res = false; + menu_ret = menu_return::RETURN_REPAINT; #ifdef ENABLE_INTERNETRADIO if (m_Mode == ModeSC) { @@ -1105,10 +1106,20 @@ bool CFileBrowser::exec(const char * const dirname) else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites) { //FIXME do nothing ? } + else if (msg == NeutrinoMessages::STANDBY_ON || + msg == NeutrinoMessages::SHUTDOWN || + msg == NeutrinoMessages::SLEEPTIMER) + { + menu_ret = menu_return::RETURN_EXIT_ALL; + loop = false; + g_RCInput->postMsg(msg, data); + } + else { if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) { + menu_ret = menu_return::RETURN_EXIT_ALL; loop = false; } } diff --git a/src/gui/filebrowser.h b/src/gui/filebrowser.h index b1e92dabf..5cf100bdf 100644 --- a/src/gui/filebrowser.h +++ b/src/gui/filebrowser.h @@ -177,6 +177,7 @@ class CFileBrowser int x; int y; + int menu_ret; SMSKeyInput m_SMSKeyInput; @@ -229,6 +230,7 @@ class CFileBrowser { return Path; } + int getMenuRet() { return menu_ret; } // size_t CurlWriteToString(void *ptr, size_t size, size_t nmemb, void *data); private: diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index cf033a766..62c3bca74 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -498,6 +498,7 @@ void CInfoViewerBB::showIcon_Resolution() case 1920: icon_name = NEUTRINO_ICON_RESOLUTION_1920; break; + case 1080: case 1088: icon_name = NEUTRINO_ICON_RESOLUTION_1080; break; @@ -541,28 +542,12 @@ void CInfoViewerBB::showIcon_Resolution() } if (g_settings.infobar_show_res == 1) {//show simple resolution icon on infobar videoDecoder->getPictureInfo(xres, yres, framerate); - switch (yres) { - case 1920: - case 1440: - case 1280: - case 1088: - case 720: + if (yres > 704) icon_name = NEUTRINO_ICON_RESOLUTION_HD; - break; - case 704: - case 576: - case 544: - case 528: - case 480: - case 382: - case 352: - case 288: + else if (yres >= 288) icon_name = NEUTRINO_ICON_RESOLUTION_SD; - break; - default: + else icon_name = NEUTRINO_ICON_RESOLUTION_000; - break; - } } } showBBIcons(CInfoViewerBB::ICON_RES, icon_name); diff --git a/src/gui/mediaplayer.cpp b/src/gui/mediaplayer.cpp index 30172d0f5..738926d1a 100644 --- a/src/gui/mediaplayer.cpp +++ b/src/gui/mediaplayer.cpp @@ -91,39 +91,27 @@ int CMediaPlayerMenu::exec(CMenuTarget* parent, const std::string &actionKey) { if (audioPlayer == NULL) audioPlayer = new CAudioPlayerGui(); - audioPlayer->exec(NULL, "init"); + int res = audioPlayer->exec(NULL, "init"); - return menu_return::RETURN_REPAINT; + return res /*menu_return::RETURN_REPAINT*/; } else if (actionKey == "inetplayer") { if (inetPlayer == NULL) inetPlayer = new CAudioPlayerGui(true); - inetPlayer->exec(NULL, "init"); + int res = inetPlayer->exec(NULL, "init"); - return menu_return::RETURN_REPAINT; + return res; //menu_return::RETURN_REPAINT; } else if (actionKey == "movieplayer") { -#if 0 //Is it really necessary to lock here? Moviebrowser got its own configurable parental lock. - bool show = true; - if ((g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_ONSIGNAL) || (g_settings.parentallock_prompt == PARENTALLOCK_PROMPT_CHANGETOLOCKED)) { - CZapProtection zapProtection( g_settings.parentallock_pincode, 0x100 ); - show = zapProtection.check(); - } - - if(show){ -#endif - int mode = CNeutrinoApp::getInstance()->getMode(); - if( mode == NeutrinoMessages::mode_radio ) - videoDecoder->StopPicture(); - CMoviePlayerGui::getInstance().exec(NULL, "tsmoviebrowser"); - if( mode == NeutrinoMessages::mode_radio ) - videoDecoder->ShowPicture(DATADIR "/neutrino/icons/radiomode.jpg"); -#if 0 - } -#endif - return menu_return::RETURN_REPAINT;; + int mode = CNeutrinoApp::getInstance()->getMode(); + if( mode == NeutrinoMessages::mode_radio ) + videoDecoder->StopPicture(); + int res = CMoviePlayerGui::getInstance().exec(NULL, "tsmoviebrowser"); + if( mode == NeutrinoMessages::mode_radio ) + videoDecoder->ShowPicture(DATADIR "/neutrino/icons/radiomode.jpg"); + return res; } int res = initMenuMedia(); @@ -153,7 +141,9 @@ int CMediaPlayerMenu::initMenuMedia(CMenuWidget *m, CPersonalizeGui *p) CMenuForwarder *fw_inet = NULL; CMenuForwarder *fw_mp = NULL; CMenuForwarder *fw_pviewer = NULL; + CPictureViewerGui *pictureviewergui = NULL; #if ENABLE_UPNP + CUpnpBrowserGui *upnpbrowsergui = NULL; CMenuForwarder *fw_upnp = NULL; #endif CMenuWidget *moviePlayer = NULL; @@ -182,11 +172,13 @@ int CMediaPlayerMenu::initMenuMedia(CMenuWidget *m, CPersonalizeGui *p) fw_mp->setHint(NEUTRINO_ICON_HINT_MOVIE, LOCALE_MENU_HINT_MOVIE); //pictureviewer - fw_pviewer = new CMenuForwarder(LOCALE_MAINMENU_PICTUREVIEWER, true, NULL, new CPictureViewerGui(), NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE); + pictureviewergui = new CPictureViewerGui(); + fw_pviewer = new CMenuForwarder(LOCALE_MAINMENU_PICTUREVIEWER, true, NULL, pictureviewergui, NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE); fw_pviewer->setHint(NEUTRINO_ICON_HINT_PICVIEW, LOCALE_MENU_HINT_PICVIEW); #if ENABLE_UPNP //upnp browser - fw_upnp = new CMenuForwarder(LOCALE_UPNPBROWSER_HEAD, true, NULL, new CUpnpBrowserGui(), NULL, CRCInput::RC_0, NEUTRINO_ICON_BUTTON_0); + upnpbrowsergui = new CUpnpBrowserGui(); + fw_upnp = new CMenuForwarder(LOCALE_UPNPBROWSER_HEAD, true, NULL, upnpbrowsergui, NULL, CRCInput::RC_0, NEUTRINO_ICON_BUTTON_0); #endif // media->addIntroItems(NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, usage_mode == MODE_AUDIO ? CMenuWidget::BTN_TYPE_CANCEL : CMenuWidget::BTN_TYPE_BACK); } @@ -233,10 +225,13 @@ int CMediaPlayerMenu::initMenuMedia(CMenuWidget *m, CPersonalizeGui *p) res = media->exec(NULL, ""); delete media; delete personalize; + delete pictureviewergui; +#if ENABLE_UPNP + delete upnpbrowsergui; +#endif setUsageMode();//set default usage_mode } - return res; } diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index af9c630ed..c1bd9c746 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -229,6 +229,7 @@ int CMiscMenue::showMiscSettingsMenu() delete sectionsdConfigNotifier; if(cs_get_revision() > 7) delete miscNotifier; + delete miscEpgNotifier; return res; } @@ -303,33 +304,48 @@ void CMiscMenue::showMiscSettingsMenuEpg(CMenuWidget *ms_epg) { ms_epg->addIntroItems(LOCALE_MISCSETTINGS_EPG_HEAD); - CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_EPG_SAVE, &g_settings.epg_save, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); - mc->setHint("", LOCALE_MENU_HINT_EPG_SAVE); - ms_epg->addItem(mc); + + 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); CStringInput * miscSettings_epg_cache = new CStringInput(LOCALE_MISCSETTINGS_EPG_CACHE, &g_settings.epg_cache, 2,LOCALE_MISCSETTINGS_EPG_CACHE_HINT1, LOCALE_MISCSETTINGS_EPG_CACHE_HINT2 , "0123456789 ", sectionsdConfigNotifier); - CMenuForwarder * mf = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_CACHE, true, g_settings.epg_cache, miscSettings_epg_cache); + CMenuForwarder * mf = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_CACHE, g_settings.epg_save, g_settings.epg_cache, miscSettings_epg_cache); mf->setHint("", LOCALE_MENU_HINT_EPG_CACHE); - ms_epg->addItem(mf); CStringInput * miscSettings_epg_cache_e = new CStringInput(LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE, &g_settings.epg_extendedcache, 3,LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE_HINT1, LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE_HINT2 , "0123456789 ", sectionsdConfigNotifier); - mf = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE, true, g_settings.epg_extendedcache, miscSettings_epg_cache_e); - mf->setHint("", LOCALE_MENU_HINT_EPG_EXTENDEDCACHE); - ms_epg->addItem(mf); + CMenuForwarder * mf1 = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_EXTENDEDCACHE, g_settings.epg_save, g_settings.epg_extendedcache, miscSettings_epg_cache_e); + mf1->setHint("", LOCALE_MENU_HINT_EPG_EXTENDEDCACHE); CStringInput * miscSettings_epg_old_events = new CStringInput(LOCALE_MISCSETTINGS_EPG_OLD_EVENTS, &g_settings.epg_old_events, 3,LOCALE_MISCSETTINGS_EPG_OLD_EVENTS_HINT1, LOCALE_MISCSETTINGS_EPG_OLD_EVENTS_HINT2 , "0123456789 ", sectionsdConfigNotifier); - mf = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_OLD_EVENTS, true, g_settings.epg_old_events, miscSettings_epg_old_events); - mf->setHint("", LOCALE_MENU_HINT_EPG_OLD_EVENTS); - ms_epg->addItem(mf); + CMenuForwarder * mf2 = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_OLD_EVENTS, g_settings.epg_save, g_settings.epg_old_events, miscSettings_epg_old_events); + mf2->setHint("", LOCALE_MENU_HINT_EPG_OLD_EVENTS); CStringInput * miscSettings_epg_max_events = new CStringInput(LOCALE_MISCSETTINGS_EPG_MAX_EVENTS, &g_settings.epg_max_events, 6,LOCALE_MISCSETTINGS_EPG_MAX_EVENTS_HINT1, LOCALE_MISCSETTINGS_EPG_MAX_EVENTS_HINT2 , "0123456789 ", sectionsdConfigNotifier); - mf = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_MAX_EVENTS, true, g_settings.epg_max_events, miscSettings_epg_max_events); - mf->setHint("", LOCALE_MENU_HINT_EPG_MAX_EVENTS); - ms_epg->addItem(mf); + CMenuForwarder * mf3 = new CMenuDForwarder(LOCALE_MISCSETTINGS_EPG_MAX_EVENTS, g_settings.epg_save, g_settings.epg_max_events, miscSettings_epg_max_events); + mf3->setHint("", LOCALE_MENU_HINT_EPG_MAX_EVENTS); - mf = new CMenuForwarder(LOCALE_MISCSETTINGS_EPG_DIR, true, g_settings.epg_dir, this, "epgdir"); - mf->setHint("", LOCALE_MENU_HINT_EPG_DIR); + 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(mf); + miscEpgNotifier->addItem(mf1); + miscEpgNotifier->addItem(mf2); + miscEpgNotifier->addItem(mf3); + 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); + + ms_epg->addItem(mc); + ms_epg->addItem(mc1); ms_epg->addItem(mf); + ms_epg->addItem(mf1); + ms_epg->addItem(mf2); + ms_epg->addItem(mf3); + ms_epg->addItem(mf4); + } //filebrowser settings diff --git a/src/gui/miscsettings_menu.h b/src/gui/miscsettings_menu.h index b05d0c68a..d9c0269fb 100644 --- a/src/gui/miscsettings_menu.h +++ b/src/gui/miscsettings_menu.h @@ -41,7 +41,7 @@ class CMiscMenue : public CMenuTarget CFanControlNotifier *fanNotifier; CSectionsdConfigNotifier* sectionsdConfigNotifier; COnOffNotifier* miscNotifier; - + COnOffNotifier* miscEpgNotifier; int width; int showMiscSettingsMenu(); diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 1fd5de186..adc0e056a 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -380,6 +380,7 @@ CMovieBrowser::~CMovieBrowser() m_playListLines.lineArray[i].clear(); m_FilterLines.lineArray[i].clear(); } + m_browserListLines.Icon.clear(); } void CMovieBrowser::fileInfoStale(void) @@ -408,6 +409,7 @@ void CMovieBrowser::fileInfoStale(void) m_playListLines.lineArray[i].clear(); m_FilterLines.lineArray[i].clear(); } + m_browserListLines.Icon.clear(); }; void CMovieBrowser::init(void) @@ -520,7 +522,6 @@ void CMovieBrowser::init(void) refreshBrowserList(); refreshFilterList(); g_PicViewer->getSupportedImageFormats(PicExts); - IsRecord = false; #if 0 TRACE_1("Frames\r\n\tScren:\t%3d,%3d,%3d,%3d\r\n\tMain:\t%3d,%3d,%3d,%3d\r\n\tTitle:\t%3d,%3d,%3d,%3d \r\n\tBrowsr:\t%3d,%3d,%3d,%3d \r\n\tPlay:\t%3d,%3d,%3d,%3d \r\n\tRecord:\t%3d,%3d,%3d,%3d\r\n\r\n", g_settings.screen_StartX, @@ -912,6 +913,7 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) int CMovieBrowser::exec(const char* path) { bool res = false; + menu_ret = menu_return::RETURN_REPAINT; TRACE("[mb] start MovieBrowser\r\n"); int timeout = -1; @@ -937,6 +939,7 @@ int CMovieBrowser::exec(const char* path) m_recordListLines.lineArray[i].clear(); m_playListLines.lineArray[i].clear(); } + m_browserListLines.Icon.clear(); m_selectedDir = path; @@ -1034,10 +1037,18 @@ int CMovieBrowser::exec(const char* path) else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites) { //FIXME do nothing ? } + else if ( msg == NeutrinoMessages::STANDBY_ON || + msg == NeutrinoMessages::SHUTDOWN || + msg == NeutrinoMessages::SLEEPTIMER) + { + menu_ret = menu_return::RETURN_EXIT_ALL; + loop = false; + g_RCInput->postMsg(msg, data); + } else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) { TRACE("[mb]->exec: getInstance\r\n"); - //res = menu_return::RETURN_EXIT_ALL; + menu_ret = menu_return::RETURN_EXIT_ALL; loop = false; } } @@ -1220,13 +1231,6 @@ void CMovieBrowser::refreshMovieInfo(void) m_pcInfo->setText(&emptytext); } else { - // Is record? - bool tmp = CRecordManager::getInstance()->IsFileRecord(m_movieSelectionHandler->file.Name); - if (tmp != IsRecord) { - IsRecord = tmp; - refreshFoot(); - } - bool logo_ok = false; int picw = (int)(((float)16 / (float)9) * (float)m_cBoxFrameInfo.iHeight); int pich = m_cBoxFrameInfo.iHeight; @@ -1507,6 +1511,7 @@ void CMovieBrowser::refreshBrowserList(void) //P1 m_browserListLines.lineArray[row].clear(); m_browserListLines.rowWidth[row] = m_settings.browserRowWidth[row]; m_browserListLines.lineHeader[row]= g_Locale->getText(m_localizedItemName[m_settings.browserRowItem[row]]); + m_browserListLines.Icon.clear(); } m_vHandleBrowserList.clear(); @@ -1544,8 +1549,13 @@ void CMovieBrowser::refreshBrowserList(void) //P1 if(m_settings.browserRowItem[row] == MB_INFO_TITLE) getMovieInfoItem(*m_vHandleBrowserList[handle], MB_INFO_FILENAME, &string_item); } + m_browserListLines.lineArray[row].push_back(string_item); } + if (CRecordManager::getInstance()->getRecordInstance(m_vHandleBrowserList[handle]->file.Name) != NULL) + m_browserListLines.Icon.push_back(NEUTRINO_ICON_REC); + else + m_browserListLines.Icon.push_back(""); } m_pcBrowser->setLines(&m_browserListLines); @@ -1629,13 +1639,9 @@ void CMovieBrowser::refreshFoot(void) m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_OKAY, &iw, &ih); m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, m_cBoxFrame.iX+xpos1+width*2, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY, m_cBoxFrameFootRel.iHeight+ 6); m_pcFontFoot->RenderString(m_cBoxFrame.iX+xpos1+width*2 + 10 + iw, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + m_cBoxFrameFootRel.iHeight + 4 , width-30, ok_text.c_str(), (CFBWindow::color_t)color, 0, true); // UTF-8 - - if (IsRecord == false) { - //delete icon - m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_SMALL, &iw, &ih); - m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_MUTE_SMALL, m_cBoxFrame.iX+xpos1+width*3, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY, m_cBoxFrameFootRel.iHeight+ 6); - m_pcFontFoot->RenderString(m_cBoxFrame.iX+xpos1+width*3 + 10 + iw , m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + m_cBoxFrameFootRel.iHeight + 4 , width-30, g_Locale->getText(LOCALE_FILEBROWSER_DELETE), (CFBWindow::color_t)color, 0, true); // UTF-8 - } + m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_SMALL, &iw, &ih); + m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_MUTE_SMALL, m_cBoxFrame.iX+xpos1+width*3, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY, m_cBoxFrameFootRel.iHeight+ 6); + m_pcFontFoot->RenderString(m_cBoxFrame.iX+xpos1+width*3 + 10 + iw , m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + m_cBoxFrameFootRel.iHeight + 4 , width-30, g_Locale->getText(LOCALE_FILEBROWSER_DELETE), (CFBWindow::color_t)color, 0, true); // UTF-8 } @@ -1731,8 +1737,32 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) } else if (msg == CRCInput::RC_spkr) { - if ((!m_vMovieInfo.empty()) && (m_movieSelectionHandler != NULL) && (IsRecord == false)) - onDeleteFile(*m_movieSelectionHandler); + if ((!m_vMovieInfo.empty()) && (m_movieSelectionHandler != NULL)) { + bool onDelete = true; + bool skipAsk = false; + CRecordInstance* inst = CRecordManager::getInstance()->getRecordInstance(m_movieSelectionHandler->file.Name); + if (inst != NULL) { + std::string delName = m_movieSelectionHandler->epgTitle; + if (delName == "") + delName = m_movieSelectionHandler->file.getFileName(); + char buf1[1024]; + memset(buf1, '\0', sizeof(buf1)); + snprintf(buf1, sizeof(buf1)-1, g_Locale->getText(LOCALE_MOVIEBROWSER_ASK_REC_TO_DELETE), delName.c_str()); + if(ShowMsgUTF(LOCALE_RECORDINGMENU_RECORD_IS_RUNNING, buf1, + CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrNo) + onDelete = false; + else { + CTimerd::RecordingStopInfo recinfo; + recinfo.channel_id = inst->GetChannelId(); + recinfo.eventID = inst->GetRecordingId(); + CRecordManager::getInstance()->Stop(&recinfo); + g_Timerd->removeTimerEvent(recinfo.eventID); + skipAsk = true; + } + } + if (onDelete) + onDeleteFile(*m_movieSelectionHandler, skipAsk); + } } else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) { @@ -2036,7 +2066,7 @@ bool CMovieBrowser::onButtonPressMovieInfoList(neutrino_msg_t msg) return (result); } -void CMovieBrowser::onDeleteFile(MI_MOVIE_INFO& movieSelectionHandler) +void CMovieBrowser::onDeleteFile(MI_MOVIE_INFO& movieSelectionHandler, bool skipAsk) { //TRACE( "[onDeleteFile] "); int test= movieSelectionHandler.file.Name.find(".ts"); @@ -2059,8 +2089,10 @@ void CMovieBrowser::onDeleteFile(MI_MOVIE_INFO& movieSelectionHandler) msg += "\r\n "; msg += g_Locale->getText(LOCALE_FILEBROWSER_DODELETE2); - if (ShowMsgUTF(LOCALE_FILEBROWSER_DELETE, msg, CMessageBox::mbrYes, CMessageBox::mbYes|CMessageBox::mbNo)==CMessageBox::mbrYes) + if ((skipAsk) || (ShowMsgUTF(LOCALE_FILEBROWSER_DELETE, msg, CMessageBox::mbrYes, CMessageBox::mbYes|CMessageBox::mbNo)==CMessageBox::mbrYes)) { + CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_MOVIEBROWSER_DELETE_INFO)); + hintBox->paint(); delFile(movieSelectionHandler.file); #if 1 @@ -2087,6 +2119,9 @@ void CMovieBrowser::onDeleteFile(MI_MOVIE_INFO& movieSelectionHandler) //delFile(file_xml); unlink(file_xml.Name.c_str()); } + hintBox->hide(); + delete hintBox; + g_RCInput->clearRCMsg(); m_vMovieInfo.erase( (std::vector::iterator)&movieSelectionHandler); TRACE("List size: %d\n", m_vMovieInfo.size()); @@ -2812,7 +2847,7 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) /********************************************************************/ /** bookmark ******************************************************/ - CStringInput* pBookNameInput[MAX_NUMBER_OF_BOOKMARK_ITEMS]; + CStringInputSMS* pBookNameInput[MAX_NUMBER_OF_BOOKMARK_ITEMS]; CIntInput* pBookPosIntInput[MAX_NUMBER_OF_BOOKMARK_ITEMS]; CIntInput* pBookTypeIntInput[MAX_NUMBER_OF_BOOKMARK_ITEMS]; CMenuWidget* pBookItemMenu[MAX_NUMBER_OF_BOOKMARK_ITEMS]; @@ -2833,7 +2868,7 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) for(int li =0 ; li < MI_MOVIE_BOOK_USER_MAX && li < MAX_NUMBER_OF_BOOKMARK_ITEMS; li++ ) { - pBookNameInput[li] = new CStringInput (LOCALE_MOVIEBROWSER_EDIT_BOOK, &movie_info->bookmarks.user[li].name, 20, LOCALE_MOVIEBROWSER_EDIT_BOOK_NAME_INFO1, LOCALE_MOVIEBROWSER_EDIT_BOOK_NAME_INFO2, "abcdefghijklmnopqrstuvwxyz0123456789-.: "); + pBookNameInput[li] = new CStringInputSMS (LOCALE_MOVIEBROWSER_EDIT_BOOK, &movie_info->bookmarks.user[li].name, 20, LOCALE_MOVIEBROWSER_EDIT_BOOK_NAME_INFO1, LOCALE_MOVIEBROWSER_EDIT_BOOK_NAME_INFO2, "abcdefghijklmnopqrstuvwxyz0123456789-.: "); pBookPosIntInput[li] = new CIntInput (LOCALE_MOVIEBROWSER_EDIT_BOOK, (int&) movie_info->bookmarks.user[li].pos, 20, LOCALE_MOVIEBROWSER_EDIT_BOOK_POS_INFO1, LOCALE_MOVIEBROWSER_EDIT_BOOK_POS_INFO2); pBookTypeIntInput[li] = new CIntInput (LOCALE_MOVIEBROWSER_EDIT_BOOK, (int&) movie_info->bookmarks.user[li].length, 20, LOCALE_MOVIEBROWSER_EDIT_BOOK_TYPE_INFO1, LOCALE_MOVIEBROWSER_EDIT_BOOK_TYPE_INFO2); @@ -2848,7 +2883,7 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) /********************************************************************/ /** serie******************************************************/ - CStringInput serieUserInput(LOCALE_MOVIEBROWSER_EDIT_SERIE, &movie_info->serieName, 20, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789-.: "); + CStringInputSMS serieUserInput(LOCALE_MOVIEBROWSER_EDIT_SERIE, &movie_info->serieName, 20, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789-.: "); CMenuWidget serieMenu (LOCALE_MOVIEBROWSER_HEAD, NEUTRINO_ICON_MOVIEPLAYER); serieMenu.addIntroItems(LOCALE_MOVIEBROWSER_SERIE_HEAD); @@ -2891,14 +2926,14 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) snprintf(size,BUFFER_SIZE,"%5llu",movie_info->file.Size>>20); } - CStringInput titelUserInput(LOCALE_MOVIEBROWSER_INFO_TITLE, &movie_info->epgTitle, MAX_STRING, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789-.: "); + CStringInputSMS titelUserInput(LOCALE_MOVIEBROWSER_INFO_TITLE, &movie_info->epgTitle, (movie_info->epgTitle.empty() || (movie_info->epgTitle.size() < MAX_STRING)) ? MAX_STRING:movie_info->epgTitle.size(), NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789-.: "); //CStringInputSMS titelUserInput(LOCALE_MOVIEBROWSER_INFO_TITLE, &movie_info->epgTitle, MAX_STRING, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789-.: "); - CStringInput channelUserInput(LOCALE_MOVIEBROWSER_INFO_CHANNEL, &movie_info->epgChannel, 15, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789-.: "); - CStringInput epgUserInput(LOCALE_MOVIEBROWSER_INFO_INFO1, &movie_info->epgInfo1, 20, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789-.: "); + CStringInputSMS channelUserInput(LOCALE_MOVIEBROWSER_INFO_CHANNEL, &movie_info->epgChannel, MAX_STRING, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789-.: "); + CStringInputSMS epgUserInput(LOCALE_MOVIEBROWSER_INFO_INFO1, &movie_info->epgInfo1, 20, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789-.: "); CDateInput dateUserDateInput(LOCALE_MOVIEBROWSER_INFO_LENGTH, &movie_info->dateOfLastPlay, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); CDateInput recUserDateInput(LOCALE_MOVIEBROWSER_INFO_LENGTH, &movie_info->file.Time, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); CIntInput lengthUserIntInput(LOCALE_MOVIEBROWSER_INFO_LENGTH, (int&)movie_info->length, 3, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); - CStringInput countryUserInput(LOCALE_MOVIEBROWSER_INFO_PRODCOUNTRY, &movie_info->productionCountry, 11, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "ABCDEFGHIJKLMNOPQRSTUVWXYZ "); + CStringInputSMS countryUserInput(LOCALE_MOVIEBROWSER_INFO_PRODCOUNTRY, &movie_info->productionCountry, 11, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "ABCDEFGHIJKLMNOPQRSTUVWXYZ "); CIntInput yearUserIntInput(LOCALE_MOVIEBROWSER_INFO_PRODYEAR, (int&)movie_info->productionDate, 4, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); CMenuWidget movieInfoMenu(LOCALE_MOVIEBROWSER_HEAD, NEUTRINO_ICON_MOVIEPLAYER /*,m_cBoxFrame.iWidth*/); //TODO: check diff --git a/src/gui/moviebrowser.h b/src/gui/moviebrowser.h index a18f19fe3..154b7364f 100644 --- a/src/gui/moviebrowser.h +++ b/src/gui/moviebrowser.h @@ -294,8 +294,6 @@ class CMovieBrowser : public CMenuTarget MB_SETTINGS m_settings; std::vector m_dir; - bool IsRecord; - int movieInfoUpdateAll[MB_INFO_MAX_NUMBER]; int movieInfoUpdateAllIfDestEmptyOnly; @@ -303,6 +301,7 @@ class CMovieBrowser : public CMenuTarget std::string getScreenshotName(std::string movie); //bool restart_mb_timeout; + int menu_ret; public: // Functions //////////////////////////////////////////////////////////7 CMovieBrowser(const char* path); //P1 @@ -324,6 +323,7 @@ class CMovieBrowser : public CMenuTarget bool delFile(CFile& file); bool delFile_vlc(CFile& file); bool delFile_std(CFile& file); + int getMenuRet() { return menu_ret; } private: //Functions ///// MovieBrowser init /////////////// @@ -366,7 +366,7 @@ class CMovieBrowser : public CMenuTarget void onSetGUIWindow(MB_GUI gui); void onSetGUIWindowNext(void); void onSetGUIWindowPrev(void); - void onDeleteFile(MI_MOVIE_INFO& movieSelectionHandler); // P4 + void onDeleteFile(MI_MOVIE_INFO& movieSelectionHandler, bool skipAsk = false); // P4 bool onSortMovieInfoHandleList(std::vector& pv_handle_list, MB_INFO_ITEM sort_type, MB_DIRECTION direction); ///// parse Storage Directories ///////////// diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 14df92259..4c8514d89 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -223,7 +223,7 @@ int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey) timeshift = 0; return menu_return::RETURN_EXIT_ALL; } - return menu_return::RETURN_REPAINT; + return menu_ret; //menu_return::RETURN_REPAINT; } void CMoviePlayerGui::updateLcd() @@ -286,6 +286,7 @@ void CMoviePlayerGui::fillPids() bool CMoviePlayerGui::SelectFile() { bool ret = false; + menu_ret = menu_return::RETURN_REPAINT; /*clear audiopids */ for (int i = 0; i < numpida; i++) { @@ -344,7 +345,8 @@ bool CMoviePlayerGui::SelectFile() ret = true; } - } + } else + menu_ret = moviebrowser->getMenuRet(); } else { // filebrowser if (filebrowser->exec(Path_local.c_str()) == true) { @@ -380,7 +382,8 @@ bool CMoviePlayerGui::SelectFile() } } } - } + } else + menu_ret = filebrowser->getMenuRet(); } if(ret && file_name.empty()) { std::string::size_type pos = full_name.find_last_of('/'); @@ -403,6 +406,7 @@ void CMoviePlayerGui::PlayFile(void) { neutrino_msg_t msg; neutrino_msg_data_t data; + menu_ret = menu_return::RETURN_REPAINT; int position = 0, duration = 0; bool first_start_timeshift = false; @@ -496,7 +500,9 @@ void CMoviePlayerGui::PlayFile(void) #ifdef DEBUG printf("CMoviePlayerGui::PlayFile: speed %d position %d duration %d (%d, %d%%)\n", speed, position, duration, duration-position, file_prozent); #endif - if (duration - position < 1000 && !timeshift) + /* in case ffmpeg report incorrect values */ + int posdiff = duration - position; + if ((posdiff > 0) && (posdiff < 1000) && !timeshift) { /* 10 seconds after end-of-file, stop */ if (++eof > 10) @@ -651,6 +657,9 @@ void CMoviePlayerGui::PlayFile(void) msg == NeutrinoMessages::SHUTDOWN || msg == NeutrinoMessages::SLEEPTIMER) { // Exit for Record/Zapto Timers printf("CMoviePlayerGui::PlayFile: ZAPTO etc..\n"); + if(msg != NeutrinoMessages::ZAPTO) + menu_ret = menu_return::RETURN_EXIT_ALL; + playstate = CMoviePlayerGui::STOPPED; g_RCInput->postMsg(msg, data); } else if (msg == CRCInput::RC_timeout) { @@ -661,6 +670,7 @@ void CMoviePlayerGui::PlayFile(void) if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) { printf("CMoviePlayerGui::PlayFile: neutrino handleMsg messages_return::cancel_all\n"); playstate = CMoviePlayerGui::STOPPED; + menu_ret = menu_return::RETURN_EXIT_ALL; } else if ( msg <= CRCInput::RC_MaxRC ) { update_lcd = true; diff --git a/src/gui/movieplayer.h b/src/gui/movieplayer.h index 31125f1a1..8217045e8 100644 --- a/src/gui/movieplayer.h +++ b/src/gui/movieplayer.h @@ -94,6 +94,7 @@ class CMoviePlayerGui : public CMenuTarget CFileBrowser * filebrowser; CFileFilter tsfilefilter; std::string Path_local; + int menu_ret; /* playback from bookmark */ CBookmarkManager * bookmarkmanager; diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 3165df49b..866f2813a 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -101,6 +101,9 @@ CPictureViewerGui::CPictureViewerGui() picture_filter.addFilter("jpeg"); picture_filter.addFilter("gif"); picture_filter.addFilter("crw"); + + decodeT = 0; + decodeTflag = false; } //------------------------------------------------------------------------ @@ -109,6 +112,12 @@ CPictureViewerGui::~CPictureViewerGui() { playlist.clear(); delete m_viewer; + + if (decodeT) + { + pthread_cancel(decodeT); + decodeT = 0; + } } //------------------------------------------------------------------------ @@ -225,6 +234,9 @@ int CPictureViewerGui::show() bool loop=true; bool update=true; + if (audioplayer) + m_currentTitle = m_audioPlayer->getAdioPayerM_currend(); + while (loop) { if (update) @@ -544,6 +556,35 @@ int CPictureViewerGui::show() CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, g_Locale->getText(LOCALE_PICTUREVIEWER_HEAD)); } } + else if (((msg==CRCInput::RC_plus) || (msg==CRCInput::RC_minus)) && decodeTflag) + { + // FIXME: do not accept volume-keys while decoding + } + // control keys for audioplayer + else if (audioplayer && msg==CRCInput::RC_pause) + { + m_currentTitle = m_audioPlayer->getAdioPayerM_currend(); + m_audioPlayer->pause(); + } + else if (audioplayer && msg==CRCInput::RC_stop) + { + m_currentTitle = m_audioPlayer->getAdioPayerM_currend(); + m_audioPlayer->stop(); + } + else if (audioplayer && msg==CRCInput::RC_play) + { + m_currentTitle = m_audioPlayer->getAdioPayerM_currend(); + if (m_currentTitle > -1) + m_audioPlayer->play((unsigned int)m_currentTitle); + } + else if (audioplayer && msg==CRCInput::RC_forward) + { + m_audioPlayer->playNext(); + } + else if (audioplayer && msg==CRCInput::RC_rewind) + { + m_audioPlayer->playPrev(); + } else if (msg == NeutrinoMessages::CHANGEMODE) { if ((data & NeutrinoMessages::mode_mask) !=NeutrinoMessages::mode_pic) @@ -726,6 +767,10 @@ void CPictureViewerGui::paint() void CPictureViewerGui::view(unsigned int index, bool unscaled) { + if (decodeTflag) + return; + + m_unscaled = unscaled; selected=index; CVFD::getInstance()->showMenuText(0, playlist[index].Name.c_str()); @@ -733,26 +778,59 @@ void CPictureViewerGui::view(unsigned int index, bool unscaled) strftime(timestring, 18, "%d-%m-%Y %H:%M", gmtime(&playlist[index].Date)); //CVFD::getInstance()->showMenuText(1, timestring); //FIXME - if (unscaled) - m_viewer->DecodeImage(playlist[index].Filename, true, unscaled); - m_viewer->ShowImage(playlist[index].Filename, unscaled); + if (m_state==MENU) + m_state=VIEW; + //decode and view in a seperate thread + if (!decodeTflag) { + decodeTflag=true; + pthread_create(&decodeT, NULL, decodeThread, (void*) this); + pthread_detach(decodeT); + } +} + +void* CPictureViewerGui::decodeThread(void *arg) +{ + CPictureViewerGui *PictureViewerGui = (CPictureViewerGui*) arg; + + pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, NULL); + pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, NULL); + + PictureViewerGui->thrView(); + + PictureViewerGui->decodeTflag=false; + pthread_exit(NULL); +} + +void CPictureViewerGui::thrView() +{ + if (m_unscaled) + m_viewer->DecodeImage(playlist[selected].Filename, true, m_unscaled); + + m_viewer->ShowImage(playlist[selected].Filename, m_unscaled); + +#if 0 //Decode next unsigned int next=selected+1; if (next > playlist.size()-1) next=0; - if (m_state==MENU) - m_state=VIEW; if (m_state==VIEW) m_viewer->DecodeImage(playlist[next].Filename,true); else m_viewer->DecodeImage(playlist[next].Filename,false); +#endif } void CPictureViewerGui::endView() { if (m_state != MENU) m_state=MENU; + + if (decodeTflag) + { + decodeTflag=false; + pthread_cancel(decodeT); + } } void CPictureViewerGui::deletePicFile(unsigned int index, bool mode) @@ -798,8 +876,16 @@ void CPictureViewerGui::showHelp() helpbox.addLine(NEUTRINO_ICON_BUTTON_5, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP20)); helpbox.addLine(NEUTRINO_ICON_BUTTON_0, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP21)); helpbox.addLine(NEUTRINO_ICON_BUTTON_HOME, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP22)); - - helpbox.addLine("Version: $Revision: 1.57 $"); + if(audioplayer) + { + helpbox.addPagebreak(); + helpbox.addLine(g_Locale->getText(LOCALE_PICTUREVIEWER_HELP30)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_PLAY, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP31)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_PAUSE, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP32)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_STOP, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP33)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_FORWARD, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP34)); + helpbox.addLine(NEUTRINO_ICON_BUTTON_BACKWARD, g_Locale->getText(LOCALE_PICTUREVIEWER_HELP35)); + } hide(); helpbox.show(LOCALE_MESSAGEBOX_INFO); } diff --git a/src/gui/pictureviewer.h b/src/gui/pictureviewer.h index 0909d6ef4..4e98071ae 100644 --- a/src/gui/pictureviewer.h +++ b/src/gui/pictureviewer.h @@ -111,6 +111,14 @@ class CPictureViewerGui : public CMenuTarget void deletePicFile(unsigned int index, bool mode); bool audioplayer; + int m_currentTitle; + + pthread_t decodeT; + static void* decodeThread(void *arg); + bool decodeTflag; + + void thrView(); + bool m_unscaled; public: CPictureViewerGui(); diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index 94357d8b6..b9b01188f 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -473,6 +473,8 @@ void CStreamInfo2::paint_techinfo(int xpos, int ypos) if(channel->getVideoPid() && !(videoDecoder->getBlank())){ videoDecoder->getPictureInfo(xres, yres, framerate); + if (yres == 1088) + yres = 1080; aspectRatio = videoDecoder->getAspectRatio(); } diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 406e10ef5..c0c15595a 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -734,6 +734,21 @@ void CTimerList::paintItem(int pos) g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13+(real_width-fw*23)/2,ypos+fheight, (real_width-fw*13)/2-5, srepeatcount, color, fheight, true); // UTF-8 } g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13+(real_width-fw*13)/2,ypos+fheight, (real_width-fw*13)/2-5, convertTimerType2String(timer.eventType), color, fheight, true); // UTF-8 + + // paint rec icon when recording in progress + if ((timer.eventType == CTimerd::TIMER_RECORD) && (CRecordManager::getInstance()->RecordingStatus(timer.channel_id))) { + CTimerd::RecordingStopInfo recinfo; + recinfo.channel_id = timer.channel_id; + recinfo.eventID = timer.eventID; + if (CRecordManager::getInstance()->IsRecording(&recinfo)) { + int icol_w, icol_h; + frameBuffer->getIconSize(NEUTRINO_ICON_REC, &icol_w, &icol_h); + if ((icol_w > 0) && (icol_h > 0)) { + frameBuffer->paintIcon(NEUTRINO_ICON_REC, (x + real_width) - (icol_w + 8), ypos, 2*fheight); + } + } + } + std::string zAddData(""); switch (timer.eventType) { diff --git a/src/gui/update.cpp b/src/gui/update.cpp index 591dcaba9..86a30055f 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -243,7 +243,7 @@ bool CFlashUpdate::selectHttpImage(void) else ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_NEW_NOTFOUND), CMessageBox::mbrOk, CMessageBox::mbOk, NEUTRINO_ICON_INFO); - SelectionWidget.exec(NULL, ""); + menu_ret = SelectionWidget.exec(NULL, ""); for (std::vector::iterator it = update_t_list.begin(); it != update_t_list.end(); ++it) delete (*it); @@ -287,9 +287,9 @@ bool CFlashUpdate::checkVersion4Update() CFlashVersionInfo * versionInfo; neutrino_locale_t msg_body; #ifdef DEBUG -printf("[update] mode is %d\n", g_settings.softupdate_mode); +printf("[update] mode is %d\n", softupdate_mode); #endif - if(g_settings.softupdate_mode==1) //internet-update + if(softupdate_mode==1) //internet-update { if(!selectHttpImage()) return false; @@ -343,8 +343,10 @@ printf("[update] mode is %d\n", g_settings.softupdate_mode); UpdatesBrowser.Filter = &UpdatesFilter; CFile * CFileSelected = NULL; - if (!(UpdatesBrowser.exec(g_settings.update_dir))) + if (!(UpdatesBrowser.exec(g_settings.update_dir))) { + menu_ret = UpdatesBrowser.getMenuRet(); return false; + } CFileSelected = UpdatesBrowser.getSelectedFile(); @@ -381,11 +383,18 @@ printf("[update] mode is %d\n", g_settings.softupdate_mode); return (ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, msg, CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) == CMessageBox::mbrYes); // UTF-8 } -int CFlashUpdate::exec(CMenuTarget* parent, const std::string &) +int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey) { + printf("CFlashUpdate::exec: [%s]\n", actionKey.c_str()); + if (actionKey == "local") + softupdate_mode = 0; + else + softupdate_mode = 1; + if(parent) parent->hide(); + menu_ret = menu_return::RETURN_REPAINT; paint(); if(sysfs.size() < 8) { @@ -395,7 +404,7 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &) } if(!checkVersion4Update()) { hide(); - return menu_return::RETURN_REPAINT; + return menu_ret; //menu_return::RETURN_REPAINT; } #ifdef VFD_UPDATE @@ -407,7 +416,7 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &) paint(); showGlobalStatus(20); - if(g_settings.softupdate_mode==1) //internet-update + if(softupdate_mode==1) //internet-update { char const * fname = rindex(filename.c_str(), '/') +1; char fullname[255]; @@ -429,12 +438,12 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &) ft.setStatusViewer(this); showStatusMessageUTF(g_Locale->getText(LOCALE_FLASHUPDATE_MD5CHECK)); // UTF-8 - if((g_settings.softupdate_mode==1) && !ft.check_md5(filename, file_md5)) { + if((softupdate_mode==1) && !ft.check_md5(filename, file_md5)) { hide(); ShowHintUTF(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_FLASHUPDATE_MD5SUMERROR)); // UTF-8 return menu_return::RETURN_REPAINT; } - if(g_settings.softupdate_mode==1) { //internet-update + if(softupdate_mode==1) { //internet-update if ( ShowMsgUTF(LOCALE_MESSAGEBOX_INFO, (fileType < '3') ? "Flash downloaded image ?" : "Install downloaded pack ?", CMessageBox::mbrYes, CMessageBox::mbYes | CMessageBox::mbNo, NEUTRINO_ICON_UPDATE) != CMessageBox::mbrYes) // UTF-8 { hide(); diff --git a/src/gui/update.h b/src/gui/update.h index 98122db86..8d9a30266 100644 --- a/src/gui/update.h +++ b/src/gui/update.h @@ -53,6 +53,8 @@ class CFlashUpdate : public CProgressWindow std::string installedVersion; std::string newVersion; + int menu_ret; + int softupdate_mode; bool selectHttpImage(void); bool getUpdateImage(const std::string & version); diff --git a/src/gui/update_menue.cpp b/src/gui/update_menue.cpp index e5f38e0e9..c93a40ec5 100644 --- a/src/gui/update_menue.cpp +++ b/src/gui/update_menue.cpp @@ -82,14 +82,24 @@ int CSoftwareUpdate::showSoftwareUpdate() //flashing CFlashUpdate flash; +#if 0 neutrino_locale_t up_text = (g_settings.softupdate_mode == 0) ? LOCALE_FLASHUPDATE_CHECKUPDATE_LOCAL : LOCALE_FLASHUPDATE_CHECKUPDATE_INTERNET; update_item = new CMenuForwarder(up_text, true, NULL, &flash, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); update_item->setHint("", LOCALE_MENU_HINT_SOFTUPDATE_CHECK); softUpdate.addItem(update_item); +#endif + + update_item = new CMenuForwarder(LOCALE_FLASHUPDATE_CHECKUPDATE_INTERNET, true, NULL, &flash, "inet", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); + update_item->setHint("", LOCALE_MENU_HINT_SOFTUPDATE_CHECK); + softUpdate.addItem(update_item); + + update_item = new CMenuForwarder(LOCALE_FLASHUPDATE_CHECKUPDATE_LOCAL, true, NULL, &flash, "local", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); + update_item->setHint("", LOCALE_MENU_HINT_SOFTUPDATE_CHECK_LOCAL); + softUpdate.addItem(update_item); //settings CUpdateSettings update_settings(update_item); - mf = new CMenuForwarder(LOCALE_FLASHUPDATE_SETTINGS, true, NULL, &update_settings, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); + mf = new CMenuForwarder(LOCALE_FLASHUPDATE_SETTINGS, true, NULL, &update_settings, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW); mf->setHint("", LOCALE_MENU_HINT_SOFTUPDATE_SETTINGS); softUpdate.addItem(mf); @@ -98,7 +108,7 @@ int CSoftwareUpdate::showSoftwareUpdate() //expert-functions CMenuWidget mtdexpert(LOCALE_FLASHUPDATE_EXPERTFUNCTIONS, NEUTRINO_ICON_UPDATE, width, MN_WIDGET_ID_MTDEXPERT); showSoftwareUpdateExpert(&mtdexpert); - mf = new CMenuForwarder(LOCALE_FLASHUPDATE_EXPERTFUNCTIONS, true, NULL, &mtdexpert, NULL, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW); + mf = new CMenuForwarder(LOCALE_FLASHUPDATE_EXPERTFUNCTIONS, true, NULL, &mtdexpert, NULL, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE); mf->setHint("", LOCALE_MENU_HINT_SOFTUPDATE_EXPERT); softUpdate.addItem(mf); diff --git a/src/gui/update_settings.cpp b/src/gui/update_settings.cpp index 07de21474..fecfa1912 100644 --- a/src/gui/update_settings.cpp +++ b/src/gui/update_settings.cpp @@ -1,27 +1,27 @@ /* Neutrino-GUI - DBoxII-Project - + Update settings implementation - Neutrino-GUI - + Copyright (C) 2001 Steffen Hehn 'McClean' and some other guys Homepage: http://dbox.cyberphoria.org/ - + Copyright (C) 2012 T. Graf 'dbt' Homepage: http://www.dbox2-tuning.net/ - + License: GPL - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, @@ -70,32 +70,32 @@ int CUpdateSettings::exec(CMenuTarget* parent, const std::string &actionKey) { dprintf(DEBUG_DEBUG, "init software-update settings\n"); int res = menu_return::RETURN_REPAINT; - + if (parent) parent->hide(); - + if(actionKey == "update_dir") { const char *action_str = "update"; if(chooserDir(g_settings.update_dir, true, action_str, sizeof(g_settings.update_dir)-1)) printf("[neutrino] new %s dir %s\n", action_str, g_settings.update_dir); - + return res; } #ifndef USE_SMS_INPUT else if(actionKey == "select_url_config_file"){ CFileBrowser fileBrowser; CFileFilter fileFilter; - + fileFilter.addFilter("conf"); fileFilter.addFilter("urls"); fileBrowser.Filter = &fileFilter; - if (fileBrowser.exec("/var/etc") == true) + if (fileBrowser.exec("/var/etc") == true) strncpy(g_settings.softupdate_url_file, fileBrowser.getSelectedFile()->Name.c_str(), 30); - + return res; } #endif - + res = initMenu(); return res; } @@ -104,31 +104,37 @@ int CUpdateSettings::exec(CMenuTarget* parent, const std::string &actionKey) int CUpdateSettings::initMenu() { CMenuWidget w_upsettings(LOCALE_SERVICEMENU_UPDATE, NEUTRINO_ICON_UPDATE, width, MN_WIDGET_ID_SOFTWAREUPDATE_SETTINGS); - + w_upsettings.addIntroItems(LOCALE_FLASHUPDATE_SETTINGS); - + +#if 0 #ifdef USE_SMS_INPUT CMenuForwarder * fw_url = new CMenuForwarder(LOCALE_FLASHUPDATE_URL_FILE, g_settings.softupdate_mode, g_settings.softupdate_url_file, input_url_file, NULL, CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); #else CMenuForwarder * fw_url = new CMenuForwarder(LOCALE_FLASHUPDATE_URL_FILE, g_settings.softupdate_mode, g_settings.softupdate_url_file, this, "select_url_config_file", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); #endif CMenuForwarder * fw_update_dir = new CMenuForwarder(LOCALE_EXTRA_UPDATE_DIR, !g_settings.softupdate_mode, g_settings.update_dir , this, "update_dir", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); - + CUrlConfigSetupNotifier url_setup_notifier(fw_url, fw_update_dir, updateItem); - + CMenuOptionChooser *oj_mode = new CMenuOptionChooser(LOCALE_FLASHUPDATE_UPDATEMODE, &g_settings.softupdate_mode, FLASHUPDATE_UPDATEMODE_OPTIONS, FLASHUPDATE_UPDATEMODE_OPTION_COUNT, true, &url_setup_notifier); - +#endif + + CMenuForwarder * fw_url = new CMenuForwarder(LOCALE_FLASHUPDATE_URL_FILE, true, g_settings.softupdate_url_file, this, "select_url_config_file", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); + CMenuForwarder * fw_update_dir = new CMenuForwarder(LOCALE_EXTRA_UPDATE_DIR, true, g_settings.update_dir , this, "update_dir", CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); +#if 0 w_upsettings.addItem(oj_mode, true); w_upsettings.addItem(GenericMenuSeparatorLine); +#endif w_upsettings.addItem(fw_update_dir); w_upsettings.addItem(fw_url); - + int res = w_upsettings.exec (NULL, ""); - + return res; } - +#if 0 CUrlConfigSetupNotifier::CUrlConfigSetupNotifier( CMenuItem* i1, CMenuItem* i2, CMenuForwarder * f1) { toDisable[0] = i1; @@ -149,3 +155,4 @@ bool CUrlConfigSetupNotifier::changeNotify(const neutrino_locale_t, void *) } return false; } +#endif diff --git a/src/gui/widget/icons.h b/src/gui/widget/icons.h index fa5a77fdd..8a3685cc2 100644 --- a/src/gui/widget/icons.h +++ b/src/gui/widget/icons.h @@ -61,6 +61,10 @@ #define NEUTRINO_ICON_BUTTON_DOWN_SMALL "down_small" #define NEUTRINO_ICON_BUTTON_LEFT "left" +#define NEUTRINO_ICON_BUTTON_BACKWARD "btn_backward" +#define NEUTRINO_ICON_BUTTON_FORWARD "btn_forward" +#define NEUTRINO_ICON_BUTTON_PAUSE "btn_pause" +#define NEUTRINO_ICON_BUTTON_PLAY "btn_play" #define NEUTRINO_ICON_BUTTON_RECORD_ACTIVE "btn_record_active" #define NEUTRINO_ICON_BUTTON_RECORD_INACTIVE "btn_record_inactive" #define NEUTRINO_ICON_BUTTON_STOP "btn_stop" diff --git a/src/gui/widget/listframe.cpp b/src/gui/widget/listframe.cpp index 8a9678ede..437cdd0c9 100644 --- a/src/gui/widget/listframe.cpp +++ b/src/gui/widget/listframe.cpp @@ -389,6 +389,20 @@ void CListFrame::refreshScroll(void) } } +int CListFrame::paintListIcon(int x, int y, int line) +{ + int xDiff = 0; + if ((!m_pLines->Icon.empty()) && (m_pLines->Icon[line] != "")) { + int icol_w, icol_h; + frameBuffer->getIconSize(m_pLines->Icon[line].c_str(), &icol_w, &icol_h); + if ((icol_w > 0) && (icol_h > 0)) { + frameBuffer->paintIcon(m_pLines->Icon[line], x+m_cFrame.iX, y+m_cFrame.iY-m_nFontListHeight, m_nFontListHeight); + xDiff = icol_w + TEXT_BORDER_WIDTH; + } + } + return xDiff; +} + void CListFrame::refreshList(void) { //TRACE("[CListFrame]->refreshList: %d\r\n",m_nCurrentLine); @@ -417,6 +431,9 @@ void CListFrame::refreshList(void) int width; int x = m_cFrameListRel.iX + TEXT_BORDER_WIDTH; y += m_nFontListHeight; + + int xDiff = paintListIcon(x, y, line); + int net_width = m_cFrameListRel.iWidth - ROW_BORDER_WIDTH * (m_pLines->rows - 1); for(int row = 0; row < m_pLines->rows; row++) { @@ -426,8 +443,10 @@ void CListFrame::refreshList(void) width = m_cFrameListRel.iWidth - x + m_cFrameListRel.iX - TEXT_BORDER_WIDTH; //TRACE(" normalize width to %d , x:%d \r\n",width,x); } - m_pcFontList->RenderString(x+m_cFrame.iX, y+m_cFrame.iY, - width, m_pLines->lineArray[row][line].c_str(), + if (row > 0) + xDiff = 0; + m_pcFontList->RenderString(x+m_cFrame.iX+xDiff, y+m_cFrame.iY, + width-xDiff, m_pLines->lineArray[row][line].c_str(), color, 0, true); // UTF-8 x += width + ROW_BORDER_WIDTH; } @@ -462,13 +481,18 @@ void CListFrame::refreshLine(int line) int width; int x = m_cFrameListRel.iX + TEXT_BORDER_WIDTH; y += m_nFontListHeight; + + int xDiff = paintListIcon(x, y, line); + int net_width = m_cFrameListRel.iWidth - ROW_BORDER_WIDTH * (m_pLines->rows - 1); for(int row = 0; row < m_pLines->rows; row++) { width = std::min(m_pLines->rowWidth[row] * net_width / 100, m_cFrameListRel.iWidth - x + m_cFrameListRel.iX - TEXT_BORDER_WIDTH); - m_pcFontList->RenderString(x+m_cFrame.iX, y+m_cFrame.iY, - width, m_pLines->lineArray[row][line].c_str(), + if (row > 0) + xDiff = 0; + m_pcFontList->RenderString(x+m_cFrame.iX+xDiff, y+m_cFrame.iY, + width-xDiff, m_pLines->lineArray[row][line].c_str(), color, 0, true); // UTF-8 x += width + ROW_BORDER_WIDTH; } diff --git a/src/gui/widget/listframe.h b/src/gui/widget/listframe.h index ff457c8dd..f548bfd2b 100644 --- a/src/gui/widget/listframe.h +++ b/src/gui/widget/listframe.h @@ -63,6 +63,7 @@ typedef struct std::string lineHeader[LF_MAX_ROWS]; std::vector lineArray[LF_MAX_ROWS]; int rowWidth[LF_MAX_ROWS]; + std::vector Icon; }LF_LINES; class CListFrame @@ -78,6 +79,7 @@ class CListFrame void refreshHeaderList(void); void reSizeMainFrameWidth(int maxTextWidth); void reSizeMainFrameHeight(int maxTextHeight); + int paintListIcon(int x, int y, int line); /* Variables */ LF_LINES* m_pLines; diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 3b6389265..66b252d8b 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -560,6 +560,7 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) if ((pos < (int)page_start[current_page + 1]) && (pos >= (int)page_start[current_page])) { items[selected]->paint( false ); item->paint( true ); + paintHint(pos); selected = pos; } else { selected=pos; @@ -577,6 +578,7 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) if ((pos < (int)page_start[current_page + 1]) && (pos >= (int)page_start[current_page])) { items[selected]->paint( false ); item->paint( true ); + paintHint(pos); selected = pos; } else { selected=pos; @@ -1132,6 +1134,7 @@ void CMenuWidget::paintHint(int pos) details_line->setYPos(ypos1a); details_line->setYPosDown(ypos2a); details_line->setHMarkDown(markh); + details_line->setColor(COL_MENUCONTENT_PLUS_6, COL_MENUCONTENTDARK_PLUS_0); } details_line->paint(savescreen); @@ -1141,6 +1144,7 @@ void CMenuWidget::paintHint(int pos) info_box->setXPos(x); info_box->setYPos(ypos2); info_box->setWidth(iwidth); + info_box->setColor(COL_MENUCONTENT_PLUS_6, COL_MENUCONTENTDARK_PLUS_0, COL_MENUCONTENTDARK_PLUS_0); } /* force full paint - menu-over i.e. option chooser with pulldown can overwrite */ info_box->paint(savescreen, true); diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index fb19beddb..47b5d0c4c 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -150,7 +150,6 @@ void CTextBox::initVar(void) m_cText = ""; m_nMode = SCROLL; - m_pcFontText = NULL; m_pcFontText = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]; m_nFontTextHeight = m_pcFontText->getHeight(); m_nMaxTextWidth = 0; @@ -333,8 +332,8 @@ void CTextBox::refreshTextLineArray(void) lineBreakWidth = std::max(m_nMaxWidth, m_cFrameTextRel.iWidth - 2*text_border_width); } -// if(m_nMaxWidth) -// lineBreakWidth = m_nMaxWidth; + if(m_nMaxTextWidth) + lineBreakWidth = m_nMaxTextWidth; //TRACE("[CTextBox] line %d: lineBreakWidth %d\n", __LINE__, lineBreakWidth); @@ -596,8 +595,7 @@ bool CTextBox::setText(const std::string* newText, int max_width) { //TRACE("[CTextBox]->SetText \r\n"); bool result = false; - if (max_width>0) - m_nMaxTextWidth = max_width; + m_nMaxTextWidth = max_width; //printf("setText: _max_width %d max_width %d\n", _max_width, max_width); if (newText != NULL) diff --git a/src/gui/zapit_setup.cpp b/src/gui/zapit_setup.cpp index 6a68b0704..245af0c4e 100644 --- a/src/gui/zapit_setup.cpp +++ b/src/gui/zapit_setup.cpp @@ -39,8 +39,6 @@ CZapitSetup::CZapitSetup() { - zapit1 = NULL; - zapit2 = NULL; width = w_max (40, 10); //% } @@ -67,38 +65,32 @@ void CZapitSetup::showMenu() //menue init CMenuWidget *zapit = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_ZAPIT); zapit->addIntroItems(LOCALE_ZAPITSETUP_INFO); - + COnOffNotifier* miscZapitNotifier = new COnOffNotifier(1); //zapit - CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_ZAPITSETUP_LAST_USE, &g_settings.uselastchannel, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); + CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_ZAPITSETUP_LAST_USE, &g_settings.uselastchannel, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, miscZapitNotifier, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED); mc->setHint("", LOCALE_MENU_HINT_LAST_USE); - zapit->addItem(mc); + CSelectChannelWidget select; - zapit->addItem(GenericMenuSeparatorLine); - - zapit1 = new CMenuForwarder(LOCALE_ZAPITSETUP_LAST_TV , !g_settings.uselastchannel, g_settings.StartChannelTV, &select, "tv", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN ); + CMenuForwarder *zapit1 = new CMenuForwarder(LOCALE_ZAPITSETUP_LAST_TV , !g_settings.uselastchannel, g_settings.StartChannelTV, &select, "tv", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN ); zapit1->setHint("", LOCALE_MENU_HINT_LAST_TV); - zapit->addItem(zapit1); - zapit2 = new CMenuForwarder(LOCALE_ZAPITSETUP_LAST_RADIO , !g_settings.uselastchannel, g_settings.StartChannelRadio, &select, "radio", CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW ); + CMenuForwarder *zapit2 = new CMenuForwarder(LOCALE_ZAPITSETUP_LAST_RADIO , !g_settings.uselastchannel, g_settings.StartChannelRadio, &select, "radio", CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW ); zapit2->setHint("", LOCALE_MENU_HINT_LAST_RADIO); + + miscZapitNotifier->addItem(zapit1); + miscZapitNotifier->addItem(zapit2); + + zapit->addItem(mc); + zapit->addItem(GenericMenuSeparatorLine); + zapit->addItem(zapit1); zapit->addItem(zapit2); zapit->exec(NULL, ""); + delete miscZapitNotifier; delete zapit; } -bool CZapitSetup::changeNotify(const neutrino_locale_t OptionName, void *) -{ - if (ARE_LOCALES_EQUAL(OptionName, LOCALE_ZAPITSETUP_LAST_USE)) - { - zapit1->setActive(!g_settings.uselastchannel); - zapit2->setActive(!g_settings.uselastchannel); - } - - return false; -} - //select menu CSelectChannelWidget::CSelectChannelWidget() { diff --git a/src/gui/zapit_setup.h b/src/gui/zapit_setup.h index 8e8c7f3db..95636611e 100644 --- a/src/gui/zapit_setup.h +++ b/src/gui/zapit_setup.h @@ -31,10 +31,9 @@ #include #include -class CZapitSetup : public CMenuTarget, CChangeObserver +class CZapitSetup : public CMenuTarget { private: - CMenuForwarder *zapit1, *zapit2; int width; @@ -44,7 +43,6 @@ public: CZapitSetup(); ~CZapitSetup(); int exec(CMenuTarget* parent, const std::string & actionKey); - virtual bool changeNotify(const neutrino_locale_t , void *); }; class CSelectChannelWidget : public CMenuWidget diff --git a/src/neutrino.cpp b/src/neutrino.cpp index eb7813239..e08594190 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -204,6 +204,7 @@ CNeutrinoApp::CNeutrinoApp() RADIOchannelList = NULL; skipShutdownTimer = false; skipSleepTimer = false; + lockStandbyCall = false; current_muted = 0; recordingstatus = 0; g_channel_list_changed = 0; @@ -286,6 +287,15 @@ int CNeutrinoApp::loadSetup(const char * fname) if(!configfile.loadConfig(fname)) { //file existiert nicht erg = 1; + } else { + /* try to detect bad / broken config file */ + if (!configfile.getInt32("screen_EndX_crt", 0) || + !configfile.getInt32("screen_EndY_crt", 0) || + !configfile.getInt32("screen_EndX_lcd", 0) || + !configfile.getInt32("screen_EndY_lcd", 0)) { + printf("[neutrino] config file %s is broken, using defaults\n", fname); + configfile.clear(); + } } std::ifstream checkParentallocked(NEUTRINO_PARENTALLOCKED_FILE); if(checkParentallocked) { @@ -420,7 +430,7 @@ int CNeutrinoApp::loadSetup(const char * fname) snprintf(g_settings.ifname, sizeof(g_settings.ifname), "%s", configfile.getString("ifname", "eth0").c_str());; g_settings.epg_save = configfile.getBool("epg_save", false); - + g_settings.epg_save_standby = configfile.getBool("epg_save_standby", true); //widget settings g_settings.widget_fade = false; g_settings.widget_fade = configfile.getBool("widget_fade" , false ); @@ -860,6 +870,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setString("timezone", g_settings.timezone); // epg configfile.setBool("epg_save", g_settings.epg_save); + configfile.setBool("epg_save_standby", g_settings.epg_save_standby); configfile.setString("epg_cache_time" ,g_settings.epg_cache ); configfile.setString("epg_extendedcache_time" ,g_settings.epg_extendedcache); configfile.setString("epg_old_events" ,g_settings.epg_old_events ); @@ -1393,16 +1404,18 @@ void CNeutrinoApp::SetChannelMode(int newmode) break; } INFO("newmode %d sort old %d new %d", newmode, sortmode[newmode], g_settings.channellist_sort_mode); - if(newmode != LIST_MODE_FAV && sortmode[newmode] != g_settings.channellist_sort_mode && g_settings.channellist_sort_mode < 3) { + if(newmode != LIST_MODE_FAV && sortmode[newmode] != g_settings.channellist_sort_mode && g_settings.channellist_sort_mode < CChannelList::SORT_MAX) { sortmode[newmode] = g_settings.channellist_sort_mode; INFO("sorting, mode %d, %d bouquets\n", g_settings.channellist_sort_mode, bouquetList->Bouquets.size()); for (uint32_t i = 0; i < bouquetList->Bouquets.size(); i++) { - if(g_settings.channellist_sort_mode == 0) + if(g_settings.channellist_sort_mode == CChannelList::SORT_ALPHA) bouquetList->Bouquets[i]->channelList->SortAlpha(); - if(g_settings.channellist_sort_mode == 1) + if(g_settings.channellist_sort_mode == CChannelList::SORT_TP) bouquetList->Bouquets[i]->channelList->SortTP(); - if(g_settings.channellist_sort_mode == 2) + if(g_settings.channellist_sort_mode == CChannelList::SORT_SAT) bouquetList->Bouquets[i]->channelList->SortSat(); + if(g_settings.channellist_sort_mode == CChannelList::SORT_CH_NUMBER) + bouquetList->Bouquets[i]->channelList->SortChNumber(); } channelList->adjustToChannelID(channelList->getActiveChannel_ChannelID()); } @@ -1845,12 +1858,10 @@ TIMER_START(); g_CamHandler->init(); #ifndef ASSUME_MDEV - const char hddsda1[] = "/media/sda1"; - const char hddsdb1[] = "/media/sdb1"; - mkdir(hddsda1, 0755); - mount("/dev/sda1", hddsda1, "ext3", 0, NULL); - mkdir(hddsdb1,0755); - mount("/dev/sdb1", hddsdb1, "ext3", 0, NULL); + mkdir("/media/sda1", 0755); + mkdir("/media/sdb1", 0755); + my_system("mount", "/dev/sda1", "/media/sda1"); + my_system("mount", "/dev/sdb1", "/media/sdb1"); #endif CFSMounter::automount(); @@ -2039,13 +2050,16 @@ void CNeutrinoApp::RealRun(CMenuWidget &mainMenu) g_RemoteControl->subChannelDown(); g_InfoViewer->showSubchan(); } - else if (g_settings.mode_left_right_key_tv == SNeutrinoSettings::VOLUME) { - g_volume->setVolume(msg, true); - } - else if((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VZAP) || (g_settings.mode_left_right_key_tv == SNeutrinoSettings::INFOBAR)) { - if(channelList->getSize()) { - showInfo(); - } + else if ( msg == CRCInput::RC_left || msg == CRCInput::RC_right) { + if (g_settings.mode_left_right_key_tv == SNeutrinoSettings::VOLUME) { + g_volume->setVolume(msg, true); + } + else if((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VZAP) + || (g_settings.mode_left_right_key_tv == SNeutrinoSettings::INFOBAR)) { + if(channelList->getSize()) { + showInfo(); + } + } } else quickZap( msg ); @@ -2350,7 +2364,7 @@ _repeat: else if (msg == CRCInput::RC_standby_on) { if (data == 0) g_RCInput->postMsg(NeutrinoMessages::STANDBY_ON, 0); - return messages_return::handled; + return messages_return::cancel_all | messages_return::handled; } else if ((msg == CRCInput::RC_standby_off) || (msg == CRCInput::RC_power_on)) { if (data == 0) @@ -2359,7 +2373,7 @@ _repeat: } else if (msg == CRCInput::RC_power_off) { g_RCInput->postMsg(NeutrinoMessages::SHUTDOWN, 0); - return messages_return::handled; + return messages_return::cancel_all | messages_return::handled; } else if (msg == (neutrino_msg_t) g_settings.key_power_off /*CRCInput::RC_standby*/) { if (data == 0) { @@ -2652,14 +2666,25 @@ _repeat: } else if( msg == NeutrinoMessages::ANNOUNCE_SLEEPTIMER) { if( mode != mode_scart && mode != mode_standby) - skipSleepTimer = (ShowLocalizedMessage(LOCALE_MESSAGEBOX_INFO, LOCALE_SLEEPTIMERBOX_ANNOUNCE,CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, true) == CMessageBox::mbrYes); + skipSleepTimer = (ShowLocalizedMessage(LOCALE_MESSAGEBOX_INFO, g_settings.shutdown_real ? LOCALE_SHUTDOWNTIMER_ANNOUNCE:LOCALE_SLEEPTIMERBOX_ANNOUNCE,CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, true) == CMessageBox::mbrYes); return messages_return::handled; } else if( msg == NeutrinoMessages::SLEEPTIMER) { - if(skipSleepTimer) { - printf("NeutrinoMessages::SLEEPTIMER: skiping\n"); - skipSleepTimer = false; - return messages_return::handled; + if(data) {//INACTIVITY SLEEPTIMER + skipShutdownTimer = + (ShowLocalizedMessage(LOCALE_MESSAGEBOX_INFO, g_settings.shutdown_real ? LOCALE_SHUTDOWNTIMER_ANNOUNCE:LOCALE_SLEEPTIMERBOX_ANNOUNCE, + CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, true) == CMessageBox::mbrYes);//FIXME + if(skipShutdownTimer) { + printf("NeutrinoMessages::INACTIVITY SLEEPTIMER: skiping\n"); + skipShutdownTimer = false; + return messages_return::handled; + } + }else{ //MAIN-MENU SLEEPTIMER + if(skipSleepTimer) { + printf("NeutrinoMessages::SLEEPTIMER: skiping\n"); + skipSleepTimer = false; + return messages_return::handled; + } } if(g_settings.shutdown_real) ExitRun(true, (cs_get_revision() > 7)); @@ -3076,6 +3101,11 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) //static bool wasshift = false; INFO("%s", bOnOff ? "ON" : "OFF" ); + if(lockStandbyCall) + return; + + lockStandbyCall = true; + if( bOnOff ) { if( mode == mode_scart ) { //g_Controld->setScartMode( 0 ); @@ -3112,7 +3142,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) if(!CRecordManager::getInstance()->RecordingStatus() ) { //only save epg when not recording - if(g_settings.epg_save && !fromDeepStandby) { + if(g_settings.epg_save && !fromDeepStandby && g_settings.epg_save_standby) { saveEpg(false);//false CVFD::MODE_STANDBY } } @@ -3205,6 +3235,7 @@ void CNeutrinoApp::standbyMode( bool bOnOff, bool fromDeepStandby ) g_volume->AudioMute(current_muted, true); StartSubtitles(); } + lockStandbyCall = false; } void CNeutrinoApp::radioMode( bool rezap) @@ -3500,7 +3531,7 @@ void sighandler (int signum) case SIGTERM: case SIGINT: delete CRecordManager::getInstance(); - CNeutrinoApp::getInstance()->saveSetup(NEUTRINO_SETTINGS_FILE); + //CNeutrinoApp::getInstance()->saveSetup(NEUTRINO_SETTINGS_FILE); stop_daemons(); stop_video(); //_exit(0); diff --git a/src/neutrino.h b/src/neutrino.h index b129adfe6..c36dd2406 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -119,6 +119,7 @@ private: bool skipShutdownTimer; bool skipSleepTimer; + bool lockStandbyCall; bool pbBlinkChange; int tvsort[LIST_MODE_LAST]; int radiosort[LIST_MODE_LAST]; diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index dfc1c5118..c2c078a67 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -34,16 +34,16 @@ #include #include #include -#include "gui/plugins.h"//for relodplugins +#include //for relodplugins #include #include -#include "gui/rc_lock.h" +#include // yhttpd -#include "yhttpd.h" -#include "ytypes_globals.h" -#include "ylogging.h" -#include "helper.h" +#include +#include +#include +#include // nhttpd #include "neutrinoapi.h" #include "controlapi.h" @@ -220,7 +220,6 @@ const CControlAPI::TyCgiCall CControlAPI::yCgiCallList[]= void CControlAPI::Execute(CyhookHandler *hh) { int index = -1; - std::string yresult; std::string filename = hh->UrlData["filename"]; log_level_printf(4,"ControlAPI.Execute filename:(%s)\n",filename.c_str()); @@ -595,44 +594,43 @@ void CControlAPI::InfoCGI(CyhookHandler *hh) void CControlAPI::HWInfoCGI(CyhookHandler *hh) { unsigned int system_rev = cs_get_revision(); - std::string boxname; + std::string boxname = "Coolstream "; static CNetAdapter netadapter; std::string eth_id = netadapter.getMacAddr(); std::transform(eth_id.begin(), eth_id.end(), eth_id.begin(), ::tolower); - if("00:c5:5c" == eth_id.substr(0, 8) ) - boxname = "Coolstream "; - else if("ba:dd:ad" == eth_id.substr(0, 8) ) - boxname = "Armas "; +#if HAVE_TRIPLEDRAGON + boxname = "Armas "; +#endif switch(system_rev) { - case 1: - if( boxname == "Armas ") - boxname += "TripleDragon"; - break; - case 6: - boxname += "HD1"; - break; - case 7: - boxname += "BSE"; - break; - case 8: - case 9: - boxname += "Neo"; - break; - case 10: - boxname += "Zee"; - break; + case 1: + if( boxname == "Armas ") + boxname += "TripleDragon"; + break; + case 6: + boxname += "HD1"; + break; + case 7: + boxname += "BSE"; + break; + case 8: + case 9: + boxname += "Neo"; + break; + case 10: + boxname += "Zee"; + break; - default: { - char buffer[10]; - snprintf(buffer, sizeof(buffer), "%u\n", system_rev); - boxname += "Unknown nr. "; - boxname += buffer; - } - break; + default: + char buffer[10]; + snprintf(buffer, sizeof(buffer), "%u\n", system_rev); + boxname += "Unknown nr. "; + boxname += buffer; + break; } + boxname += (g_info.delivery_system == DVB_S || (system_rev == 1)) ? " SAT":" CABLE"; hh->printf("%s\nMAC:%s\n", boxname.c_str(),eth_id.c_str()); @@ -893,7 +891,6 @@ void CControlAPI::ChannellistCGI(CyhookHandler *hh) std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChannel * channel) { std::string result, firstEPG, secondEPG = ""; t_channel_id current_channel = CZapit::getInstance()->GetCurrentChannelID(); - int percentage = 100; std::string timestr; CSectionsdClient::responseGetCurrentNextInfoChannelID currentNextInfo; @@ -901,6 +898,7 @@ std::string CControlAPI::_GetBouquetActualEPGItem(CyhookHandler *hh, CZapitChann event = NeutrinoAPI->ChannelListEvents[channel->channel_id]; if (event) { + int percentage = 100; if (event->duration > 0) percentage = 100 * (time(NULL) - event->startTime) / event->duration; CEitManager::getInstance()->getCurrentNextServiceKey(channel->channel_id, currentNextInfo); @@ -1367,7 +1365,7 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) { else if (hh->ParamList.empty() || hh->ParamList["1"] == "ext") { hh->SetHeader(HTTP_OK, "text/plain; charset=UTF-8"); bool isExt = (hh->ParamList["1"] == "ext"); - CChannelEvent *event; + CChannelEvent *event = NULL; NeutrinoAPI->GetChannelEvents(); int mode = NeutrinoAPI->Zapit->getMode(); @@ -1390,7 +1388,7 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) { // query details for given eventid else if (hh->ParamList["eventid"] != "") { //special epg query - uint64_t epgid; + uint64_t epgid = 0; sscanf(hh->ParamList["eventid"].c_str(), "%llu", &epgid); CShortEPGData epg; if (CEitManager::getInstance()->getEPGidShort(epgid, &epg)) { @@ -1401,8 +1399,8 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) { } else if (hh->ParamList["eventid2fsk"] != "") { if (hh->ParamList["starttime"] != "") { - uint64_t epgid; - time_t starttime; + uint64_t epgid = 0; + time_t starttime = 0; sscanf(hh->ParamList["fskid"].c_str(), "%llu", &epgid); sscanf(hh->ParamList["starttime"].c_str(), "%lu", &starttime); CEPGData longepg; @@ -1415,7 +1413,7 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) { } // list EPG for channel id else if (!(hh->ParamList["id"].empty())) { - t_channel_id channel_id; + t_channel_id channel_id = 0; sscanf(hh->ParamList["id"].c_str(), SCANF_CHANNEL_ID_TYPE, &channel_id); CEitManager::getInstance()->getEventsServiceKey(channel_id, NeutrinoAPI->eList); CChannelEventList::iterator eventIterator; @@ -1432,7 +1430,7 @@ void CControlAPI::EpgCGI(CyhookHandler *hh) { // list EPG for channelID 64Bit else { //eventlist for a chan - t_channel_id channel_id; + t_channel_id channel_id = 0; sscanf(hh->ParamList["1"].c_str(), SCANF_CHANNEL_ID_TYPE, &channel_id); SendEventList(hh, channel_id); } @@ -2007,10 +2005,9 @@ void CControlAPI::SendTimersXML(CyhookHandler *hh) void CControlAPI::YWebCGI(CyhookHandler *hh) { bool status=true; - int para; if (hh->ParamList["video_stream_pids"] != "") { - para=0; + int para=0; sscanf( hh->ParamList["video_stream_pids"].c_str(), "%d", ¶); YWeb_SendVideoStreamingPids(hh, para); } @@ -2073,7 +2070,7 @@ std::string CControlAPI::YexecuteScript(CyhookHandler *, std::string cmd) // get file std::string fullfilename; script += ".sh"; //add script extention - char cwd[255]; + char cwd[255]={0}; getcwd(cwd, 254); for (unsigned int i=0; iParamList["alarm"] != "") @@ -2146,7 +2142,7 @@ void CControlAPI::doNewTimer(CyhookHandler *hh) // Alarm Time - Format exact! HH:MM if(hh->ParamList["alTime"] != "") strptime(hh->ParamList["alTime"].c_str(), "%H:%M", alarmTime); - alHour = alarmTime->tm_hour; + int alHour = alarmTime->tm_hour; correctTime(alarmTime); alarmTimeT = mktime(alarmTime); @@ -2390,10 +2386,8 @@ void CControlAPI::moveBouquetCGI(CyhookHandler *hh) //------------------------------------------------------------------------- void CControlAPI::deleteBouquetCGI(CyhookHandler *hh) { - int selected = -1; - if (hh->ParamList["selected"] != "") { - selected = atoi(hh->ParamList["selected"].c_str()); + int selected = atoi(hh->ParamList["selected"].c_str()); NeutrinoAPI->Zapit->deleteBouquet(selected - 1); hh->SendOk(); } @@ -2480,7 +2474,7 @@ void CControlAPI::updateBouquetCGI(CyhookHandler *hh) // host : (optional) ip of dbox void CControlAPI::build_live_url(CyhookHandler *hh) { - std::string xpids,port,yresult; + std::string xpids; int mode = NeutrinoAPI->Zapit->getMode(); if ( mode == CZapitClient::MODE_TV) @@ -2736,18 +2730,13 @@ void CControlAPI::FileCGI(CyhookHandler *hh) { if (hh->ParamList["action"] == "list") { // directory list: action=list&path= DIR *dirp; - struct dirent*entry; - struct stat statbuf; - struct passwd *pwd; - struct group *grp; - struct tm *tm; - char datestring[256]; TOutType outType = hh->outStart(); std::string path = hh->ParamList["path"]; if ((dirp = opendir(path.c_str()))) { bool isFirstLine = true; + struct dirent *entry; while ((entry = readdir(dirp))) { std::string item = ""; item += hh->outPair("name", @@ -2768,6 +2757,7 @@ void CControlAPI::FileCGI(CyhookHandler *hh) { std::string fullname = path + entry->d_name; item += hh->outPair("fullname", hh->outValue(fullname), true); + struct stat statbuf; if (stat(fullname.c_str(), &statbuf) != -1) { item += hh->outPair( @@ -2781,6 +2771,7 @@ void CControlAPI::FileCGI(CyhookHandler *hh) { string_printf("%d", statbuf.st_nlink), true); /* Print out owner's name if it is found using getpwuid(). */ + struct passwd *pwd; if ((pwd = getpwuid(statbuf.st_uid)) != NULL) { item += hh->outPair("user", pwd->pw_name, true); } @@ -2789,6 +2780,7 @@ void CControlAPI::FileCGI(CyhookHandler *hh) { string_printf("%d", statbuf.st_uid), true); } /* Print out group name if it is found using getgrgid(). */ + struct group *grp; if ((grp = getgrgid(statbuf.st_gid)) != NULL) item += hh->outPair("group", grp->gr_name, true); else { @@ -2799,7 +2791,8 @@ void CControlAPI::FileCGI(CyhookHandler *hh) { item += hh->outPair("size", string_printf("%jd", (intmax_t) statbuf.st_size), true); - tm = localtime(&statbuf.st_mtime); + struct tm *tm = localtime(&statbuf.st_mtime); + char datestring[256] = {0}; /* Get localized date string. */ strftime(datestring, sizeof(datestring), nl_langinfo(D_T_FMT), tm); diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.h b/src/nhttpd/tuxboxapi/coolstream/controlapi.h index 052739005..db8670cd3 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.h +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.h @@ -8,7 +8,7 @@ #include // yhttpd #include -#include "yhook.h" +#include // forward declaration class CNeutrinoAPI; diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp b/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp index 2ca05cfd4..65b433331 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.cpp @@ -50,7 +50,7 @@ extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */ extern CZapitClient::SatelliteList satList; // yhttpd -#include "ylogging.h" +#include // nhttpd #include "neutrinoapi.h" @@ -266,7 +266,7 @@ bool CNeutrinoAPI::GetChannelEvents(void) if (eList.begin() == eList.end()) return false; - for (eventIterator = eList.begin(); eventIterator != eList.end(); eventIterator++) + for (eventIterator = eList.begin(); eventIterator != eList.end(); ++eventIterator) ChannelListEvents[(*eventIterator).get_channel_id()] = &(*eventIterator); return true; @@ -457,14 +457,13 @@ std::string CNeutrinoAPI::getAudioInfoAsString(void) { //------------------------------------------------------------------------- std::string CNeutrinoAPI::getCryptInfoAsString(void) { - unsigned short i; std::stringstream out; std::string casys[11]= {"Irdeto:","Betacrypt:","Seca:","Viaccess:","Nagra:","Conax: ","Cryptoworks:","Videoguard:","EBU:","XCrypt:","PowerVU:"}; int caids[] = { 0x600, 0x1700, 0x0100, 0x0500, 0x1800, 0xB00, 0xD00, 0x900, 0x2600, 0x4a00, 0x0E00 }; CZapitChannel * channel = CZapit::getInstance()->GetCurrentChannel(); if(channel) { - for (i = 0; i < 11; i++) { + for (unsigned short i = 0; i < 11; i++) { for(casys_map_iterator_t it = channel->camap.begin(); it != channel->camap.end(); ++it) { int caid = (*it) & 0xFF00; if(caid == caids[i]) diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.h b/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.h index 892dde995..a98a7b5bf 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.h +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoapi.h @@ -12,7 +12,7 @@ #include // nhttpd -#include "helper.h" +#include #include "neutrinoyparser.h" #include "controlapi.h" diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp index 64b5ebdb8..cf02c5473 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp @@ -17,9 +17,9 @@ #include #include // yhttpd -#include "yhttpd.h" -#include "ytypes_globals.h" -#include "mod_yparser.h" +#include +#include +#include // tuxbox #include //timer list // nhttpd @@ -210,7 +210,7 @@ std::string CNeutrinoYParser::func_mount_set_values(CyhookHandler *hh, std::str //------------------------------------------------------------------------- std::string CNeutrinoYParser::func_get_bouquets_as_dropdown(CyhookHandler *, std::string para) { - std::string ynr, yresult, sel, nr_str, do_show_hidden; + std::string yresult, sel, nr_str, do_show_hidden; int nr=1; ySplitString(para," ",nr_str, do_show_hidden); @@ -269,7 +269,7 @@ std::string CNeutrinoYParser::func_get_actual_bouquet_number(CyhookHandler *, s //------------------------------------------------------------------------- std::string CNeutrinoYParser::func_get_channels_as_dropdown(CyhookHandler *, std::string para) { - std::string abouquet, achannel_id, yresult, sel, sid; + std::string abouquet, achannel_id, yresult, sel; int bnumber = 1; int mode = NeutrinoAPI->Zapit->getMode(); @@ -597,7 +597,7 @@ std::string CNeutrinoYParser::func_get_audio_pids_as_dropdown(CyhookHandler *, //------------------------------------------------------------------------- std::string CNeutrinoYParser::func_unmount_get_list(CyhookHandler *, std::string) { - std::string ysel, ymount, ylocal_dir, yfstype, ynr, yresult, mounts; + std::string ysel, ymount, ylocal_dir, yfstype, yresult, mounts; std::ifstream in; in.open("/proc/mounts", std::ifstream::in); @@ -648,48 +648,43 @@ std::string CNeutrinoYParser::func_get_partition_list(CyhookHandler *, std::str return yresult; } //------------------------------------------------------------------------- -// y-func : get boxtypetext (Nokia, Philips, Sagem) +// y-func : get boxtypetext //------------------------------------------------------------------------- std::string CNeutrinoYParser::func_get_boxtype(CyhookHandler *, std::string) { unsigned int system_rev = cs_get_revision(); - std::string boxname; - static CNetAdapter netadapter; - std::string eth_id = netadapter.getMacAddr(); - std::transform(eth_id.begin(), eth_id.end(), eth_id.begin(), ::tolower); + std::string boxname = "Coolstream "; - if("00:c5:5c" == eth_id.substr(0, 8) ) - boxname = "Coolstream "; - else if("ba:dd:ad" == eth_id.substr(0, 8) ) - boxname = "Armas "; +#if HAVE_TRIPLEDRAGON + boxname = "Armas "; +#endif switch(system_rev) { - case 1: - if( boxname == "Armas ") - boxname += "TripleDragon"; - break; - case 6: - boxname += "HD1"; - break; - case 7: - boxname += "BSE"; - break; - case 8: - case 9: - boxname += "Neo"; - break; - case 10: - boxname += "Zee"; - break; + case 1: + if( boxname == "Armas ") + boxname += "TripleDragon"; + break; + case 6: + boxname += "HD1"; + break; + case 7: + boxname += "BSE"; + break; + case 8: + case 9: + boxname += "Neo"; + break; + case 10: + boxname += "Zee"; + break; - default: { - char buffer[10]; - snprintf(buffer, sizeof(buffer), "%u\n", system_rev); - boxname += "Unknown nr. "; - boxname += buffer; - } - break; + default: + char buffer[10]; + snprintf(buffer, sizeof(buffer), "%u\n", system_rev); + boxname += "Unknown nr. "; + boxname += buffer; + break; } boxname += (g_info.delivery_system == DVB_S || (system_rev == 1)) ? " SAT":" CABLE"; @@ -838,7 +833,7 @@ std::string CNeutrinoYParser::func_get_timer_list(CyhookHandler *, std::string yresult += string_printf(para.c_str(), classname, zAlarmTime, zStopTime, zRep.c_str(), zRepCount.c_str(), zType.c_str(), sAddData.c_str(),timer->eventID,timer->eventID); } - classname = (i++&1)?'a':'b'; + //classname = (i++&1)?'a':'b'; return yresult; } diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.h b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.h index 2d8da7697..b32f99c32 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.h +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.h @@ -9,9 +9,9 @@ // c++ #include // yhttpd -#include "yhttpd.h" -#include "ytypes_globals.h" -#include "mod_yparser.h" +#include +#include +#include // forward declaration class CNeutrinoAPI; diff --git a/src/nhttpd/web/Y_VLC.js b/src/nhttpd/web/Y_VLC.js index 8a594459a..b51c19e06 100644 --- a/src/nhttpd/web/Y_VLC.js +++ b/src/nhttpd/web/Y_VLC.js @@ -51,17 +51,28 @@ CyVLC.prototype = { return words[0]; } else - if(navigator.plugins) { - var plug = navigator.plugins['VLC multimedia plugin']; - if(typeof plug == 'undefined') - var plug = navigator.plugins['VLC Multimedia Plugin']; - if(typeof plug == 'undefined') - var plug = navigator.plugins['VLC Multimedia Plug-in']; - var ex = /^.*[vV]ersion [\"]*([^ \"]*)[\"]*.*$/; - var ve = ex.exec(plug.description); - if(ve[1]) - return ve[1]; - else + if (navigator.plugins && (navigator.plugins.length > 0)) { + var name = "VLC"; + for(var i=0;i static CmAuth *auth = NULL; #endif #ifdef Y_CONFIG_USE_WEBLOG -#include "mod_weblog.h" +#include static CmWebLog *weblog = NULL; #endif #ifdef Y_CONFIG_USE_SENDFILE -#include "mod_sendfile.h" +#include static CmodSendfile *mod_sendfile = NULL; #endif #ifdef Y_CONFIG_USE_CACHE -#include "mod_cache.h" +#include static CmodCache mod_cache; // static instance #endif diff --git a/src/nhttpd/yhttpd_core/helper.cpp b/src/nhttpd/yhttpd_core/helper.cpp index 38b188ba2..e2449fbbd 100644 --- a/src/nhttpd/yhttpd_core/helper.cpp +++ b/src/nhttpd/yhttpd_core/helper.cpp @@ -12,7 +12,7 @@ #include // yhttpd -#include "yconfig.h" +#include #include "ytypes_globals.h" #include "helper.h" #include "ylogging.h" @@ -220,10 +220,10 @@ std::string encodeString(std::string decodedString) { unsigned int len = sizeof(char) * decodedString.length() * 5 + 1; std::string result(len, '\0'); char *newString = (char *) result.c_str(); - char *dstring = (char *) decodedString.c_str(); char one_char; if (len == result.length()) // got memory needed { + char *dstring = (char *) decodedString.c_str(); while ((one_char = *dstring++)) /* use the null character as a loop terminator */ { if (isalnum(one_char)) diff --git a/src/nhttpd/yhttpd_core/yconnection.cpp b/src/nhttpd/yhttpd_core/yconnection.cpp index 7c035c12d..ea16280b5 100644 --- a/src/nhttpd/yhttpd_core/yconnection.cpp +++ b/src/nhttpd/yhttpd_core/yconnection.cpp @@ -8,7 +8,7 @@ #include #include // yhttpd -#include "yconfig.h" +#include #include "ytypes_globals.h" #include "ywebserver.h" #include "yconnection.h" @@ -44,6 +44,7 @@ CWebserverConnection::CWebserverConnection(CWebserver *pWebserver) { //------------------------------------------------------------------------- CWebserverConnection::CWebserverConnection() { // aprintf("test CWebserverConnection::CWebserverConnection()\n"); + Method = M_UNKNOWN; sock = 0; RequestCanceled = 0; keep_alive = 0; diff --git a/src/nhttpd/yhttpd_core/yconnection.h b/src/nhttpd/yhttpd_core/yconnection.h index 50dca5580..cc8ebc6ca 100644 --- a/src/nhttpd/yhttpd_core/yconnection.h +++ b/src/nhttpd/yhttpd_core/yconnection.h @@ -14,7 +14,7 @@ // c++ #include // yhttpd -#include "yconfig.h" +#include #include "ytypes_globals.h" #include "ywebserver.h" #include "yrequest.h" diff --git a/src/nhttpd/yhttpd_core/yhook.h b/src/nhttpd/yhttpd_core/yhook.h index 9556be9f5..b313dadda 100644 --- a/src/nhttpd/yhttpd_core/yhook.h +++ b/src/nhttpd/yhttpd_core/yhook.h @@ -51,7 +51,7 @@ #include #include // yhttpd -#include "yconfig.h" +#include #include "ytypes_globals.h" #include "ylogging.h" // tuxbox @@ -141,7 +141,7 @@ public: CStringList HookVarList; // Variables in Hook-Handling passing to other Hooks THttp_Method Method; // HTTP Method (requested) // constructor & deconstructor - CyhookHandler(){ContentLength = 0; keep_alive = 0; _outIndent = 0;}; + CyhookHandler(){ContentLength = 0; keep_alive = 0; _outIndent = 0;status = HANDLED_NONE;Method = M_UNKNOWN;httpStatus = HTTP_NIL;outType = plain;}; virtual ~CyhookHandler(){}; // hook slot handler diff --git a/src/nhttpd/yhttpd_core/ylanguage.h b/src/nhttpd/yhttpd_core/ylanguage.h index 3ba368f7c..e90658fc2 100644 --- a/src/nhttpd/yhttpd_core/ylanguage.h +++ b/src/nhttpd/yhttpd_core/ylanguage.h @@ -8,7 +8,7 @@ #include #include // yhttpd -#include "yconfig.h" +#include #include "ytypes_globals.h" #include "ywebserver.h" diff --git a/src/nhttpd/yhttpd_core/yrequest.cpp b/src/nhttpd/yhttpd_core/yrequest.cpp index 94fb344bd..999903915 100644 --- a/src/nhttpd/yhttpd_core/yrequest.cpp +++ b/src/nhttpd/yhttpd_core/yrequest.cpp @@ -116,7 +116,7 @@ bool CWebserverRequest::HandleRequest(void) { // Split URL into path, filename, fileext .. UrlData[] //----------------------------------------------------------------------------- bool CWebserverRequest::ParseStartLine(std::string start_line) { - std::string method, url, http, tmp; + std::string method, url, tmp; log_level_printf(8, ": line: %s\n", start_line.c_str()); if (ySplitString(start_line, " ", method, tmp)) { diff --git a/src/nhttpd/yhttpd_core/yresponse.cpp b/src/nhttpd/yhttpd_core/yresponse.cpp index c010a0f74..96ed8f510 100644 --- a/src/nhttpd/yhttpd_core/yresponse.cpp +++ b/src/nhttpd/yhttpd_core/yresponse.cpp @@ -15,8 +15,8 @@ #include #include // yhttpd -#include "yconfig.h" -#include "yhttpd.h" +#include +#include #include "ytypes_globals.h" #include "ylogging.h" #include "ywebserver.h" diff --git a/src/nhttpd/yhttpd_core/yresponse.h b/src/nhttpd/yhttpd_core/yresponse.h index 6bdaeab1b..4eb2bf864 100644 --- a/src/nhttpd/yhttpd_core/yresponse.h +++ b/src/nhttpd/yhttpd_core/yresponse.h @@ -9,7 +9,7 @@ // c++ #include // yhttpd -#include "yconfig.h" +#include #include "ytypes_globals.h" #include "yhook.h" @@ -42,8 +42,8 @@ public: void printf(const char *fmt, ...); bool Write(char const *text); bool WriteLn(char const *text); - bool Write(const std::string text) { return Write(text.c_str()); } - bool WriteLn(const std::string text) { return WriteLn(text.c_str()); } + bool Write(const std::string &text) { return Write(text.c_str()); } + bool WriteLn(const std::string &text) { return WriteLn(text.c_str()); } // Headers void SendError(HttpResponseType responseType) {SendHeader(responseType, false, "text/html");} diff --git a/src/nhttpd/yhttpd_core/ysocket.cpp b/src/nhttpd/yhttpd_core/ysocket.cpp index d78912640..6c51d3324 100644 --- a/src/nhttpd/yhttpd_core/ysocket.cpp +++ b/src/nhttpd/yhttpd_core/ysocket.cpp @@ -17,7 +17,7 @@ #include // yhttpd -#include "yhttpd.h" +#include #include "ysocket.h" #include "ylogging.h" // system @@ -64,6 +64,7 @@ CySocket::~CySocket() { // initialize //----------------------------------------------------------------------------- void CySocket::init(void) { + BytesSend = 0; handling = false; isOpened = false; isValid = true; @@ -194,8 +195,8 @@ CySocket* CySocket::accept() { #else set_tcp_nodelay(); #endif + new_ySocket->isOpened = true; } - new_ySocket->isOpened = true; // handling = true; return new_ySocket; } diff --git a/src/nhttpd/yhttpd_core/ywebserver.cpp b/src/nhttpd/yhttpd_core/ywebserver.cpp index 601b966a3..eae380b95 100644 --- a/src/nhttpd/yhttpd_core/ywebserver.cpp +++ b/src/nhttpd/yhttpd_core/ywebserver.cpp @@ -19,7 +19,7 @@ #include // yhttpd -#include "yhttpd.h" +#include #include "ytypes_globals.h" #include "ywebserver.h" #include "ylogging.h" @@ -241,7 +241,6 @@ bool CWebserver::run(void) { int CWebserver::AcceptNewConnectionSocket() { int slot = -1; CySocket *connectionSock = NULL; - int newfd; if (!(connectionSock = listenSocket.accept())) // Blocking wait { @@ -265,7 +264,7 @@ int CWebserver::AcceptNewConnectionSocket() { SocketList[slot] = connectionSock; // put it to list fcntl(connectionSock->get_socket(), F_SETFD, O_NONBLOCK); // set non-blocking open_connections++; // count open connectins - newfd = connectionSock->get_socket(); + int newfd = connectionSock->get_socket(); if (newfd > fdmax) // keep track of the maximum fd fdmax = newfd; } @@ -377,7 +376,7 @@ bool CWebserver::CheckKeepAliveAllowedByIP(std::string client_ip) { while (it != conf_no_keep_alive_ips.end()) { if (trim(*it) == client_ip) do_keep_alive = false; - it++; + ++it; } pthread_mutex_unlock(&mutex); return do_keep_alive; diff --git a/src/nhttpd/yhttpd_mods/mod_auth.cpp b/src/nhttpd/yhttpd_mods/mod_auth.cpp index 3934dc0e4..8e747243c 100644 --- a/src/nhttpd/yhttpd_mods/mod_auth.cpp +++ b/src/nhttpd/yhttpd_mods/mod_auth.cpp @@ -6,7 +6,7 @@ #include #include #include "mod_auth.h" -#include "helper.h" +#include //----------------------------------------------------------------------------- // HOOK: response_hook @@ -65,11 +65,11 @@ bool CmAuth::CheckAuth(CyhookHandler *hh) { // decode Base64 buffer to String //----------------------------------------------------------------------------- std::string CmAuth::decodeBase64(const char *b64buffer) { - char *newString, *org_newString; //shorter then b64buffer + char *newString; //shorter then b64buffer std::string result; if ((newString = (char *) malloc(sizeof(char) * strlen(b64buffer) + 1)) != NULL) { - org_newString = newString; + char *org_newString = newString; int i = 0; unsigned long c = 0; diff --git a/src/nhttpd/yhttpd_mods/mod_auth.h b/src/nhttpd/yhttpd_mods/mod_auth.h index 6215c3fb9..4efdcd8e9 100644 --- a/src/nhttpd/yhttpd_mods/mod_auth.h +++ b/src/nhttpd/yhttpd_mods/mod_auth.h @@ -5,11 +5,12 @@ #ifndef __yhttpd_mod_auth_h__ #define __yhttpd_mod_auth_h__ -#include "yhook.h" +#include class CmAuth: public Cyhook { public: bool authenticate; CmAuth() { + authenticate = false; } ; ~CmAuth() { diff --git a/src/nhttpd/yhttpd_mods/mod_cache.cpp b/src/nhttpd/yhttpd_mods/mod_cache.cpp index 2c59edf20..2172e17e0 100644 --- a/src/nhttpd/yhttpd_mods/mod_cache.cpp +++ b/src/nhttpd/yhttpd_mods/mod_cache.cpp @@ -8,9 +8,9 @@ #include #include // yhttpd -#include "yconfig.h" -#include "ytypes_globals.h" -#include "helper.h" +#include +#include +#include #include "mod_cache.h" //============================================================================= @@ -128,7 +128,7 @@ void CmodCache::AddToCache(CyhookHandler *, std::string url, CacheList[url].mime_type = mime_type; CacheList[url].category = category; CacheList[url].created = time(NULL); - std::string test = CacheList[url].filename; +// std::string test = CacheList[url].filename; } fflush(fd); // flush and close file fclose(fd); @@ -154,7 +154,7 @@ void CmodCache::RemoveCategoryFromCache(std::string category) { do { restart = false; TCacheList::iterator i = CacheList.begin(); - for (; i != CacheList.end(); i++) { + for (; i != CacheList.end(); ++i) { TCache *item = &((*i).second); if (item->category == category) { CacheList.erase(((*i).first)); @@ -198,7 +198,7 @@ void CmodCache::yshowCacheInfo(CyhookHandler *hh) { "URLMimeFilenameCategoryCreatedRemove\n"); pthread_mutex_lock(&mutex); TCacheList::iterator i = CacheList.begin(); - for (; i != CacheList.end(); i++) { + for (; i != CacheList.end(); ++i) { TCache *item = &((*i).second); char timeStr[80]; strftime(timeStr, sizeof(timeStr), RFC1123FMT, gmtime(&(item->created))); diff --git a/src/nhttpd/yhttpd_mods/mod_cache.h b/src/nhttpd/yhttpd_mods/mod_cache.h index 149c0f8a3..d4172e6aa 100644 --- a/src/nhttpd/yhttpd_mods/mod_cache.h +++ b/src/nhttpd/yhttpd_mods/mod_cache.h @@ -11,9 +11,9 @@ // c++ #include // yhttpd -#include "yconfig.h" -#include "ytypes_globals.h" -#include "yhook.h" +#include +#include +#include //----------------------------------------------------------------------------- typedef struct { diff --git a/src/nhttpd/yhttpd_mods/mod_sendfile.cpp b/src/nhttpd/yhttpd_mods/mod_sendfile.cpp index 1e0d42b02..ce3a2551f 100644 --- a/src/nhttpd/yhttpd_mods/mod_sendfile.cpp +++ b/src/nhttpd/yhttpd_mods/mod_sendfile.cpp @@ -47,9 +47,9 @@ #include #include // yhttpd -#include "yconfig.h" -#include "ytypes_globals.h" -#include "helper.h" +#include +#include +#include #include "mod_sendfile.h" //============================================================================= @@ -64,7 +64,6 @@ CStringList CmodSendfile::sendfileTypes; THandleStatus CmodSendfile::Hook_PrepareResponse(CyhookHandler *hh) { hh->status = HANDLED_NONE; - int filed; log_level_printf(4, "mod_sendfile prepare hook start url:%s\n", hh->UrlData["fullurl"].c_str()); std::string mime = sendfileTypes[hh->UrlData["fileext"]]; if (((mime != "") || (hh->WebserverConfigList["mod_sendfile.sendAll"] == "true")) @@ -73,7 +72,7 @@ THandleStatus CmodSendfile::Hook_PrepareResponse(CyhookHandler *hh) { // build filename std::string fullfilename = GetFileName(hh, hh->UrlData["path"], hh->UrlData["filename"]); - + int filed; if ((filed = OpenFile(hh, fullfilename)) != -1) //can access file? { struct stat statbuf; @@ -180,7 +179,6 @@ std::string CmodSendfile::GetFileName(CyhookHandler *hh, std::string path, std:: //----------------------------------------------------------------------------- int CmodSendfile::OpenFile(CyhookHandler *, std::string fullfilename) { int fd = -1; - std::string tmpstring; if (fullfilename.length() > 0) { fd = open(fullfilename.c_str(), O_RDONLY | O_LARGEFILE); if (fd <= 0) { diff --git a/src/nhttpd/yhttpd_mods/mod_sendfile.h b/src/nhttpd/yhttpd_mods/mod_sendfile.h index 0bdcf157e..e4294a25f 100644 --- a/src/nhttpd/yhttpd_mods/mod_sendfile.h +++ b/src/nhttpd/yhttpd_mods/mod_sendfile.h @@ -11,9 +11,9 @@ // c++ #include // yhttpd -#include "yconfig.h" -#include "ytypes_globals.h" -#include "yhook.h" +#include +#include +#include //----------------------------------------------------------------------------- class CmodSendfile : public Cyhook diff --git a/src/nhttpd/yhttpd_mods/mod_testhook.h b/src/nhttpd/yhttpd_mods/mod_testhook.h index a92f9ed98..1f6ed9f2e 100644 --- a/src/nhttpd/yhttpd_mods/mod_testhook.h +++ b/src/nhttpd/yhttpd_mods/mod_testhook.h @@ -6,7 +6,7 @@ #define TESTHOOK_H_ -#include "yhook.h" +#include class CTesthook : public Cyhook { public: diff --git a/src/nhttpd/yhttpd_mods/mod_weblog.cpp b/src/nhttpd/yhttpd_mods/mod_weblog.cpp index 4d25f6e3f..49e88dab4 100644 --- a/src/nhttpd/yhttpd_mods/mod_weblog.cpp +++ b/src/nhttpd/yhttpd_mods/mod_weblog.cpp @@ -11,7 +11,7 @@ #include #include "mod_weblog.h" -#include "helper.h" +#include //============================================================================= // Initialization of static variables @@ -97,8 +97,8 @@ bool CmWebLog::printf(const char *fmt, ...) { if (!OpenLogFile()) return false; bool success = false; - char buffer[bufferlen]; if (WebLogFile != NULL) { + char buffer[bufferlen]={0}; pthread_mutex_lock(&WebLog_mutex); // yeah, its mine va_list arglist; va_start(arglist, fmt); @@ -130,6 +130,8 @@ bool CmWebLog::printf(const char *fmt, ...) { //----------------------------------------------------------------------------- void CmWebLog::AddLogEntry_CLF(CyhookHandler *hh) { +#if 0 +//never used std::string cs_method; switch (hh->Method) { @@ -141,6 +143,7 @@ void CmWebLog::AddLogEntry_CLF(CyhookHandler *hh) cs_method = "unknown"; break; } +#endif std::string c_ip = hh->UrlData["clientaddr"].c_str(); std::string request_startline = hh->UrlData["startline"].c_str(); int s_status = hh->httpStatus; @@ -315,7 +318,6 @@ void CmWebLog::AddLogEntry_ELF(CyhookHandler *hh) std::string c_ip = hh->UrlData["clientaddr"].c_str(); std::string request_startline = hh->UrlData["startline"].c_str(); std::string cs_uri = hh->UrlData["fullurl"]; - std::string cs_uri_stem = hh->UrlData["url"]; int sc_status = hh->httpStatus; int bytes = hh->GetContentLength(); int cached = (hh->HookVarList["CacheCategory"].empty()) ? 0 : 1; diff --git a/src/nhttpd/yhttpd_mods/mod_weblog.h b/src/nhttpd/yhttpd_mods/mod_weblog.h index f65026b55..bcdf2d96e 100644 --- a/src/nhttpd/yhttpd_mods/mod_weblog.h +++ b/src/nhttpd/yhttpd_mods/mod_weblog.h @@ -5,8 +5,8 @@ #ifndef __yhttpd_mod_weblog_h__ #define __yhttpd_mod_weblog_h__ -#include "yconfig.h" -#include "yhook.h" +#include +#include //----------------------------------------------------------------------------- // Defaults #ifndef LOG_FILE diff --git a/src/nhttpd/yhttpd_mods/mod_yparser.cpp b/src/nhttpd/yhttpd_mods/mod_yparser.cpp index 9ad6eb7e6..3fd7a1c5e 100644 --- a/src/nhttpd/yhttpd_mods/mod_yparser.cpp +++ b/src/nhttpd/yhttpd_mods/mod_yparser.cpp @@ -18,12 +18,12 @@ // tuxbox #include // yhttpd -#include "yconfig.h" -#include "ytypes_globals.h" -#include "helper.h" -#include "ylogging.h" +#include +#include +#include +#include #include "mod_yparser.h" -#include "ylanguage.h" +#include //============================================================================= // Initialization of static variables @@ -111,7 +111,7 @@ void CyParser::Execute(CyhookHandler *hh) { if (CLogging::getInstance()->getDebug()) { dprintf("Execute CGI : %s\n", filename.c_str()); for (CStringList::iterator it = hh->ParamList.begin(); it - != hh->ParamList.end(); it++) + != hh->ParamList.end(); ++it) dprintf(" Parameter %s : %s\n", it->first.c_str(), it->second.c_str()); } @@ -156,7 +156,6 @@ void CyParser::Execute(CyhookHandler *hh) { // mini cgi Engine (Entry for ycgi) //----------------------------------------------------------------------------- void CyParser::cgi(CyhookHandler *hh) { - bool ydebug = false; std::string htmlfilename, yresult, ycmd; if ( !hh->ParamList.empty() ) { @@ -164,6 +163,7 @@ void CyParser::cgi(CyhookHandler *hh) { htmlfilename = hh->ParamList["tmpl"]; else htmlfilename = hh->ParamList["1"]; + bool ydebug = false; if (hh->ParamList["debug"] != "") // switch debug on ydebug = true; @@ -171,7 +171,6 @@ void CyParser::cgi(CyhookHandler *hh) { { ycmd = hh->ParamList["execute"]; ycmd = YPARSER_ESCAPE_START + ycmd + YPARSER_ESCAPE_END; - ycmd = ycmd; yresult = cgi_cmd_parsing(hh, ycmd, ydebug); // parsing engine } // parsing given file @@ -471,7 +470,7 @@ std::string CyParser::YWeb_cgi_cmd(CyhookHandler *hh, std::string ycmd) { pthread_mutex_unlock(&yParser_mutex); } } else if (ycmd_type == "file-action") { - std::string filename, actionname, content, tmp, ydefault; + std::string filename, actionname, content, tmp; if (ySplitString(ycmd_name, ";", filename, tmp)) { ySplitString(tmp, ";", actionname, content); replace(content, "\r\n", "\n"); @@ -522,7 +521,6 @@ std::string CyParser::YWeb_cgi_get_ini(CyhookHandler *, std::string filename, //------------------------------------------------------------------------- void CyParser::YWeb_cgi_set_ini(CyhookHandler *, std::string filename, std::string varname, std::string varvalue, std::string yaccess) { - std::string result; if ((yaccess == "open") || (yaccess == "")) { yConfig->clear(); yConfig->loadConfig(filename); @@ -738,11 +736,11 @@ std::string CyParser::func_get_languages_as_dropdown(CyhookHandler *, std::string para) { std::string yresult, sel; DIR *d; - struct dirent *dir; std::string act_language = CLanguage::getInstance()->language; d = opendir((CLanguage::getInstance()->language_dir).c_str()); if (d != NULL) { + struct dirent *dir; while ((dir = readdir(d))) { if (strcmp(dir->d_name, ".") == 0 || strcmp(dir->d_name, "..") == 0) continue; diff --git a/src/nhttpd/yhttpd_mods/mod_yparser.h b/src/nhttpd/yhttpd_mods/mod_yparser.h index 628ed0a7e..ae5d49118 100644 --- a/src/nhttpd/yhttpd_mods/mod_yparser.h +++ b/src/nhttpd/yhttpd_mods/mod_yparser.h @@ -16,10 +16,10 @@ #include // yhttpd -#include "helper.h" -#include "yconfig.h" -#include "ytypes_globals.h" -#include "yhook.h" +#include +#include +#include +#include // forward declaration class CWebserverConnection; diff --git a/src/system/configure_network.cpp b/src/system/configure_network.cpp index 6eaa20d54..ff927a375 100644 --- a/src/system/configure_network.cpp +++ b/src/system/configure_network.cpp @@ -218,11 +218,11 @@ void CNetworkConfig::commitConfig(void) void CNetworkConfig::startNetwork(void) { - const char _ifup[] = "/sbin/ifup"; + std::string cmd = "/sbin/ifup " + ifname; #ifdef DEBUG - printf("CNetworkConfig::startNetwork: %s %s\n",_ifup, ifname.c_str()); + printf("CNetworkConfig::startNetwork: %s\n", cmd.c_str()); #endif - my_system(_ifup, ifname.c_str()); + my_system("/bin/sh", "-c", cmd.c_str()); if (!inet_static) { init_vars(); @@ -232,11 +232,11 @@ void CNetworkConfig::startNetwork(void) void CNetworkConfig::stopNetwork(void) { - const char _ifdown[] = "/sbin/ifdown"; + std::string cmd = "/sbin/ifdown " + ifname; #ifdef DEBUG - printf("CNetworkConfig::stopNetwork: %s %s\n",_ifdown, ifname.c_str()); + printf("CNetworkConfig::stopNetwork: %s\n", cmd.c_str()); #endif - my_system(_ifdown, ifname.c_str()); + my_system("/bin/sh", "-c", cmd.c_str()); } diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index c993bbf41..23708b752 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -37,6 +37,7 @@ #include #include +#include bool file_exists(const char *filename) { @@ -339,7 +340,7 @@ bool CFileHelpers::copyFile(const char *Src, const char *Dst, mode_t mode) return true; } -bool CFileHelpers::copyDir(const char *Src, const char *Dst) +bool CFileHelpers::copyDir(const char *Src, const char *Dst, bool backupMode) { DIR *Directory; struct dirent *CurrentFile; @@ -402,7 +403,10 @@ bool CFileHelpers::copyDir(const char *Src, const char *Dst) } // is file else if (S_ISREG(FileInfo.st_mode)) { - copyFile(srcPath, dstPath, FileInfo.st_mode & 0x0FFF); + std::string save = ""; + if (backupMode && (CExtUpdate::getInstance()->isBlacklistEntry(srcPath))) + save = ".save"; + copyFile(srcPath, (dstPath + save).c_str(), FileInfo.st_mode & 0x0FFF); } } } diff --git a/src/system/helpers.h b/src/system/helpers.h index b3393a0d3..2d9731494 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -50,7 +50,7 @@ class CFileHelpers bool doCopyFlag; bool copyFile(const char *Src, const char *Dst, mode_t mode); - bool copyDir(const char *Src, const char *Dst); + bool copyDir(const char *Src, const char *Dst, bool backupMode=false); bool createDir(const char *Dir, mode_t mode); bool removeDir(const char *Dir); diff --git a/src/system/locals.h b/src/system/locals.h index b929a9b7a..0da8a0913 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -238,6 +238,7 @@ typedef enum LOCALE_CHANNELLIST_FOOT_NEXT, LOCALE_CHANNELLIST_FOOT_OFF, LOCALE_CHANNELLIST_FOOT_SORT_ALPHA, + LOCALE_CHANNELLIST_FOOT_SORT_CHNUM, LOCALE_CHANNELLIST_FOOT_SORT_FREQ, LOCALE_CHANNELLIST_FOOT_SORT_SAT, LOCALE_CHANNELLIST_HEAD, @@ -512,6 +513,7 @@ typedef enum LOCALE_FLASHUPDATE_SQUASHFS_NOVERSION, LOCALE_FLASHUPDATE_TITLEREADFLASH, LOCALE_FLASHUPDATE_TITLEWRITEFLASH, + LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_DEL_SKIPPED, LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_PROCESSED, LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_SKIPPED, LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_SUCCESSFULLY, @@ -776,6 +778,7 @@ typedef enum LOCALE_MENU_HINT_EPG_MAX_EVENTS, LOCALE_MENU_HINT_EPG_OLD_EVENTS, LOCALE_MENU_HINT_EPG_SAVE, + LOCALE_MENU_HINT_EPG_SAVE_STANDBY, LOCALE_MENU_HINT_EVENT_TEXTCOLOR, LOCALE_MENU_HINT_EVENTLIST_FONTS, LOCALE_MENU_HINT_EXTENDED, @@ -1060,6 +1063,7 @@ typedef enum LOCALE_MENU_HINT_SLEEPTIMER, LOCALE_MENU_HINT_SOFT_RESTART, LOCALE_MENU_HINT_SOFTUPDATE_CHECK, + LOCALE_MENU_HINT_SOFTUPDATE_CHECK_LOCAL, LOCALE_MENU_HINT_SOFTUPDATE_EXPERT, LOCALE_MENU_HINT_SOFTUPDATE_EXPERT_READ, LOCALE_MENU_HINT_SOFTUPDATE_EXPERT_WRITE, @@ -1127,6 +1131,7 @@ typedef enum LOCALE_MISCSETTINGS_EPG_OLD_EVENTS_HINT1, LOCALE_MISCSETTINGS_EPG_OLD_EVENTS_HINT2, LOCALE_MISCSETTINGS_EPG_SAVE, + LOCALE_MISCSETTINGS_EPG_SAVE_STANDBY, LOCALE_MISCSETTINGS_GENERAL, LOCALE_MISCSETTINGS_HEAD, LOCALE_MISCSETTINGS_INFOBAR, @@ -1193,6 +1198,7 @@ typedef enum LOCALE_MOTORCONTROL_TIMED_MODE, LOCALE_MOTORCONTROL_USER_MENU, LOCALE_MOTORCONTROL_WEST_LIMIT, + LOCALE_MOVIEBROWSER_ASK_REC_TO_DELETE, LOCALE_MOVIEBROWSER_BOOK_ADD, LOCALE_MOVIEBROWSER_BOOK_CLEAR_ALL, LOCALE_MOVIEBROWSER_BOOK_HEAD, @@ -1210,6 +1216,7 @@ typedef enum LOCALE_MOVIEBROWSER_BROWSER_ROW_ITEM, LOCALE_MOVIEBROWSER_BROWSER_ROW_NR, LOCALE_MOVIEBROWSER_BROWSER_ROW_WIDTH, + LOCALE_MOVIEBROWSER_DELETE_INFO, LOCALE_MOVIEBROWSER_DIR, LOCALE_MOVIEBROWSER_DIR_HEAD, LOCALE_MOVIEBROWSER_EDIT_BOOK, @@ -1472,6 +1479,12 @@ typedef enum LOCALE_PICTUREVIEWER_HELP21, LOCALE_PICTUREVIEWER_HELP22, LOCALE_PICTUREVIEWER_HELP3, + LOCALE_PICTUREVIEWER_HELP30, + LOCALE_PICTUREVIEWER_HELP31, + LOCALE_PICTUREVIEWER_HELP32, + LOCALE_PICTUREVIEWER_HELP33, + LOCALE_PICTUREVIEWER_HELP34, + LOCALE_PICTUREVIEWER_HELP35, LOCALE_PICTUREVIEWER_HELP4, LOCALE_PICTUREVIEWER_HELP5, LOCALE_PICTUREVIEWER_HELP6, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index e2ea8e0db..db36beee4 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -238,6 +238,7 @@ const char * locale_real_names[] = "channellist.foot_next", "channellist.foot_off", "channellist.foot_sort_alpha", + "channellist.foot_sort_chnum", "channellist.foot_sort_freq", "channellist.foot_sort_sat", "channellist.head", @@ -512,6 +513,7 @@ const char * locale_real_names[] = "flashupdate.squashfs.noversion", "flashupdate.titlereadflash", "flashupdate.titlewriteflash", + "flashupdate.update_with_settings_del_skipped", "flashupdate.update_with_settings_processed", "flashupdate.update_with_settings_skipped", "flashupdate.update_with_settings_successfully", @@ -776,6 +778,7 @@ const char * locale_real_names[] = "menu.hint_epg_max_events", "menu.hint_epg_old_events", "menu.hint_epg_save", + "menu.hint_epg_save_standby", "menu.hint_event_textcolor", "menu.hint_eventlist_fonts", "menu.hint_extended", @@ -1060,6 +1063,7 @@ const char * locale_real_names[] = "menu.hint_sleeptimer", "menu.hint_soft_restart", "menu.hint_softupdate_check", + "menu.hint_softupdate_check_local", "menu.hint_softupdate_expert", "menu.hint_softupdate_expert_read", "menu.hint_softupdate_expert_write", @@ -1127,6 +1131,7 @@ const char * locale_real_names[] = "miscsettings.epg_old_events_hint1", "miscsettings.epg_old_events_hint2", "miscsettings.epg_save", + "miscsettings.epg_save_standby", "miscsettings.general", "miscsettings.head", "miscsettings.infobar", @@ -1193,6 +1198,7 @@ const char * locale_real_names[] = "motorcontrol.timed_mode", "motorcontrol.user_menu", "motorcontrol.west_limit", + "moviebrowser.ask_rec_to_delete", "moviebrowser.book_add", "moviebrowser.book_clear_all", "moviebrowser.book_head", @@ -1210,6 +1216,7 @@ const char * locale_real_names[] = "moviebrowser.browser_row_item", "moviebrowser.browser_row_nr", "moviebrowser.browser_row_width", + "moviebrowser.delete_info", "moviebrowser.dir", "moviebrowser.dir_head", "moviebrowser.edit_book", @@ -1472,6 +1479,12 @@ const char * locale_real_names[] = "pictureviewer.help21", "pictureviewer.help22", "pictureviewer.help3", + "pictureviewer.help30", + "pictureviewer.help31", + "pictureviewer.help32", + "pictureviewer.help33", + "pictureviewer.help34", + "pictureviewer.help35", "pictureviewer.help4", "pictureviewer.help5", "pictureviewer.help6", diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index eeb013c9f..d362132c5 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -58,7 +58,7 @@ #include #include #include - +#include // obsolete #include #include @@ -445,7 +445,7 @@ bool CTZChangeNotifier::changeNotify(const neutrino_locale_t, void * Data) printf("Timezone: %s -> %s\n", name.c_str(), zone.c_str()); std::string cmd = "cp /usr/share/zoneinfo/" + zone + " /etc/localtime"; printf("exec %s\n", cmd.c_str()); - system(cmd.c_str()); + my_system("/bin/sh", "-c", cmd.c_str()); cmd = ":" + zone; setenv("TZ", cmd.c_str(), 1); } @@ -468,7 +468,7 @@ int CDataResetNotifier::exec(CMenuTarget* /*parent*/, const std::string& actionK return true; if(delete_all) { - system("rm -f /var/tuxbox/config/zapit/*.conf"); + my_system("/bin/sh", "-c", "rm -f /var/tuxbox/config/zapit/*.conf"); CServiceManager::getInstance()->SatelliteList().clear(); CZapit::getInstance()->LoadSettings(); CZapit::getInstance()->GetConfig(zapitCfg); @@ -488,7 +488,7 @@ int CDataResetNotifier::exec(CMenuTarget* /*parent*/, const std::string& actionK CFrameBuffer::getInstance()->Clear(); } if(delete_chan) { - system("rm -f /var/tuxbox/config/zapit/*.xml"); + my_system("/bin/sh", "-c", "rm -f /var/tuxbox/config/zapit/*.xml"); g_Zapit->reinitChannels(); } return ret; diff --git a/src/system/settings.h b/src/system/settings.h index cbb7b0c25..2ca0ddd42 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -123,6 +123,7 @@ struct SNeutrinoSettings // EPG int epg_save; + int epg_save_standby; std::string epg_cache; std::string epg_old_events; std::string epg_max_events; diff --git a/src/zapit/src/fastscan.cpp b/src/zapit/src/fastscan.cpp index 8fb2b8324..9c2cefde4 100644 --- a/src/zapit/src/fastscan.cpp +++ b/src/zapit/src/fastscan.cpp @@ -288,7 +288,7 @@ bool CServiceScan::ParseFst(unsigned short pid, fast_scan_operator_t * op) std::string providerName = convertDVBUTF8((const char*)&(dbuf[4]), service_provider_name_length, 1, 1); std::string serviceName = convertDVBUTF8((const char*)&(dbuf[4 + service_provider_name_length + 1]), service_name_length, 1, 1); - + #ifdef SCAN_DEBUG printf("[FST] #%04d at %04d: net %04x tp %04x sid %04x v %04x a %04x pcr %04x frq %05d type %d prov [%s] name [%s]\n", num, satellitePosition, original_network_id, transport_stream_id, service_id, video_pid, audio_pid, pcr_pid, freq, service_type, providerName.c_str(), serviceName.c_str()); #endif @@ -297,8 +297,20 @@ bool CServiceScan::ParseFst(unsigned short pid, fast_scan_operator_t * op) channel_id = CREATE_CHANNEL_ID64; CZapitChannel * newchannel; - +#if 0 newchannel = CServiceManager::getInstance()->FindChannel(channel_id); +#else + + int flist[5] = { freq, freq-1, freq+1, freq-2, freq+2 }; + for(int i = 0; i < 5; i++) { + freq_id_t freq_id = flist[i]; + t_channel_id newid = CZapitChannel::makeChannelId(satellitePosition, + freq_id, transport_stream_id, original_network_id, service_id); + newchannel = CServiceManager::getInstance()->FindChannel(newid); + if(newchannel) + break; + } +#endif if(newchannel == NULL) { newchannel = new CZapitChannel ( serviceName, @@ -338,10 +350,13 @@ bool CServiceScan::ParseFst(unsigned short pid, fast_scan_operator_t * op) bouquetId = g_bouquetManager->existsUBouquet(op->name); if (bouquetId == -1) { bouquet = g_bouquetManager->addBouquet(std::string(op->name), true); + bouquetId = g_bouquetManager->existsUBouquet(op->name); } else bouquet = g_bouquetManager->Bouquets[bouquetId]; - bouquet->addService(newchannel); + + if (!(g_bouquetManager->existsChannelInBouquet(bouquetId, newchannel->getChannelID()))) + bouquet->addService(newchannel); } break; default: diff --git a/src/zapit/src/frontend.cpp b/src/zapit/src/frontend.cpp index 4ffd3be48..c3b6a6a13 100644 --- a/src/zapit/src/frontend.cpp +++ b/src/zapit/src/frontend.cpp @@ -1168,9 +1168,8 @@ void CFrontend::setDiseqc(int sat_no, const uint8_t pol, const uint32_t frequenc secSetVoltage(v, 100); #endif sendDiseqcReset(); + usleep(50*1000); /* sleep at least 50 milli seconds */ for (loop = 0; loop <= config.diseqcRepeats; loop++) { - //usleep(50*1000); /* sleep at least 50 milli seconds */ - if (config.diseqcType == MINI_DISEQC) sendToneBurst(b, 1); diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 83571b176..4ed17fae1 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -1055,6 +1055,7 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd) PrepareChannels(); current_channel = CServiceManager::getInstance()->FindChannel(cid); + ParsePatPmt(current_channel);//reinit pids SendCmdReady(connfd); SendEvent(CZapitClient::EVT_SERVICES_CHANGED);