diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 9980d88f7..9d2f1a47b 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1469,7 +1469,7 @@ void CChannelList::virtual_zap_mode(bool up) break; } } - g_InfoViewer->clearVirtualZapMode(); + g_InfoViewer->resetSwitchMode(); //disable virtual_zap_mode if (doZap) { if(g_settings.timing[SNeutrinoSettings::TIMING_INFOBAR] == 0) @@ -2068,8 +2068,10 @@ void CChannelList::paint() void CChannelList::paintHead() { - if (header == NULL) + if (header == NULL){ header = new CComponentsHeader(); + header->getTextObject()->enableTboxSaveScreen(g_settings.theme.menu_Head_gradient);//enable screen save for title text if color gradient is in use + } header->setDimensionsAll(x, y, full_width, theight); @@ -2106,7 +2108,7 @@ void CChannelList::paintHead() else logo_off = 10; - header->paint(CC_SAVE_SCREEN_NO); + header->paint(CC_SAVE_SCREEN_NO); //TODO: paint title only, currently paint() does paint all enabled header items at once and causes flicker effects in unchanged items (e.g. clock) } CComponentsHeader* CChannelList::getHeaderObject() diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index a43e0e461..0b2a4456e 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -620,8 +620,6 @@ void CCDraw::paintFbItems(bool do_save_bg) void CCDraw::hide() { - bool restored = false; - //restore saved screen background of item if available for(size_t i =0; i< v_fbdata.size() ;i++) { if (v_fbdata[i].fbdata_type == CC_FBDATA_TYPE_BGSCREEN){ @@ -629,14 +627,9 @@ void CCDraw::hide() //restore screen from backround layer frameBuffer->waitForIdle("CCDraw::hide()"); frameBuffer->RestoreScreen(v_fbdata[i].x, v_fbdata[i].y, v_fbdata[i].dx, v_fbdata[i].dy, v_fbdata[i].pixbuf); - restored = true; } } } - //cleanup background layer, but only if restore was required - if (restored) - clearSavedScreen(); - is_painted = false; firstPaint = true; } diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index 38087c79a..403418664 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -174,6 +174,7 @@ void CComponentsButton::initCaption() if (cc_btn_capt_obj == NULL){ cc_btn_capt_obj = new CComponentsLabel(); cc_btn_capt_obj->doPaintBg(false); + cc_btn_capt_obj->doPaintTextBoxBg(false); cc_btn_capt_obj->enableTboxSaveScreen(cc_txt_save_screen); addCCItem(cc_btn_capt_obj); } diff --git a/src/gui/components/cc_frm_button.h b/src/gui/components/cc_frm_button.h index 44a688b32..d665ac6ce 100644 --- a/src/gui/components/cc_frm_button.h +++ b/src/gui/components/cc_frm_button.h @@ -135,6 +135,27 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen ///set text color virtual void setButtonTextColor(fb_pixel_t text_color, fb_pixel_t text_color_disabled = COL_MENUCONTENTINACTIVE_TEXT){cc_btn_capt_col = text_color; cc_btn_capt_disable_col = text_color_disabled;} + /**Member to modify background behavior of embeded caption object. + * @param[in] mode + * @li bool, default = true + * @return + * void + * @see + * Parent member: CCTextScreen::enableTboxSaveScreen() + * CTextBox::enableSaveScreen() + * disableTboxSaveScreen() + */ + virtual void enableTboxSaveScreen(bool mode) + { + if (cc_txt_save_screen == mode) + return; + cc_txt_save_screen = mode; + for(size_t i=0; igetItemType() == CC_ITEMTYPE_LABEL) + static_cast(v_cc_items[i])->enableTboxSaveScreen(cc_txt_save_screen); + } + }; + ///set caption: parameter as string virtual void setCaption(const std::string& text); ///set caption: parameter as locale diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index 313b05cc2..e20ef0916 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -402,16 +402,13 @@ void CComponentsFrmClock::kill(const fb_pixel_t& bg_color, bool ignore_parent) CComponentsForm::kill(bg_color, ignore_parent); } -void CComponentsFrmClock::enableSegmentSaveScreen(bool mode) +void CComponentsFrmClock::enableTboxSaveScreen(bool mode) { if (cc_txt_save_screen == mode || v_cc_items.empty()) return; - cc_txt_save_screen = mode; - for (size_t i = 0; i < v_cc_items.size(); i++){ CComponentsLabel *seg = static_cast (v_cc_items[i]); - //seg->clearSavedScreen(); seg->enableTboxSaveScreen(cc_txt_save_screen); } } diff --git a/src/gui/components/cc_frm_clock.h b/src/gui/components/cc_frm_clock.h index 6b91c836f..8f5fe47b4 100644 --- a/src/gui/components/cc_frm_clock.h +++ b/src/gui/components/cc_frm_clock.h @@ -158,8 +158,18 @@ class CComponentsFrmClock : public CComponentsForm, public CCTextScreen ///reinitialize clock contents virtual void refresh() { initCCLockItems(); } - ///allows to save bg screen behind text within segment objects, see also cl_save_segment_screen - void enableSegmentSaveScreen(bool mode); + + /**Member to modify background behavior of embeded segment objects + * @param[in] mode + * @li bool, default = true + * @return + * void + * @see + * Parent member: CCTextScreen::enableTboxSaveScreen() + * CTextBox::enableSaveScreen() + * disableTboxSaveScreen() + */ + void enableTboxSaveScreen(bool mode); ///set color gradient on/off, returns true if gradient mode was changed virtual bool enableColBodyGradient(const int& enable_mode, const fb_pixel_t& sec_color = 255 /*=COL_BACKGROUND*/); diff --git a/src/gui/components/cc_frm_ext_text.cpp b/src/gui/components/cc_frm_ext_text.cpp index 5d24e7d58..97b798795 100644 --- a/src/gui/components/cc_frm_ext_text.cpp +++ b/src/gui/components/cc_frm_ext_text.cpp @@ -104,7 +104,8 @@ void CComponentsExtTextForm::initLabel() //initialize label object if (ccx_label_obj == NULL){ ccx_label_obj = new CComponentsLabel(); - ccx_label_obj->doPaintBg(false); + ccx_label_obj->doPaintBg(!cc_txt_save_screen); + ccx_label_obj->doPaintTextBoxBg(false); ccx_label_obj->enableTboxSaveScreen(cc_txt_save_screen); } @@ -117,7 +118,7 @@ void CComponentsExtTextForm::initLabel() ccx_label_width = (ccx_percent_label_w * width/100); ccx_label_obj->setText(ccx_label_text, ccx_label_align, ccx_font); ccx_label_obj->setTextColor(ccx_label_color); - ccx_label_obj->setDimensionsAll(fr_thickness, 0, ccx_label_width-fr_thickness, height-2*fr_thickness); + ccx_label_obj->setDimensionsAll(0, 0, ccx_label_width-2*fr_thickness, height-2*fr_thickness); ccx_label_obj->setCorner(this->corner_rad, CORNER_LEFT); } } @@ -127,7 +128,8 @@ void CComponentsExtTextForm::initText() //initialize text object if (ccx_text_obj == NULL){ ccx_text_obj = new CComponentsText(); - ccx_text_obj->doPaintBg(false); + ccx_text_obj->doPaintBg(!cc_txt_save_screen); + ccx_text_obj->doPaintTextBoxBg(false); ccx_text_obj->enableTboxSaveScreen(cc_txt_save_screen); } diff --git a/src/gui/components/cc_frm_ext_text.h b/src/gui/components/cc_frm_ext_text.h index 007680dea..0bf45f508 100644 --- a/src/gui/components/cc_frm_ext_text.h +++ b/src/gui/components/cc_frm_ext_text.h @@ -110,6 +110,24 @@ class CComponentsExtTextForm : public CComponentsForm, public CCTextScreen ///returns a pointer to the internal text object, use this to get access to its most properties CComponentsText*getTextObject(){return ccx_text_obj;}; + /**Member to modify background behavior of embeded label and text objects + * @param[in] mode + * @li bool, default = true + * @return + * void + * @see + * Parent member: CCTextScreen::enableTboxSaveScreen() + * CTextBox::enableSaveScreen() + * disableTboxSaveScreen() + */ + void enableTboxSaveScreen(bool mode){ + if (cc_txt_save_screen == mode) + return; + cc_txt_save_screen = mode; + for(size_t i=0; i(v_cc_items[i])->enableTboxSaveScreen(cc_txt_save_screen); + }; + ///sets the text modes (mainly text alignment) to the label and text object, see /gui/widget/textbox.h for possible modes void setTextModes(const int& label_mode, const int& text_mode); diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index fc8f35c1a..3f75e2fb2 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -86,7 +86,7 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const fb_pixel_t color_shadow) { cc_item_type = CC_ITEMTYPE_FRM_HEADER; - cc_txt_save_screen = true; + cc_txt_save_screen = false; x = x_old = x_pos; y = y_old = y_pos; diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index 56eb3e38d..45354ca2e 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -211,6 +211,23 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen ///returns the text object virtual CComponentsText* getTextObject(){return cch_text_obj;} + /**Member to modify background behavior of embeded title + * @param[in] mode + * @li bool, default = true + * @return + * void + * @see + * Parent member: CCTextScreen::enableTboxSaveScreen() + * CTextBox::enableSaveScreen() + * disableTboxSaveScreen() + */ + void enableTboxSaveScreen(bool mode) + { + cc_txt_save_screen = mode; + if (cch_text_obj->getCTextBoxObject()) + cch_text_obj->getCTextBoxObject()->enableSaveScreen(cc_txt_save_screen); + } + ///returns the clock object virtual CComponentsFrmClock* getClockObject(){return cch_cl_obj;} diff --git a/src/gui/components/cc_frm_signalbars.cpp b/src/gui/components/cc_frm_signalbars.cpp index 5bea94103..27061c8b8 100644 --- a/src/gui/components/cc_frm_signalbars.cpp +++ b/src/gui/components/cc_frm_signalbars.cpp @@ -106,7 +106,7 @@ void CSignalBar::initVarSigBar() append_x_offset = 2; append_y_offset = 2; height = SB_MIN_HEIGHT; - + cc_item_type = CC_ITEMTYPE_FRM_SIGNALBAR; sb_scale_height = -1; dy_font = CNeutrinoFonts::getInstance(); @@ -144,12 +144,13 @@ void CSignalBar::initSBarValue() //create value label object with basic properties if (sb_vlbl == NULL){ sb_vlbl = new CComponentsLabel(); - sb_vlbl->doPaintBg(false); - sb_vlbl->doPaintTextBoxBg(false); - sb_vlbl->enableTboxSaveScreen(true); sb_vlbl->setText(REF_PERCENT_TXT, sb_val_mode, sb_font); } + sb_vlbl->doPaintBg(false); + sb_vlbl->doPaintTextBoxBg(!cc_txt_save_screen); + sb_vlbl->enableTboxSaveScreen(cc_txt_save_screen); + //move and set dimensions int vlbl_x = sb_scale->getXPos() + sb_scale_width + append_y_offset; int vlbl_h = sb_scale->getHeight(); @@ -169,12 +170,14 @@ void CSignalBar::initSBarName() //create name label object with basic properties if (sb_lbl == NULL){ sb_lbl = new CComponentsLabel(); - sb_lbl->doPaintBg(false); - sb_lbl->doPaintTextBoxBg(false); - sb_lbl->enableTboxSaveScreen(true); - sb_lbl->setText(sb_name, CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, sb_font); } + sb_lbl->doPaintBg(false); + sb_lbl->doPaintTextBoxBg(!cc_txt_save_screen); + sb_lbl->enableTboxSaveScreen(cc_txt_save_screen); + + sb_lbl->setText(sb_name, CTextBox::NO_AUTO_LINEBREAK | CTextBox::RIGHT, sb_font); + //move and set dimensions int lbl_x = sb_vlbl->getXPos()+ sb_vlbl->getWidth(); int lbl_h = sb_vlbl->getHeight(); @@ -316,11 +319,13 @@ void CSignalBox::initSignalItems() sbar->setFrontEnd(sbx_frontend); sbar->setCorner(0); sbar->setScaleHeight(scale_h); + sbar->enableTboxSaveScreen(cc_txt_save_screen); snrbar->setDimensionsAll(vertical ? sbar_x : CC_APPEND, vertical ? CC_APPEND : 1, sbar_w, sbar_h); snrbar->setFrontEnd(sbx_frontend); snrbar->setCorner(0); snrbar->setScaleHeight(scale_h); + snrbar->enableTboxSaveScreen(cc_txt_save_screen); } void CSignalBox::paintScale() diff --git a/src/gui/components/cc_frm_signalbars.h b/src/gui/components/cc_frm_signalbars.h index e78de5353..216b221af 100644 --- a/src/gui/components/cc_frm_signalbars.h +++ b/src/gui/components/cc_frm_signalbars.h @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -47,7 +48,7 @@ CSignalBar() and their sub classes based up CComponentsForm() and are usable lik CSignalBar() is intended to show signal rate. */ -class CSignalBar : public CComponentsForm +class CSignalBar : public CComponentsForm, public CCTextScreen { public: ///refresh current item properties, use this before paintScale(). @@ -141,6 +142,27 @@ class CSignalBar : public CComponentsForm //returns the current signal value uint16_t getValue(void) { return sb_signal; } + + /**Member to modify background behavior of embeded caption objects (value, name) + * @param[in] mode + * @li bool, default = true + * @return + * void + * @see + * Parent member: CCTextScreen::enableTboxSaveScreen() + * CTextBox::enableSaveScreen() + * disableTboxSaveScreen() + */ + void enableTboxSaveScreen(bool mode) + { + if (cc_txt_save_screen == mode) + return; + cc_txt_save_screen = mode; + for(size_t i=0; igetItemType() == CC_ITEMTYPE_LABEL) + static_cast(v_cc_items[i])->enableTboxSaveScreen(cc_txt_save_screen); + } + } }; /// Sub class of CSignalBar() @@ -237,7 +259,7 @@ void CSampleClass::hide () */ -class CSignalBox : public CComponentsForm +class CSignalBox : public CComponentsForm, public CCTextScreen { private: ///object: current frontend @@ -289,8 +311,27 @@ class CSignalBox : public CComponentsForm ///return current snr value uint16_t getSNRValue(void) { return snrbar->getValue();} - - ///return current snr value + + /**Member to modify background behavior of embeded caption objects (value, name) + * @param[in] mode + * @li bool, default = true + * @return + * void + * @see + * Parent member: CCTextScreen::enableTboxSaveScreen() + * CTextBox::enableSaveScreen() + * disableTboxSaveScreen() + */ + void enableTboxSaveScreen(bool mode) + { + if (cc_txt_save_screen == mode) + return; + cc_txt_save_screen = mode; + for(size_t i=0; igetItemType() == CC_ITEMTYPE_FRM_SIGNALBAR) + static_cast(v_cc_items[i])->enableTboxSaveScreen(cc_txt_save_screen); + } + }; }; #endif diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 9c938167c..4f9b242c4 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -135,7 +135,6 @@ void CComponentsItem::kill(const fb_pixel_t& bg_color, bool ignore_parent) else CComponents::kill(cc_parent->getColorBody(), cc_parent->getCornerRadius()); } - clearScreenBuffer(); } //synchronize colors for forms diff --git a/src/gui/components/cc_item_text.cpp b/src/gui/components/cc_item_text.cpp index bfe7a622a..c554f1123 100644 --- a/src/gui/components/cc_item_text.cpp +++ b/src/gui/components/cc_item_text.cpp @@ -133,7 +133,7 @@ void CComponentsText::initCCText() if (cc_parent){ int th_parent_fr = cc_parent->getFrameThickness(); iX = cc_xr + (x <= th_parent_fr ? th_parent_fr : 0); - iY = cc_yr + (y <= th_parent_fr ? th_parent_fr : 0); + iY = cc_yr - (y <= th_parent_fr ? th_parent_fr : 0); } //init textbox @@ -145,13 +145,13 @@ void CComponentsText::initCCText() ct_textbox->setTextMode(ct_text_mode); ct_textbox->setWindowPos(this); ct_textbox->setTextBorderWidth(ct_text_Hborder, ct_text_Vborder); - ct_textbox->enableBackgroundPaint(ct_paint_textbg); + ct_textbox->enableBackgroundPaint(ct_paint_textbg && !cc_txt_save_screen); ct_textbox->setBackGroundColor(col_body); ct_textbox->setBackGroundRadius(corner_rad-fr_thickness, corner_type); ct_textbox->setTextColor(ct_col_text); ct_textbox->setWindowMaxDimensions(iWidth, iHeight); ct_textbox->setWindowMinDimensions(iWidth, iHeight); - ct_textbox->enableSaveScreen(cc_txt_save_screen); + ct_textbox->enableSaveScreen(cc_txt_save_screen && !ct_paint_textbg); ct_textbox->enableUTF8(ct_utf8_encoded); //observe behavior of parent form if available diff --git a/src/gui/components/cc_item_text.h b/src/gui/components/cc_item_text.h index af36d128b..5bf297212 100644 --- a/src/gui/components/cc_item_text.h +++ b/src/gui/components/cc_item_text.h @@ -177,14 +177,22 @@ class CComponentsText : public CCTextScreen, public CComponentsItem, public CBox ///returns count of lines from a text box page virtual int getTextLinesAutoHeight(const int& textMaxHeight, const int& textWidth, const int& mode); - ///allows to save bg screen behind text within CTextBox object, see also cc_txt_save_screen + + /**Member to modify background behavior of textbox object + * @param[in] mode + * @li bool, default = true + * @return + * void + * @see + * Parent member: CCTextScreen::enableTboxSaveScreen() + * CTextBox::enableSaveScreen() + * disableTboxSaveScreen() + */ void enableTboxSaveScreen(bool mode) { - if (cc_txt_save_screen == mode) - return; cc_txt_save_screen = mode; if (ct_textbox) - ct_textbox->enableSaveScreen(mode); + ct_textbox->enableSaveScreen(cc_txt_save_screen); } ///enable/disable utf8 encoding void enableUTF8(bool enable = true){ct_utf8_encoded = enable;} diff --git a/src/gui/components/cc_text_screen.h b/src/gui/components/cc_text_screen.h index afdbe9024..07f7e05e6 100644 --- a/src/gui/components/cc_text_screen.h +++ b/src/gui/components/cc_text_screen.h @@ -24,7 +24,6 @@ #ifndef __CC_TXT_SCREEN__ #define __CC_TXT_SCREEN__ - //! Sub class for CTextBox using CComponent classes. /*! This class contains flags or helpers to control CTextBox screen and paint handling and mostly used by @@ -38,7 +37,25 @@ class CCTextScreen bool cc_txt_save_screen; public: - CCTextScreen(){cc_txt_save_screen = false;}; + CCTextScreen(){cc_txt_save_screen = false;} + + /**Abstract member to modify background behavior of embeded textbox object + * @param[in] mode + * @li bool, default = true, enables backround saving of textbox object. This causes painting of backround from saved screen instead simple backround (if enabled) + * This is usefull if text should be paint on transparent background or background with color gradient. + * @return + * void + * @see + * CTextBox::enableSaveScreen() + * disableTboxSaveScreen() + */ + virtual void enableTboxSaveScreen(bool mode) = 0; + + /**member to disable background behavior of embeded textbox object. + * @see + * disableTboxSaveScreen() + */ + virtual void disableTboxSaveScreen(){enableTboxSaveScreen(false);} }; #endif diff --git a/src/gui/components/cc_types.h b/src/gui/components/cc_types.h index 8636ab679..cb135fe6a 100644 --- a/src/gui/components/cc_types.h +++ b/src/gui/components/cc_types.h @@ -63,6 +63,7 @@ typedef enum CC_ITEMTYPE_BUTTON_BLUE, CC_ITEMTYPE_SLIDER, CC_ITEMTYPE_FRM_SCROLLBAR, + CC_ITEMTYPE_FRM_SIGNALBAR, CC_ITEMTYPES }CC_ITEMTYPES_T; diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 56f2244b2..413e0a390 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -145,7 +145,7 @@ void CInfoViewer::Init() showButtonBar = false; //gotTime = g_Sectionsd->getIsTimeSet (); gotTime = timeset; - virtual_zap_mode = false; + zap_mode = IV_MODE_DEFAULT; newfreq = true; chanready = 1; fileplay = 0; @@ -255,10 +255,10 @@ void CInfoViewer::initClock() InfoClock->getInstance()->disableInfoClock(); clock->enableColBodyGradient(gradient_top, COL_INFOBAR_PLUS_0); - clock->enableSegmentSaveScreen(gradient_top); + clock->doPaintBg(!gradient_top); + clock->enableTboxSaveScreen(gradient_top); clock->setColorBody(COL_INFOBAR_PLUS_0); clock->setCorner(RADIUS_LARGE, CORNER_TOP_RIGHT); - clock->doPaintBg(!gradient_top); clock->setClockFont(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]); clock->setPos(BoxEndX - 10 - clock->getWidth(), ChanNameY); clock->setTextColor(COL_INFOBAR_TEXT); @@ -434,7 +434,7 @@ void CInfoViewer::paintBody() { int h_body = InfoHeightY - header_height + (g_settings.infobar_casystem_display < 2 ? infoViewerBB->bottom_bar_offset : 0); - if(virtual_zap_mode) + if(zap_mode) h_body -= (g_settings.infobar_casystem_display < 2 ? infoViewerBB->bottom_bar_offset : 0); if (body == NULL) @@ -443,8 +443,8 @@ void CInfoViewer::paintBody() body->setDimensionsAll(ChanInfoX, ChanNameY + header_height, BoxEndX-ChanInfoX, h_body); //set corner and shadow modes, consider virtual zap mode - body->setCorner(RADIUS_LARGE, virtual_zap_mode ? CORNER_BOTTOM : CORNER_NONE); - body->enableShadow(virtual_zap_mode ? CC_SHADOW_ON : CC_SHADOW_RIGHT); + body->setCorner(RADIUS_LARGE, (zap_mode) ? CORNER_BOTTOM : CORNER_NONE); + body->enableShadow(zap_mode ? CC_SHADOW_ON : CC_SHADOW_RIGHT); body->setColorBody(g_settings.theme.infobar_gradient_body ? COL_MENUHEAD_PLUS_0 : COL_INFOBAR_PLUS_0); body->enableColBodyGradient(g_settings.theme.infobar_gradient_body, COL_INFOBAR_PLUS_0, g_settings.theme.infobar_gradient_body_direction); @@ -705,7 +705,7 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap ChannelName = Channel; bool new_chan = false; - if (virtual_zap_mode) { + if (zap_mode & IV_MODE_VIRTUAL_ZAP) { if (g_RemoteControl->current_channel_id != new_channel_id) { col_NumBoxText = COL_MENUHEAD_TEXT; } @@ -898,7 +898,7 @@ void CInfoViewer::setInfobarTimeout(int timeout_ext) void CInfoViewer::loop(bool show_dot) { bool hideIt = true; - virtual_zap_mode = false; + resetSwitchMode(); //no virtual zap //bool fadeOut = false; timeoutEnd=0;; setInfobarTimeout(); @@ -953,7 +953,7 @@ void CInfoViewer::loop(bool show_dot) //infoViewerBB->showIcon_CA_Status(0); infoViewerBB->showIcon_Resolution(); } else if ((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VZAP) && ((msg == CRCInput::RC_right) || (msg == CRCInput::RC_left ))) { - virtual_zap_mode = true; + setSwitchMode(IV_MODE_VIRTUAL_ZAP); res = messages_return::cancel_all; hideIt = true; } else if ((msg == NeutrinoMessages::EVT_RECORDMODE) && @@ -1032,7 +1032,7 @@ void CInfoViewer::loop(bool show_dot) g_RCInput->killTimer (sec_timer_id); fader.StopFade(); - if (virtual_zap_mode) { + if (zap_mode & IV_MODE_VIRTUAL_ZAP) { /* if bouquet cycle set, do virtual over current bouquet */ if (/*g_settings.zap_cycle && */ /* (bouquetList != NULL) && */ !(bouquetList->Bouquets.empty())) bouquetList->Bouquets[bouquetList->getActiveBouquetNumber()]->channelList->virtual_zap_mode(msg == CRCInput::RC_right); @@ -1369,20 +1369,18 @@ int CInfoViewer::handleMsg (const neutrino_msg_t msg, neutrino_msg_data_t data) if (is_visible) showRecordIcon(true); } else if (msg == NeutrinoMessages::EVT_ZAP_GOTAPIDS) { if ((*(t_channel_id *) data) == current_channel_id) { -#if 0 - if (is_visible && showButtonBar) - infoViewerBB->showBBButtons(CInfoViewerBB::BUTTON_GREEN); -#endif + if (is_visible && showButtonBar) { + infoViewerBB->showIcon_DD(); + infoViewerBB->showBBButtons(); // in case button text has changed + } if (g_settings.radiotext_enable && g_Radiotext && !g_RemoteControl->current_PIDs.APIDs.empty() && ((CNeutrinoApp::getInstance()->getMode()) == NeutrinoMessages::mode_radio)) g_Radiotext->setPid(g_RemoteControl->current_PIDs.APIDs[g_RemoteControl->current_PIDs.PIDs.selected_apid].pid); } return messages_return::handled; } else if (msg == NeutrinoMessages::EVT_ZAP_GOT_SUBSERVICES) { if ((*(t_channel_id *) data) == current_channel_id) { -#if 0 if (is_visible && showButtonBar) - infoViewerBB->showBBButtons(CInfoViewerBB::BUTTON_YELLOW); -#endif + infoViewerBB->showBBButtons(); // in case button text has changed } return messages_return::handled; } else if (msg == NeutrinoMessages::EVT_ZAP_SUB_COMPLETE) { @@ -1451,7 +1449,7 @@ int CInfoViewer::handleMsg (const neutrino_msg_t msg, neutrino_msg_data_t data) void CInfoViewer::sendNoEpg(const t_channel_id for_channel_id) { - if (!virtual_zap_mode) { + if (!zap_mode/* & IV_MODE_DEFAULT*/) { char *p = new char[sizeof(t_channel_id)]; memcpy(p, &for_channel_id, sizeof(t_channel_id)); g_RCInput->postMsg (NeutrinoMessages::EVT_NOEPG_YET, (const neutrino_msg_data_t) p, false); @@ -1528,7 +1526,9 @@ void CInfoViewer::showSNR () int sigbox_offset = ChanWidth *10/100; sigbox = new CSignalBox(BoxStartX + sigbox_offset, y_numbox+ChanHeight/2, ChanWidth - 2*sigbox_offset, ChanHeight/2, CFEManager::getInstance()->getLiveFE(), true, NULL, "S", "Q"); sigbox->setTextColor(COL_INFOBAR_TEXT); + sigbox->setColorBody(numbox->getColorBody()); sigbox->doPaintBg(false); + sigbox->enableTboxSaveScreen(numbox->getColBodyGradientMode()); } sigbox->paint(CC_SAVE_SCREEN_NO); } @@ -1791,9 +1791,7 @@ void CInfoViewer::show_Data (bool calledFromEvent) frameBuffer->paintBackgroundBoxRel (BoxEndX - 108, posy, 112, height2); } #endif - infoViewerBB->showBBButtons(CInfoViewerBB::BUTTON_RED); - infoViewerBB->showBBButtons(CInfoViewerBB::BUTTON_GREEN); - infoViewerBB->showBBButtons(CInfoViewerBB::BUTTON_YELLOW); + infoViewerBB->showBBButtons(); } if ((info_CurrentNext.flags & CSectionsdClient::epgflags::not_broadcast) || @@ -1979,7 +1977,7 @@ void CInfoViewer::showInfoFile() //paint info, don't save background, if already painted, global hide is also done by killTitle() bool save_bg = !infobar_txt->isPainted(); - if (new_text || virtual_zap_mode) + if (new_text || (zap_mode & IV_MODE_VIRTUAL_ZAP)) infobar_txt->paint(save_bg); } diff --git a/src/gui/infoviewer.h b/src/gui/infoviewer.h index 92a374212..dacc27f24 100644 --- a/src/gui/infoviewer.h +++ b/src/gui/infoviewer.h @@ -57,6 +57,7 @@ class CInfoViewer bool gotTime; bool recordModeActive; + #ifndef SKIP_CA_STATUS bool CA_Status; #endif @@ -110,6 +111,7 @@ class CInfoViewer bool casysChange; bool channellogoChange; uint32_t lcdUpdateTimer; + int zap_mode; void paintBackground(int col_Numbox); void paintHead(); @@ -147,7 +149,7 @@ class CInfoViewer public: bool chanready; bool is_visible; - bool virtual_zap_mode; + char aspectRatio; uint32_t sec_timer_id; @@ -179,7 +181,27 @@ class CInfoViewer //void Set_CA_Status(int Status); int handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data); - void clearVirtualZapMode() {virtual_zap_mode = false;} + + enum{ + IV_MODE_DEFAULT = 0, + IV_MODE_VIRTUAL_ZAP = 1, + IV_MODE_NUMBER_ZAP = 2 + };/*iv_switch_mode_t*/ + /**sets mode for infoviewer. + * @param[in] mode + * @li IV_MODE_DEFAULT + * @li IV_MODE_VIRTUAL_ZAP means the virtual zap mode, user is typing keys for virtual channel switch + * @li IV_MODE_NUMBER_ZAP means number mode, user is typing number keys into screen + * @return + * void + * @see + * resetSwitchMode() + * getSwitchMode() + */ + void setSwitchMode(const int& mode) {zap_mode = mode;} + int getSwitchMode() {return zap_mode;} + void resetSwitchMode() {setSwitchMode(IV_MODE_DEFAULT);} + void changePB(); void ResetPB(); void showSNR(); diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index f776e815f..54a9548e8 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -439,9 +439,6 @@ void CInfoViewerBB::showBBButtons(const int modus) } } - if (modus == CInfoViewerBB::BUTTON_GREEN) - showIcon_DD(); - for (i = 0; i < CInfoViewerBB::BUTTON_MAX; i++) { tmp_bbButtonInfoText[i] = bbButtonInfo[i].text; } diff --git a/src/gui/infoviewer_bb.h b/src/gui/infoviewer_bb.h index 4a7944028..1c690a677 100644 --- a/src/gui/infoviewer_bb.h +++ b/src/gui/infoviewer_bb.h @@ -113,7 +113,6 @@ class CInfoViewerBB void showBBIcons(const int modus, const std::string & icon); void getBBIconInfo(void); bool checkBBIcon(const char * const icon, int *w, int *h); - void showIcon_DD(void); void paint_ca_icons(int, const char*, int&); void paintCA_bar(int,int); @@ -143,6 +142,7 @@ class CInfoViewerBB void showIcon_SubT(); void showIcon_Resolution(); void showIcon_Tuner(void); + void showIcon_DD(void); void showBBButtons(const int modus=-1); void paintshowButtonBar(); void getBBButtonInfo(void); diff --git a/src/gui/lua/Makefile.am b/src/gui/lua/Makefile.am index 4cf5c50aa..e3861cb76 100644 --- a/src/gui/lua/Makefile.am +++ b/src/gui/lua/Makefile.am @@ -25,6 +25,7 @@ noinst_LIBRARIES = libneutrino_gui_lua.a libneutrino_gui_lua_a_SOURCES = \ luainstance.cpp \ luainstance_helpers.cpp \ + lua_cc_header.cpp \ lua_cc_picture.cpp \ lua_cc_signalbox.cpp \ lua_cc_text.cpp \ diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index c5a53aad9..f95bdbc54 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 37 +#define LUA_API_VERSION_MINOR 39 diff --git a/src/gui/lua/lua_cc_header.cpp b/src/gui/lua/lua_cc_header.cpp new file mode 100644 index 000000000..c2273cde5 --- /dev/null +++ b/src/gui/lua/lua_cc_header.cpp @@ -0,0 +1,138 @@ +/* + * lua components header + * + * (C) 2016 M. Liebmann (micha-bbg) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "luainstance.h" +#include "lua_cc_window.h" +#include "lua_cc_header.h" + + +CLuaInstCCHeader* CLuaInstCCHeader::getInstance() +{ + static CLuaInstCCHeader* LuaInstCCHeader = NULL; + + if(!LuaInstCCHeader) + LuaInstCCHeader = new CLuaInstCCHeader(); + return LuaInstCCHeader; +} + +CLuaCCHeader *CLuaInstCCHeader::CCHeaderCheck(lua_State *L, int n) +{ + return *(CLuaCCHeader **) luaL_checkudata(L, n, LUA_HEADER_CLASSNAME); +} + +void CLuaInstCCHeader::CCHeaderRegister(lua_State *L) +{ + luaL_Reg meth[] = { + { "new", CLuaInstCCHeader::CCHeaderNew }, + { "paint", CLuaInstCCHeader::CCHeaderPaint }, + { "hide", CLuaInstCCHeader::CCHeaderHide }, + { "__gc", CLuaInstCCHeader::CCHeaderDelete }, + { NULL, NULL } + }; + + luaL_newmetatable(L, LUA_HEADER_CLASSNAME); + luaL_setfuncs(L, meth, 0); + lua_pushvalue(L, -1); + lua_setfield(L, -1, "__index"); + lua_setglobal(L, LUA_HEADER_CLASSNAME); +} + + +int CLuaInstCCHeader::CCHeaderNew(lua_State *L) +{ + lua_assert(lua_istable(L,1)); + + CLuaCCWindow* parent = NULL; + lua_Integer x=10, y=10, dx=100, dy=100; + lua_Integer buttons = 0; + lua_Integer shadow_mode = CC_SHADOW_OFF; + + std::string caption, icon; + lua_Unsigned color_frame = (lua_Unsigned)COL_MENUCONTENT_PLUS_6; + lua_Unsigned color_body = (lua_Unsigned)COL_MENUCONTENT_PLUS_0; + lua_Unsigned color_shadow = (lua_Unsigned)COL_MENUCONTENTDARK_PLUS_0; + + tableLookup(L, "parent", (void**)&parent); + tableLookup(L, "x", x); + tableLookup(L, "y", y); + tableLookup(L, "dx", dx); + tableLookup(L, "dy", dy); + tableLookup(L, "caption", caption); + tableLookup(L, "icon", icon); + tableLookup(L, "shadow_mode", shadow_mode); + tableLookup(L, "color_frame", color_frame); + tableLookup(L, "color_body" , color_body); + tableLookup(L, "color_shadow", color_shadow); + + color_frame = checkMagicMask(color_frame); + color_body = checkMagicMask(color_body); + color_shadow = checkMagicMask(color_shadow); + + CComponentsForm* pw = (parent && parent->w) ? parent->w->getBodyObject() : NULL; + CLuaCCHeader **udata = (CLuaCCHeader **) lua_newuserdata(L, sizeof(CLuaCCHeader *)); + *udata = new CLuaCCHeader(); + (*udata)->ch = new CComponentsHeader((const int&)x, (const int&)y, (const int&)dx, (const int&)dy, + caption, (std::string)"", (const int&)buttons, + (CComponentsForm*)parent, (int)shadow_mode, + (fb_pixel_t)color_frame, (fb_pixel_t)color_body, (fb_pixel_t)color_shadow); + (*udata)->parent = pw; + luaL_getmetatable(L, LUA_HEADER_CLASSNAME); + lua_setmetatable(L, -2); + return 1; +} + +int CLuaInstCCHeader::CCHeaderPaint(lua_State *L) +{ + lua_assert(lua_istable(L,1)); + CLuaCCHeader *D = CCHeaderCheck(L, 1); + if (!D) return 0; + + bool do_save_bg = true; + tableLookup(L, "do_save_bg", do_save_bg); + + D->ch->paint(do_save_bg); + return 0; +} + +int CLuaInstCCHeader::CCHeaderHide(lua_State *L) +{ + CLuaCCHeader *D = CCHeaderCheck(L, 1); + if (!D) return 0; + + D->ch->hide(); + return 0; +} + +int CLuaInstCCHeader::CCHeaderDelete(lua_State *L) +{ + CLuaCCHeader *D = CCHeaderCheck(L, 1); + if (!D) return 0; + delete D; + return 0; +} diff --git a/src/gui/lua/lua_cc_header.h b/src/gui/lua/lua_cc_header.h new file mode 100644 index 000000000..bea6bf72f --- /dev/null +++ b/src/gui/lua/lua_cc_header.h @@ -0,0 +1,49 @@ +/* + * lua components header + * + * (C) 2016 M. Liebmann (micha-bbg) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef _LUACCHEADER_H +#define _LUACCHEADER_H + +class CLuaCCHeader +{ + public: + CComponentsHeader *ch; + CComponentsForm *parent; + CLuaCCHeader() { ch = NULL; parent = NULL; } + ~CLuaCCHeader() { if (parent == NULL) delete ch; } +}; + +class CLuaInstCCHeader +{ + public: + CLuaInstCCHeader() {}; + ~CLuaInstCCHeader() {}; + static CLuaInstCCHeader* getInstance(); + static void CCHeaderRegister(lua_State *L); + + private: + static CLuaCCHeader *CCHeaderCheck(lua_State *L, int n); + static int CCHeaderNew(lua_State *L); + static int CCHeaderPaint(lua_State *L); + static int CCHeaderHide(lua_State *L); + static int CCHeaderDelete(lua_State *L); + +}; + +#endif //_LUACCHEADER_H diff --git a/src/gui/lua/lua_misc.cpp b/src/gui/lua/lua_misc.cpp index 65c03b435..890ce404a 100644 --- a/src/gui/lua/lua_misc.cpp +++ b/src/gui/lua/lua_misc.cpp @@ -71,6 +71,7 @@ void CLuaInstMisc::LuaMiscRegister(lua_State *L) { "GetRevision", CLuaInstMisc::GetRevision }, { "checkVersion", CLuaInstMisc::checkVersion }, { "postMsg", CLuaInstMisc::postMsg }, + { "getTimeOfDay", CLuaInstMisc::getTimeOfDay }, { "__gc", CLuaInstMisc::MiscDelete }, { NULL, NULL } }; @@ -342,6 +343,20 @@ int CLuaInstMisc::postMsg(lua_State *L) return 0; } +int CLuaInstMisc::getTimeOfDay(lua_State *L) +{ + CLuaMisc *D = MiscCheckData(L, 1); + if (!D) return 0; + + struct timeval t1; + double dt; + gettimeofday(&t1, NULL); + dt = (double)t1.tv_sec + ((double)t1.tv_usec)/1000000ULL; + + lua_pushnumber(L, (lua_Number)dt); + return 1; +} + int CLuaInstMisc::MiscDelete(lua_State *L) { CLuaMisc *D = MiscCheckData(L, 1); diff --git a/src/gui/lua/lua_misc.h b/src/gui/lua/lua_misc.h index 0d4969be7..56ea4023f 100644 --- a/src/gui/lua/lua_misc.h +++ b/src/gui/lua/lua_misc.h @@ -63,6 +63,7 @@ class CLuaInstMisc static int GetRevision(lua_State *L); static int checkVersion(lua_State *L); static int postMsg(lua_State *L); + static int getTimeOfDay(lua_State *L); static int MiscDelete(lua_State *L); static void miscFunctionDeprecated(lua_State *L, std::string oldFunc); diff --git a/src/gui/lua/luainstance.cpp b/src/gui/lua/luainstance.cpp index f02cea774..f3bf6b45f 100644 --- a/src/gui/lua/luainstance.cpp +++ b/src/gui/lua/luainstance.cpp @@ -37,6 +37,7 @@ #include #include "luainstance.h" +#include "lua_cc_header.h" #include "lua_cc_picture.h" #include "lua_cc_signalbox.h" #include "lua_cc_text.h" @@ -605,6 +606,7 @@ void LuaInstRegisterFunctions(lua_State *L, bool fromThreads/*=false*/) lua_settop(L, top); // ------------------------------------------ CLuaInstCCPicture::getInstance()->CCPictureRegister(L); + CLuaInstCCHeader::getInstance()->CCHeaderRegister(L); CLuaInstCCSignalbox::getInstance()->CCSignalBoxRegister(L); CLuaInstCCText::getInstance()->CCTextRegister(L); CLuaInstCCWindow::getInstance()->CCWindowRegister(L); diff --git a/src/gui/lua/luainstance_helpers.h b/src/gui/lua/luainstance_helpers.h index bd4eb571f..5b6dfb141 100644 --- a/src/gui/lua/luainstance_helpers.h +++ b/src/gui/lua/luainstance_helpers.h @@ -29,6 +29,7 @@ #define LUA_VIDEO_CLASSNAME "video" #define LUA_MISC_CLASSNAME "misc" #define LUA_CURL_CLASSNAME "curl" +#define LUA_HEADER_CLASSNAME "header" //#define LUA_WIKI "http://wiki.tuxbox.org/....." #define LUA_WIKI "https://slknet.de/wiki/w" diff --git a/src/gui/screensaver.cpp b/src/gui/screensaver.cpp index 0235a9358..05c7396e5 100644 --- a/src/gui/screensaver.cpp +++ b/src/gui/screensaver.cpp @@ -271,7 +271,7 @@ void CScreenSaver::paint() if (!scr_clock){ scr_clock = new CComponentsFrmClock(1, 1, NULL, "%H.%M:%S", "%H.%M %S", true); scr_clock->setClockFont(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]); - scr_clock->enableSaveBg(); + scr_clock->disableSaveBg(); scr_clock->doPaintBg(false); } if (scr_clock->isPainted()) @@ -279,7 +279,17 @@ void CScreenSaver::paint() scr_clock->kill(); scr_clock->setTextColor(clr.i_color); - scr_clock->setPosP(rand() % 80, rand() % 90); + + //check position and size use only possible available screen size + int x_cl, y_cl, w_cl, h_cl; + scr_clock->getDimensions( &x_cl, &y_cl, &w_cl, &h_cl); + bool unchecked = true; + while(unchecked){ + scr_clock->setPosP(uint8_t(rand() % 100),uint8_t(rand() % 100)); + scr_clock->getDimensions( &x_cl, &y_cl, &w_cl, &h_cl); + if (x_cl+w_cl < g_settings.screen_EndX && y_cl+h_cl < g_settings.screen_EndY) + unchecked = false; + } scr_clock->Start(); if (g_settings.screensaver_mode == SCR_MODE_CLOCK_COLOR) { diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index 18205ea50..5f33a725e 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -588,8 +588,8 @@ void CTextBox::refreshText(void) //save screen only if no paint of background required if (!m_nPaintBackground && m_SaveScreen) { if (m_bgpixbuf == NULL){ - //TRACE("[CTextBox] %s save bg %d\r\n", __FUNCTION__, __LINE__); if ((dx * dy) >0){ +// TRACE("[CTextBox] [%s - %d] save bg for use as transparent background [%s]\n", __func__, __LINE__, m_cText.c_str()); m_bgpixbuf= new fb_pixel_t[dx * dy]; frameBuffer->SaveScreen(ax, ay, dx, dy, m_bgpixbuf); } @@ -598,7 +598,7 @@ void CTextBox::refreshText(void) //Paint Text Background bool allow_paint_bg = (m_old_cText != m_cText || has_changed || m_has_scrolled); - if (m_nPaintBackground){ + if (m_nPaintBackground && !m_SaveScreen){ clearScreenBuffer(); if (allow_paint_bg){ //TRACE("[CTextBox] %s paint bg %d\r\n", __FUNCTION__, __LINE__); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 357c0fdba..64b067dda 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2193,6 +2193,7 @@ void CNeutrinoApp::quickZap(int msg) void CNeutrinoApp::numericZap(int msg) { StopSubtitles(); + g_InfoViewer->setSwitchMode(CInfoViewer::IV_MODE_NUMBER_ZAP); int res = channelList->numericZap( msg ); StartSubtitles(res < 0); if (res >= 0 && CRCInput::isNumeric(msg)) { @@ -2835,7 +2836,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) } /* ================================== KEYS ================================================ */ - if( msg == CRCInput::RC_ok || (!g_InfoViewer->virtual_zap_mode && (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites))) { + if( msg == CRCInput::RC_ok || (!g_InfoViewer->getSwitchMode() && (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites))) { if( (mode == mode_tv) || (mode == mode_radio) || (mode == mode_ts) || (mode == mode_webtv)) { showChannelList(msg); return messages_return::handled; diff --git a/src/nhttpd/doc/nhttpd_controlapi.html b/src/nhttpd/doc/nhttpd_controlapi.html index 8cedb54d7..4a215504f 100644 --- a/src/nhttpd/doc/nhttpd_controlapi.html +++ b/src/nhttpd/doc/nhttpd_controlapi.html @@ -1655,6 +1655,16 @@ ok
Fernbedienung
Handler: http://box_ip/control/rc

