diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 8672c83b1..4fc8f2384 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -288,21 +288,36 @@ CRCInput::~CRCInput() * stopInput - stop reading rcin for plugins * **************************************************************************/ -void CRCInput::stopInput() +void CRCInput::stopInput(const bool ext) { + if (isLocked()) + return; + input_stopped = true; close(); + if (ext) + postMsg(NeutrinoMessages::LOCK_RC_EXTERN, 0); +} + +bool CRCInput::isLocked(void) +{ + return input_stopped; } /************************************************************************** * restartInput - restart reading rcin after calling plugins * **************************************************************************/ -void CRCInput::restartInput() +void CRCInput::restartInput(const bool ext) { + if (!isLocked()) + return; + close(); open(); input_stopped = false; + if (ext) + postMsg(NeutrinoMessages::UNLOCK_RC_EXTERN, 0); } #if 0 //never used diff --git a/src/driver/rcinput.h b/src/driver/rcinput.h index 7b020bb82..52cac1aa0 100644 --- a/src/driver/rcinput.h +++ b/src/driver/rcinput.h @@ -282,8 +282,9 @@ class CRCInput { return fd_rc[0]; } - void stopInput(); - void restartInput(); + void stopInput(const bool ext = false); + void restartInput(const bool ext = false); + bool isLocked(void); uint64_t repeat_block; uint64_t repeat_block_generic; diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index b2266f15c..c4ab96790 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -641,7 +641,7 @@ void CBouquetList::paintItem(int pos) i_radius = RADIUS_LARGE; if (i_radius) - frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, bgcolor); + frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, COL_MENUCONTENT_PLUS_0); frameBuffer->paintBoxRel(x, ypos, width- 15, fheight, bgcolor, i_radius); if (npos < (int) Bouquets.size()) @@ -701,7 +701,8 @@ void CBouquetList::paintItem(int pos) void CBouquetList::paintHead() { - CComponentsHeader header(x, y, width, theight, name); + std::string icon(""); + CComponentsHeader header(x, y, width, theight, name, icon, CComponentsHeader::CC_BTN_LEFT | CComponentsHeader::CC_BTN_RIGHT | CComponentsHeader::CC_BTN_MENU); header.paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index be517fa5b..8f0a3beb5 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -533,26 +533,6 @@ void CChannelList::calcSize() else pig_height = 0; infozone_height = height - theight - pig_height - footerHeight; - - ChannelList_Rec = 0; - int icon_w, h; - int recmode_icon_max = 0; - frameBuffer->getIconSize(NEUTRINO_ICON_REC, &icon_w, &h); - recmode_icon_max = std::max(recmode_icon_max, icon_w); - frameBuffer->getIconSize(NEUTRINO_ICON_AUTO_SHIFT, &icon_w, &h); - recmode_icon_max = std::max(recmode_icon_max, icon_w); - frameBuffer->getIconSize(NEUTRINO_ICON_PIP, &icon_w, &h); - recmode_icon_max = std::max(recmode_icon_max, icon_w); - - for (uint32_t i = 0; i < (*chanlist).size(); i++) { - if (CRecordManager::getInstance()->GetRecordMode((*chanlist)[i]->getChannelID()) || - (*chanlist)[i]->getChannelID() == CZapit::getInstance()->GetPipChannelID()) { - ChannelList_Rec = recmode_icon_max; - break; - } - } - if (ChannelList_Rec > 0) - ChannelList_Rec += 8; } bool CChannelList::updateSelection(int newpos) @@ -1943,13 +1923,13 @@ void CChannelList::paintItem(int pos, const bool firstpaint) char nameAndDescription[255]; char tmp[10]; CZapitChannel* chan = (*chanlist)[curr]; - int prg_offset=0; - int title_offset=0; + int prg_offset = 0; + int title_offset = 0; int rec_mode; if(g_settings.channellist_progressbar_design != CProgressBar::PB_OFF) { prg_offset = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth("00:00"); - title_offset=6; + title_offset = OFFSET_INNER_SMALL; } snprintf(tmp, sizeof(tmp), "%d", this->historyMode ? pos : chan->number); @@ -1964,52 +1944,99 @@ void CChannelList::paintItem(int pos, const bool firstpaint) rec_mode = CRecordManager::getInstance()->GetRecordMode((*chanlist)[curr]->getChannelID()); //set recording icon - std::string rec_icon; + const char *record_icon = NULL; if (rec_mode & CRecordManager::RECMODE_REC) - rec_icon = NEUTRINO_ICON_REC; + record_icon = NEUTRINO_ICON_REC; else if (rec_mode & CRecordManager::RECMODE_TSHIFT) - rec_icon = NEUTRINO_ICON_AUTO_SHIFT; + record_icon = NEUTRINO_ICON_AUTO_SHIFT; + + //set pip icon + const char *pip_icon = NULL; #ifdef ENABLE_PIP - else if ((*chanlist)[curr]->getChannelID() == CZapit::getInstance()->GetPipChannelID()) - rec_icon = NEUTRINO_ICON_PIP; + if ((*chanlist)[curr]->getChannelID() == CZapit::getInstance()->GetPipChannelID()) + pip_icon = NEUTRINO_ICON_PIP; #endif - //calculating icons - bool isWebTV = !chan->getUrl().empty(); - const char *icon = isWebTV ? NEUTRINO_ICON_STREAMING : NEUTRINO_ICON_SCRAMBLED; - int icon_x = (x+width-15-2) - RADIUS_LARGE/2; - int r_icon_w; int s_icon_h=0; int s_icon_w=0; - frameBuffer->getIconSize(icon, &s_icon_w, &s_icon_h); - r_icon_w = ChannelList_Rec; - int r_icon_x = icon_x; - //paint icon - if(chan->scrambled || isWebTV) - if (frameBuffer->paintIcon(icon, icon_x - s_icon_w, ypos, fheight))//ypos + (fheight - 16)/2); - r_icon_x = r_icon_x - s_icon_w; + //set webtv icon + const char *webtv_icon = NULL; + if (!chan->getUrl().empty()) + webtv_icon = NEUTRINO_ICON_STREAMING; - //paint recording icon - if (!rec_icon.empty()) - frameBuffer->paintIcon(rec_icon, r_icon_x - r_icon_w, ypos, fheight);//ypos + (fheight - 16)/2); + //set scramble icon + const char *scramble_icon = NULL; + if (chan->scrambled) + scramble_icon = NEUTRINO_ICON_SCRAMBLED; + + //calculate and paint right status icons + int icon_w = 0; + int icon_h = 0; + int offset_right = OFFSET_INNER_MID; + int icon_x_right = x + width - 15 - offset_right; + + if (scramble_icon) + { + frameBuffer->getIconSize(scramble_icon, &icon_w, &icon_h); + if (frameBuffer->paintIcon(scramble_icon, icon_x_right - icon_w, ypos, fheight)) + { + offset_right += icon_w + OFFSET_INNER_MID; + icon_x_right -= icon_w + OFFSET_INNER_MID; + } + } + + if (webtv_icon) + { + frameBuffer->getIconSize(webtv_icon, &icon_w, &icon_h); + if (frameBuffer->paintIcon(webtv_icon, icon_x_right - icon_w, ypos, fheight)) + { + offset_right += icon_w + OFFSET_INNER_MID; + icon_x_right -= icon_w + OFFSET_INNER_MID; + } + } + + if (pip_icon) + { + frameBuffer->getIconSize(pip_icon, &icon_w, &icon_h); + if (frameBuffer->paintIcon(pip_icon, icon_x_right - icon_w, ypos, fheight)) + { + offset_right += icon_w + OFFSET_INNER_MID; + icon_x_right -= icon_w + OFFSET_INNER_MID; + } + } + + if (record_icon) + { + frameBuffer->getIconSize(record_icon, &icon_w, &icon_h); + if (frameBuffer->paintIcon(record_icon, icon_x_right - icon_w, ypos, fheight)) + { + offset_right += icon_w + OFFSET_INNER_MID; + icon_x_right -= icon_w + OFFSET_INNER_MID; + } + } //paint buttons if (paintbuttons) paintButtonBar(is_available); - int icon_space = r_icon_w+s_icon_w; - //channel numbers - int icon_w = 0, icon_h = 0; - if (curr == selected && move_state == beMoving) { + if (curr == selected && move_state == beMoving) + { frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_YELLOW, &icon_w, &icon_h); - frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x + 5 + numwidth - icon_w, ypos, fheight); - } else if (edit_state && chan->bLocked) { + frameBuffer->paintIcon(NEUTRINO_ICON_BUTTON_YELLOW, x + OFFSET_INNER_SMALL + numwidth - icon_w, ypos, fheight); + } + else if (edit_state && chan->bLocked) + { frameBuffer->getIconSize(NEUTRINO_ICON_LOCK, &icon_w, &icon_h); - frameBuffer->paintIcon(NEUTRINO_ICON_LOCK, x + 5 + numwidth - icon_w, ypos, fheight); - } else if (g_settings.channellist_show_numbers) { - int numpos = x+5+numwidth- g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(tmp); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(numpos,ypos+fheight, numwidth+5, tmp, color, fheight); - } else if (!edit_state) + frameBuffer->paintIcon(NEUTRINO_ICON_LOCK, x + OFFSET_INNER_SMALL + numwidth - icon_w, ypos, fheight); + } + else if (g_settings.channellist_show_numbers) + { + int numpos = x + OFFSET_INNER_SMALL + numwidth - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getRenderWidth(tmp); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(numpos, ypos + fheight, numwidth + 5, tmp, color, fheight); + } + else if (!edit_state) + { numwidth = -5; + } int l=0; if (this->historyMode) @@ -2019,7 +2046,7 @@ void CChannelList::paintItem(int pos, const bool firstpaint) int pb_space = prg_offset - title_offset; int pb_height = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->getDigitHeight(); - CProgressBar pb(x+5+numwidth + title_offset, ypos + (fheight-pb_height)/2, pb_space + 2, pb_height, COL_MENUCONTENT_PLUS_0); + CProgressBar pb(x + OFFSET_INNER_SMALL + numwidth + title_offset, ypos + (fheight-pb_height)/2, pb_space + 2, pb_height, COL_MENUCONTENT_PLUS_0); pb.setType(CProgressBar::PB_TIMESCALE); pb.setDesign(g_settings.channellist_progressbar_design); pb.setCornerType(0); @@ -2034,14 +2061,13 @@ void CChannelList::paintItem(int pos, const bool firstpaint) pb.doPaintBg(false); int pb_max = pb_space - 4; - if (!(p_event->description.empty())) { + if (!(p_event->description.empty())) + { snprintf(nameAndDescription+l, sizeof(nameAndDescription)-l,g_settings.channellist_epgtext_align_right ? " ":" - "); unsigned int ch_name_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->getRenderWidth(nameAndDescription); unsigned int ch_desc_len = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getRenderWidth(p_event->description); - int max_desc_len = width - numwidth - prg_offset - ch_name_len - 15 - 20; // 15 = scrollbar, 20 = spaces - if (chan->scrambled || g_settings.channellist_epgtext_align_right) - max_desc_len -= icon_space+g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->getWidth(); /* do we need space for the lock/rec icon? */ + int max_desc_len = width - numwidth - prg_offset - ch_name_len - 15 - 2*OFFSET_INNER_MID - offset_right; // 15 = scrollbar if (max_desc_len < 0) max_desc_len = 0; @@ -2054,7 +2080,7 @@ void CChannelList::paintItem(int pos, const bool firstpaint) struct tm *pStartZeit = localtime(&p_event->startTime); snprintf(tmp, sizeof(tmp), "%02d:%02d", pStartZeit->tm_hour, pStartZeit->tm_min); - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(x+ 5+ numwidth+ 6, ypos + fheight, width- numwidth- 20- 15 -prg_offset, tmp, ecolor, fheight); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_NUMBER]->RenderString(x + OFFSET_INNER_SMALL + numwidth + 6, ypos + fheight, width - numwidth - 15 - prg_offset - 2*OFFSET_INNER_MID, tmp, ecolor, fheight); } else { @@ -2071,18 +2097,20 @@ void CChannelList::paintItem(int pos, const bool firstpaint) } } - 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 (g_settings.channellist_epgtext_align_right) { // align right - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x + width - 20 - ch_desc_len - icon_space - 4, ypos + fheight, ch_desc_len, p_event->description, ecolor); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x + width - 15 - offset_right - ch_desc_len, ypos + fheight, ch_desc_len, p_event->description, ecolor); } else { // align left - g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x+ 5+ numwidth+ 10+ ch_name_len+ 5+prg_offset, ypos+ fheight, ch_desc_len, p_event->description, ecolor); + g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]->RenderString(x + OFFSET_INNER_SMALL + numwidth + OFFSET_INNER_MID + ch_name_len + OFFSET_INNER_SMALL + prg_offset, ypos + fheight, ch_desc_len, p_event->description, ecolor); } } - else { - if(g_settings.channellist_progressbar_design != CProgressBar::PB_OFF) { + else + { + if (g_settings.channellist_progressbar_design != CProgressBar::PB_OFF) + { pb.setValues(0, pb_max); if (g_settings.progressbar_design == CProgressBar::PB_GRAPHIC) //NI graphic pb.setGraphic("progressbar_inactive"); @@ -2091,16 +2119,6 @@ void CChannelList::paintItem(int pos, const bool firstpaint) //name g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]->RenderString(x+ 5+ numwidth+ 10+prg_offset, ypos+ fheight, width- numwidth- 40- 15-prg_offset, nameAndDescription, color); } - - //NI do update VFD only when cursor on live channel - if ((curr == selected) && (getKey(curr) == CNeutrinoApp::getInstance()->channelList->getActiveChannelNumber())) { //NI - if (!(chan->currentEvent.description.empty())) { - snprintf(nameAndDescription, sizeof(nameAndDescription), "%s - %s", - chan->getName().c_str(), p_event->description.c_str()); - CVFD::getInstance()->showMenuText(0, nameAndDescription, -1, true); // UTF-8 - } else - CVFD::getInstance()->showMenuText(0, chan->getName().c_str(), -1, true); // UTF-8 - } if (!firstpaint && curr == selected) updateVfd(); //NI lcd4l-support diff --git a/src/gui/channellist.h b/src/gui/channellist.h index 49d057105..2a4058bff 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -133,9 +133,6 @@ private: bool displayList; bool pig_on_win; - int ChannelList_Rec; - - bool headerNew; void paintDetails(int index); diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 1e7cd3363..c0a281434 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -668,13 +668,18 @@ void CCDraw::kill(const fb_pixel_t& bg_color, const int& corner_radius, const in int r = v_fbdata[i].r; if (corner_radius > -1) r = corner_radius; - frameBuffer->paintBoxRel(v_fbdata[i].x, - v_fbdata[i].y, - v_fbdata[i].dx, - v_fbdata[i].dy, - bg_color, - r, - corner_type); + + if (v_fbdata[i].dx > 0 && v_fbdata[i].dy > 0){ + frameBuffer->paintBoxRel(v_fbdata[i].x, + v_fbdata[i].y, + v_fbdata[i].dx, + v_fbdata[i].dy, + bg_color, + r, + corner_type); + }else + dprintf(DEBUG_NORMAL, "\033[33m[CCDraw][%s - %d], WARNING! render with bad dimensions [dx = %d dy = %d]\033[0m\n", __func__, __LINE__, v_fbdata[i].dx, v_fbdata[i].dy ); + if (v_fbdata[i].frame_thickness) frameBuffer->paintBoxFrame(v_fbdata[i].x, v_fbdata[i].y, diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 4b60711eb..0261daf54 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -275,14 +275,14 @@ void CComponentsHeader::addContextButton(const int& buttons) addContextButton(NEUTRINO_ICON_BUTTON_OKAY); if (buttons & CC_BTN_MUTE) addContextButton(NEUTRINO_ICON_BUTTON_MUTE); - if (buttons & CC_BTN_TOP) - addContextButton(NEUTRINO_ICON_BUTTON_TOP); + if (buttons & CC_BTN_UP) + addContextButton(NEUTRINO_ICON_BUTTON_UP); if (buttons & CC_BTN_DOWN) addContextButton(NEUTRINO_ICON_BUTTON_DOWN); - if (buttons & CC_BTN_RIGHT) - addContextButton(NEUTRINO_ICON_BUTTON_RIGHT); if (buttons & CC_BTN_LEFT) addContextButton(NEUTRINO_ICON_BUTTON_LEFT); + if (buttons & CC_BTN_RIGHT) + addContextButton(NEUTRINO_ICON_BUTTON_RIGHT); if (buttons & CC_BTN_FORWARD) addContextButton(NEUTRINO_ICON_BUTTON_FORWARD); if (buttons & CC_BTN_BACKWARD) diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index 74201268e..b3f185e68 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -182,10 +182,10 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen CC_BTN_MUTE_ZAP_INACTIVE = 0x200, CC_BTN_OKAY = 0x400, CC_BTN_MUTE = 0x800, - CC_BTN_TOP = 0x1000, + CC_BTN_UP = 0x1000, CC_BTN_DOWN = 0x2000, - CC_BTN_RIGHT = 0x4000, - CC_BTN_LEFT = 0x8000, + CC_BTN_LEFT = 0x4000, + CC_BTN_RIGHT = 0x8000, CC_BTN_FORWARD = 0x10000, CC_BTN_BACKWARD = 0x20000, CC_BTN_PAUSE = 0x40000, diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index 7157e9625..dc277f6be 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -82,7 +82,7 @@ void CComponentsScrollBar::initVarSbForm(const int& count) sb_up_obj = sb_down_obj = NULL; sb_segments_obj = NULL; - sb_up_icon = frameBuffer->getIconPath(NEUTRINO_ICON_BUTTON_TOP) ; + sb_up_icon = frameBuffer->getIconPath(NEUTRINO_ICON_BUTTON_UP) ; sb_down_icon = frameBuffer->getIconPath(NEUTRINO_ICON_BUTTON_DOWN); sb_segments_count = count; diff --git a/src/gui/infoicons.cpp b/src/gui/infoicons.cpp index 046cc8e3b..c378c7b77 100644 --- a/src/gui/infoicons.cpp +++ b/src/gui/infoicons.cpp @@ -53,14 +53,14 @@ typedef struct icon_data_t static icon_data_t icon[MODE_ICONS_NR_OF_ENTRIES]= { - {-1, 0, 0, 0, "info0", ""}, - {-1, 0, 0, 2, "info1", ""}, - {-1, 0, 0, 2, "info2", ""}, - {-1, 0, 0, 2, "info3", ""}, - {-1, 0, 0, 2, "info4", ""}, - {-1, 0, 0, 2, "info5", ""}, - {-1, 0, 0, 2, "info6", ""}, - {-1, 0, 0, 2, "info7", ""} + {-1, 0, 0, OFFSET_INNER_NONE , "info0", ""}, + {-1, 0, 0, OFFSET_INNER_SMALL, "info1", ""}, + {-1, 0, 0, OFFSET_INNER_SMALL, "info2", ""}, + {-1, 0, 0, OFFSET_INNER_SMALL, "info3", ""}, + {-1, 0, 0, OFFSET_INNER_SMALL, "info4", ""}, + {-1, 0, 0, OFFSET_INNER_SMALL, "info5", ""}, + {-1, 0, 0, OFFSET_INNER_SMALL, "info6", ""}, + {-1, 0, 0, OFFSET_INNER_SMALL, "info7", ""} }; CInfoIcons::CInfoIcons() @@ -101,9 +101,9 @@ void CInfoIcons::Init() { std::ostringstream buf; - x = frameBuffer->getScreenX() + 10; + x = frameBuffer->getScreenX() + OFFSET_INNER_MID; y = frameBuffer->getScreenY(); - offset = 10; + offset = OFFSET_INNER_MID; int icons_width = 0; int icons_height = 0; diff --git a/src/gui/motorcontrol.cpp b/src/gui/motorcontrol.cpp index 438e3eebe..ed159f368 100644 --- a/src/gui/motorcontrol.cpp +++ b/src/gui/motorcontrol.cpp @@ -542,7 +542,7 @@ void CMotorControl::paintMenu() paintLine(xpos1, xpos2, &ypos, width2, NEUTRINO_ICON_BUTTON_9, installerMenue ? g_Locale->getText(LOCALE_MOTORCONTROL_CALC_POSITIONS) : g_Locale->getText(LOCALE_MOTORCONTROL_STEP_DECREASE)); - paintLine(xpos1, xpos2, &ypos, width2, NEUTRINO_ICON_BUTTON_TOP, g_Locale->getText(LOCALE_MOTORCONTROL_POS_INCREASE)); + paintLine(xpos1, xpos2, &ypos, width2, NEUTRINO_ICON_BUTTON_UP, g_Locale->getText(LOCALE_MOTORCONTROL_POS_INCREASE)); paintLine(xpos1, xpos2, &ypos, width2, NEUTRINO_ICON_BUTTON_DOWN, g_Locale->getText(LOCALE_MOTORCONTROL_POS_DECREASE)); paintLine(xpos1, xpos2, &ypos, width2, NEUTRINO_ICON_BUTTON_BLUE, g_Locale->getText(LOCALE_MOTORCONTROL_STEP_DRIVE)); paintLine(xpos1, xpos2, &ypos, width2, NEUTRINO_ICON_BUTTON_INFO_SMALL, g_Locale->getText(LOCALE_MOTORCONTROL_NETWORK)); diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index efd35ccf8..f3f8cbefb 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -189,7 +189,7 @@ font_sizes_groups font_sizes_groups[] = {LOCALE_FONTMENU_EPG , epg_font_items , epg_font_sizes , "fontsize.depg", LOCALE_MENU_HINT_EPG_FONTS }, {LOCALE_FONTMENU_INFOBAR , infobar_font_items , infobar_font_sizes , "fontsize.dinf", LOCALE_MENU_HINT_INFOBAR_FONTS }, {LOCALE_FONTMENU_MOVIEBROWSER,moviebrowser_font_items,moviebrowser_font_sizes,"fontsize.dmbr", LOCALE_MENU_HINT_MOVIEBROWSER_FONTS }, - {LOCALE_FONTMENU_MESSAGES , msgtext_font_items , msgtext_font_sizes , "fontsize.msg", LOCALE_MENU_HINT_MESSAGE_FONTS }, + {LOCALE_FONTMENU_MESSAGES , msgtext_font_items , msgtext_font_sizes , "fontsize.dmsg", LOCALE_MENU_HINT_MESSAGE_FONTS }, {LOCALE_FONTMENU_OTHER , other_font_items , other_font_sizes , "fontsize.doth", LOCALE_MENU_HINT_OTHER_FONTS } }; #define FONT_GROUP_COUNT (sizeof(font_sizes_groups)/sizeof(font_sizes_groups[0])) diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 1679f187c..d885d79a6 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -55,7 +55,7 @@ #include #include #include - +#include #include #include #include @@ -845,7 +845,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) } else if (actionKey == "msgbox_test_yes_no") { - int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press key! ...", CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NULL, 500, -1); + int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press key! ...", CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NULL, 500); std::string msg_txt = "Return value of MsgBox test is "; msg_txt += to_string(msgRet); @@ -868,7 +868,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) return res; } else if (actionKey == "msgbox_test_all"){ - int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press key! ...", CMsgBox::mbrOk, CMsgBox::mbAll, NULL, 700, -1); + int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press key! ...", CMsgBox::mbrOk, CMsgBox::mbAll, NULL, 700); std::string msg_txt = "Return value of MsgBox test is "; msg_txt += to_string(msgRet); @@ -876,7 +876,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) return menu_return::RETURN_REPAINT; } else if (actionKey == "msgbox_test_yes_no_cancel"){ - int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press key! ...", CMsgBox::mbrCancel, CMsgBox::mbYes | CMsgBox::mbNo | CMsgBox::mbCancel, NULL, 500, -1); + int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press key! ...", CMsgBox::mbrCancel, CMsgBox::mbYes | CMsgBox::mbNo | CMsgBox::mbCancel, NULL, 500); std::string msg_txt = "Return value of MsgBox test is "; msg_txt += to_string(msgRet); @@ -884,7 +884,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) return menu_return::RETURN_REPAINT; } else if (actionKey == "msgbox_test_ok_cancel"){ - int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press key! ...", CMsgBox::mbrOk, CMsgBox::mbOk | CMsgBox::mbCancel, NULL, 500, -1); + int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press key! ...", CMsgBox::mbrOk, CMsgBox::mbOk | CMsgBox::mbCancel, NULL, 500); std::string msg_txt = "Return value of MsgBox test is "; msg_txt += to_string(msgRet); @@ -892,7 +892,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) return menu_return::RETURN_REPAINT; } else if (actionKey == "msgbox_test_no_yes"){ - int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press key! ...", CMsgBox::mbrOk, CMsgBox::mbNoYes, NULL, 500, -1); + int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press key! ...", CMsgBox::mbrOk, CMsgBox::mbNoYes, NULL, 500); std::string msg_txt = "Return value of MsgBox test is "; msg_txt += to_string(msgRet); @@ -900,7 +900,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) return menu_return::RETURN_REPAINT; } else if (actionKey == "msgbox_test_ok"){ - int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press ok key! ...", CMsgBox::mbrOk, CMsgBox::mbOk, NULL, 500, -1); + int msgRet = ShowMsg("Testmenu: MsgBox test", "Test for MsgBox,\nPlease press ok key! ...", CMsgBox::mbrOk, CMsgBox::mbOk, NULL, 500); std::string msg_txt = "Return value of MsgBox test is "; msg_txt += to_string(msgRet); @@ -940,11 +940,95 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) return res; } + else if (actionKey == "show_records"){ + showRecords(); + return res; + } return showTestMenu(); } +void CTestMenu::showRecords() +{ + CRecordManager * crm = CRecordManager::getInstance(); + + const int box_posX = 30; + const int box_posY = 300; + + if (crm->RecordingStatus()) + { + CComponentsForm *recordsbox = new CComponentsForm(); + recordsbox->setWidth(0); + recordsbox->doPaintBg(false); + recordsbox->setCornerType(CORNER_NONE); + //recordsbox->setColorBody(COL_BACKGROUND_PLUS_0); + + recmap_t recmap = crm->GetRecordMap(); + std::vector images; + CComponentsForm *recline = NULL; + CComponentsText *rec_name = NULL; + int y_recline = 0; + int h_recline = 0; + int w_recbox = 0; + int w_shadow = OFFSET_SHADOW/2; + + for(recmap_iterator_t it = recmap.begin(); it != recmap.end(); it++) + { + CRecordInstance * inst = it->second; + + recline = new CComponentsForm(0, y_recline, 0); + recline->doPaintBg(true); + recline->setColorBody(COL_INFOBAR_PLUS_0); + recline->enableShadow(CC_SHADOW_ON, w_shadow); + recline->setCorner(CORNER_RADIUS_MID); + recordsbox->addCCItem(recline); + + CComponentsPicture *iconf = new CComponentsPicture(OFFSET_INNER_MID, CC_CENTERED, NEUTRINO_ICON_REC, recline, CC_SHADOW_OFF, COL_RED, COL_INFOBAR_PLUS_0); + iconf->setCornerType(CORNER_NONE); + iconf->doPaintBg(true); + iconf->SetTransparent(CFrameBuffer::TM_BLACK); + images.push_back(iconf); + h_recline = iconf->getHeight(); + y_recline += h_recline + w_shadow; + recline->setHeight(h_recline); + + std::string records_msg = inst->GetEpgTitle(); + + rec_name = new CComponentsText(iconf->getWidth()+2*OFFSET_INNER_MID, CC_CENTERED, 0, 0, records_msg, CTextBox::AUTO_WIDTH, g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]); + rec_name->doPaintBg(false); + rec_name->setTextColor(COL_INFOBAR_TEXT); + + recline->setHeight(std::max(rec_name->getHeight(), iconf->getHeight())); + recline->setWidth(OFFSET_INNER_MIN+iconf->getWidth()+OFFSET_INNER_MID+rec_name->getWidth()+OFFSET_INNER_MID); + w_recbox = (std::max(recline->getWidth(), recordsbox->getWidth())); + + recline->addCCItem(rec_name); + + recordsbox->setWidth(std::max(recordsbox->getWidth(), recline->getWidth())); + y_recline += h_recline; + } + + int h_rbox = 0; + for(size_t i = 0; i< recordsbox->size(); i++) + h_rbox += recordsbox->getCCItem(i)->getHeight()+w_shadow; + + recordsbox->setDimensionsAll(box_posX, box_posY, w_recbox+w_shadow, h_rbox); + recordsbox->paint0(); + + for(size_t j = 0; j< images.size(); j++){ + images[j]->kill(); + images[j]->paintBlink(); + } + + ShowHint("Testmenu: Records", "Record test ...", 200, 30, NULL, NEUTRINO_ICON_HINT_RECORDING, CComponentsHeader::CC_BTN_EXIT); + recordsbox->kill(); + delete recordsbox; recordsbox = NULL; + } + else + ShowHint("Testmenu: Records", "No records ...", 200, 30, NULL, NEUTRINO_ICON_HINT_RECORDING, CComponentsHeader::CC_BTN_EXIT); +} + /* shows entries for proxy settings */ int CTestMenu::showTestMenu() { @@ -1016,6 +1100,7 @@ void CTestMenu::showCCTests(CMenuWidget *widget) widget->addItem(new CMenuForwarder("Text-Extended", true, NULL, this, "text_ext")); widget->addItem(new CMenuForwarder("Blinking Extended Text", true, NULL, this, "blinking_text_ext")); widget->addItem(new CMenuForwarder("Scrollbar", true, NULL, this, "scrollbar")); + widget->addItem(new CMenuForwarder("Record", true, NULL, this, "show_records")); } void CTestMenu::showHWTests(CMenuWidget *widget) diff --git a/src/gui/test_menu.h b/src/gui/test_menu.h index 1b09192b0..20c4937b1 100644 --- a/src/gui/test_menu.h +++ b/src/gui/test_menu.h @@ -60,6 +60,7 @@ class CTestMenu : public CMenuTarget void showHWTests(CMenuWidget *widget); void showCCTests(CMenuWidget *widget); void showMsgTests(CMenuWidget *widget); + void showRecords(); public: CTestMenu(); ~CTestMenu(); diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index d9adcefae..98c020aa8 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -653,7 +653,6 @@ struct button_label TimerListButtons[] = { NEUTRINO_ICON_BUTTON_YELLOW , LOCALE_TIMERLIST_RELOAD }, { NEUTRINO_ICON_BUTTON_BLUE , LOCALE_TIMERLIST_MODIFY }, { NEUTRINO_ICON_BUTTON_INFO_SMALL, NONEXISTANT_LOCALE }, - { NEUTRINO_ICON_BUTTON_MENU_SMALL, NONEXISTANT_LOCALE }, { NEUTRINO_ICON_BUTTON_PLAY , NONEXISTANT_LOCALE } }; // int to match the type in paintButtons @@ -992,7 +991,7 @@ int CTimerList::show() if (!epgdata.title.empty()) title = "(" + epgdata.title + ")\n"; snprintf(buf1, sizeof(buf1)-1, g_Locale->getText(LOCALE_TIMERLIST_ASK_TO_DELETE), title.c_str()); - if (ShowMsg(LOCALE_RECORDINGMENU_RECORD_IS_RUNNING, buf1, CMsgBox::mbrYes, CMsgBox::mbYes | CMsgBox::mbNo, NULL, 450, 30, false) == CMsgBox::mbrNo) + if (ShowMsg(LOCALE_RECORDINGMENU_RECORD_IS_RUNNING, buf1, CMsgBox::mbrNo, CMsgBox::mbYesNo, NULL, 450) & CMsgBox::mbrNo) { killTimer = false; update = false; @@ -1386,16 +1385,18 @@ void CTimerList::paintHead() void CTimerList::paintFoot() { - CTimerd::responseGetTimer* timer=&timerlist[selected]; - if (timer != NULL) + if(!timerlist.empty() ) { + CTimerd::responseGetTimer* timer=&timerlist[selected]; + if (timer != NULL) + { //replace info button with dummy if timer is not type REC or ZAP - if (timer->eventType == CTimerd::TIMER_RECORD || timer->eventType == CTimerd::TIMER_REMOTEBOX || timer->eventType == CTimerd::TIMER_ZAPTO) - TimerListButtons[4].button = NEUTRINO_ICON_BUTTON_INFO_SMALL; - else - TimerListButtons[4].button = NEUTRINO_ICON_BUTTON_DUMMY_SMALL; + if (timer->eventType == CTimerd::TIMER_RECORD || timer->eventType == CTimerd::TIMER_REMOTEBOX || timer->eventType == CTimerd::TIMER_ZAPTO) + TimerListButtons[4].button = NEUTRINO_ICON_BUTTON_INFO_SMALL; + else + TimerListButtons[4].button = NEUTRINO_ICON_BUTTON_DUMMY_SMALL; + } } - //shadow frameBuffer->paintBoxRel(x + OFFSET_SHADOW, y + height - footerHeight, width, footerHeight + OFFSET_SHADOW, COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); diff --git a/src/gui/widget/Makefile.am b/src/gui/widget/Makefile.am index 17a932b04..5da8d7ebe 100644 --- a/src/gui/widget/Makefile.am +++ b/src/gui/widget/Makefile.am @@ -17,7 +17,6 @@ noinst_LIBRARIES = libneutrino_gui_widget.a libneutrino_gui_widget2.a libneutrino_gui_widget_a_SOURCES = \ buttons.cpp \ colorchooser.cpp \ - drawable.cpp \ helpbox.cpp \ hintbox.cpp \ keychooser.cpp \ diff --git a/src/gui/widget/drawable.cpp b/src/gui/widget/drawable.cpp deleted file mode 100644 index 0319e34ff..000000000 --- a/src/gui/widget/drawable.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/* - Neutrino-GUI - DBoxII-Project - - Copyright (C) 2001 Steffen Hehn 'McClean' - Homepage: http://dbox.cyberphoria.org/ - - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. - - - License: GPL - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include - -#include - -#include -#include - -Drawable::Drawable() -{ -} - -Drawable::~Drawable() -{ -} - -int Drawable::getWidth(void) -{ - return m_width; -} - -int Drawable::getHeight(void) -{ - return m_height; -} - -Drawable::DType Drawable::getType(void) -{ - return Drawable::DTYPE_DRAWABLE; -} - - -// ------------------------------------------------------------------------------ -DText::DText(std::string& text) -{ - m_text = text; - init(); -} - -DText::DText(const char *text) -{ - m_text = std::string(text); - init(); -} - -void DText::init() -{ - m_width = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(m_text); - m_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); -} - - -void DText::draw(CFBWindow *window, int x, int y, int width) -{ - window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU], x, y + m_height, width, - m_text.c_str(), COL_MENUCONTENT_TEXT); -} - -void DText::print(void) -{ - std::cout << " text: " << m_text; -} - -// ------------------------------------------------------------------------------ -DIcon::DIcon(std::string& icon) -{ - m_icon = icon; - init(); -} - -DIcon::DIcon(const char *icon) -{ - m_icon = std::string(icon); - init(); -} - -void DIcon::init() -{ - m_height = 16; - m_width = 16; -} - -void DIcon::draw(CFBWindow *window, int x, int y, int /*width*/) -{ - window->paintIcon(m_icon.c_str(), x, y); -} - -void DIcon::print(void) -{ - std::cout << " icon: " << m_icon; -} - -// ------------------------------------------------------------------------------ -DPagebreak::DPagebreak() -{ - m_height = 0; - m_width = 0; -} - -void DPagebreak::draw(CFBWindow */*window*/, int /*x*/, int /*y*/, int /*width*/) -{ -// window->RenderString(g_Font[SNeutrinoSettings::FONT_TYPE_MENU], -// x, y + m_height, width, "", -// COL_MENUCONTENT_TEXT); -} - -void DPagebreak::print(void) -{ - std::cout << ""; -} - -Drawable::DType DPagebreak::getType(void) -{ - return Drawable::DTYPE_PAGEBREAK; -} diff --git a/src/gui/widget/drawable.h b/src/gui/widget/drawable.h deleted file mode 100644 index 744f4446e..000000000 --- a/src/gui/widget/drawable.h +++ /dev/null @@ -1,164 +0,0 @@ -/* - Neutrino-GUI - DBoxII-Project - - Copyright (C) 2001 Steffen Hehn 'McClean' - Homepage: http://dbox.cyberphoria.org/ - - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. - - - License: GPL - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - - -#ifndef __drawable__ -#define __drawable__ - -#include -#include - -#include -#include - -class Drawable; - -typedef std::vector > ContentLines; - - -/** - * The base class for items which can be drawn on a CFBWindow. - */ -class Drawable -{ -public: - - enum DType { - DTYPE_DRAWABLE, - DTYPE_PAGEBREAK - }; - - virtual ~Drawable(); - - /** - * Overwrite this method in subclasses to draw on the window - * - * @param window the window to draw on - * @param x x component of the top left corner - * @param y y component of the top left corner - */ - virtual void draw(CFBWindow *window, int x, int y, int width) = 0; - - virtual int getWidth(void); - - virtual int getHeight(void); - - /** - * Overwrite this method in subclasses to print some info - * about the content. Mainly used for debuging ;) - */ - virtual void print(void) = 0; - - /** - * Returns the type of this drawable. Used to distinguish between - * drawing objects and control objects like pagebreaks. - * @return the type of this drawable. - */ - virtual DType getType(); - -protected: - - Drawable(); - - int m_height; - - int m_width; - -private: - -}; - -/** - * This class draws a given string. - */ -class DText : public Drawable -{ -public: - DText(std::string& text); - - DText(const char *text); - - void init(); - - void draw(CFBWindow *window, int x, int y, int width); - - void print(); - -protected: - - std::string m_text; - -}; - - -/** - * This class draws a given icon. - */ -class DIcon : public Drawable -{ -public: - DIcon(std::string& icon); - - DIcon(const char *icon); - - void init(); - - void draw(CFBWindow *window, int x, int y, int width); - - void print(); - -protected: - - std::string m_icon; -}; - -/** - * This class is used as a control object and forces a new page - * in scrollable windows. - */ -class DPagebreak : public Drawable -{ -public: - DPagebreak(); - - void draw(CFBWindow *window, int x, int y, int width); - - void print(); - - DType getType(); - -protected: - -private: - -}; - -#endif diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 6d64e7fc1..52728f3c1 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -273,7 +273,7 @@ void CHintBox::addHintItem(const std::string& Text, const int& text_mode, const /* add scroll mode if needed */ if (h_lines > h_hint_obj){ txt_mode = text_mode | CTextBox::SCROLL; - ccw_buttons = ccw_buttons | CComponentsHeader::CC_BTN_TOP | CComponentsHeader::CC_BTN_DOWN; + ccw_buttons = ccw_buttons | CComponentsHeader::CC_BTN_UP | CComponentsHeader::CC_BTN_DOWN; } /* define y start position of infobox inside body */ diff --git a/src/gui/widget/hintbox.h b/src/gui/widget/hintbox.h index 4afacb82a..c005feb26 100644 --- a/src/gui/widget/hintbox.h +++ b/src/gui/widget/hintbox.h @@ -36,7 +36,8 @@ #define HINTBOX_MIN_HEIGHT 125 #define HINTBOX_MAX_HEIGHT 520 #define HINTBOX_DEFAULT_TIMEOUT g_settings.timing[SNeutrinoSettings::TIMING_POPUP_MESSAGES] -#define NO_TIMEOUT -1 +#define NO_TIMEOUT 0 +#define DEFAULT_TIMEOUT -1 //frame around hint container as indent #define W_FRAME std::max(HINTBOX_MIN_WIDTH, HINTBOX_MIN_HEIGHT) * 2/100 //frame color around hint/message box @@ -179,7 +180,9 @@ class CHintBox : public CComponentsWindow int exec(); /** - * Defines timeout, timeout is enabled if parameter1 > -1 + * Defines timeout for message window. + * Timeout is enabled with parameter1 = DEFAULT_TIMEOUT (-1) or any other value > 0 + * To disable timeout use NO_TIMEOUT (0) * @param[in] Timeout as int as seconds */ virtual void setTimeOut(const int& Timeout){timeout = Timeout;} diff --git a/src/gui/widget/icons.h b/src/gui/widget/icons.h index 5494aaaf4..0d19fafa6 100644 --- a/src/gui/widget/icons.h +++ b/src/gui/widget/icons.h @@ -57,8 +57,8 @@ #define NEUTRINO_ICON_BUTTON_8 "8" #define NEUTRINO_ICON_BUTTON_9 "9" -#define NEUTRINO_ICON_BUTTON_TOP "up" -#define NEUTRINO_ICON_BUTTON_TOP_SMALL "up_small" +#define NEUTRINO_ICON_BUTTON_UP "up" +#define NEUTRINO_ICON_BUTTON_UP_SMALL "up_small" #define NEUTRINO_ICON_BUTTON_RIGHT "right" #define NEUTRINO_ICON_BUTTON_DOWN "down" #define NEUTRINO_ICON_BUTTON_DOWN_SMALL "down_small" diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 151a0cc73..5f6e375e0 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -114,7 +114,7 @@ void CMsgBox::init(const int& Height, const int& ShowButtons, const msg_result_t void CMsgBox::initTimeOut() { - timeout = -1; + timeout = NO_TIMEOUT; enable_timeout_result = false; } @@ -238,7 +238,9 @@ int CMsgBox::exec() ccw_footer->getSelectedButtonObject()->setButtonAlias(mb_show_button); int selected = ccw_footer->getSelectedButton(); if (timeout == NO_TIMEOUT) - timeout = MSGBOX_DEFAULT_TIMEOUT; + timeout = 0; + if (timeout == DEFAULT_TIMEOUT) + timeout = g_settings.timing[SNeutrinoSettings::TIMING_STATIC_MESSAGES]; uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(timeout); @@ -528,12 +530,12 @@ int ShowMsg( const std::string & Title, void DisplayErrorMessage(const char * const ErrorMsg, const neutrino_locale_t& caption, const int& Text_mode) { - ShowMsg(caption, ErrorMsg, CMsgBox::mbrCancel, CMsgBox::mbBack, NEUTRINO_ICON_ERROR, 500, -1, false, Text_mode, COL_RED); + ShowMsg(caption, ErrorMsg, CMsgBox::mbrCancel, CMsgBox::mbBack, NEUTRINO_ICON_ERROR, 500, NO_TIMEOUT, false, Text_mode, COL_RED); } void DisplayErrorMessage(const char * const ErrorMsg, const std::string& caption, const int& Text_mode) { - ShowMsg(caption, ErrorMsg, CMsgBox::mbrCancel, CMsgBox::mbBack, NEUTRINO_ICON_ERROR, 500, -1, false, Text_mode, COL_RED); + ShowMsg(caption, ErrorMsg, CMsgBox::mbrCancel, CMsgBox::mbBack, NEUTRINO_ICON_ERROR, 500, NO_TIMEOUT, false, Text_mode, COL_RED); } void DisplayErrorMessage(const char * const ErrorMsg, const int& Text_mode) @@ -543,12 +545,12 @@ void DisplayErrorMessage(const char * const ErrorMsg, const int& Text_mode) void DisplayInfoMessage(const char * const InfoMsg, const neutrino_locale_t& caption, const int& Text_mode, fb_pixel_t color_frame) { - ShowMsg(caption, InfoMsg, CMsgBox::mbrBack, CMsgBox::mbOk, NEUTRINO_ICON_INFO, 500, -1, false, Text_mode, color_frame); + ShowMsg(caption, InfoMsg, CMsgBox::mbrBack, CMsgBox::mbOk, NEUTRINO_ICON_INFO, 500, NO_TIMEOUT, false, Text_mode, color_frame); } void DisplayInfoMessage(const char * const InfoMsg, const std::string& caption, const int& Text_mode, fb_pixel_t color_frame) { - ShowMsg(caption, InfoMsg, CMsgBox::mbrBack, CMsgBox::mbOk, NEUTRINO_ICON_INFO, 500, -1, false, Text_mode, color_frame); + ShowMsg(caption, InfoMsg, CMsgBox::mbrBack, CMsgBox::mbOk, NEUTRINO_ICON_INFO, 500, NO_TIMEOUT, false, Text_mode, color_frame); } void DisplayInfoMessage(const char * const InfoMsg, const int& Text_mode, fb_pixel_t color_frame) diff --git a/src/gui/widget/msgbox.h b/src/gui/widget/msgbox.h index 5c81dfb33..5325bd764 100644 --- a/src/gui/widget/msgbox.h +++ b/src/gui/widget/msgbox.h @@ -33,7 +33,6 @@ #endif #include "hintbox.h" -#include #define MSGBOX_MIN_WIDTH HINTBOX_MIN_WIDTH #define MSGBOX_MIN_HEIGHT HINTBOX_MIN_HEIGHT + 75 @@ -56,14 +55,14 @@ class CMsgBox : public CHintBox /* enum definition */ enum msg_result_t { - mbrYes = 0, - mbrNo = 1, - mbrCancel = 2, - mbrBack = 3, - mbrOk = 4, - mbrTimeout = 5, + mbrYes = 0x01, + mbrNo = 0x02, + mbrCancel = 0x04, + mbrBack = 0x08, + mbrOk = 0x10, + mbrTimeout = 0x20, - mbrNone = -1 + mbrNone = 0x00 }; enum button_define_t { @@ -171,7 +170,7 @@ class CMsgBox : public CHintBox const int& Width = MSGBOX_MIN_WIDTH, const int& Height = MSGBOX_MIN_HEIGHT, const int& ShowButtons = mbCancel, - const msg_result_t& Default_result = mbrCancel, + const msg_result_t& Default_result = mbrNone, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE); /**CMsgBox Constructor @@ -225,7 +224,7 @@ class CMsgBox : public CHintBox const int& Width = MSGBOX_MIN_WIDTH, const int& Height = MSGBOX_MIN_HEIGHT, const int& ShowButtons = mbCancel, - const msg_result_t& Default_result = mbrCancel, + const msg_result_t& Default_result = mbrNone, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE); // ~CMsgBox(); //inherited diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index c1c17ce60..6c78b4f48 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -890,11 +890,17 @@ int CTextBox::getLines(const std::string& text) int CTextBox::getMaxLineWidth(const std::string& text, Font* font) { - // if found no linebreak, return pure size only - if (text.find('\n', 0) == std::string::npos) - return font->getRenderWidth(text.c_str()); + std::string txt = text; + if (txt.find('\n', 0) == std::string::npos){ + /* If found no linebreak, return pure size with additional space char. + * Space char simulates a line termination as a workaround to get + * largest possible width. + */ + txt += ' '; + return font->getRenderWidth(txt.c_str()); + } - std::stringstream in (text); + std::stringstream in (txt); if (!in) return 0; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 8fd5c0c6b..db436cc83 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -3626,7 +3626,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) } else if (msg == NeutrinoMessages::EVT_POPUP || msg == NeutrinoMessages::EVT_EXTMSG) { if (mode != mode_scart && mode != mode_standby) { - int timeout = NO_TIMEOUT; + int timeout = DEFAULT_TIMEOUT; std::string text = (char*)data; std::string::size_type pos; @@ -3670,6 +3670,11 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) CRCLock::getInstance()->exec(NULL, CRCLock::NO_USER_INPUT); return messages_return::handled; } + else if (msg == NeutrinoMessages::LOCK_RC_EXTERN || msg == NeutrinoMessages::UNLOCK_RC_EXTERN) + { + printf("CNeutrinoApp::handleMsg: RC is %s now\n", msg == NeutrinoMessages::LOCK_RC_EXTERN ? "LOCKED" : "UNLOCKED"); + return messages_return::handled; + } else if( msg == NeutrinoMessages::CHANGEMODE ) { printf("CNeutrinoApp::handleMsg: CHANGEMODE to %d rezap %d\n", (int)(data & mode_mask), (data & norezap) != norezap); if((data & mode_mask)== mode_radio) { diff --git a/src/neutrinoMessages.h b/src/neutrinoMessages.h index 4049ead7e..fe89d019a 100644 --- a/src/neutrinoMessages.h +++ b/src/neutrinoMessages.h @@ -71,10 +71,13 @@ struct NeutrinoMessages { REMIND = CRCInput::RC_Messages + 18, LOCK_RC = CRCInput::RC_Messages + 19, UNLOCK_RC = CRCInput::RC_Messages + 20, - REBOOT = CRCInput::RC_Messages + 21, - RELOAD_SETUP = CRCInput::RC_Messages + 22, - SHOW_MAINMENU = CRCInput::RC_Messages + 23, - LEAVE_ALL = CRCInput::RC_Messages + 24, + LOCK_RC_EXTERN = CRCInput::RC_Messages + 21, + UNLOCK_RC_EXTERN = CRCInput::RC_Messages + 22, + REBOOT = CRCInput::RC_Messages + 23, + RELOAD_SETUP = CRCInput::RC_Messages + 24, + SHOW_MAINMENU = CRCInput::RC_Messages + 25, + LEAVE_ALL = CRCInput::RC_Messages + 26, + EVT_VOLCHANGED = CRCInput::RC_Events + 1, EVT_MUTECHANGED = CRCInput::RC_Events + 2, diff --git a/src/system/settings.h b/src/system/settings.h index 6927e5900..4acd6889d 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -966,12 +966,13 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO #define RADIUS_NONE 0 // offsets -#define OFFSET_SHADOW 6 -#define OFFSET_INTER 6 +#define OFFSET_SHADOW 6 +#define OFFSET_INTER 6 #define OFFSET_INNER_LARGE 20 #define OFFSET_INNER_MID 10 #define OFFSET_INNER_SMALL 5 #define OFFSET_INNER_MIN 2 +#define OFFSET_INNER_NONE 0 struct SglobalInfo { diff --git a/src/zapit/include/zapit/client/msgtypes.h b/src/zapit/include/zapit/client/msgtypes.h index dd479f868..c38b754d5 100644 --- a/src/zapit/include/zapit/client/msgtypes.h +++ b/src/zapit/include/zapit/client/msgtypes.h @@ -150,9 +150,8 @@ class CZapitMessages CMD_GET_MODE43 = 109, CMD_SET_MODE43 = 110, CMD_STOP_PIP = 111, - CMD_ZAPTO_EPG = 112 - - + CMD_ZAPTO_EPG = 112, + CMD_LOCKRC = 113 }; struct commandBoolean diff --git a/src/zapit/include/zapit/client/zapitclient.h b/src/zapit/include/zapit/client/zapitclient.h index d81334ec9..602385c97 100644 --- a/src/zapit/include/zapit/client/zapitclient.h +++ b/src/zapit/include/zapit/client/zapitclient.h @@ -375,6 +375,9 @@ class CZapitClient:public CBasicClient /* get dvb transmission type */ delivery_system_t getDeliverySystem(void); + /* Lock remote control */ + void lockRc(const bool mute); + void zaptoNvodSubService(const int num); /* send diseqc 1.2 motor command */ diff --git a/src/zapit/lib/zapitclient.cpp b/src/zapit/lib/zapitclient.cpp index d32c4cac2..fc9c6b9da 100644 --- a/src/zapit/lib/zapitclient.cpp +++ b/src/zapit/lib/zapitclient.cpp @@ -635,6 +635,19 @@ void CZapitClient::getVolume(unsigned int *left, unsigned int *right) close_connection(); } + +void CZapitClient::lockRc(const bool b) +{ + CZapitMessages::commandBoolean msg; + //VALGRIND_PARANOIA; + + msg.truefalse = b; + + OpenThreads::ScopedLock lock(mutex); + send(CZapitMessages::CMD_LOCKRC, (char*)&msg, sizeof(msg)); + + close_connection(); +} #if 0 //never used delivery_system_t CZapitClient::getDeliverySystem(void) diff --git a/src/zapit/src/pzapit.cpp b/src/zapit/src/pzapit.cpp index d31e8a718..744187486 100644 --- a/src/zapit/src/pzapit.cpp +++ b/src/zapit/src/pzapit.cpp @@ -70,6 +70,8 @@ int usage (const char * basename) std::cout << "switch to pal mode: " << basename << " --pal" << std::endl; std::cout << "switch to hd 720p mode: " << basename << " --720p" << std::endl; std::cout << "send diseqc 1.2 motor command: " << basename << " -m " << std::endl; + std::cout << "lock remote control: " << basename << " -lockrc" << std::endl; + std::cout << "unlock remote control: " << basename << " -unlockrc" << std::endl; return -1; } @@ -92,6 +94,7 @@ int main (int argc, char** argv) int nvod = -1; int arat = -1; int m43 = -1; + int lockrc = -1; const char * channelName = NULL; bool playback = false; @@ -351,6 +354,16 @@ int main (int argc, char** argv) continue; } } + else if (!strncmp(argv[i], "-lockrc", 7)) + { + lockrc = 1; + continue; + } + else if (!strncmp(argv[i], "-unlockrc", 9)) + { + lockrc = 0; + continue; + } else if (i < argc - 1) { if ((sscanf(argv[i], "%d", &bouquet) > 0) && (sscanf(argv[++i], "%u", &channel) > 0)) @@ -418,6 +431,11 @@ int main (int argc, char** argv) zapit.setVolume(volume, volume); return 0; } + if (lockrc != -1) + { + zapit.lockRc(lockrc); + return 0; + } if (rezap) { zapit.Rezap(); diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index d19fae601..38faa5972 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -1947,6 +1947,17 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd) break; } + case CZapitMessages::CMD_LOCKRC: { + CZapitMessages::commandBoolean msgBoolean; + CBasicServer::receive_data(connfd, &msgBoolean, sizeof(msgBoolean)); + extern CRCInput *g_RCInput; + if (msgBoolean.truefalse) + g_RCInput->stopInput(true); + else + g_RCInput->restartInput(true); + break; + } + case CZapitMessages::CMD_SET_VOLUME: { CZapitMessages::commandVolume msgVolume; CBasicServer::receive_data(connfd, &msgVolume, sizeof(msgVolume));