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..4b256a96e 100644 --- a/data/icons/Makefile.am +++ b/data/icons/Makefile.am @@ -94,6 +94,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/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 ba8f1d949..d21fa9e8f 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -486,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. @@ -1034,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 diff --git a/data/locale/english.locale b/data/locale/english.locale index 59b3fe7da..b5ec1277e 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -486,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. @@ -1034,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 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 805db400e..51c690a0f 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -1248,11 +1248,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) -#ifndef HAVE_SPARK_HARDWARE - && (cs_get_revision() > 7) -#endif - )) + (g_settings.shutdown_real_rcdelay && ((trkey == RC_standby) && (g_info.hw_caps->can_shutdown)))) { #ifdef ENABLE_REPEAT_CHECK if (rc_last_repeat_key != ev.code) { diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index da5c68906..6b929001e 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, (int)r); + printf("send err, fd %d: (%d from %d)\n", *it, ret, (int)r); } } mutex.unlock(); @@ -353,8 +353,8 @@ bool CStreamManager::Parse(int fd, stream_pids_t &pids, t_channel_id &chid) } } } - if(CRecordManager::getInstance()->RecordingStatus(tmpid)) { - printf("CStreamManager::Parse: channel %" PRIx64 " recorded, aborting..\n", tmpid); + if(CRecordManager::getInstance()->RecordingStatus(chid)) { + printf("CStreamManager::Parse: channel %" PRIx64 " recorded, aborting..\n", chid); return false; } #endif diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 561b9c8e0..8d48c12ab 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/ext_update.cpp b/src/gui/ext_update.cpp index c8763de72..7e4d430e4 100644 --- a/src/gui/ext_update.cpp +++ b/src/gui/ext_update.cpp @@ -25,8 +25,8 @@ Boston, MA 02110-1301, USA. */ -#define UPDATE_DEBUG_TIMER -#define UPDATE_DEBUG +//#define UPDATE_DEBUG_TIMER +//#define UPDATE_DEBUG #ifdef HAVE_CONFIG_H #include @@ -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 ea2f09d79..d85e26a1c 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -830,6 +830,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) { @@ -1098,10 +1099,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/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/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 8d3ca6e91..2311d74cf 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -903,6 +903,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; @@ -1026,10 +1027,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; } } @@ -2806,7 +2815,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]; @@ -2827,7 +2836,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); @@ -2842,7 +2851,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); @@ -2885,14 +2894,14 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) snprintf(size,BUFFER_SIZE,"%5" PRIu64 "",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..1b3c89712 100644 --- a/src/gui/moviebrowser.h +++ b/src/gui/moviebrowser.h @@ -303,6 +303,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 +325,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 /////////////// diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 82cc89eb1..d7448e47a 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -247,7 +247,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() @@ -310,6 +310,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++) { @@ -368,7 +369,8 @@ bool CMoviePlayerGui::SelectFile() ret = true; } - } + } else + menu_ret = moviebrowser->getMenuRet(); } else { // filebrowser if (filebrowser->exec(Path_local.c_str()) == true) { @@ -404,7 +406,8 @@ bool CMoviePlayerGui::SelectFile() } } } - } + } else + menu_ret = filebrowser->getMenuRet(); } if(ret && file_name.empty()) { std::string::size_type pos = full_name.find_last_of('/'); @@ -427,6 +430,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; @@ -677,6 +681,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) { @@ -687,6 +694,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/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/neutrino.cpp b/src/neutrino.cpp index 6144e187e..50262b155 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -310,6 +310,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) { @@ -2446,7 +2455,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) @@ -2455,7 +2464,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) { @@ -3657,7 +3666,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(); delete CVFD::getInstance(); delete SHTDCNT::getInstance(); diff --git a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp index 0740b73cf..be0475da9 100644 --- a/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/controlapi.cpp @@ -599,44 +599,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()); diff --git a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp index a4ba3bce3..4498f8064 100644 --- a/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp +++ b/src/nhttpd/tuxboxapi/coolstream/neutrinoyparser.cpp @@ -647,48 +647,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"; 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 #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 495ed1c55..aeeca7443 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -513,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, @@ -1062,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, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 5f7098601..4a72331b4 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -513,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", @@ -1062,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", diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index 2a77c36b3..4d8888a37 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -58,7 +58,7 @@ #include #include #include - +#include // obsolete #include #include @@ -472,7 +472,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); @@ -492,7 +492,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/zapit/src/frontend.cpp b/src/zapit/src/frontend.cpp index d6c36a1da..a08e1b7e8 100644 --- a/src/zapit/src/frontend.cpp +++ b/src/zapit/src/frontend.cpp @@ -1269,9 +1269,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 b8395f398..fa4b3eacc 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -1101,6 +1101,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);