+Parameter:keine/status
+Rückgabe:on/off
+
+Zeigt den Status der Fernbedienung
+
+Beispiel:
+
+http://box_ip/control/rc?status
+on
+
Parameter: lock
Rückgabe: ok

@@ -1674,7 +1684,6 @@ Beispiel:

http://box_ip/control/rc?unlock
ok
-
diff --git a/src/nhttpd/tuxboxapi/controlapi.cpp b/src/nhttpd/tuxboxapi/controlapi.cpp index 7a288014d..f693277d7 100644 --- a/src/nhttpd/tuxboxapi/controlapi.cpp +++ b/src/nhttpd/tuxboxapi/controlapi.cpp @@ -498,23 +498,34 @@ void CControlAPI::StandbyCGI(CyhookHandler *hh) //----------------------------------------------------------------------------- void CControlAPI::RCCGI(CyhookHandler *hh) { - if (!(hh->ParamList.empty())) - { - bool locked = CRCLock::getInstance()->isLocked(); + bool locked = CRCLock::getInstance()->isLocked(); - if (hh->ParamList["1"] == "lock"){ // lock remote control + if (hh->ParamList.empty() || hh->ParamList["1"] == "status") + { + if (locked) + hh->WriteLn("off"); + else + hh->WriteLn("on"); + } + else + { + if (hh->ParamList["1"] == "lock") + { if (!locked) NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::LOCK_RC, CEventServer::INITID_HTTPD); } - else if (hh->ParamList["1"] == "unlock"){// unlock remote control + else if (hh->ParamList["1"] == "unlock") + { if (locked) NeutrinoAPI->EventServer->sendEvent(NeutrinoMessages::UNLOCK_RC, CEventServer::INITID_HTTPD); } - else{ + else + { hh->SendError(); + return; } + hh->SendOk(); } - hh->SendOk(); } //----------------------------------------------------------------------------- diff --git a/src/nhttpd/web/Y_Ext_Settings.yhtm b/src/nhttpd/web/Y_Ext_Settings.yhtm index f9a9f906d..ae3d6a290 100644 --- a/src/nhttpd/web/Y_Ext_Settings.yhtm +++ b/src/nhttpd/web/Y_Ext_Settings.yhtm @@ -23,7 +23,7 @@ function do_submit(){ - +
 

