From c4aaf7678cf6a02c24524f71fba7663602466f07 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Thu, 23 Feb 2017 12:13:49 +0100 Subject: [PATCH 01/38] - neutrino.cpp: fix compiler warning; ... msg and data is type long unsigned int, so %lu seems the right format, but above %lX is used too and it works fine. So, what's the right one? --- src/neutrino.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 1844b0276..57a0ca62c 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3520,7 +3520,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) return messages_return::handled; } if ((msg >= CRCInput::RC_WithData) && (msg < CRCInput::RC_WithData + 0x10000000)) { - INFO("###################################### DELETED msg %x data %x\n", msg, data); + INFO("###################################### DELETED msg %lX data %lX\n", msg, data); delete [] (unsigned char*) data; return messages_return::handled; } From ee9138f065391914dddf158ca9676fb9d87b9667 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Wed, 22 Feb 2017 08:45:37 +0100 Subject: [PATCH 02/38] Revert "rcinput: Add exception handling for cs hd2" This reverts commit 1b79faff780befa63a04be86560e7183d7a663aa. Wrong in so many ways :-) - The code worked perfectly. But ok, it's easier possible. ;) Signed-off-by: M. Liebmann --- src/driver/rcinput.cpp | 53 +----------------------------------------- src/driver/rcinput.h | 6 ----- 2 files changed, 1 insertion(+), 58 deletions(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 8357f2355..ddba969d2 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -174,49 +174,9 @@ bool CRCInput::checkdev() return true; /* need to check anyway... */ } -#ifdef BOXMODEL_CS_HD2 -bool CRCInput::checkdev_lnk(std::string lnk) -{ - static struct stat info; - if (lstat(lnk.c_str(), &info) != -1) { - if (S_ISLNK(info.st_mode)) { - std::string tmp = readLink(lnk); - if (!tmp.empty()) { - if (lstat(tmp.c_str(), &info) != -1) { - if (S_ISCHR(info.st_mode)) - return true; - } - } - } - } - return false; -} -#endif - bool CRCInput::checkpath(in_dev id) { for (std::vector::iterator it = indev.begin(); it != indev.end(); ++it) { -#ifdef BOXMODEL_CS_HD2 - if ((id.type == DT_LNK) || ((*it).type == DT_LNK)) { - std::string check1, check2; - if (id.type == DT_LNK) - check1 = readLink(id.path); - else - check1 = id.path; - - if ((*it).type == DT_LNK) - check2 = readLink((*it).path); - else - check2 = (*it).path; - - if ((!check1.empty()) && (!check2.empty()) && (check1 == check2)) { - printf("[rcinput:%s] skipping already opened %s => %s\n", __func__, id.path.c_str(), check1.c_str()); - return true; - } - else - return false; - } -#endif if ((*it).path == id.path) { printf("[rcinput:%s] skipping already opened %s\n", __func__, id.path.c_str()); return true; @@ -245,21 +205,10 @@ void CRCInput::open(bool recheck) while ((dentry = readdir(dir)) != NULL) { - if ((dentry->d_type != DT_CHR) -#ifdef BOXMODEL_CS_HD2 - && (dentry->d_type != DT_LNK) -#endif - ) { + if (dentry->d_type != DT_CHR) { d_printf("[rcinput:%s] skipping '%s'\n", __func__, dentry->d_name); continue; } -#ifdef BOXMODEL_CS_HD2 - if ((dentry->d_type == DT_LNK) && (!checkdev_lnk("/dev/input/" + std::string(dentry->d_name)))) { - d_printf("[rcinput:%s] skipping '%s'\n", __func__, dentry->d_name); - continue; - } - id.type = dentry->d_type; -#endif d_printf("[rcinput:%s] considering '%s'\n", __func__, dentry->d_name); id.path = "/dev/input/" + std::string(dentry->d_name); if (checkpath(id)) diff --git a/src/driver/rcinput.h b/src/driver/rcinput.h index 450dd4dd7..d2c29e50f 100644 --- a/src/driver/rcinput.h +++ b/src/driver/rcinput.h @@ -145,9 +145,6 @@ class CRCInput { int fd; std::string path; -#ifdef BOXMODEL_CS_HD2 - int type; -#endif }; uint32_t timerid; @@ -170,9 +167,6 @@ class CRCInput void open(bool recheck = false); bool checkpath(in_dev id); bool checkdev(); -#ifdef BOXMODEL_CS_HD2 - bool checkdev_lnk(std::string lnk); -#endif void close(); int translate(int code); void calculateMaxFd(void); From f0ab22d8b0144260d34160347392472550044e9f Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Wed, 22 Feb 2017 08:46:05 +0100 Subject: [PATCH 03/38] Revert "CRCInput::set_rc_hw: Fix device check for cs hd2" This reverts commit 5cac45ccb837955bd03b9b2cc41e415c983139d7. --- src/driver/rcinput.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index ddba969d2..76090ef0e 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -1764,11 +1764,7 @@ void CRCInput::set_rc_hw(ir_protocol_t ir_protocol, unsigned int ir_address) } int fd = -1; for (std::vector::iterator it = indev.begin(); it != indev.end(); ++it) { - if (((*it).path == "/dev/input/nevis_ir") -#ifdef BOXMODEL_CS_HD2 - || ((*it).path == "/dev/input/input0") -#endif - ){ + if ((*it).path == "/dev/input/nevis_ir") { fd = (*it).fd; break; } From d02b29650e376c3de136e65ecf76bda290f00092 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Wed, 22 Feb 2017 11:43:37 +0100 Subject: [PATCH 04/38] rcinput: add less ugly hack for crappy hd2 driver --- src/driver/rcinput.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 76090ef0e..f54f7bcaf 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -205,12 +205,23 @@ void CRCInput::open(bool recheck) while ((dentry = readdir(dir)) != NULL) { - if (dentry->d_type != DT_CHR) { + id.path = "/dev/input/" + std::string(dentry->d_name); + /* hack: on hd2, the device is called "/dev/cs_ir", + there are links in /dev/input: pointing to it nevis_ir and event0 (WTF???) + so if nevis_ir points to cs_ir, accept it, even though it is a symlink... + the rest of the code then uses coolstream specific parts if path == "nevis_ir" + a better solution would be to simply mknod /dev/input/nevis_ir c 240 0, creating + a second instance of /dev/cs_ir named /dv/input/nevis_ir (or to fix the driver + to actually create a real input device */ + if (dentry->d_type == DT_LNK && + id.path == "/dev/input/nevis_ir") { + if (readLink(id.path) != "/dev/cs_ir") + continue; + } else if (dentry->d_type != DT_CHR) { d_printf("[rcinput:%s] skipping '%s'\n", __func__, dentry->d_name); continue; } d_printf("[rcinput:%s] considering '%s'\n", __func__, dentry->d_name); - id.path = "/dev/input/" + std::string(dentry->d_name); if (checkpath(id)) continue; id.fd = ::open(id.path.c_str(), O_RDWR|O_NONBLOCK|O_CLOEXEC); From 25165a1eaf106e5d5f74b5645ca33b42c1cda527 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Wed, 22 Feb 2017 20:29:51 +0100 Subject: [PATCH 05/38] rcinput: clarify comment regarding hd2 device --- src/driver/rcinput.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index f54f7bcaf..35c0a5542 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -209,10 +209,11 @@ void CRCInput::open(bool recheck) /* hack: on hd2, the device is called "/dev/cs_ir", there are links in /dev/input: pointing to it nevis_ir and event0 (WTF???) so if nevis_ir points to cs_ir, accept it, even though it is a symlink... - the rest of the code then uses coolstream specific parts if path == "nevis_ir" a better solution would be to simply mknod /dev/input/nevis_ir c 240 0, creating - a second instance of /dev/cs_ir named /dv/input/nevis_ir (or to fix the driver - to actually create a real input device */ + a second instance of /dev/cs_ir named /dev/input/nevis_ir (or to fix the driver + to actually create a real event0 device via udev) + Note: i'm deliberately not using event0, because this might be replaced by a "real" + event0 device if e.g. an USB keyboard is plugged in*/ if (dentry->d_type == DT_LNK && id.path == "/dev/input/nevis_ir") { if (readLink(id.path) != "/dev/cs_ir") From 41e420d35dfbadd53d6f3571536820ac3e79b989 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Wed, 22 Feb 2017 21:23:11 +0100 Subject: [PATCH 06/38] fb_accel: move hd2 specific parts from fader to fb_accel --- src/driver/fade.cpp | 16 ---------------- src/driver/fb_accel_cs_hd2.cpp | 5 ++++- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/src/driver/fade.cpp b/src/driver/fade.cpp index 3af188521..daefa3696 100644 --- a/src/driver/fade.cpp +++ b/src/driver/fade.cpp @@ -55,11 +55,7 @@ void COSDFader::StartFadeIn() fadeIn = true; fadeOut = false; fadeValue = 100; -#ifdef BOXMODEL_CS_HD2 - frameBuffer->setBlendMode(CNXTFB_BLEND_MODE_UNIFORM_ALPHA); // Global alpha multiplied with pixel alpha -#else frameBuffer->setBlendMode(2); // Global alpha multiplied with pixel alpha -#endif frameBuffer->setBlendLevel(fadeValue); #if HAVE_SPARK_HARDWARE || HAVE_DUCKBOX_HARDWARE || (HAVE_COOL_HARDWARE && defined(BOXMODEL_CS_HD2)) @@ -79,11 +75,7 @@ bool COSDFader::StartFadeOut() if ((!fadeOut) && g_settings.widget_fade) { fadeOut = true; fadeTimer = g_RCInput->addTimer( FADE_TIME, false ); -#ifdef BOXMODEL_CS_HD2 - frameBuffer->setBlendMode(CNXTFB_BLEND_MODE_UNIFORM_ALPHA); // Global alpha multiplied with pixel alpha -#else frameBuffer->setBlendMode(2); // Global alpha multiplied with pixel alpha -#endif ret = true; } return ret; @@ -93,11 +85,7 @@ void COSDFader::StopFade() { if ( fadeIn || fadeOut ) { g_RCInput->killTimer(fadeTimer); -#ifdef BOXMODEL_CS_HD2 - frameBuffer->setBlendMode(CNXTFB_BLEND_MODE_PER_PIXEL); // Global alpha multiplied with pixel alpha -#else frameBuffer->setBlendMode(1); // Global alpha multiplied with pixel alpha -#endif #if HAVE_SPARK_HARDWARE || HAVE_DUCKBOX_HARDWARE || (HAVE_COOL_HARDWARE && defined(BOXMODEL_CS_HD2)) usleep(60000); #endif @@ -124,11 +112,7 @@ bool COSDFader::FadeDone() fadeValue = max_alpha; g_RCInput->killTimer (fadeTimer); fadeIn = false; -#ifdef BOXMODEL_CS_HD2 - frameBuffer->setBlendMode(CNXTFB_BLEND_MODE_PER_PIXEL); // Global alpha multiplied with pixel alpha -#else frameBuffer->setBlendMode(1); // Global alpha multiplied with pixel alpha -#endif #if HAVE_SPARK_HARDWARE || HAVE_DUCKBOX_HARDWARE || (HAVE_COOL_HARDWARE && defined(BOXMODEL_CS_HD2)) usleep(60000); #endif diff --git a/src/driver/fb_accel_cs_hd2.cpp b/src/driver/fb_accel_cs_hd2.cpp index b801a37ff..ce20ce051 100644 --- a/src/driver/fb_accel_cs_hd2.cpp +++ b/src/driver/fb_accel_cs_hd2.cpp @@ -241,7 +241,10 @@ fb_pixel_t * CFbAccelCSHD2::getBackBufferPointer() const void CFbAccelCSHD2::setBlendMode(uint8_t mode) { - if (ioctl(fd, FBIO_SETBLENDMODE, mode)) + uint8_t arg = CNXTFB_BLEND_MODE_PER_PIXEL; + if (mode == 2) + arg = CNXTFB_BLEND_MODE_UNIFORM_ALPHA; + if (ioctl(fd, FBIO_SETBLENDMODE, arg)) printf("FBIO_SETBLENDMODE failed.\n"); } From 6b8a7eb5f32f7249a260ee368b8afe1727bd9c2d Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Thu, 23 Feb 2017 08:54:01 +0100 Subject: [PATCH 07/38] CKeybindSetup: Fix changeNotify call for change repeat_block... --- src/gui/keybind_setup.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/keybind_setup.cpp b/src/gui/keybind_setup.cpp index 1e835cc30..bd6af76e7 100644 --- a/src/gui/keybind_setup.cpp +++ b/src/gui/keybind_setup.cpp @@ -305,7 +305,7 @@ int CKeybindSetup::showKeySetup() #endif cc = new CMenuOptionNumberChooser(LOCALE_KEYBINDINGMENU_REPEATBLOCK, - &g_settings.repeat_blocker, true, 0, 999, NULL, + &g_settings.repeat_blocker, true, 0, 999, this, CRCInput::convertDigitToKey(shortcut++), NULL, 0, 0, LOCALE_OPTIONS_OFF); cc->setNumberFormat(ms_number_format); cc->setNumericInput(true); @@ -313,7 +313,7 @@ int CKeybindSetup::showKeySetup() keySettings->addItem(cc); cc = new CMenuOptionNumberChooser(LOCALE_KEYBINDINGMENU_REPEATBLOCKGENERIC, - &g_settings.repeat_genericblocker, true, 0, 999, NULL, + &g_settings.repeat_genericblocker, true, 0, 999, this, CRCInput::convertDigitToKey(shortcut++), NULL, 0, 0, LOCALE_OPTIONS_OFF); cc->setNumberFormat(ms_number_format); cc->setNumericInput(true); From 1f5778b769942a79754f97fce66a008c46a83f5a Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 23 Feb 2017 20:41:54 +0100 Subject: [PATCH 08/38] src/gui/widget/msgbox.cpp dont block record msg --- src/gui/widget/msgbox.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 25deb70f8..db9ba0f97 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -315,6 +315,9 @@ int CMsgBox::exec() result = (msg_result_t)ccw_footer->getSelectedButtonObject()->getButtonResult(); loop = false; } + else if (msg == NeutrinoMessages::RECORD_START) { + CNeutrinoApp::getInstance()->handleMsg(msg, data); + } //***ignore*** else if (CNeutrinoApp::getInstance()->listModeKey(msg)){ // do nothing //TODO: if passed rc messages are ignored rc messaages: has no effect here too!! From 3c1e3252464eae82943483695a90d4d98e292ccb Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Thu, 23 Feb 2017 21:49:44 +0100 Subject: [PATCH 09/38] - followscreenings: don't show, when channel_id is 0 --- src/gui/followscreenings.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/followscreenings.cpp b/src/gui/followscreenings.cpp index b14a00bb5..e712754cc 100644 --- a/src/gui/followscreenings.cpp +++ b/src/gui/followscreenings.cpp @@ -145,6 +145,9 @@ void CFollowScreenings::updateRightIcon(int ix, time_t start, unsigned int durat void CFollowScreenings::show() { + if (channel_id == 0) + return; + char actionstr[32]; getFollowScreenings(); @@ -177,4 +180,3 @@ void CFollowScreenings::show() m.exec(NULL, ""); } } - From b97a3e84ed8f41e9d7fe681278c18886b896aa14 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Thu, 23 Feb 2017 22:00:42 +0100 Subject: [PATCH 10/38] - followscreenings: don't show, when followlist is empty --- src/gui/followscreenings.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/followscreenings.cpp b/src/gui/followscreenings.cpp index e712754cc..2ee471fd6 100644 --- a/src/gui/followscreenings.cpp +++ b/src/gui/followscreenings.cpp @@ -152,10 +152,13 @@ void CFollowScreenings::show() getFollowScreenings(); - if (followlist.size() == 1) { + if (followlist.size() == 1) + { snprintf(actionstr, sizeof(actionstr), "%lu", followlist.front().startTime); exec(NULL, actionstr); - } else { + } + else if (followlist.size() > 1) + { CMenuWidget m(LOCALE_EPGVIEWER_SELECT_SCREENING, NEUTRINO_ICON_SETTINGS); const char *icon = NEUTRINO_ICON_BUTTON_RED; neutrino_msg_t directKey = CRCInput::RC_red; From 98afb08c5d17ef73b62fb338c180a6decc701c24 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Fri, 24 Feb 2017 12:30:33 +0100 Subject: [PATCH 11/38] supplement to 1f5778b769942a79754f97fce66a008c46a83f5a, add stop msg --- src/gui/widget/msgbox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index db9ba0f97..bc364fd9f 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -315,7 +315,7 @@ int CMsgBox::exec() result = (msg_result_t)ccw_footer->getSelectedButtonObject()->getButtonResult(); loop = false; } - else if (msg == NeutrinoMessages::RECORD_START) { + else if (msg == NeutrinoMessages::RECORD_START || msg == NeutrinoMessages::RECORD_STOP) { CNeutrinoApp::getInstance()->handleMsg(msg, data); } //***ignore*** From d2408d1ade63c0e76d0926e9cc09162e2c2d537f Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 10 Jan 2016 16:14:10 +0100 Subject: [PATCH 12/38] rcinput/neutrino: avoid the use of EVT_TIMESET sectionsd's EVT_TIMESET was only used to fix time calculations for input repeat detection. I doubt this reliably worked anyway. Just calculate an absolute input timestamp from CLOCK_MONOTONIC and use that. Even better solution would be to use a newer kernel with EVIOCSCLOCKID ioctl, leave that for later :-) --- src/neutrino.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 57a0ca62c..28d062bd7 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -5,7 +5,7 @@ and some other guys Homepage: http://dbox.cyberphoria.org/ - Copyright (C) 2006-2014 Stefan Seyfried + Copyright (C) 2006-2016 Stefan Seyfried Copyright (C) 2011 CoolStream International Ltd @@ -1981,7 +1981,11 @@ void CNeutrinoApp::InitZapitClient() void CNeutrinoApp::InitSectiondClient() { g_Sectionsd = new CSectionsdClient; - g_Sectionsd->registerEvent(CSectionsdClient::EVT_TIMESET, 222, NEUTRINO_UDS_NAME); + struct timespec t; + if (clock_gettime(CLOCK_MONOTONIC, &t)) { + dprintf(DEBUG_NORMAL, "CLOCK_MONOTONIC not supported? (%m), falling back to EVT_TIMESET\n"); + g_Sectionsd->registerEvent(CSectionsdClient::EVT_TIMESET, 222, NEUTRINO_UDS_NAME); + } g_Sectionsd->registerEvent(CSectionsdClient::EVT_GOT_CN_EPG, 222, NEUTRINO_UDS_NAME); g_Sectionsd->registerEvent(CSectionsdClient::EVT_EIT_COMPLETE, 222, NEUTRINO_UDS_NAME); g_Sectionsd->registerEvent(CSectionsdClient::EVT_WRITE_SI_FINISHED, 222, NEUTRINO_UDS_NAME); From eb477aee8efc01d9781c98d1a76f47fe6438c267 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Fri, 24 Feb 2017 18:26:07 +0100 Subject: [PATCH 13/38] - audioplayer: fix small typo --- src/gui/audioplayer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 151165907..46ab4b8b9 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1601,7 +1601,7 @@ void CAudioPlayerGui::paintFoot() if (m_screensaver) return; - const struct button_label ScondLineButtons[3] = + const struct button_label SecondLineButtons[3] = { { NEUTRINO_ICON_BUTTON_OKAY , LOCALE_AUDIOPLAYER_PLAY }, { NEUTRINO_ICON_BUTTON_HELP , LOCALE_AUDIOPLAYER_KEYLEVEL }, @@ -1620,7 +1620,7 @@ void CAudioPlayerGui::paintFoot() int bwidth = m_width - (2*c_rad_mid); if (!m_playlist.empty()) - ::paintButtons(m_x + c_rad_mid, top+m_buttonHeight, bwidth, 3, ScondLineButtons, bwidth, m_buttonHeight); + ::paintButtons(m_x + c_rad_mid, top+m_buttonHeight, bwidth, 3, SecondLineButtons, bwidth, m_buttonHeight); if (m_key_level == 0) { From 0953e66d22819072237e5480b6e8f7cda62e51be Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Thu, 23 Feb 2017 22:47:09 +0100 Subject: [PATCH 14/38] neutrino: No terminate moviebrowser, menue, etc. when recording start --- src/neutrino.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 28d062bd7..e02de17e5 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3181,7 +3181,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) if (rec_mode == CRecordManager::RECMODE_OFF || rec_mode == CRecordManager::RECMODE_TSHIFT) CRecordManager::getInstance()->Record(live_channel_id); delete[] (unsigned char*) data; - return messages_return::handled | messages_return::cancel_all; + return messages_return::handled; } if(mode == mode_standby){ if((eventinfo->channel_id != live_channel_id) && !(SAME_TRANSPONDER(live_channel_id, eventinfo->channel_id))) @@ -3194,7 +3194,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) } delete[] (unsigned char*) data; - return messages_return::handled | messages_return::cancel_all; + return messages_return::handled; } else if( msg == NeutrinoMessages::RECORD_STOP) { CTimerd::RecordingStopInfo* recinfo = (CTimerd::RecordingStopInfo*)data; From 803253e3d42c074b918891de5fd9920f066ffb3a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 22 Feb 2017 20:47:12 +0100 Subject: [PATCH 15/38] CComponentsScrollBar: remove unnecessary debug output --- src/gui/components/cc_frm_scrollbar.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index 529d0102a..2fcfd737c 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -165,9 +165,6 @@ void CComponentsScrollBar::initSegments() y_seg += h_seg + append_y_offset; int id = sb_segments_obj->getCCItemId(item); - if (sb_mark_id > id){ - dprintf(DEBUG_NORMAL, "[CComponentsScrollBar] %s: sb_mark_id out of range current=%d allowed=%d\n", __func__, sb_mark_id, id); - } //set color for marked id if (sb_mark_id == id){ From be9dd7938dbdb16e068ff27879be4a203b0b1934 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 24 Feb 2017 23:06:35 +0100 Subject: [PATCH 16/38] CVideoSettings: avoid unnecessary display of messageboxes --- src/gui/videosettings.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/videosettings.cpp b/src/gui/videosettings.cpp index 6515f171e..9a013a6af 100644 --- a/src/gui/videosettings.cpp +++ b/src/gui/videosettings.cpp @@ -565,6 +565,7 @@ void CVideoSettings::nextMode(void) int curmode = 0; int i; bool disp_cur = 1; + int res = messages_return::none; for (i = 0; i < VIDEOMENU_VIDEOMODE_OPTION_COUNT; i++) { if (VIDEOMENU_VIDEOMODE_OPTIONS[i].key == g_settings.video_Mode) { @@ -576,7 +577,9 @@ void CVideoSettings::nextMode(void) while(1) { CVFD::getInstance()->ShowText(text); - int res = ShowHint(LOCALE_VIDEOMENU_VIDEOMODE, text, 450, 2); + + if (res != messages_return::cancel_info) // avoid unnecessary display of messageboxes, when user is trying to press repeated format button + res = ShowHint(LOCALE_VIDEOMENU_VIDEOMODE, text, 450, 2); if(disp_cur && res != messages_return::handled) break; From c3e5d77bfe1d1f85c47ca5ddfd4f9121253da316 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sat, 25 Feb 2017 15:58:07 +0100 Subject: [PATCH 17/38] rcinput: apply ev.time adjustment to all events This fixes detection of keys that are allowed to be long-pressed if "long keypress" feature is enabled. No idea why this was applied only to key press events before :-) --- src/driver/rcinput.cpp | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 35c0a5542..657a2a244 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -1320,21 +1320,19 @@ void CRCInput::getMsg_us(neutrino_msg_t * msg, neutrino_msg_data_t * data, uint6 } if (ev.type == EV_SYN) continue; /* ignore... */ - if (ev.value) { - /* try to compensate for possible changes in wall clock - * kernel ev.time default uses CLOCK_REALTIME, as does gettimeofday(). - * so subtract gettimeofday() from ev.time and then add - * CLOCK_MONOTONIC, which is supposed to not change with settimeofday. - * Everything would be much easier if we could use the post-kernel 3.4 - * EVIOCSCLOCKID ioctl :-) */ - struct timespec t1; - now_pressed = ev.time.tv_usec + ev.time.tv_sec * 1000000ULL; - if (!clock_gettime(CLOCK_MONOTONIC, &t1)) { - struct timeval t2; - gettimeofday(&t2, NULL); - now_pressed += t1.tv_sec * 1000000ULL + t1.tv_nsec / 1000; - now_pressed -= (t2.tv_usec + t2.tv_sec * 1000000ULL); - } + /* try to compensate for possible changes in wall clock + * kernel ev.time default uses CLOCK_REALTIME, as does gettimeofday(). + * so subtract gettimeofday() from ev.time and then add + * CLOCK_MONOTONIC, which is supposed to not change with settimeofday. + * Everything would be much easier if we could use the post-kernel 3.4 + * EVIOCSCLOCKID ioctl :-) */ + struct timespec t1; + now_pressed = ev.time.tv_usec + ev.time.tv_sec * 1000000ULL; + if (!clock_gettime(CLOCK_MONOTONIC, &t1)) { + struct timeval t2; + gettimeofday(&t2, NULL); + now_pressed += t1.tv_sec * 1000000ULL + t1.tv_nsec / 1000; + now_pressed -= (t2.tv_usec + t2.tv_sec * 1000000ULL); } SHTDCNT::getInstance()->resetSleepTimer(); if (ev.value && firstKey) { From cf9a1a705cf819e1112c20c20d09e823c4bb675f Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Sun, 26 Feb 2017 00:06:32 +0100 Subject: [PATCH 18/38] - timerlist: fix timer comparison in modifyTimer() --- src/gui/timerlist.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index f54d04c30..145360ee8 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -1616,6 +1616,7 @@ int CTimerList::modifyTimer() if (!strlen(timer->recordingDir)) strncpy(timer->recordingDir,g_settings.network_nfs_recordingdir.c_str(),sizeof(timer->recordingDir)-1); timer_recordingDir = timer->recordingDir; + strncpy(t_old.recordingDir, timer->recordingDir, sizeof(t_old.recordingDir)-1); bool recDirEnabled = (g_settings.recording_type == RECORDING_FILE); // obsolete? CMenuForwarder* m6 = new CMenuForwarder(LOCALE_TIMERLIST_RECORDING_DIR, recDirEnabled, timer_recordingDir, this, "rec_dir1", CRCInput::RC_green); From 1aa5e929db9197bd5c2480471b4e57712995b734 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Sun, 26 Feb 2017 01:01:15 +0100 Subject: [PATCH 19/38] - channelist: use OFFSET-defines for channels w/o EPG too --- src/gui/channellist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index d4a139537..9f8fc22be 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2087,7 +2087,7 @@ void CChannelList::paintItem(int pos, const bool firstpaint) pb.paint(); } //name - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 5+ numwidth+ 10+prg_offset, ypos+ fheight, width- numwidth- 40- 15-prg_offset, nameAndDescription, color); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x + OFFSET_INNER_SMALL + numwidth + OFFSET_INNER_MID + prg_offset, ypos + fheight, width - numwidth - 4*OFFSET_INNER_MID - 15 - prg_offset, nameAndDescription, color); } if (!firstpaint && curr == selected) updateVfd(); From df25b5094427705816f3264252e2c506ff50b9e2 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 26 Feb 2017 15:05:21 +0100 Subject: [PATCH 20/38] src/gui/movieplayer.cpp try fix stop play file on file end --- src/gui/movieplayer.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 87499697e..05fd0b093 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1285,8 +1285,11 @@ void CMoviePlayerGui::PlayFileLoop(void) bool first_start = true; bool update_lcd = true; int eof = 0; + int eof2 = 0; + int position_tmp = 0; bool at_eof = !(playstate >= CMoviePlayerGui::PLAY);; keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_NORMAL; + while (playstate >= CMoviePlayerGui::PLAY) { if (update_lcd) { @@ -1320,6 +1323,20 @@ void CMoviePlayerGui::PlayFileLoop(void) printf("CMoviePlayerGui::%s: spd %d pos %d/%d (%d, %d%%)\n", __func__, speed, position, duration, duration-position, file_prozent); #endif /* in case ffmpeg report incorrect values */ + if((playstate == CMoviePlayerGui::PLAY) && (speed == 1)){ + if(position_tmp != position){ + position_tmp = position ; + eof2 = 0; + }else{ + if (++eof2 > 6) { + at_eof = true; + break; + } + } + } + else{ + eof2 = 0; + } int posdiff = duration - position; if ((posdiff >= 0) && (posdiff < 2000) && timeshift == TSHIFT_MODE_OFF) { From 6166f4a6f44fd8e300bf0994839cf210e5915242 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Mon, 27 Feb 2017 00:20:49 +0100 Subject: [PATCH 21/38] CLuaInstance: Add script fumction 'scale2Res' - Set Lua api version to 1.69 --- src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/luainstance.cpp | 19 +++++++++++++++++++ src/gui/lua/luainstance.h | 1 + 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 54fa105fa..6c8b8bc22 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 68 +#define LUA_API_VERSION_MINOR 69 diff --git a/src/gui/lua/luainstance.cpp b/src/gui/lua/luainstance.cpp index e3ac5aa40..b3aaea15b 100644 --- a/src/gui/lua/luainstance.cpp +++ b/src/gui/lua/luainstance.cpp @@ -568,6 +568,7 @@ void LuaInstRegisterFunctions(lua_State *L, bool fromThreads/*=false*/) { "saveScreen", CLuaInstance::saveScreen }, { "restoreScreen", CLuaInstance::restoreScreen }, { "deleteSavedScreen", CLuaInstance::deleteSavedScreen }, + { "scale2Res", CLuaInstance::scale2Res }, /* lua_misc.cpp @@ -1183,4 +1184,22 @@ int CLuaInstance::deleteSavedScreen(lua_State *L) return 0; } +int CLuaInstance::scale2Res(lua_State *L) +{ + CLuaData *W = CheckData(L, 1); + if (!W || !W->fbwin) return 0; + + int value, ret; + value = luaL_checkint(L, 2); + +/* Remove this when pu/fb-setmode branch is merged to master */ +#ifdef SCALE2RES_DEFINED + ret = CFrameBuffer::getInstance()->scale2Res(value); +#else + ret = value; +#endif + lua_pushinteger(L, ret); + return 1; +} + /* --------------------------------------------------------------- */ diff --git a/src/gui/lua/luainstance.h b/src/gui/lua/luainstance.h index 69311a9b9..21ebb625b 100644 --- a/src/gui/lua/luainstance.h +++ b/src/gui/lua/luainstance.h @@ -73,6 +73,7 @@ public: static int saveScreen(lua_State *L); static int restoreScreen(lua_State *L); static int deleteSavedScreen(lua_State *L); + static int scale2Res(lua_State *L); private: lua_State* lua; From 2d30ef10d8a4f085ca8cbef6b0cc5c18f41d8c34 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Tue, 28 Feb 2017 22:08:34 +0100 Subject: [PATCH 22/38] lua cwindow.new: Fix draw small windows - Ignore percent conversion of width and height to remain compatible with the Lua API --- src/gui/lua/lua_cc_window.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/lua/lua_cc_window.cpp b/src/gui/lua/lua_cc_window.cpp index 7dc5e77bd..494487614 100644 --- a/src/gui/lua/lua_cc_window.cpp +++ b/src/gui/lua/lua_cc_window.cpp @@ -127,6 +127,10 @@ int CLuaInstCCWindow::CCWindowNew(lua_State *L) CLuaCCWindow **udata = (CLuaCCWindow **) lua_newuserdata(L, sizeof(CLuaCCWindow *)); *udata = new CLuaCCWindow(); (*udata)->w = new CComponentsWindow(x, y, dx, dy, name.c_str(), icon.c_str(), 0, has_shadow, (fb_pixel_t)color_frame, (fb_pixel_t)color_body, (fb_pixel_t)color_shadow); + /* Ignore percent conversion of width and height + to remain compatible with the Lua API */ + (*udata)->w->setWidth(dx); + (*udata)->w->setHeight(dy); if (!show_header) (*udata)->w->showHeader(false); From 5edc8571223fac0307e5ce81e8d576447749f179 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 1 Mar 2017 11:51:25 +0100 Subject: [PATCH 23/38] - yWeb: unify rec/zap timer handling; avoid german umlaut in js-popup --- data/y-web/Y_Baselib.js | 7 ++++++- data/y-web/Y_EPG.js | 9 ++++----- data/y-web/Y_EPG_Plus.yhtm | 4 ++-- data/y-web/Y_Live_EPG.yhtm | 26 ++++++++++++-------------- data/y-web/Y_Version.txt | 4 ++-- data/y-web/languages/Deutsch | 4 ++-- data/y-web/languages/English | 4 ++-- data/y-web/languages/Polski | 4 ++-- data/y-web/languages/Portuguese | 4 ++-- data/y-web/languages/Slovak | 4 ++-- 10 files changed, 36 insertions(+), 34 deletions(-) diff --git a/data/y-web/Y_Baselib.js b/data/y-web/Y_Baselib.js index 7bd0552e6..e47890961 100644 --- a/data/y-web/Y_Baselib.js +++ b/data/y-web/Y_Baselib.js @@ -412,11 +412,16 @@ function dbox_popup(_msg) { return loadSyncURL("/control/message?popup="+_msg); } -function dbox_set_timer(_channel_id, _start, _stop) +function dbox_set_timer_rec(_channel_id, _start, _stop) { var _url = "/control/timer?action=new&type=5&alarm="+_start+"&stop="+_stop+"&announce="+_start+"&channel_id="+_channel_id+"&rs=1"; return loadSyncURL(_url); } +function dbox_set_timer_zap(_channel_id, _start) +{ + var _url = "/control/timer?action=new&type=3&alarm="+_start+"&channel_id="+_channel_id; + return loadSyncURL(_url); +} function dbox_zapto(_channel_id) { var _url = "/control/zapto?"+_channel_id; diff --git a/data/y-web/Y_EPG.js b/data/y-web/Y_EPG.js index f3d3ebd96..bfaec3e13 100644 --- a/data/y-web/Y_EPG.js +++ b/data/y-web/Y_EPG.js @@ -30,12 +30,11 @@ function epg_plus_calc_dimensions(){ function epg_zapto(){ dbox_zapto($('d_channel_id').innerHTML); } -function epg_set_timer(){ - dbox_set_timer($("d_channel_id").innerHTML, $("d_start").innerHTML, $("d_stop").innerHTML); +function epg_set_timer_rec(){ + dbox_set_timer_rec($("d_channel_id").innerHTML, $("d_start").innerHTML, $("d_stop").innerHTML); } -function set_zapit(){ - var rec = "/control/timer?action=new&type=3&alarm="+$("d_start").innerHTML+"&channel_id="+$("d_channel_id").innerHTML; - var res = loadSyncURL(rec); +function epg_set_timer_zap(){ + dbox_set_timer_zap($("d_channel_id").innerHTML, $("d_start").innerHTML); } function build_epg_clear(){ var ep = $("epg_plus"); diff --git a/data/y-web/Y_EPG_Plus.yhtm b/data/y-web/Y_EPG_Plus.yhtm index 4a4eb7c2e..cf4ef0066 100644 --- a/data/y-web/Y_EPG_Plus.yhtm +++ b/data/y-web/Y_EPG_Plus.yhtm @@ -59,8 +59,8 @@ function epg_imdb(){
- - + + diff --git a/data/y-web/Y_Live_EPG.yhtm b/data/y-web/Y_Live_EPG.yhtm index 8d0dc53f0..efb7e9dbf 100644 --- a/data/y-web/Y_Live_EPG.yhtm +++ b/data/y-web/Y_Live_EPG.yhtm @@ -20,29 +20,27 @@ function sLog_clear() } sLog_line_number = 0; } -function sLog_addRow(_body, _date, _rec, _zapit, _start, _end, _title) +function sLog_addRow(_body, _date, _rec, _zap, _start, _end, _title) { sLog_line_number++; var mycurrent_row = y_add_row_to_table(_body, ((sLog_line_number % 2) ==0)?"a":"b" ); y_add_html_cell_to_row(mycurrent_row, "rec", _rec); - y_add_html_cell_to_row(mycurrent_row, "zap", _zapit); + y_add_html_cell_to_row(mycurrent_row, "zap", _zap); y_add_html_cell_to_row(mycurrent_row, "date", _date); y_add_html_cell_to_row(mycurrent_row, "starttime", _start); y_add_html_cell_to_row(mycurrent_row, "endtime", _end); y_add_html_cell_to_row(mycurrent_row, "epgtitle", _title); } -function set_timer(_channel_id, _start, _stop) +function set_timer_rec(_channel_id, _start, _stop) { - var rec = "/control/timer?action=new&type=5&alarm="+_start+"&stop="+_stop+"&announce="+_start+"&channel_id="+_channel_id+"&rs=1"; - var res = loadSyncURL(rec); - alert("{=L:epg.set_timer=}"); + var res = dbox_set_timer_rec(_channel_id, _start, _stop); + alert("{=L:epg.set_timer_rec=}"); } -function set_zapit(_channel_id, _start) +function set_timer_zap(_channel_id, _start) { - var rec = "/control/timer?action=new&type=3&alarm="+_start+"&channel_id="+_channel_id; - var res = loadSyncURL(rec); - alert("{=L:epg.zap_to=}"); + var res = dbox_set_timer_zap(_channel_id, _start); + alert("{=L:epg.set_timer_zap=}"); } function show_info(_index) { @@ -102,10 +100,10 @@ function _show_epg() var epg_obj= new Array(_desc, _info1, _info2, _start, _start_t, _stop.toString(), "{=channel=}"); epg_data.push(epg_obj); - var _rec = ""; - var _zapit = ""; - var _tit = ""+_desc+""; - sLog_addRow(sLog_body, _date, _rec, _zapit, _start_t, _stop_t, _tit); + var _rec = ""; + var _zap = ""; + var _title = ""+_desc+""; + sLog_addRow(sLog_body, _date, _rec, _zap, _start_t, _stop_t, _title); epg_data_index++; } } diff --git a/data/y-web/Y_Version.txt b/data/y-web/Y_Version.txt index cdf6bc930..df5cf3f7c 100644 --- a/data/y-web/Y_Version.txt +++ b/data/y-web/Y_Version.txt @@ -1,4 +1,4 @@ -version=2.9.0.39 -date=26.08.2016 +version=2.9.0.40 +date=01.03.2017 type=Release info=Port Tuxbox-Neutrino diff --git a/data/y-web/languages/Deutsch b/data/y-web/languages/Deutsch index e726ac538..47bbe3947 100644 --- a/data/y-web/languages/Deutsch +++ b/data/y-web/languages/Deutsch @@ -203,8 +203,8 @@ epg.hover_for_details=Für Details: Maus über die entsprechende Sendung epg.refresh=EPG Daten aktualisieren epg.past_hours=Stunden zurück epg.next_hours=Stunden vor -epg.set_timer=Timer für Aufnahme gesetzt -epg.zap_to=Umschalt-Timer gesetzt +epg.set_timer_rec=Aufnahme-Timer gesetzt +epg.set_timer_zap=Umschalt-Timer gesetzt ========EPG Streaminfo epg.si.streaminfo=Streaminfo diff --git a/data/y-web/languages/English b/data/y-web/languages/English index 8ee0e178d..e3af6cbae 100644 --- a/data/y-web/languages/English +++ b/data/y-web/languages/English @@ -206,8 +206,8 @@ epg.hover_for_details=move to program for more details epg.refresh=get or refresh EPG epg.past_hours=past hours epg.next_hours=next hours -epg.set_timer=Set timer for recording. Done. -epg.zap_to=Set switch to channel. Done. +epg.set_timer_rec=Set timer for recording. Done. +epg.set_timer_zap=Set switch to channel. Done. ========EPG Streaminfo epg.si.streaminfo=Streaminfo diff --git a/data/y-web/languages/Polski b/data/y-web/languages/Polski index 034d3f54a..7588b3cfc 100644 --- a/data/y-web/languages/Polski +++ b/data/y-web/languages/Polski @@ -187,8 +187,8 @@ epg.hover_for_details=Przełącz, aby uzyskać więcej informacji epg.refresh=Aktualizacja EPG epg.past_hours=Poprzednie epg.next_hours=Następne -epg.set_timer=Ustawianie timera -epg.zap_to=Przełączanie kanału +epg.set_timer_rec=Ustawianie timera +epg.set_timer_zap=Przełączanie kanału # ========= EPG Stream Informacje epg.si.streaminfo=Informacje Stream diff --git a/data/y-web/languages/Portuguese b/data/y-web/languages/Portuguese index 1dffab32c..37d51e692 100644 --- a/data/y-web/languages/Portuguese +++ b/data/y-web/languages/Portuguese @@ -191,8 +191,8 @@ epg.hover_for_details=mover para programa para ver detalhes epg.refresh=buscar ou actualizar a EPG epg.past_hours=últimas horas epg.next_hours=próximas horas -epg.set_timer=Ajustar o programador para gravação. Realizado. -epg.zap_to=Coloque o canal para mudar. Realizado. +epg.set_timer_rec=Ajustar o programador para gravação. Realizado. +epg.set_timer_zap=Coloque o canal para mudar. Realizado. ========EPG Streaminfo diff --git a/data/y-web/languages/Slovak b/data/y-web/languages/Slovak index 440ce4ea7..c6ea61153 100644 --- a/data/y-web/languages/Slovak +++ b/data/y-web/languages/Slovak @@ -185,8 +185,8 @@ epg.hover_for_details=Presun ukazovateľa na stanicu pre získanie podrobností epg.refresh=obnovovanie EPG epg.past_hours=predchádzajúce hodiny epg.next_hours=nasledujúce hodiny -epg.set_timer=Nastavenie časovaca. Vykonané. -epg.zap_to=Prepnutie na kanál. Vykonané. +epg.set_timer_rec=Nastavenie časovaca. Vykonané. +epg.set_timer_zap=Prepnutie na kanál. Vykonané. ======= EPG Streaminfo epg.si.streaminfo=Informácie streamu From 856c6764306bfa446cf62f242609a9f1177d4df8 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 1 Mar 2017 13:03:50 +0100 Subject: [PATCH 24/38] - rename g_PluginList to g_Plugins; this isn't a list of plugins --- src/gui/miscsettings_menu.cpp | 10 +++--- src/gui/movieplayer.cpp | 2 +- src/gui/osdlang_setup.cpp | 2 +- src/gui/personalize.cpp | 34 +++++++++---------- src/gui/personalize.h | 2 +- src/gui/pluginlist.cpp | 28 ++++++++-------- src/gui/plugins.cpp | 4 +-- src/gui/user_menue.cpp | 52 ++++++++++++++--------------- src/gui/user_menue_setup.cpp | 6 ++-- src/gui/widget/menue.cpp | 10 +++--- src/neutrino.cpp | 24 ++++++------- src/neutrino_menue.cpp | 10 +++--- src/nhttpd/tuxboxapi/controlapi.cpp | 4 +-- src/system/setting_helpers.cpp | 4 +-- 14 files changed, 96 insertions(+), 96 deletions(-) diff --git a/src/gui/miscsettings_menu.cpp b/src/gui/miscsettings_menu.cpp index 176629ac6..af84c0213 100644 --- a/src/gui/miscsettings_menu.cpp +++ b/src/gui/miscsettings_menu.cpp @@ -60,7 +60,7 @@ #include -extern CPlugins * g_PluginList; +extern CPlugins * g_Plugins; extern cVideo *videoDecoder; CMiscMenue::CMiscMenue() @@ -99,7 +99,7 @@ int CMiscMenue::exec(CMenuTarget* parent, const std::string &actionKey) { const char *action_str = "plugin"; if(chooserDir(g_settings.plugin_hdd_dir, false, action_str)) - g_PluginList->loadPlugins(); + g_Plugins->loadPlugins(); return menu_return::RETURN_REPAINT; } @@ -111,13 +111,13 @@ int CMiscMenue::exec(CMenuTarget* parent, const std::string &actionKey) MoviePluginSelector.addItem(GenericMenuSeparatorLine); char id[5]; int enabled_count = 0; - for(unsigned int count=0;count < (unsigned int) g_PluginList->getNumberOfPlugins();count++) + for(unsigned int count=0;count < (unsigned int) g_Plugins->getNumberOfPlugins();count++) { - if (!g_PluginList->isHidden(count)) + if (!g_Plugins->isHidden(count)) { sprintf(id, "%d", count); enabled_count++; - MoviePluginSelector.addItem(new CMenuForwarder(g_PluginList->getName(count), true, NULL, new CMoviePluginChangeExec(), id, CRCInput::convertDigitToKey(count))); + MoviePluginSelector.addItem(new CMenuForwarder(g_Plugins->getName(count), true, NULL, new CMoviePluginChangeExec(), id, CRCInput::convertDigitToKey(count))); } } diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 05fd0b093..fead5c9be 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1384,7 +1384,7 @@ void CMoviePlayerGui::PlayFileLoop(void) } if (msg == (neutrino_msg_t) g_settings.mpkey_plugin) { - g_PluginList->startPlugin_by_name(g_settings.movieplayer_plugin.c_str ()); + g_Plugins->startPlugin_by_name(g_settings.movieplayer_plugin.c_str ()); } else if (msg == (neutrino_msg_t) g_settings.mpkey_stop) { playstate = CMoviePlayerGui::STOPPED; keyPressed = CMoviePlayerGui::PLUGIN_PLAYSTATE_STOP; diff --git a/src/gui/osdlang_setup.cpp b/src/gui/osdlang_setup.cpp index dbf05ff02..4ac06cf4c 100644 --- a/src/gui/osdlang_setup.cpp +++ b/src/gui/osdlang_setup.cpp @@ -76,7 +76,7 @@ int COsdLangSetup::exec(CMenuTarget* parent, const std::string &actionKey) if (!actionKey.empty()) { g_settings.language = actionKey; - g_PluginList->loadPlugins(); + g_Plugins->loadPlugins(); g_Locale->loadLocale(g_settings.language.c_str()); return menu_return::RETURN_EXIT; } diff --git a/src/gui/personalize.cpp b/src/gui/personalize.cpp index 7461c0b76..0cf748993 100644 --- a/src/gui/personalize.cpp +++ b/src/gui/personalize.cpp @@ -390,7 +390,7 @@ int CPersonalizeGui::ShowPersonalizationMenu() ShowUserMenu(); } CMenuWidget* plMenu = NULL; - int pcount = g_PluginList->getNumberOfPlugins(); + int pcount = g_Plugins->getNumberOfPlugins(); std::string pldesc[pcount]; int pltype[pcount]; if (show_pluginmenu) @@ -418,31 +418,31 @@ int CPersonalizeGui::ShowPersonalizationMenu() if (pltype[i] & CPlugins::P_TYPE_DISABLED) { if (!g_settings.plugins_disabled.empty()) g_settings.plugins_disabled += ","; - g_settings.plugins_disabled += g_PluginList->getFileName(i); - g_PluginList->setType(i, CPlugins::P_TYPE_DISABLED); + g_settings.plugins_disabled += g_Plugins->getFileName(i); + g_Plugins->setType(i, CPlugins::P_TYPE_DISABLED); } else if (pltype[i] & CPlugins::P_TYPE_GAME) { if (!g_settings.plugins_game.empty()) g_settings.plugins_game += ","; - g_settings.plugins_game += g_PluginList->getFileName(i); - g_PluginList->setType(i, CPlugins::P_TYPE_GAME); + g_settings.plugins_game += g_Plugins->getFileName(i); + g_Plugins->setType(i, CPlugins::P_TYPE_GAME); } else if (pltype[i] & CPlugins::P_TYPE_TOOL) { if (!g_settings.plugins_tool.empty()) g_settings.plugins_tool += ","; - g_settings.plugins_tool += g_PluginList->getFileName(i); - g_PluginList->setType(i, CPlugins::P_TYPE_TOOL); + g_settings.plugins_tool += g_Plugins->getFileName(i); + g_Plugins->setType(i, CPlugins::P_TYPE_TOOL); } else if (pltype[i] & CPlugins::P_TYPE_SCRIPT) { if (!g_settings.plugins_script.empty()) g_settings.plugins_script += ","; - g_settings.plugins_script += g_PluginList->getFileName(i); - g_PluginList->setType(i, CPlugins::P_TYPE_SCRIPT); + g_settings.plugins_script += g_Plugins->getFileName(i); + g_Plugins->setType(i, CPlugins::P_TYPE_SCRIPT); } else if (pltype[i] & CPlugins::P_TYPE_LUA) { if (!g_settings.plugins_lua.empty()) g_settings.plugins_lua += ","; - g_settings.plugins_lua += g_PluginList->getFileName(i); - g_PluginList->setType(i, CPlugins::P_TYPE_LUA); + g_settings.plugins_lua += g_Plugins->getFileName(i); + g_Plugins->setType(i, CPlugins::P_TYPE_LUA); } } - g_PluginList->loadPlugins(); + g_Plugins->loadPlugins(); } if (show_usermenu) @@ -571,18 +571,18 @@ void CPersonalizeGui::ShowPluginMenu(CMenuWidget* p_widget, std::string da[], in p_widget->addIntroItems(LOCALE_PERSONALIZE_PLUGINS); uint d_key = 1; - int pcount = g_PluginList->getNumberOfPlugins(); + int pcount = g_Plugins->getNumberOfPlugins(); for (int i = 0; i < pcount; i++) { - ia[i] = g_PluginList->getType(i); - da[i] = g_PluginList->getName(i); + ia[i] = g_Plugins->getType(i); + da[i] = g_Plugins->getName(i); if (da[i].empty()) continue; - std::string pluginDesc = g_PluginList->getDescription(i); + std::string pluginDesc = g_Plugins->getDescription(i); if (!pluginDesc.empty()) da[i] += " (" + pluginDesc + ")"; p_widget->addItem(new CMenuOptionChooser(da[i].c_str(), &ia[i], PERSONALIZE_PLUGINTYPE_OPTIONS, PERSONALIZE_PLUGINTYPE_MAX, - !g_PluginList->isHidden(i), NULL, getShortcut(d_key++))); + !g_Plugins->isHidden(i), NULL, getShortcut(d_key++))); } } diff --git a/src/gui/personalize.h b/src/gui/personalize.h index 2a92f6f2b..7b63cda0a 100644 --- a/src/gui/personalize.h +++ b/src/gui/personalize.h @@ -61,7 +61,7 @@ #include class CPlugins; -extern CPlugins * g_PluginList; /* neutrino.cpp */ +extern CPlugins * g_Plugins; /* neutrino.cpp */ //helper class to enable/disable some items in usermenu setup class CUserMenuNotifier : public CChangeObserver diff --git a/src/gui/pluginlist.cpp b/src/gui/pluginlist.cpp index f44432096..33e743300 100644 --- a/src/gui/pluginlist.cpp +++ b/src/gui/pluginlist.cpp @@ -61,7 +61,7 @@ #include "plugins.h" -extern CPlugins * g_PluginList; /* neutrino.cpp */ +extern CPlugins * g_Plugins; /* neutrino.cpp */ CPluginList::CPluginList(const neutrino_locale_t Title, const uint32_t listtype) { @@ -74,10 +74,10 @@ CPluginList::CPluginList(const neutrino_locale_t Title, const uint32_t listtype) int CPluginList::run() { - g_PluginList->startPlugin(number); - if (!g_PluginList->getScriptOutput().empty()) { + g_Plugins->startPlugin(number); + if (!g_Plugins->getScriptOutput().empty()) { hide(); - ShowMsg(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_SHELL, 320, g_settings.timing[SNeutrinoSettings::TIMING_STATIC_MESSAGES]); + ShowMsg(LOCALE_PLUGINS_RESULT, g_Plugins->getScriptOutput(), CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_SHELL, 320, g_settings.timing[SNeutrinoSettings::TIMING_STATIC_MESSAGES]); } return menu_return::RETURN_REPAINT; } @@ -108,14 +108,14 @@ int CPluginList::exec(CMenuTarget* parent, const std::string &actionKey) m.setSelected(selected); m.addIntroItems(); - int nop = g_PluginList->getNumberOfPlugins(); + int nop = g_Plugins->getNumberOfPlugins(); for(int count = 0; count < nop; count++) { - if ((g_PluginList->getType(count) & pluginlisttype) && !g_PluginList->isHidden(count) && (g_PluginList->getIntegration(count) == CPlugins::I_TYPE_DISABLED)) { - neutrino_msg_t d_key = g_PluginList->getKey(count); + if ((g_Plugins->getType(count) & pluginlisttype) && !g_Plugins->isHidden(count) && (g_Plugins->getIntegration(count) == CPlugins::I_TYPE_DISABLED)) { + neutrino_msg_t d_key = g_Plugins->getKey(count); keyhelper.get(&key, &dummy, d_key); - CMenuForwarder *f = new CMenuForwarder(std::string(g_PluginList->getName(count)), true, NULL, this, to_string(count).c_str(), key); - f->setHint(g_PluginList->getHintIcon(count), g_PluginList->getDescription(count)); + CMenuForwarder *f = new CMenuForwarder(std::string(g_Plugins->getName(count)), true, NULL, this, to_string(count).c_str(), key); + f->setHint(g_Plugins->getHintIcon(count), g_Plugins->getDescription(count)); m.addItem(f); } } @@ -134,7 +134,7 @@ CPluginChooser::CPluginChooser(const neutrino_locale_t Name, const uint32_t list int CPluginChooser::run() { if (number > -1) - *selectedFilePtr = g_PluginList->getFileName(number); + *selectedFilePtr = g_Plugins->getFileName(number); return menu_return::RETURN_EXIT; } @@ -165,12 +165,12 @@ int CPluginsExec::exec(CMenuTarget* parent, const std::string & actionKey) return menu_return::RETURN_EXIT; } else if (sel >= 0) - g_PluginList->startPlugin(sel); + g_Plugins->startPlugin(sel); - if (!g_PluginList->getScriptOutput().empty()) - ShowMsg(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_SHELL); + if (!g_Plugins->getScriptOutput().empty()) + ShowMsg(LOCALE_PLUGINS_RESULT, g_Plugins->getScriptOutput(), CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_SHELL); - if (g_PluginList->getIntegration(sel) == CPlugins::I_TYPE_DISABLED) + if (g_Plugins->getIntegration(sel) == CPlugins::I_TYPE_DISABLED) return menu_return::RETURN_EXIT; return menu_return::RETURN_REPAINT; diff --git a/src/gui/plugins.cpp b/src/gui/plugins.cpp index 9f0b5f29e..0f7bdc7e6 100644 --- a/src/gui/plugins.cpp +++ b/src/gui/plugins.cpp @@ -71,7 +71,7 @@ extern cVideo * videoDecoder; #include #include -extern CPlugins * g_PluginList; /* neutrino.cpp */ +extern CPlugins * g_Plugins; /* neutrino.cpp */ extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ CPlugins::CPlugins() @@ -354,7 +354,7 @@ void CPlugins::startPlugin_by_name(const std::string & name) { for (int i = 0; i < (int) plugin_list.size(); i++) { - if (name.compare(g_PluginList->getName(i)) == 0) + if (name.compare(g_Plugins->getName(i)) == 0) { startPlugin(i); return; diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index bd5987f30..a7d77530d 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -84,7 +84,7 @@ #include extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ -extern CPlugins * g_PluginList; /* neutrino.cpp */ +extern CPlugins * g_Plugins; /* neutrino.cpp */ extern cVideo * videoDecoder; #if !HAVE_SPARK_HARDWARE extern CCAMMenuHandler * g_CamHandler; @@ -326,33 +326,33 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) } case SNeutrinoSettings::ITEM_PLUGIN_TYPES: { - unsigned int number_of_plugins = (unsigned int) g_PluginList->getNumberOfPlugins(); + unsigned int number_of_plugins = (unsigned int) g_Plugins->getNumberOfPlugins(); if (!number_of_plugins) continue; for (unsigned int count = 0; count < number_of_plugins; count++) { #if 0 - bool show = g_PluginList->getType(count) == CPlugins::P_TYPE_TOOL || - g_PluginList->getType(count) == CPlugins::P_TYPE_LUA; + bool show = g_Plugins->getType(count) == CPlugins::P_TYPE_TOOL || + g_Plugins->getType(count) == CPlugins::P_TYPE_LUA; #endif bool show = false; if (g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_GAMES]) - show = show || g_PluginList->getType(count) == CPlugins::P_TYPE_GAME; + show = show || g_Plugins->getType(count) == CPlugins::P_TYPE_GAME; if (g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_TOOLS]) - show = show || g_PluginList->getType(count) == CPlugins::P_TYPE_TOOL; + show = show || g_Plugins->getType(count) == CPlugins::P_TYPE_TOOL; if (g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_SCRIPTS]) - show = show || g_PluginList->getType(count) == CPlugins::P_TYPE_SCRIPT; + show = show || g_Plugins->getType(count) == CPlugins::P_TYPE_SCRIPT; if (g_settings.personalize[SNeutrinoSettings::P_UMENU_PLUGIN_TYPE_LUA]) - show = show || g_PluginList->getType(count) == CPlugins::P_TYPE_LUA; + show = show || g_Plugins->getType(count) == CPlugins::P_TYPE_LUA; - if (show && !g_PluginList->isHidden(count) && (g_PluginList->getIntegration(count) == CPlugins::I_TYPE_DISABLED)) + if (show && !g_Plugins->isHidden(count) && (g_Plugins->getIntegration(count) == CPlugins::I_TYPE_DISABLED)) { menu_items++; - neutrino_msg_t d_key = g_PluginList->getKey(count); - //printf("[neutrino usermenu] plugin %d, set key %d...\n", count, g_PluginList->getKey(count)); + neutrino_msg_t d_key = g_Plugins->getKey(count); + //printf("[neutrino usermenu] plugin %d, set key %d...\n", count, g_Plugins->getKey(count)); keyhelper.get(&key,&icon, d_key); - menu_item = new CMenuForwarder(g_PluginList->getName(count), true, NULL, CPluginsExec::getInstance(), to_string(count).c_str(), key, icon); - menu_item->setHint(g_PluginList->getHintIcon(count), g_PluginList->getDescription(count)); + menu_item = new CMenuForwarder(g_Plugins->getName(count), true, NULL, CPluginsExec::getInstance(), to_string(count).c_str(), key, icon); + menu_item->setHint(g_Plugins->getHintIcon(count), g_Plugins->getDescription(count)); menu->addItem(menu_item, false); } @@ -393,14 +393,14 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) case SNeutrinoSettings::ITEM_GAMES: { keyhelper.get(&key,&icon); - menu_item = new CMenuDForwarder(LOCALE_MAINMENU_GAMES, g_PluginList->hasPlugin(CPlugins::P_TYPE_GAME), NULL, new CPluginList(LOCALE_MAINMENU_GAMES,CPlugins::P_TYPE_GAME), "-1", key, icon ); + menu_item = new CMenuDForwarder(LOCALE_MAINMENU_GAMES, g_Plugins->hasPlugin(CPlugins::P_TYPE_GAME), NULL, new CPluginList(LOCALE_MAINMENU_GAMES,CPlugins::P_TYPE_GAME), "-1", key, icon ); menu_item->setHint(NEUTRINO_ICON_HINT_GAMES, LOCALE_MENU_HINT_GAMES); break; } case SNeutrinoSettings::ITEM_SCRIPTS: { keyhelper.get(&key,&icon); - menu_item = new CMenuDForwarder(LOCALE_MAINMENU_SCRIPTS, g_PluginList->hasPlugin(CPlugins::P_TYPE_SCRIPT), NULL, new CPluginList(LOCALE_MAINMENU_SCRIPTS,CPlugins::P_TYPE_SCRIPT), "-1", key, icon ); + menu_item = new CMenuDForwarder(LOCALE_MAINMENU_SCRIPTS, g_Plugins->hasPlugin(CPlugins::P_TYPE_SCRIPT), NULL, new CPluginList(LOCALE_MAINMENU_SCRIPTS,CPlugins::P_TYPE_SCRIPT), "-1", key, icon ); menu_item->setHint(NEUTRINO_ICON_HINT_SCRIPTS, LOCALE_MENU_HINT_SCRIPTS); break; } @@ -421,14 +421,14 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) case SNeutrinoSettings::ITEM_TOOLS: { keyhelper.get(&key,&icon); - menu_item = new CMenuDForwarder(LOCALE_MAINMENU_TOOLS, g_PluginList->hasPlugin(CPlugins::P_TYPE_TOOL), NULL, new CPluginList(LOCALE_MAINMENU_TOOLS,CPlugins::P_TYPE_TOOL), "-1", key, icon ); + menu_item = new CMenuDForwarder(LOCALE_MAINMENU_TOOLS, g_Plugins->hasPlugin(CPlugins::P_TYPE_TOOL), NULL, new CPluginList(LOCALE_MAINMENU_TOOLS,CPlugins::P_TYPE_TOOL), "-1", key, icon ); // FIXME menu_item->setHint("", NONEXISTANT_LOCALE); break; } case SNeutrinoSettings::ITEM_LUA: { keyhelper.get(&key,&icon); - menu_item = new CMenuDForwarder(LOCALE_MAINMENU_LUA, g_PluginList->hasPlugin(CPlugins::P_TYPE_LUA), NULL, new CPluginList(LOCALE_MAINMENU_LUA,CPlugins::P_TYPE_LUA), "-1", key, icon ); + menu_item = new CMenuDForwarder(LOCALE_MAINMENU_LUA, g_Plugins->hasPlugin(CPlugins::P_TYPE_LUA), NULL, new CPluginList(LOCALE_MAINMENU_LUA,CPlugins::P_TYPE_LUA), "-1", key, icon ); // FIXME menu_item->setHint("", NONEXISTANT_LOCALE); break; } @@ -485,17 +485,17 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) } case -1: // plugin { - int number_of_plugins = g_PluginList->getNumberOfPlugins(); + int number_of_plugins = g_Plugins->getNumberOfPlugins(); if (!number_of_plugins) continue; int count = 0; for(; count < number_of_plugins; count++) { - const char *pname = g_PluginList->getFileName(count); - if (pname && (std::string(pname) == *it) && !g_PluginList->isHidden(count)) { - neutrino_msg_t d_key = g_PluginList->getKey(count); + const char *pname = g_Plugins->getFileName(count); + if (pname && (std::string(pname) == *it) && !g_Plugins->isHidden(count)) { + neutrino_msg_t d_key = g_Plugins->getKey(count); keyhelper.get(&key,&icon, d_key); - menu_item = new CMenuForwarder(g_PluginList->getName(count), true, NULL, CPluginsExec::getInstance(), to_string(count).c_str(), key, icon); - menu_item->setHint(g_PluginList->getHintIcon(count), g_PluginList->getDescription(count)); + menu_item = new CMenuForwarder(g_Plugins->getName(count), true, NULL, CPluginsExec::getInstance(), to_string(count).c_str(), key, icon); + menu_item->setHint(g_Plugins->getHintIcon(count), g_Plugins->getDescription(count)); break; } } @@ -553,10 +553,10 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu if(loc != NONEXISTANT_LOCALE || text) return_title = true; else { - int nop = g_PluginList->getNumberOfPlugins(); + int nop = g_Plugins->getNumberOfPlugins(); for(int count = 0; count < nop; count++) { - if (std::string(g_PluginList->getFileName(count)) == *it) { - text = g_PluginList->getName(count); + if (std::string(g_Plugins->getFileName(count)) == *it) { + text = g_Plugins->getName(count); active = true; break; } diff --git a/src/gui/user_menue_setup.cpp b/src/gui/user_menue_setup.cpp index b67a76370..900ad3c75 100644 --- a/src/gui/user_menue_setup.cpp +++ b/src/gui/user_menue_setup.cpp @@ -120,10 +120,10 @@ CUserMenuSetup::CUserMenuSetup(neutrino_locale_t menue_title, int menue_button) vals[keys[loc]] = loc; } - int number_of_plugins = g_PluginList->getNumberOfPlugins(); + int number_of_plugins = g_Plugins->getNumberOfPlugins(); for (int count = 0; count < number_of_plugins; count++) { - const char *loc = g_PluginList->getName(count); - const char *key = g_PluginList->getFileName(count); + const char *loc = g_Plugins->getName(count); + const char *key = g_Plugins->getFileName(count); if (loc && *loc && key && *key) { options.push_back(loc); keys[loc] = key; diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index d859c966b..3ccd2905c 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1029,21 +1029,21 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) void CMenuWidget::integratePlugins(CPlugins::i_type_t integration, const unsigned int shortcut, bool enabled) { bool separatorline = false; - unsigned int number_of_plugins = (unsigned int) g_PluginList->getNumberOfPlugins(); + unsigned int number_of_plugins = (unsigned int) g_Plugins->getNumberOfPlugins(); unsigned int sc = shortcut; for (unsigned int count = 0; count < number_of_plugins; count++) { - if ((g_PluginList->getIntegration(count) == integration) && !g_PluginList->isHidden(count)) + if ((g_Plugins->getIntegration(count) == integration) && !g_Plugins->isHidden(count)) { if (!separatorline) { addItem(GenericMenuSeparatorLine); separatorline = true; } - printf("[neutrino] integratePlugins: add %s\n", g_PluginList->getName(count)); + printf("[neutrino] integratePlugins: add %s\n", g_Plugins->getName(count)); neutrino_msg_t dk = (shortcut != CRCInput::RC_nokey) ? CRCInput::convertDigitToKey(sc++) : CRCInput::RC_nokey; - CMenuForwarder *fw_plugin = new CMenuForwarder(g_PluginList->getName(count), enabled, NULL, CPluginsExec::getInstance(), to_string(count).c_str(), dk); - fw_plugin->setHint(g_PluginList->getHintIcon(count), g_PluginList->getDescription(count)); + CMenuForwarder *fw_plugin = new CMenuForwarder(g_Plugins->getName(count), enabled, NULL, CPluginsExec::getInstance(), to_string(count).c_str(), dk); + fw_plugin->setHint(g_Plugins->getHintIcon(count), g_Plugins->getDescription(count)); addItem(fw_plugin); } } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index e02de17e5..08b728cdd 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -201,7 +201,7 @@ CBouquetList * RADIOwebList; CBouquetList * AllFavBouquetList; -CPlugins * g_PluginList; +CPlugins * g_Plugins; CRemoteControl * g_RemoteControl; CPictureViewer * g_PicViewer; CCAMMenuHandler * g_CamHandler; @@ -2186,10 +2186,10 @@ TIMER_START(); #endif CFSMounter::automount(); - g_PluginList = new CPlugins; - g_PluginList->setPluginDir(PLUGINDIR); + g_Plugins = new CPlugins; + g_Plugins->setPluginDir(PLUGINDIR); //load Pluginlist before main menu (only show script menu if at least one script is available - g_PluginList->loadPlugins(); + g_Plugins->loadPlugins(); // setup recording device setupRecordingDevice(); @@ -2365,9 +2365,9 @@ void CNeutrinoApp::RealRun() #ifdef ENABLE_LUA CLuaServer *luaServer = CLuaServer::getInstance(); #endif - g_PluginList->startPlugin("startup"); - if (!g_PluginList->getScriptOutput().empty()) { - ShowMsg(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_SHELL); + g_Plugins->startPlugin("startup"); + if (!g_Plugins->getScriptOutput().empty()) { + ShowMsg(LOCALE_PLUGINS_RESULT, g_Plugins->getScriptOutput(), CMsgBox::mbrBack, CMsgBox::mbBack, NEUTRINO_ICON_SHELL); } g_RCInput->clearRCMsg(); @@ -3485,9 +3485,9 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) } } else if (msg == NeutrinoMessages::EVT_START_PLUGIN) { - g_PluginList->startPlugin((const char *)data); - if (!g_PluginList->getScriptOutput().empty()) { - ShowMsg(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMsgBox::mbrBack,CMsgBox::mbBack,NEUTRINO_ICON_SHELL); + g_Plugins->startPlugin((const char *)data); + if (!g_Plugins->getScriptOutput().empty()) { + ShowMsg(LOCALE_PLUGINS_RESULT, g_Plugins->getScriptOutput(), CMsgBox::mbrBack,CMsgBox::mbBack,NEUTRINO_ICON_SHELL); } delete[] (unsigned char*) data; @@ -4079,7 +4079,7 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey) CHintBox hintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_SERVICEMENU_GETPLUGINS_HINT)); hintBox.paint(); - g_PluginList->loadPlugins(); + g_Plugins->loadPlugins(); hintBox.hide(); } @@ -4650,7 +4650,7 @@ void CNeutrinoApp::Cleanup() printf("cleanup 12\n");fflush(stdout); delete g_PicViewer; g_PicViewer = NULL; printf("cleanup 13\n");fflush(stdout); - delete g_PluginList; g_PluginList = NULL; + delete g_Plugins; g_Plugins = NULL; printf("cleanup 16\n");fflush(stdout); delete g_CamHandler; g_CamHandler = NULL; printf("cleanup 17\n");fflush(stdout); diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index 158074334..7665c847f 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -82,7 +82,7 @@ #include "driver/display.h" -extern CPlugins * g_PluginList; +extern CPlugins * g_Plugins; extern CRemoteControl * g_RemoteControl; extern CCAMMenuHandler * g_CamHandler; // extern bool has_hdd; @@ -195,25 +195,25 @@ void CNeutrinoApp::InitMenuMain() CMenuForwarder * mf; if (!g_settings.easymenu) { //games - bool show_games = g_PluginList->hasPlugin(CPlugins::P_TYPE_GAME); + bool show_games = g_Plugins->hasPlugin(CPlugins::P_TYPE_GAME); mf = new CMenuForwarder(LOCALE_MAINMENU_GAMES, show_games, NULL, new CPluginList(LOCALE_MAINMENU_GAMES,CPlugins::P_TYPE_GAME)); mf->setHint(NEUTRINO_ICON_HINT_GAMES, LOCALE_MENU_HINT_GAMES); personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_GAMES]); //tools - bool show_tools = g_PluginList->hasPlugin(CPlugins::P_TYPE_TOOL); + bool show_tools = g_Plugins->hasPlugin(CPlugins::P_TYPE_TOOL); mf = new CMenuForwarder(LOCALE_MAINMENU_TOOLS, show_tools, NULL, new CPluginList(LOCALE_MAINMENU_TOOLS,CPlugins::P_TYPE_TOOL)); mf->setHint(NEUTRINO_ICON_HINT_SCRIPTS, LOCALE_MENU_HINT_TOOLS); personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TOOLS]); //scripts - bool show_scripts = g_PluginList->hasPlugin(CPlugins::P_TYPE_SCRIPT); + bool show_scripts = g_Plugins->hasPlugin(CPlugins::P_TYPE_SCRIPT); mf = new CMenuForwarder(LOCALE_MAINMENU_SCRIPTS, show_scripts, NULL, new CPluginList(LOCALE_MAINMENU_SCRIPTS,CPlugins::P_TYPE_SCRIPT)); mf->setHint(NEUTRINO_ICON_HINT_SCRIPTS, LOCALE_MENU_HINT_SCRIPTS); personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_SCRIPTS]); //lua - bool show_lua = g_PluginList->hasPlugin(CPlugins::P_TYPE_LUA); + bool show_lua = g_Plugins->hasPlugin(CPlugins::P_TYPE_LUA); mf = new CMenuForwarder(LOCALE_MAINMENU_LUA, show_lua, NULL, new CPluginList(LOCALE_MAINMENU_LUA,CPlugins::P_TYPE_LUA)); mf->setHint(NEUTRINO_ICON_HINT_SCRIPTS, LOCALE_MENU_HINT_LUA); personalize.addItem(MENU_MAIN, mf, &g_settings.personalize[SNeutrinoSettings::P_MAIN_LUA]); diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 49f9bee1f..6f64faf4c 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -56,7 +56,7 @@ extern CPictureViewer *g_PicViewer; extern cVideo * videoDecoder; -extern CPlugins *g_PluginList;//for relodplugins +extern CPlugins *g_Plugins;//for relodplugins extern CBouquetManager *g_bouquetManager; #define EVENTDEV "/dev/input/input0" @@ -2024,7 +2024,7 @@ void CControlAPI::ReloadNeutrinoSetupCGI(CyhookHandler *hh) void CControlAPI::ReloadPluginsCGI(CyhookHandler *hh) { - g_PluginList->loadPlugins(); + g_Plugins->loadPlugins(); hh->SendOk(); } diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index d14bae874..f53bce83e 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -75,7 +75,7 @@ #include #include -extern CPlugins * g_PluginList; /* neutrino.cpp */ +extern CPlugins * g_Plugins; /* neutrino.cpp */ extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ extern cVideo *videoDecoder; extern cAudio *audioDecoder; @@ -391,7 +391,7 @@ int CMoviePluginChangeExec::exec(CMenuTarget* parent, const std::string & action { int sel = atoi(actionKey.c_str()); if (sel >= 0) - g_settings.movieplayer_plugin = g_PluginList->getName(sel); + g_settings.movieplayer_plugin = g_Plugins->getName(sel); } return menu_return::RETURN_EXIT; From d12ea80c5b6607657ffc8fdd74e9c0345f3c4d2b Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 1 Mar 2017 15:04:10 +0100 Subject: [PATCH 25/38] src/neutrino.cpp init struct timer_remotebox_item, avoid segfault without InfoClock --- src/neutrino.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 08b728cdd..fe94460d2 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -468,6 +468,7 @@ int CNeutrinoApp::loadSetup(const char * fname) if (timer_remotebox_itemcount) { for (int i = 0; i < timer_remotebox_itemcount; i++) { timer_remotebox_item timer_rb; + memset(&timer_rb, 0, sizeof(struct timer_remotebox_item)); std::string k; k = "timer_remotebox_ip_" + to_string(i); timer_rb.rbaddress = configfile.getString(k, ""); @@ -4237,9 +4238,10 @@ void stop_daemons(bool stopall, bool for_flash) if(!for_flash && !stopall && g_settings.hdmi_cec_mode && g_settings.hdmi_cec_standby){ videoDecoder->SetCECMode((VIDEO_HDMI_CEC_MODE)0); } - - delete InfoClock; - delete FileTimeOSD; + if(InfoClock) + delete InfoClock; + if(FileTimeOSD) + delete FileTimeOSD; delete &CMoviePlayerGui::getInstance(); CZapit::getInstance()->Stop(); From 16537620a6cb6d4f7f7885066a4d9b9338a81c0d Mon Sep 17 00:00:00 2001 From: TangoCash Date: Wed, 1 Mar 2017 18:16:09 +0100 Subject: [PATCH 26/38] fix blinking clock in some modes (thx dbo) --- src/gui/infoviewer.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index c32a4e9e2..367bca476 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -2168,9 +2168,13 @@ void CInfoViewer::killTitle() sigbox->kill(); #endif header->kill(); -#if 0 //not really required to kill clock, header does this +#if 1 //not really required to kill clock, header does this <--- really ???? if (clock) + { clock->kill(); + delete clock; + clock = NULL; + } #endif body->kill(); @@ -2380,7 +2384,10 @@ void CInfoViewer::ResetModules() delete header; header = NULL; delete body; body = NULL; delete infobar_txt; infobar_txt = NULL; - delete clock; clock = NULL; + if (clock) + { + delete clock; clock = NULL; + } delete txt_cur_start; txt_cur_start = NULL; delete txt_cur_event; txt_cur_event = NULL; delete txt_cur_event_rest; txt_cur_event_rest = NULL; From 950f74dd411f72dbaf78c0c2f4b78fbca9ce0ed4 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 1 Mar 2017 18:16:09 +0100 Subject: [PATCH 27/38] - flashtool: localize getType() function --- data/locale/deutsch.locale | 9 +++++++++ data/locale/english.locale | 9 +++++++++ src/system/flashtool.cpp | 20 +++++++++----------- src/system/locals.h | 9 +++++++++ src/system/locals_intern.h | 9 +++++++++ 5 files changed, 45 insertions(+), 11 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index a1715b44f..05b8b5e58 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -682,6 +682,15 @@ flashupdate.selectimage Verfügbare Images/Files flashupdate.settings Update-Einstellungen flashupdate.titlereadflash Flash auslesen flashupdate.titlewriteflash Flash schreiben +flashupdate.type_addon Erweiterung +flashupdate.type_beta Beta +flashupdate.type_internal Intern +flashupdate.type_locale Sprachdatei +flashupdate.type_release Release +flashupdate.type_settings Einstellungen +flashupdate.type_text Text +flashupdate.type_unknown Unbekannt +flashupdate.type_update Aktualisierung flashupdate.update_with_settings_del_skipped Ordner [%s] kann nicht gelöscht werden. Eintrag wird übersprungen. flashupdate.update_with_settings_error Error Flashspeicher!\n \nIm neuen Image sind nur noch %ld KB (von %ld KB) frei,\ndas ist zu wenig, um einen sicheren Betrieb zu gewährleisten.\n \nDer Vorgang wird abgebrochen! flashupdate.update_with_settings_processed Image wird bearbeitet ... diff --git a/data/locale/english.locale b/data/locale/english.locale index 4feae3a1e..4f4430a68 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -682,6 +682,15 @@ flashupdate.selectimage Available Images/Files flashupdate.settings Update settings flashupdate.titlereadflash Reading Flash flashupdate.titlewriteflash Writing Flash +flashupdate.type_addon Addon +flashupdate.type_beta Beta +flashupdate.type_internal Internal +flashupdate.type_locale Locale +flashupdate.type_release Release +flashupdate.type_settings Settings +flashupdate.type_text Text +flashupdate.type_unknown Unknown +flashupdate.type_update Update flashupdate.update_with_settings_del_skipped Folder [%s] can not be deleted. Entry is skipped. flashupdate.update_with_settings_error Flash Error!\n \nNew Image only has %ld KB (out of %ld KB) left. Not\nenough space to complete this operation.\n \nCanceling operation! flashupdate.update_with_settings_processed Image is being processed ... diff --git a/src/system/flashtool.cpp b/src/system/flashtool.cpp index aea8e5125..5c1eb4234 100644 --- a/src/system/flashtool.cpp +++ b/src/system/flashtool.cpp @@ -521,28 +521,26 @@ const char *CFlashVersionInfo::getReleaseCycle(void) const const char *CFlashVersionInfo::getType(void) const { - // TODO: localize it - switch (snapshot) { case '0': - return "Release"; + return g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_RELEASE); case '1': - return "Beta"; + return g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_BETA); case '2': - return "Internal"; + return g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_INTERNAL); case 'L': - return "Locale"; + return g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_LOCALE); case 'S': - return "Settings"; + return g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_SETTINGS); case 'A': - return "Addon"; + return g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_ADDON); case 'U': - return "Update"; + return g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_UPDATE); case 'T': - return "Text"; + return g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_TEXT); default: - return "Unknown"; + return g_Locale->getText(LOCALE_FLASHUPDATE_TYPE_UNKNOWN); } } diff --git a/src/system/locals.h b/src/system/locals.h index b74b90eb8..8aa833059 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -709,6 +709,15 @@ typedef enum LOCALE_FLASHUPDATE_SETTINGS, LOCALE_FLASHUPDATE_TITLEREADFLASH, LOCALE_FLASHUPDATE_TITLEWRITEFLASH, + LOCALE_FLASHUPDATE_TYPE_ADDON, + LOCALE_FLASHUPDATE_TYPE_BETA, + LOCALE_FLASHUPDATE_TYPE_INTERNAL, + LOCALE_FLASHUPDATE_TYPE_LOCALE, + LOCALE_FLASHUPDATE_TYPE_RELEASE, + LOCALE_FLASHUPDATE_TYPE_SETTINGS, + LOCALE_FLASHUPDATE_TYPE_TEXT, + LOCALE_FLASHUPDATE_TYPE_UNKNOWN, + LOCALE_FLASHUPDATE_TYPE_UPDATE, LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_DEL_SKIPPED, LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_ERROR, LOCALE_FLASHUPDATE_UPDATE_WITH_SETTINGS_PROCESSED, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index b3b18075b..f1134b99e 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -709,6 +709,15 @@ const char * locale_real_names[] = "flashupdate.settings", "flashupdate.titlereadflash", "flashupdate.titlewriteflash", + "flashupdate.type_addon", + "flashupdate.type_beta", + "flashupdate.type_internal", + "flashupdate.type_locale", + "flashupdate.type_release", + "flashupdate.type_settings", + "flashupdate.type_text", + "flashupdate.type_unknown", + "flashupdate.type_update", "flashupdate.update_with_settings_del_skipped", "flashupdate.update_with_settings_error", "flashupdate.update_with_settings_processed", From 943c03fc52b8c95d6a6ca066cc33a7a2e57055e6 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 1 Mar 2017 18:16:09 +0100 Subject: [PATCH 28/38] - update: prepare for menu hints --- src/gui/update.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/update.cpp b/src/gui/update.cpp index eeca7c65c..e31a2ff17 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -257,6 +257,7 @@ bool CFlashUpdate::selectHttpImage(void) { std::ifstream in(gTmpPath LIST_OF_UPDATES_LOCAL_FILENAME); bool enabled; + CMenuForwarder * mf; while (in >> url >> version >> md5 >> std::ws) { urls.push_back(url); @@ -290,7 +291,9 @@ bool CFlashUpdate::selectHttpImage(void) //SelectionWidget.addItem(new CMenuForwarder(names[i].c_str(), enabled, descriptions[i].c_str(), new CUpdateMenuTarget(i, &selected))); CUpdateMenuTarget * up = new CUpdateMenuTarget(i, &selected); - SelectionWidget.addItem(new CMenuDForwarder(descriptions[i].c_str(), enabled, names[i].c_str(), up)); + mf = new CMenuDForwarder(descriptions[i].c_str(), enabled, names[i].c_str(), up); + //TODO mf->setHint(NEUTRINO_ICON_HINT_SW_UPDATE, ""); + SelectionWidget.addItem(mf); i++; } } From 2a9b39f45fe8c3c6383e80bbaa3831473635e7da Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 1 Mar 2017 18:16:09 +0100 Subject: [PATCH 29/38] - update: change filetype comparsion; "< '3'" to "<= '2'" --- src/gui/update.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gui/update.cpp b/src/gui/update.cpp index e31a2ff17..dc3fbdbf0 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -175,7 +175,7 @@ bool CFlashUpdate::checkOnlineVersion() #ifdef DEBUG printf("[update] url %s version %s (%d) timestamp %s (%ld) md5 %s name %s\n", url.c_str(), version.c_str(), newVer, versionInfo.getDate(), versionInfo.getDateTime(), md5.c_str(), name.c_str()); #endif - if(versionInfo.snapshot < '3' && (newVer > curVer || versionInfo.getDateTime() > curInfo.getDateTime())) { + if(versionInfo.snapshot <= '2' && (newVer > curVer || versionInfo.getDateTime() > curInfo.getDateTime())) { newfound = true; printf("[update] found new image\n"); break; @@ -273,9 +273,9 @@ bool CFlashUpdate::selectHttpImage(void) #ifdef DEBUG printf("[update] url %s version %s (%d) timestamp %s (%ld) md5 %s name %s\n", url.c_str(), version.c_str(), newVer, versionInfo.getDate(), versionInfo.getDateTime(), md5.c_str(), name.c_str()); #endif - if(versionInfo.snapshot < '3' && (newVer > curVer || versionInfo.getDateTime() > curInfo.getDateTime())) + if(versionInfo.snapshot <= '2' && (newVer > curVer || versionInfo.getDateTime() > curInfo.getDateTime())) newfound = 1; - if(!allow_flash && (versionInfo.snapshot < '3')) + if(!allow_flash && (versionInfo.snapshot <= '2')) enabled = false; fileTypes[i] = versionInfo.snapshot; //std::string description = versionInfo.getType(); @@ -325,7 +325,7 @@ bool CFlashUpdate::selectHttpImage(void) file_md5 = md5s[selected]; fileType = fileTypes[selected]; #ifdef BOXMODEL_CS_HD2 - if(fileType < '3') { + if(fileType <= '2') { int esize = CMTDInfo::getInstance()->getMTDEraseSize(sysfs); printf("[update] erase size is %x\n", esize); if (esize == 0x40000) { @@ -387,7 +387,7 @@ printf("[update] mode is %d\n", softupdate_mode); versionInfo = new CFlashVersionInfo(newVersion);//Memory leak: versionInfo sprintf(msg, g_Locale->getText(msg_body), versionInfo->getDate(), versionInfo->getTime(), versionInfo->getReleaseCycle(), versionInfo->getType()); - if(fileType < '3') + if(fileType <= '2') { if ((strncmp(RELEASE_CYCLE, versionInfo->getReleaseCycle(), 2) != 0) && (ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_WRONGBASE), CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) != CMsgBox::mbrYes)) @@ -545,7 +545,7 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey) return menu_return::RETURN_REPAINT; } if(softupdate_mode==1) { //internet-update - if ( ShowMsg(LOCALE_MESSAGEBOX_INFO, (fileType < '3') ? LOCALE_FLASHUPDATE_INSTALL_IMAGE : LOCALE_FLASHUPDATE_INSTALL_PACKAGE, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) != CMsgBox::mbrYes) // UTF-8 + if ( ShowMsg(LOCALE_MESSAGEBOX_INFO, (fileType <= '2') ? LOCALE_FLASHUPDATE_INSTALL_IMAGE : LOCALE_FLASHUPDATE_INSTALL_PACKAGE, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) != CMsgBox::mbrYes) // UTF-8 { hide(); return menu_return::RETURN_REPAINT; @@ -557,7 +557,7 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey) #ifdef DEBUG printf("[update] flash/install filename %s type %c\n", filename.c_str(), fileType); #endif - if(fileType < '3') { + if(fileType <= '2') { //flash it... #ifndef BOXMODEL_CS_HD2 if (g_settings.apply_settings) { From ea3ab21bb0633936f1bf05d43aa61ac481a435b7 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 1 Mar 2017 18:16:09 +0100 Subject: [PATCH 30/38] - update: small cleanup; ... remove obsolete g_Locale->getText() from ShowHint calls --- src/gui/update.cpp | 79 +++++++++++++++++++--------------------------- 1 file changed, 33 insertions(+), 46 deletions(-) diff --git a/src/gui/update.cpp b/src/gui/update.cpp index dc3fbdbf0..3d78c5f69 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -207,7 +207,7 @@ bool CFlashUpdate::selectHttpImage(void) curVer = curInfo.getVersion(); httpTool.setStatusViewer(this); - showStatusMessageUTF(g_Locale->getText(LOCALE_FLASHUPDATE_GETINFOFILE)); // UTF-8 + showStatusMessageUTF(g_Locale->getText(LOCALE_FLASHUPDATE_GETINFOFILE)); char current[200]; snprintf(current, 200, "%s: %s %s %s %s %s", g_Locale->getText(LOCALE_FLASHUPDATE_CURRENTVERSION_SEP), curInfo.getReleaseCycle(), @@ -239,18 +239,13 @@ bool CFlashUpdate::selectHttpImage(void) if (startpos == std::string::npos) { startpos = 0; - endpos = std::string::npos; - updates_lists.push_back(url.substr(startpos, endpos - startpos)); } else { - //startpos += 2; - //endpos = url.find('/', startpos); startpos = url.find('/', startpos+2)+1; - endpos = std::string::npos; - updates_lists.push_back(url.substr(startpos, endpos - startpos)); } - //updates_lists.push_back(url.substr(startpos, endpos - startpos)); + endpos = std::string::npos; + updates_lists.push_back(url.substr(startpos, endpos - startpos)); SelectionWidget.addItem(new CMenuSeparator(CMenuSeparator::STRING | CMenuSeparator::LINE, updates_lists.rbegin()->c_str())); if (httpTool.downloadFile(url, gTmpPath LIST_OF_UPDATES_LOCAL_FILENAME, 20)) @@ -278,7 +273,6 @@ bool CFlashUpdate::selectHttpImage(void) if(!allow_flash && (versionInfo.snapshot <= '2')) enabled = false; fileTypes[i] = versionInfo.snapshot; - //std::string description = versionInfo.getType(); std::string description = versionInfo.getReleaseCycle(); description += ' '; description += versionInfo.getType(); @@ -289,7 +283,6 @@ bool CFlashUpdate::selectHttpImage(void) descriptions.push_back(description); /* workaround since CMenuForwarder does not store the Option String itself */ - //SelectionWidget.addItem(new CMenuForwarder(names[i].c_str(), enabled, descriptions[i].c_str(), new CUpdateMenuTarget(i, &selected))); CUpdateMenuTarget * up = new CUpdateMenuTarget(i, &selected); mf = new CMenuDForwarder(descriptions[i].c_str(), enabled, names[i].c_str(), up); //TODO mf->setHint(NEUTRINO_ICON_HINT_SW_UPDATE, ""); @@ -303,7 +296,7 @@ bool CFlashUpdate::selectHttpImage(void) if (urls.empty()) { - ShowMsg(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_FLASHUPDATE_GETINFOFILEERROR), CMsgBox::mbrOk, CMsgBox::mbOk); // UTF-8 + ShowMsg(LOCALE_MESSAGEBOX_ERROR, LOCALE_FLASHUPDATE_GETINFOFILEERROR, CMsgBox::mbrOk, CMsgBox::mbOk); return false; } if (notify) { @@ -352,11 +345,10 @@ bool CFlashUpdate::getUpdateImage(const std::string & version) else return false; sprintf(dest_name, "%s/%s", g_settings.update_dir.c_str(), fname); - showStatusMessageUTF(std::string(g_Locale->getText(LOCALE_FLASHUPDATE_GETUPDATEFILE)) + ' ' + version); // UTF-8 + showStatusMessageUTF(std::string(g_Locale->getText(LOCALE_FLASHUPDATE_GETUPDATEFILE)) + ' ' + version); printf("get update (url): %s - %s\n", filename.c_str(), dest_name); return httpTool.downloadFile(filename, dest_name, 40 ); - //return httpTool.downloadFile(filename, gTmpPath UPDATE_LOCAL_FILENAME, 40 ); } bool CFlashUpdate::checkVersion4Update() @@ -365,7 +357,7 @@ bool CFlashUpdate::checkVersion4Update() CFlashVersionInfo * versionInfo; neutrino_locale_t msg_body; #ifdef DEBUG -printf("[update] mode is %d\n", softupdate_mode); + printf("[update] mode is %d\n", softupdate_mode); #endif if(softupdate_mode==1) //internet-update { @@ -374,7 +366,7 @@ printf("[update] mode is %d\n", softupdate_mode); showLocalStatus(100); showGlobalStatus(20); - showStatusMessageUTF(g_Locale->getText(LOCALE_FLASHUPDATE_VERSIONCHECK)); // UTF-8 + showStatusMessageUTF(g_Locale->getText(LOCALE_FLASHUPDATE_VERSIONCHECK)); printf("internet version: %s\n", newVersion.c_str()); @@ -390,15 +382,15 @@ printf("[update] mode is %d\n", softupdate_mode); if(fileType <= '2') { if ((strncmp(RELEASE_CYCLE, versionInfo->getReleaseCycle(), 2) != 0) && - (ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_WRONGBASE), CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) != CMsgBox::mbrYes)) + (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_FLASHUPDATE_WRONGBASE, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) != CMsgBox::mbrYes)) { delete versionInfo; - //ShowHint(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_FLASHUPDATE_WRONGBASE)); // UTF-8 + //ShowHint(LOCALE_MESSAGEBOX_ERROR, LOCALE_FLASHUPDATE_WRONGBASE); return false; } if ((strcmp("Release", versionInfo->getType()) != 0) && - //(ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_EXPERIMENTALIMAGE), CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) != CMsgBox::mbrYes)) // UTF-8 + //(ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_FLASHUPDATE_EXPERIMENTALIMAGE, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) != CMsgBox::mbrYes)) (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_FLASHUPDATE_EXPERIMENTALIMAGE, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) != CMsgBox::mbrYes)) { delete versionInfo; @@ -414,7 +406,8 @@ printf("[update] mode is %d\n", softupdate_mode); CFileBrowser UpdatesBrowser; CFileFilter UpdatesFilter; - if(allow_flash) UpdatesFilter.addFilter(FILEBROWSER_UPDATE_FILTER); + if (allow_flash) + UpdatesFilter.addFilter(FILEBROWSER_UPDATE_FILTER); string filters[] = {"bin", "txt", "opk", "ipk"}; for(size_t i=0; igetType() == CFile::FILE_PKG_PACKAGE){ COPKGManager opkg; if (opkg.hasOpkgSupport()){ - int msgres = ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_OPKG_WARNING_3RDPARTY_PACKAGES, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE, 700); // UTF-8 + int msgres = ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_OPKG_WARNING_3RDPARTY_PACKAGES, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE, 700); if (msgres == CMsgBox::mbrYes){ if (!opkg.installPackage(UpdatesBrowser.getSelectedFile()->Name)) DisplayErrorMessage(g_Locale->getText(LOCALE_OPKG_FAILURE_INSTALL)); @@ -479,9 +472,8 @@ printf("[update] mode is %d\n", softupdate_mode); } strcpy(msg, g_Locale->getText(LOCALE_FLASHUPDATE_NOVERSION)); -//never read msg_body = LOCALE_FLASHUPDATE_MSGBOX_MANUAL; } - return (ShowMsg(LOCALE_MESSAGEBOX_INFO, msg, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) == CMsgBox::mbrYes); // UTF-8 + return (ShowMsg(LOCALE_MESSAGEBOX_INFO, msg, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) == CMsgBox::mbrYes); } int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey) @@ -499,13 +491,13 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey) paint(); if(sysfs.size() < 8) { - ShowHint(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_FLASHUPDATE_CANTOPENMTD)); + ShowHint(LOCALE_MESSAGEBOX_ERROR, LOCALE_FLASHUPDATE_CANTOPENMTD); hide(); return menu_return::RETURN_REPAINT; } if(!checkVersion4Update()) { hide(); - return menu_ret; //menu_return::RETURN_REPAINT; + return menu_ret; } #ifdef VFD_UPDATE @@ -524,7 +516,7 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey) if(!getUpdateImage(newVersion)) { hide(); - ShowHint(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_FLASHUPDATE_GETUPDATEFILEERROR)); // UTF-8 + ShowHint(LOCALE_MESSAGEBOX_ERROR, LOCALE_FLASHUPDATE_GETUPDATEFILEERROR); return menu_return::RETURN_REPAINT; } sprintf(fullname, "%s/%s", g_settings.update_dir.c_str(), fname); @@ -534,18 +526,17 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey) showGlobalStatus(40); CFlashTool ft; - //ft.setMTDDevice(MTD_DEVICE_OF_UPDATE_PART); ft.setMTDDevice(sysfs); ft.setStatusViewer(this); - showStatusMessageUTF(g_Locale->getText(LOCALE_FLASHUPDATE_MD5CHECK)); // UTF-8 + showStatusMessageUTF(g_Locale->getText(LOCALE_FLASHUPDATE_MD5CHECK)); if((softupdate_mode==1) && !ft.check_md5(filename, file_md5)) { hide(); - ShowHint(LOCALE_MESSAGEBOX_ERROR, g_Locale->getText(LOCALE_FLASHUPDATE_MD5SUMERROR)); // UTF-8 + ShowHint(LOCALE_MESSAGEBOX_ERROR, LOCALE_FLASHUPDATE_MD5SUMERROR); return menu_return::RETURN_REPAINT; } if(softupdate_mode==1) { //internet-update - if ( ShowMsg(LOCALE_MESSAGEBOX_INFO, (fileType <= '2') ? LOCALE_FLASHUPDATE_INSTALL_IMAGE : LOCALE_FLASHUPDATE_INSTALL_PACKAGE, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) != CMsgBox::mbrYes) // UTF-8 + if ( ShowMsg(LOCALE_MESSAGEBOX_INFO, (fileType <= '2') ? LOCALE_FLASHUPDATE_INSTALL_IMAGE : LOCALE_FLASHUPDATE_INSTALL_PACKAGE, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) != CMsgBox::mbrYes) { hide(); return menu_return::RETURN_REPAINT; @@ -561,7 +552,7 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey) //flash it... #ifndef BOXMODEL_CS_HD2 if (g_settings.apply_settings) { - if (ShowMsg(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_APPLY_SETTINGS), CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) == CMsgBox::mbrYes) + if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_FLASHUPDATE_APPLY_SETTINGS, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) == CMsgBox::mbrYes) if (!CExtUpdate::getInstance()->applySettings(filename, CExtUpdate::MODE_SOFTUPDATE)) { hide(); return menu_return::RETURN_REPAINT; @@ -575,15 +566,15 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey) if(!ft.program(filename, 80, 100)) { #endif hide(); - ShowHint(LOCALE_MESSAGEBOX_ERROR, ft.getErrorMessage().c_str()); // UTF-8 + ShowHint(LOCALE_MESSAGEBOX_ERROR, ft.getErrorMessage().c_str()); return menu_return::RETURN_REPAINT; } //status anzeigen showGlobalStatus(100); - showStatusMessageUTF(g_Locale->getText(LOCALE_FLASHUPDATE_READY)); // UTF-8 + showStatusMessageUTF(g_Locale->getText(LOCALE_FLASHUPDATE_READY)); hide(); - ShowHint(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_FLASHREADYREBOOT)); // UTF-8 + ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_FLASHUPDATE_FLASHREADYREBOOT); sleep(2); ft.reboot(); } @@ -598,7 +589,7 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey) fread(buffer, (uint32_t)filesize, 1, fd); fclose(fd); buffer[filesize] = 0; - ShowMsg(LOCALE_MESSAGEBOX_INFO, buffer, CMsgBox::mbrBack, CMsgBox::mbBack); // UTF-8 + ShowMsg(LOCALE_MESSAGEBOX_INFO, buffer, CMsgBox::mbrBack, CMsgBox::mbBack); free(buffer); } } @@ -612,16 +603,12 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey) my_system(3, install_sh, g_settings.update_dir.c_str(), filename.c_str()); #endif showGlobalStatus(100); - ShowHint(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_READY)); // UTF-8 + ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_FLASHUPDATE_READY); } hide(); return menu_return::RETURN_REPAINT; } - -//-------------------------------------------------------------------------------------------------------------- - - CFlashExpert::CFlashExpert() :CProgressWindow() { @@ -833,17 +820,17 @@ void CFlashExpert::readmtd(int preadmtd) setTitle(LOCALE_FLASHUPDATE_TITLEREADFLASH); paint(); showGlobalStatus(0); - showStatusMessageUTF((std::string(g_Locale->getText(LOCALE_FLASHUPDATE_ACTIONREADFLASH)) + " (" + mtdInfo->getMTDName(preadmtd) + ')')); // UTF-8 + showStatusMessageUTF((std::string(g_Locale->getText(LOCALE_FLASHUPDATE_ACTIONREADFLASH)) + " (" + mtdInfo->getMTDName(preadmtd) + ')')); CFlashTool ft; ft.setStatusViewer( this ); ft.setMTDDevice(mtdInfo->getMTDFileName(preadmtd)); if(!ft.readFromMTD(filename, 100)) { - showStatusMessageUTF(ft.getErrorMessage()); // UTF-8 + showStatusMessageUTF(ft.getErrorMessage()); sleep(10); } else { showGlobalStatus(100); - showStatusMessageUTF(g_Locale->getText(LOCALE_FLASHUPDATE_READY)); // UTF-8 + showStatusMessageUTF(g_Locale->getText(LOCALE_FLASHUPDATE_READY)); char message[500]; sprintf(message, g_Locale->getText(LOCALE_FLASHUPDATE_SAVESUCCESS), filename.c_str()); sleep(1); @@ -866,7 +853,7 @@ void CFlashExpert::writemtd(const std::string & filename, int mtdNumber) FILESYSTEM_ENCODING_TO_UTF8_STRING(filename).c_str(), CMTDInfo::getInstance()->getMTDName(mtdNumber).c_str()); - if (ShowMsg(LOCALE_MESSAGEBOX_INFO, message, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) != CMsgBox::mbrYes) // UTF-8 + if (ShowMsg(LOCALE_MESSAGEBOX_INFO, message, CMsgBox::mbrNo, CMsgBox::mbYes | CMsgBox::mbNo, NEUTRINO_ICON_UPDATE) != CMsgBox::mbrYes) return; #ifdef VFD_UPDATE CVFD::getInstance()->showProgressBar2(0,"checking",0,"Update Neutrino"); @@ -880,14 +867,14 @@ void CFlashExpert::writemtd(const std::string & filename, int mtdNumber) ft.setStatusViewer( this ); ft.setMTDDevice( CMTDInfo::getInstance()->getMTDFileName(mtdNumber) ); if(!ft.program( (std::string)g_settings.update_dir + "/" + filename, 50, 100)) { - showStatusMessageUTF(ft.getErrorMessage()); // UTF-8 + showStatusMessageUTF(ft.getErrorMessage()); sleep(10); } else { showGlobalStatus(100); - showStatusMessageUTF(g_Locale->getText(LOCALE_FLASHUPDATE_READY)); // UTF-8 + showStatusMessageUTF(g_Locale->getText(LOCALE_FLASHUPDATE_READY)); sleep(2); hide(); - ShowHint(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_FLASHUPDATE_FLASHREADYREBOOT)); // UTF-8 + ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_FLASHUPDATE_FLASHREADYREBOOT); ft.reboot(); } } From 00d2d557c25ed931596de237f1945c7b401b0e2f Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 1 Mar 2017 18:16:09 +0100 Subject: [PATCH 31/38] - update: rename DEBUG1 to DRYRUN --- src/gui/update.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/update.cpp b/src/gui/update.cpp index 3d78c5f69..e0ce4cf0a 100644 --- a/src/gui/update.cpp +++ b/src/gui/update.cpp @@ -80,6 +80,8 @@ extern int allow_flash; +//#define DRYRUN + //#define gTmpPath "/var/update/" #define gTmpPath "/tmp/" #define gUserAgent "neutrino/softupdater 1.0" @@ -560,7 +562,7 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey) } #endif -#ifdef DEBUG1 +#ifdef DRYRUN if(1) { #else if(!ft.program(filename, 80, 100)) { @@ -596,10 +598,8 @@ int CFlashUpdate::exec(CMenuTarget* parent, const std::string &actionKey) else // not image, install { const char install_sh[] = "/bin/install.sh"; -#ifdef DEBUG1 - printf("[update] calling %s %s %s\n",install_sh, g_settings.update_dir.c_str(), filename.c_str() ); -#else printf("[update] calling %s %s %s\n",install_sh, g_settings.update_dir.c_str(), filename.c_str() ); +#ifndef DRYRUN my_system(3, install_sh, g_settings.update_dir.c_str(), filename.c_str()); #endif showGlobalStatus(100); From 6eb1bb1ea4c6d807771a60948b716f3d20a376c6 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Thu, 2 Mar 2017 23:00:49 +0100 Subject: [PATCH 32/38] - luainstance: add offsets to lua; set Lua api version to 1.70 --- src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/luainstance.cpp | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 6c8b8bc22..55b19f4e0 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 69 +#define LUA_API_VERSION_MINOR 70 diff --git a/src/gui/lua/luainstance.cpp b/src/gui/lua/luainstance.cpp index b3aaea15b..8df8c00ec 100644 --- a/src/gui/lua/luainstance.cpp +++ b/src/gui/lua/luainstance.cpp @@ -273,6 +273,19 @@ static void set_lua_variables(lua_State *L) { NULL, 0 } }; + /* offsets, exported as e.g. OFFSET['SHADOW'] */ + table_key offsets[] = + { + { "SHADOW", OFFSET_SHADOW }, + { "INTER", OFFSET_INTER }, + { "INNER_LARGE", OFFSET_INNER_LARGE }, + { "INNER_MID", OFFSET_INNER_MID }, + { "INNER_SMALL", OFFSET_INNER_SMALL }, + { "INNER_MIN", OFFSET_INNER_MIN }, + { "INNER_NONE", OFFSET_INNER_NONE }, + { NULL, 0 } + }; + /* screen offsets, exported as e.g. SCREEN['END_Y'] */ lua_Integer xRes = (lua_Integer)CFrameBuffer::getInstance()->getScreenWidth(true); lua_Integer yRes = (lua_Integer)CFrameBuffer::getInstance()->getScreenHeight(true); @@ -375,6 +388,7 @@ static void set_lua_variables(lua_State *L) { "SCREEN", screenopts }, { "FONT", fontlist }, { "CORNER", corners }, + { "OFFSET", offsets }, { "MENU_RETURN", menureturn }, { "APIVERSION", apiversion }, { "PLAYSTATE", playstate }, From 9fe20399c4f8ed47f129eb20901eaf27f8ee9853 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Thu, 2 Mar 2017 23:32:01 +0100 Subject: [PATCH 33/38] CNeutrinoApp::loadSetup: Fix Segfault when an remote timer is defined --- src/neutrino.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index fe94460d2..0a15d9969 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -468,7 +468,8 @@ int CNeutrinoApp::loadSetup(const char * fname) if (timer_remotebox_itemcount) { for (int i = 0; i < timer_remotebox_itemcount; i++) { timer_remotebox_item timer_rb; - memset(&timer_rb, 0, sizeof(struct timer_remotebox_item)); + timer_rb.online = false; + timer_rb.port = 0; std::string k; k = "timer_remotebox_ip_" + to_string(i); timer_rb.rbaddress = configfile.getString(k, ""); From 6afe247bc3f37f220795a72d90fe165e8f00d26f Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Fri, 3 Mar 2017 08:55:35 +0100 Subject: [PATCH 34/38] - luainstance: add missing RADIUS_NONE; fix typo in dynfont handling --- src/gui/lua/luainstance.cpp | 5 +++-- src/gui/lua/luainstance.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gui/lua/luainstance.cpp b/src/gui/lua/luainstance.cpp index 8df8c00ec..2b8a2ac76 100644 --- a/src/gui/lua/luainstance.cpp +++ b/src/gui/lua/luainstance.cpp @@ -270,6 +270,7 @@ static void set_lua_variables(lua_State *L) { "RADIUS_MID", RADIUS_MID }, { "RADIUS_SMALL", RADIUS_SMALL }, { "RADIUS_MIN", RADIUS_MIN }, + { "RADIUS_NONE", RADIUS_NONE }, { NULL, 0 } }; @@ -343,7 +344,7 @@ static void set_lua_variables(lua_State *L) { "STYLE_ITALIC", (lua_Integer)CNeutrinoFonts::FONT_STYLE_ITALIC }, { "MAX", (lua_Integer)CNeutrinoFonts::DYNFONTEXT_MAX }, { "MAXIMUM_FONTS", (lua_Integer)CLuaInstance::DYNFONT_MAXIMUM_FONTS }, - { "TO_WIDE", (lua_Integer)CLuaInstance::DYNFONT_TO_WIDE }, + { "TOO_WIDE", (lua_Integer)CLuaInstance::DYNFONT_TOO_WIDE }, { "TOO_HIGH", (lua_Integer)CLuaInstance::DYNFONT_TOO_HIGH }, { NULL, 0 } }; @@ -1050,7 +1051,7 @@ int CLuaInstance::getDynFont(lua_State *L) dx = luaL_checkint(L, 2); if (dx > (lua_Integer)CFrameBuffer::getInstance()->getScreenWidth(true)) { lua_pushnil(L); - lua_pushinteger(L, DYNFONT_TO_WIDE); + lua_pushinteger(L, DYNFONT_TOO_WIDE); return 2; } dy = luaL_checkint(L, 3); diff --git a/src/gui/lua/luainstance.h b/src/gui/lua/luainstance.h index 21ebb625b..fe0ad3bff 100644 --- a/src/gui/lua/luainstance.h +++ b/src/gui/lua/luainstance.h @@ -46,7 +46,7 @@ public: enum { DYNFONT_NO_ERROR = 0, DYNFONT_MAXIMUM_FONTS = 1, - DYNFONT_TO_WIDE = 2, + DYNFONT_TOO_WIDE = 2, DYNFONT_TOO_HIGH = 3 }; From 75ff8687dd2cdc445977501e8201cd95e6bb9e17 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Fri, 3 Mar 2017 08:57:42 +0100 Subject: [PATCH 35/38] - luainstance: re-add typo TO_WIDE to stay backward compatible --- src/gui/lua/luainstance.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/lua/luainstance.cpp b/src/gui/lua/luainstance.cpp index 2b8a2ac76..9adfa1d4e 100644 --- a/src/gui/lua/luainstance.cpp +++ b/src/gui/lua/luainstance.cpp @@ -344,6 +344,7 @@ static void set_lua_variables(lua_State *L) { "STYLE_ITALIC", (lua_Integer)CNeutrinoFonts::FONT_STYLE_ITALIC }, { "MAX", (lua_Integer)CNeutrinoFonts::DYNFONTEXT_MAX }, { "MAXIMUM_FONTS", (lua_Integer)CLuaInstance::DYNFONT_MAXIMUM_FONTS }, + { "TO_WIDE", (lua_Integer)CLuaInstance::DYNFONT_TOO_WIDE }, // just here to stay backward compatible { "TOO_WIDE", (lua_Integer)CLuaInstance::DYNFONT_TOO_WIDE }, { "TOO_HIGH", (lua_Integer)CLuaInstance::DYNFONT_TOO_HIGH }, { NULL, 0 } From c9242679a0a567479c3578fc84858ca44d6e0ef0 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Fri, 3 Mar 2017 14:38:01 +0100 Subject: [PATCH 36/38] CScanTs::handleMsg: Fix handling left/right keys during channel search --- src/gui/scan.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index d26ea9229..26a00d41c 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -451,9 +451,13 @@ int CScanTs::handleMsg(neutrino_msg_t msg, neutrino_msg_data_t data) break; case CRCInput::RC_plus: case CRCInput::RC_minus: + CVolume::getInstance()->setVolume(msg); + break; case CRCInput::RC_left: case CRCInput::RC_right: - CVolume::getInstance()->setVolume(msg); + if (g_settings.mode_left_right_key_tv == SNeutrinoSettings::VOLUME) { + CVolume::getInstance()->setVolume(msg); + } break; default: break; From 629f91e22901a0962008aea6e1fa9a68a1cadd23 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Fri, 3 Mar 2017 15:48:31 +0100 Subject: [PATCH 37/38] - imageinfo: change handling of yWeb version; use own CConfigFile --- src/gui/imageinfo.cpp | 13 +++++-------- src/gui/imageinfo.h | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index 15dd92544..aaa942d65 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -310,7 +310,7 @@ void CImageInfo::InitInfoData() s_api += ", "; #endif s_api += "yWeb "; - s_api += getYApi(); + s_api += getYWebVersion(); s_api += ", "; s_api += HTTPD_NAME; s_api += + " "; @@ -462,12 +462,9 @@ void CImageInfo::hide() } } -string CImageInfo::getYApi() +string CImageInfo::getYWebVersion() { - string ret; - config.loadConfig(Y_VERSION_FILE); - ret = config.getString("version", "n/a"); - config.loadConfig(VERSION_FILE); - return ret; + CConfigFile yV('=', false); + yV.loadConfig(PRIVATE_HTTPDDIR "/Y_Version.txt"); + return yV.getString("version", "n/a"); } - diff --git a/src/gui/imageinfo.h b/src/gui/imageinfo.h index 9d6e399f8..0449b7591 100644 --- a/src/gui/imageinfo.h +++ b/src/gui/imageinfo.h @@ -63,7 +63,7 @@ class CImageInfo : public CMenuTarget std::string getLicenseText(); void ShowWindow(); void ScrollLic(bool scrollDown); - std::string getYApi(); + std::string getYWebVersion(); CComponentsWindowMax *cc_win; CComponentsForm *cc_info; From b283128d0ff639fd05ab8ec8834e466f266a4639 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Fri, 3 Mar 2017 15:50:47 +0100 Subject: [PATCH 38/38] - imageinfo: remove obsolete define --- src/gui/imageinfo.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index aaa942d65..8dd342ed8 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -49,7 +49,6 @@ #include #define VERSION_FILE TARGET_PREFIX "/.version" -#define Y_VERSION_FILE DATADIR "/neutrino/httpd/Y_Version.txt" using namespace std;