diff --git a/src/nhttpd/web/Y_Ext_Uninstall.yhtm b/src/nhttpd/web/Y_Ext_Uninstall.yhtm index 8bdc1c748..4ce14288f 100644 --- a/src/nhttpd/web/Y_Ext_Uninstall.yhtm +++ b/src/nhttpd/web/Y_Ext_Uninstall.yhtm @@ -63,7 +63,7 @@ function init(){
- +

diff --git a/src/nhttpd/web/Y_Ext_Update.yhtm b/src/nhttpd/web/Y_Ext_Update.yhtm index eff7c7ee0..e42e9d6f4 100644 --- a/src/nhttpd/web/Y_Ext_Update.yhtm +++ b/src/nhttpd/web/Y_Ext_Update.yhtm @@ -54,7 +54,7 @@ - +

diff --git a/src/nhttpd/web/Y_Filemgr_Edit.yhtm b/src/nhttpd/web/Y_Filemgr_Edit.yhtm index 53c920441..ed52365e5 100644 --- a/src/nhttpd/web/Y_Filemgr_Edit.yhtm +++ b/src/nhttpd/web/Y_Filemgr_Edit.yhtm @@ -56,7 +56,7 @@ function ni(){ - +
diff --git a/src/nhttpd/web/Y_Main.css b/src/nhttpd/web/Y_Main.css index 2a4142672..6c975bd3f 100644 --- a/src/nhttpd/web/Y_Main.css +++ b/src/nhttpd/web/Y_Main.css @@ -95,6 +95,11 @@ input[type="text"],input[type="password"],select{ margin: 0px; } +textarea { + font: monospace medium 'Courier New', sans-serif; + background: #ffffff; + color: #436976; +} * html .boxhead h2 {height: 1%;} /* For IE 5 PC */ a { color: #555555; diff --git a/src/nhttpd/web/Y_Settings_Timer.yhtm b/src/nhttpd/web/Y_Settings_Timer.yhtm index e7897b78c..772812db3 100644 --- a/src/nhttpd/web/Y_Settings_Timer.yhtm +++ b/src/nhttpd/web/Y_Settings_Timer.yhtm @@ -50,7 +50,7 @@ function do_submit() {   - +
diff --git a/src/nhttpd/web/Y_Tools_Boxcontrol.yhtm b/src/nhttpd/web/Y_Tools_Boxcontrol.yhtm index ade978061..200ad4064 100644 --- a/src/nhttpd/web/Y_Tools_Boxcontrol.yhtm +++ b/src/nhttpd/web/Y_Tools_Boxcontrol.yhtm @@ -73,6 +73,7 @@ function standby(_standby){ + diff --git a/src/nhttpd/web/Y_Tools_Cmd.yhtm b/src/nhttpd/web/Y_Tools_Cmd.yhtm index 5eea1491b..511646fc4 100644 --- a/src/nhttpd/web/Y_Tools_Cmd.yhtm +++ b/src/nhttpd/web/Y_Tools_Cmd.yhtm @@ -51,7 +51,7 @@ function doUpload() {=var-set:help_url=Help-Tools-Command_Shell=}{=var-set:menu={=L:tools.command_shell=}=}{=include-block:Y_Blocks.txt;work_menu=}
- +
diff --git a/src/nhttpd/web/Y_Version.txt b/src/nhttpd/web/Y_Version.txt index ecf60e920..691238b8c 100644 --- a/src/nhttpd/web/Y_Version.txt +++ b/src/nhttpd/web/Y_Version.txt @@ -1,4 +1,4 @@ -version=2.9.0.24 -date=28.12.2015 +version=2.9.0.26 +date=21.01.2016 type=Release info=Port CST