diff --git a/.gitignore b/.gitignore index 16493bc12..5eb1fdb42 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ Makefile autom4te.cache *.in aclocal.m4 +compile config.* configure depcomp diff --git a/.svnignore b/.svnignore deleted file mode 100644 index e44c6013e..000000000 --- a/.svnignore +++ /dev/null @@ -1,12 +0,0 @@ -autom4te.cache -*.in -aclocal.m4 -config.* -configure -depcomp -install-sh -*.pc -libtool -ltmain.sh -missing -stamp.h1 diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index ede204b93..7c74dd323 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -2426,6 +2426,7 @@ satsetup.smatvremote SMATV Remote Tuning satsetup.uncomm_input Uncommitted satsetup.uni_settings Unicable Einstellungen satsetup.unicable Unicable +satsetup.unicable2 Unicable 2 (Jess) satsetup.usals_repeat USALS wiederholen satsetup.use_bat Benutze BAT satsetup.use_fta_flag nur FTA Kanäle diff --git a/data/locale/english.locale b/data/locale/english.locale index 1371ccb94..8dedd91de 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -2425,6 +2425,7 @@ satsetup.smatvremote SMATV Remote Tuning satsetup.uncomm_input Uncommited input satsetup.uni_settings Unicable Settings satsetup.unicable Unicable +satsetup.unicable2 Unicable 2 (Jess) satsetup.usals_repeat USALS command repeat satsetup.use_bat Use BAT satsetup.use_fta_flag just free Channels diff --git a/data/locale/slovak.locale b/data/locale/slovak.locale index 3ae068e32..46da1a908 100644 --- a/data/locale/slovak.locale +++ b/data/locale/slovak.locale @@ -682,6 +682,15 @@ flashupdate.selectimage Dostupné verzie / súbory flashupdate.settings Aktualizácia nastavení flashupdate.titlereadflash Načítavanie pamäte FLASH flashupdate.titlewriteflash Zapisovanie pamäte FLASH +flashupdate.type_addon Doplnok +flashupdate.type_beta Beta +flashupdate.type_internal Interná +flashupdate.type_locale Jazyk +flashupdate.type_release Release +flashupdate.type_settings Nastavenia +flashupdate.type_text Text +flashupdate.type_unknown Neznáma +flashupdate.type_update Aktualizácia flashupdate.update_with_settings_del_skipped Zložka [%s] nebola vymazaná. Zadanie je preskočené. flashupdate.update_with_settings_error Chyba FLASH pamäte!\n \nNový IMAGE má len %ld KB (ostáva %ld KB) do konca. \nnedostatok miesta pre dokončenie operácie.\n \nOperácia prerušená! flashupdate.update_with_settings_processed IMAGE sa spracováva... diff --git a/src/driver/fb_generic.cpp b/src/driver/fb_generic.cpp index 0fd7e0ee4..8dea24c47 100644 --- a/src/driver/fb_generic.cpp +++ b/src/driver/fb_generic.cpp @@ -281,8 +281,8 @@ unsigned int CFrameBuffer::getScreenHeight(bool real) unsigned int CFrameBuffer::getScreenWidthRel(bool force_small) { int percent = force_small ? WINDOW_SIZE_MIN_FORCED : g_settings.window_width; - // always reduce a possible detailline - return (g_settings.screen_EndX - g_settings.screen_StartX - 2*ConnectLineBox_Width) * percent / 100; + // always reduce a possible detailsline + return (g_settings.screen_EndX - g_settings.screen_StartX - 2*DETAILSLINE_WIDTH) * percent / 100; } unsigned int CFrameBuffer::getScreenHeightRel(bool force_small) diff --git a/src/driver/fb_generic.h b/src/driver/fb_generic.h index 67fe8214f..ca386f04a 100644 --- a/src/driver/fb_generic.h +++ b/src/driver/fb_generic.h @@ -75,7 +75,6 @@ typedef struct gradientData_t #define WINDOW_SIZE_MAX 100 // % #define WINDOW_SIZE_MIN 50 // % #define WINDOW_SIZE_MIN_FORCED 80 // % -#define ConnectLineBox_Width 16 // px /** Ausfuehrung als Singleton */ class CFrameBuffer : public sigc::trackable diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index 58dc8b392..86384b446 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -463,8 +463,8 @@ unsigned int CFrameBuffer::getScreenHeight(bool real) unsigned int CFrameBuffer::getScreenWidthRel(bool force_small) { int percent = force_small ? WINDOW_SIZE_MIN_FORCED : g_settings.window_width; - // always reduce a possible detailline - return (g_settings.screen_EndX - g_settings.screen_StartX - 2*ConnectLineBox_Width) * percent / 100; + // always reduce a possible detailsline + return (g_settings.screen_EndX - g_settings.screen_StartX - 2*DETAILSLINE_WIDTH) * percent / 100; } unsigned int CFrameBuffer::getScreenHeightRel(bool force_small) diff --git a/src/driver/framebuffer.h b/src/driver/framebuffer.h index 08fa7f038..6b2dced9c 100644 --- a/src/driver/framebuffer.h +++ b/src/driver/framebuffer.h @@ -70,7 +70,6 @@ typedef struct gradientData_t #define WINDOW_SIZE_MAX 100 // % #define WINDOW_SIZE_MIN 50 // % #define WINDOW_SIZE_MIN_FORCED 80 // % -#define ConnectLineBox_Width 16 // px /** Ausfuehrung als Singleton */ class CFrameBuffer : public sigc::trackable diff --git a/src/driver/screenshot.cpp b/src/driver/screenshot.cpp index 5577b64c8..636238431 100644 --- a/src/driver/screenshot.cpp +++ b/src/driver/screenshot.cpp @@ -347,7 +347,7 @@ bool CScreenShot::SaveJpg() int xres2 = xres1+2; for (int x = 0; x < xres; x++) { int x2 = x*3; - memcpy(pixel_data + x2 + xres1, pixel_data + x*4 + y*xres*4, 3); + memmove(pixel_data + x2 + xres1, pixel_data + x*4 + y*xres*4, 3); SWAP(pixel_data[x2 + xres1], pixel_data[x2 + xres2]); } } diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index e660512e2..b313ff6bc 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -273,8 +273,8 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_height = m_theight + m_info_height + m_title_height + 2*m_buttonHeight + m_listmaxshow * m_fheight; // recalc height m_x = getScreenStartX( m_width ); - if (m_x < ConnectLineBox_Width) - m_x = ConnectLineBox_Width; + if (m_x < DETAILSLINE_WIDTH) + m_x = DETAILSLINE_WIDTH; m_y = getScreenStartY( m_height ); m_idletime=time(NULL); @@ -1504,8 +1504,8 @@ void CAudioPlayerGui::hide() // printf("hide(){\n"); if (m_visible) { - m_frameBuffer->paintBackgroundBoxRel(m_x - ConnectLineBox_Width, m_y + m_title_height, - m_width + ConnectLineBox_Width, m_height - m_title_height); + m_frameBuffer->paintBackgroundBoxRel(m_x - DETAILSLINE_WIDTH, m_y + m_title_height, + m_width + DETAILSLINE_WIDTH, m_height - m_title_height); clearItemID3DetailsLine(); m_frameBuffer->paintBackgroundBoxRel(m_x, m_y, m_width, m_title_height); m_visible = false; @@ -1825,7 +1825,7 @@ void CAudioPlayerGui::clearItemID3DetailsLine () void CAudioPlayerGui::paintItemID3DetailsLine (int pos) { - int xpos = m_x - ConnectLineBox_Width; + int xpos = m_x - DETAILSLINE_WIDTH; int ypos1 = m_y + m_title_height + m_theight + pos*m_fheight; int ypos2 = m_y + (m_height - m_info_height) + OFFSET_INTER; int ypos1a = ypos1 + (m_fheight / 2); @@ -1843,7 +1843,7 @@ void CAudioPlayerGui::paintItemID3DetailsLine (int pos) { //details line if (dline == NULL) - dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, m_fheight/2, m_info_height-RADIUS_LARGE*2); + dline = new CComponentsDetailsLine(xpos, ypos1a, ypos2a, m_fheight/2, m_info_height-RADIUS_LARGE*2); dline->paint(false); // paint id3 infobox diff --git a/src/gui/audioplayer.h b/src/gui/audioplayer.h index 7905d6e1c..af7c10df8 100644 --- a/src/gui/audioplayer.h +++ b/src/gui/audioplayer.h @@ -139,7 +139,7 @@ class CAudioPlayerGui : public CMenuTarget int m_idletime; bool m_screensaver; bool m_inetmode; - CComponentsDetailLine *dline; + CComponentsDetailsLine *dline; CComponentsInfoBox *ibox; SMSKeyInput m_SMSKeyInput; diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 9abeb7a1a..9fade03d4 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -231,7 +231,7 @@ void CBEChannelWidget::paintDetails(int index) void CBEChannelWidget::initItem2DetailsLine (int pos, int /*ch_index*/) { - int xpos = x - ConnectLineBox_Width; + int xpos = x - DETAILSLINE_WIDTH; int ypos1 = y + theight+0 + pos*iheight; int ypos2 = y + height + OFFSET_INTER; int ypos1a = ypos1 + (fheight/2); @@ -244,7 +244,7 @@ void CBEChannelWidget::initItem2DetailsLine (int pos, int /*ch_index*/) if (pos >= 0) { if (dline == NULL) - dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, fheight/2, info_height-RADIUS_LARGE*2); + dline = new CComponentsDetailsLine(xpos, ypos1a, ypos2a, fheight/2, info_height-RADIUS_LARGE*2); dline->setYPos(ypos1a); //infobox @@ -318,8 +318,8 @@ int CBEChannelWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* height = theight+footerHeight+listmaxshow*iheight; // recalc height x = getScreenStartX(width); - if (x < ConnectLineBox_Width) - x = ConnectLineBox_Width; + if (x < DETAILSLINE_WIDTH) + x = DETAILSLINE_WIDTH; y = getScreenStartY(height + info_height); diff --git a/src/gui/bedit/bouqueteditor_channels.h b/src/gui/bedit/bouqueteditor_channels.h index 09394fc64..8ee180710 100644 --- a/src/gui/bedit/bouqueteditor_channels.h +++ b/src/gui/bedit/bouqueteditor_channels.h @@ -48,7 +48,7 @@ class CBEChannelWidget : public CMenuTarget, public CListHelpers private: CFrameBuffer *frameBuffer; - CComponentsDetailLine *dline; + CComponentsDetailsLine *dline; CComponentsInfoBox *ibox; CComponentsFooter footer; enum state_ diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp index c60372450..c80a182b2 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.cpp +++ b/src/gui/bedit/bouqueteditor_chanselect.cpp @@ -202,8 +202,8 @@ int CBEChannelSelectWidget::exec(CMenuTarget* parent, const std::string & action height = theight+footerHeight+listmaxshow*iheight; // recalc height x = getScreenStartX(width); - if (x < ConnectLineBox_Width) - x = ConnectLineBox_Width; + if (x < DETAILSLINE_WIDTH) + x = DETAILSLINE_WIDTH; y = getScreenStartY(height + info_height); bouquetChannels = mode == CZapitClient::MODE_TV ? &(bouquet->tvChannels) : &(bouquet->radioChannels); @@ -288,7 +288,7 @@ void CBEChannelSelectWidget::paintDetails(int index) void CBEChannelSelectWidget::initItem2DetailsLine (int pos, int /*ch_index*/) { - int xpos = x - ConnectLineBox_Width; + int xpos = x - DETAILSLINE_WIDTH; int ypos1 = y + theight+0 + pos*iheight; int ypos2 = y + height + OFFSET_INTER; int ypos1a = ypos1 + (fheight/2); @@ -301,7 +301,7 @@ void CBEChannelSelectWidget::initItem2DetailsLine (int pos, int /*ch_index*/) if (pos >= 0) { if (dline == NULL) - dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, fheight/2, info_height-RADIUS_LARGE*2); + dline = new CComponentsDetailsLine(xpos, ypos1a, ypos2a, fheight/2, info_height-RADIUS_LARGE*2); dline->setYPos(ypos1a); //infobox diff --git a/src/gui/bedit/bouqueteditor_chanselect.h b/src/gui/bedit/bouqueteditor_chanselect.h index 91ed9fdb3..519b16397 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.h +++ b/src/gui/bedit/bouqueteditor_chanselect.h @@ -49,7 +49,7 @@ class CBEChannelSelectWidget : public CListBox enum{SORT_ALPHA,SORT_FREQ,SORT_SAT,SORT_CH_NUMBER, SORT_END}; CZapitClient::channelsMode mode; bool isChannelInBouquet( int index); - CComponentsDetailLine *dline; + CComponentsDetailsLine *dline; CComponentsInfoBox *ibox; CComponentsFooter footer; uint getItemCount(); diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index fc7b977a1..4b534a36c 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -510,8 +510,8 @@ void CChannelList::calcSize() // calculate x position x = getScreenStartX(full_width); - if (x < ConnectLineBox_Width) - x = ConnectLineBox_Width; + if (x < DETAILSLINE_WIDTH) + x = DETAILSLINE_WIDTH; // calculate header height const int pic_h = 39; @@ -1673,14 +1673,14 @@ void CChannelList::paintItem2DetailsLine (int pos) if (!g_settings.channellist_show_infobox) return; - int xpos = x - ConnectLineBox_Width; + int xpos = x - DETAILSLINE_WIDTH; int ypos1 = y + theight + pos*fheight + (fheight/2); int ypos2 = y + height + OFFSET_INTER + (info_height/2); // paint Line if detail info (and not valid list pos) if (pos >= 0) { if (dline == NULL) - dline = new CComponentsDetailLine(xpos, ypos1, ypos2, fheight/2, info_height-RADIUS_LARGE*2); + dline = new CComponentsDetailsLine(xpos, ypos1, ypos2, fheight/2, info_height-RADIUS_LARGE*2); dline->paint(false); } } diff --git a/src/gui/channellist.h b/src/gui/channellist.h index aa9933030..f5addbe68 100644 --- a/src/gui/channellist.h +++ b/src/gui/channellist.h @@ -104,7 +104,7 @@ private: ZapitChannelList *chanlist; CBouquet *bouquet; CZapProtection* zapProtection; - CComponentsDetailLine *dline; + CComponentsDetailsLine *dline; int full_width; int width; diff --git a/src/gui/components/cc_detailsline.cpp b/src/gui/components/cc_detailsline.cpp index 2d0d0dec7..ec23624bf 100644 --- a/src/gui/components/cc_detailsline.cpp +++ b/src/gui/components/cc_detailsline.cpp @@ -35,15 +35,15 @@ using namespace std; -//sub class CComponentsDetailLine from CComponents -CComponentsDetailLine::CComponentsDetailLine( const int& x_pos, const int& y_pos_top, +//sub class CComponentsDetailsLine from CComponents +CComponentsDetailsLine::CComponentsDetailsLine( const int& x_pos, const int& y_pos_top, const int& y_pos_down, const int& h_mark_top_, const int& h_mark_down_, fb_pixel_t color_line, fb_pixel_t color_shadow) { initVarDline(x_pos, y_pos_top, y_pos_down, h_mark_top_, h_mark_down_, color_line, color_shadow); } -void CComponentsDetailLine::initVarDline( const int& x_pos, const int& y_pos_top, +void CComponentsDetailsLine::initVarDline( const int& x_pos, const int& y_pos_top, const int& y_pos_down, const int& h_mark_top_, const int& h_mark_down_, fb_pixel_t color_line, fb_pixel_t color_shadow) { @@ -53,20 +53,20 @@ void CComponentsDetailLine::initVarDline( const int& x_pos, const int& y_pos_top col_shadow = color_shadow; col_body = color_line; - //CComponentsDetailLine + //CComponentsDetailsLine y_down = y_pos_down; h_mark_top = h_mark_top_; h_mark_down = h_mark_down_; shadow_w = 1; - //CComponentsDetailLine - thickness = 2; /* MUST be an even value! */ //NI + //CComponentsDetailsLine + dl_w = CFrameBuffer::getInstance()->scale2Res(2); //NI cc_body_gradient_enable = false; } -CComponentsDetailLine::~CComponentsDetailLine() +CComponentsDetailsLine::~CComponentsDetailsLine() { } @@ -86,7 +86,7 @@ CComponentsDetailLine::~CComponentsDetailLine() //paint details line with current parameters -void CComponentsDetailLine::paint(bool do_save_bg) +void CComponentsDetailsLine::paint(bool do_save_bg) { //NI if (!g_settings.show_menu_hints_line) return; @@ -104,6 +104,7 @@ void CComponentsDetailLine::paint(bool do_save_bg) int y_mark_top = y-h_mark_top/2; int y_mark_down = y_down-h_mark_down/2; + int dx_c = dl_w%2; //correction for odd values cc_fbdata_t fbdata[] = { @@ -111,26 +112,26 @@ void CComponentsDetailLine::paint(bool do_save_bg) {true, CC_FBDATA_TYPE_BGSCREEN, x, y_mark_top, width, y_mark_down-y_mark_top+h_mark_down+sw, 0, 0, 0, 0, NULL, NULL, NULL, false}, /* vertical item mark | */ - {true, CC_FBDATA_TYPE_BOX, x+width-thickness-sw, y_mark_top, thickness, h_mark_top, col_body, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+width-dl_w-sw, y_mark_top, dl_w, h_mark_top, col_body, 0, 0, 0, NULL, NULL, NULL, false}, {true, CC_FBDATA_TYPE_BOX, x+width-sw, y_mark_top+sw, sw, h_mark_top-sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, - {true, CC_FBDATA_TYPE_BOX, x+width-thickness, y_mark_top+h_mark_top, thickness, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+width-dl_w, y_mark_top+h_mark_top, dl_w, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, /* horizontal item line - */ - {true, CC_FBDATA_TYPE_BOX, x, y-thickness/2, width-thickness-sw, thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false}, - {true, CC_FBDATA_TYPE_BOX, x+thickness, y+thickness/2, width-2*thickness-sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x, y-dl_w/2, width-dl_w-sw, dl_w, col_body, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+dl_w, y+dl_w/2+dx_c, width-2*dl_w-sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, /* vertical connect line [ */ - {true, CC_FBDATA_TYPE_BOX, x, y+thickness/2, thickness, y_down-y-thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false}, - {true, CC_FBDATA_TYPE_BOX, x+thickness, y+thickness/2+sw, sw, y_down-y-thickness-sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x, y+dl_w/2+dx_c, dl_w, y_down-y-dl_w, col_body, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+dl_w, y+dl_w/2+dx_c, sw, y_down-y-dl_w, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, /* horizontal info line - */ - {true, CC_FBDATA_TYPE_BOX, x, y_down-thickness/2, width-thickness-sw, thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false}, - {true, CC_FBDATA_TYPE_BOX, x+sw, y_down+thickness/2, width-thickness-2*sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x, y_down-dl_w/2, width-dl_w-sw, dl_w, col_body, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+sw, y_down+dl_w/2+dx_c, width-dl_w-2*sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, /* vertical info mark | */ - {true, CC_FBDATA_TYPE_BOX, x+width-thickness-sw, y_mark_down, thickness, h_mark_down, col_body, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+width-dl_w-sw, y_mark_down, dl_w, h_mark_down, col_body, 0, 0, 0, NULL, NULL, NULL, false}, {true, CC_FBDATA_TYPE_BOX, x+width-sw, y_mark_down+sw, sw, h_mark_down-sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, - {true, CC_FBDATA_TYPE_BOX, x+width-thickness, y_mark_down+h_mark_down,thickness, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+width-dl_w, y_mark_down+h_mark_down,dl_w, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, }; for(size_t i =0; i< (sizeof(fbdata) / sizeof(fbdata[0])) ;i++) @@ -142,7 +143,7 @@ void CComponentsDetailLine::paint(bool do_save_bg) //synchronize colors for details line //This is usefull if the system colors are changed during runtime //so you can ensure correct applied system colors in relevant objects with unchanged instances. -void CComponentsDetailLine::syncSysColors() +void CComponentsDetailsLine::syncSysColors() { col_body = COL_FRAME_PLUS_0; col_shadow = COL_SHADOW_PLUS_0; diff --git a/src/gui/components/cc_detailsline.h b/src/gui/components/cc_detailsline.h index dfea467bd..66197f51f 100644 --- a/src/gui/components/cc_detailsline.h +++ b/src/gui/components/cc_detailsline.h @@ -37,11 +37,11 @@ Not usable as CCItem! */ -class CComponentsDetailLine : public CComponents +class CComponentsDetailsLine : public CComponents { private: - ///property: line thickness - int thickness; + ///property: line width + int dl_w; ///property: lowest y position int y_down; ///property: height of top marker @@ -55,10 +55,10 @@ class CComponentsDetailLine : public CComponents fb_pixel_t color_line, fb_pixel_t color_shadow); public: - CComponentsDetailLine( const int& x_pos = 1,const int& y_pos_top = 1, const int& y_pos_down = 1, + CComponentsDetailsLine( const int& x_pos = 1,const int& y_pos_top = 1, const int& y_pos_down = 1, const int& h_mark_top_ = CC_HEIGHT_MIN , const int& h_mark_down_ = CC_HEIGHT_MIN, fb_pixel_t color_line = COL_FRAME_PLUS_0, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); - ~CComponentsDetailLine(); + ~CComponentsDetailsLine(); ///set colors void setColors(fb_pixel_t color_line, fb_pixel_t color_shadow){col_body = color_line; col_shadow = color_shadow;}; @@ -73,6 +73,8 @@ class CComponentsDetailLine : public CComponents ///set all positions and dimensions of details line at once void setDimensionsAll(const int& x_pos,const int& y_pos, const int& y_pos_down, const int& h_mark_top_ , const int& h_mark_down_) {setXPos(x_pos); setYPos(y_pos); setYPosDown(y_pos_down); setHMarkTop(h_mark_top_); setHMarkDown(h_mark_down_);} + ///property: set line thickness + void setLineWidth(const int& w){dl_w = w;} ///paint all to screen void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); diff --git a/src/gui/components/cc_frm_ext_text.cpp b/src/gui/components/cc_frm_ext_text.cpp index 864336d91..0587d90db 100644 --- a/src/gui/components/cc_frm_ext_text.cpp +++ b/src/gui/components/cc_frm_ext_text.cpp @@ -31,7 +31,8 @@ #include -#define DEF_HEIGHT 27 +#define DEF_HEIGHT CFrameBuffer::getInstance()->scale2Res(27) +#define DEF_WIDTH CFrameBuffer::getInstance()->scale2Res(300) #define DEF_LABEL_WIDTH_PERCENT 30 using namespace std; @@ -39,7 +40,7 @@ using namespace std; CComponentsExtTextForm::CComponentsExtTextForm(CComponentsForm* parent) { Font* t_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]; - initVarExtTextForm(0, 0, 300, t_font->getHeight(), "", "", t_font, parent, CC_SHADOW_OFF, COL_MENUCONTENTINACTIVE_TEXT, COL_MENUCONTENT_TEXT, COL_FRAME_PLUS_0, COL_MENUCONTENT_PLUS_0, COL_SHADOW_PLUS_0); + initVarExtTextForm(0, 0, DEF_WIDTH, t_font->getHeight(), "", "", t_font, parent, CC_SHADOW_OFF, COL_MENUCONTENTINACTIVE_TEXT, COL_MENUCONTENT_TEXT, COL_FRAME_PLUS_0, COL_MENUCONTENT_PLUS_0, COL_SHADOW_PLUS_0); initCCTextItems(); } @@ -86,8 +87,7 @@ void CComponentsExtTextForm::initVarExtTextForm(const int& x_pos, const int& y_p width = w; //init ccx_label_width and ccx_text_width //default ccx_label_width = 30% of form width - ccx_percent_label_w = DEF_LABEL_WIDTH_PERCENT; - ccx_label_width = ccx_percent_label_w * width/100; + ccx_label_width = DEF_LABEL_WIDTH_PERCENT * width/100; ccx_text_width = width-ccx_label_width; height = h; @@ -223,7 +223,8 @@ void CComponentsExtTextForm::initCCTextItems() void CComponentsExtTextForm::setLabelWidthPercent(const uint8_t& percent_val) { - ccx_percent_label_w = (int)percent_val; + ccx_label_width = (int)percent_val * width/100; + ccx_text_width = width-ccx_label_width; initCCTextItems(); } diff --git a/src/gui/components/cc_frm_ext_text.h b/src/gui/components/cc_frm_ext_text.h index 837eb8c18..4e37efd0f 100644 --- a/src/gui/components/cc_frm_ext_text.h +++ b/src/gui/components/cc_frm_ext_text.h @@ -49,8 +49,6 @@ class CComponentsExtTextForm : public CComponentsForm, public CCTextScreen int ccx_text_width; ///property: font type of both items (label and text), see also setLabelAndText() Font* ccx_font; - ///property: percentage val of label width related to full width, causes fit of text automatically into the available remaining size of item, see also setLabelWidthPercent() - uint8_t ccx_percent_label_w; ///centered y position of label and text int y_text; diff --git a/src/gui/components/cc_frm_footer.h b/src/gui/components/cc_frm_footer.h index 0a7aeb91d..d2688321e 100644 --- a/src/gui/components/cc_frm_footer.h +++ b/src/gui/components/cc_frm_footer.h @@ -29,18 +29,6 @@ #include #include //for compatibility with 'button_label' type -//for 'button_label' type with string -typedef struct button_label_cc -{ - const char * button; - std::string text; - neutrino_locale_t locale; - neutrino_msg_t directKey; - neutrino_msg_t directKeyAlt; - int btn_result; - int btn_alias; - button_label_cc(): text(std::string()), locale(NONEXISTANT_LOCALE){} -} button_label_cc_struct; /*! CComponentsFooter, sub class of CComponentsHeader provides prepared container for footer diff --git a/src/gui/components/cc_types.h b/src/gui/components/cc_types.h index c76520bb8..7b57dc9e3 100644 --- a/src/gui/components/cc_types.h +++ b/src/gui/components/cc_types.h @@ -175,8 +175,24 @@ typedef struct cc_string_ext_txt_t Font* font; } cc_string_ext_txt_struct_t; -#define CC_WIDTH_MIN 16 -#define CC_HEIGHT_MIN 16 + +//for 'button_label' type with string +typedef struct button_label_cc +{ + const char * button; + std::string text; + neutrino_locale_t locale; + neutrino_msg_t directKey; + neutrino_msg_t directKeyAlt; + int btn_result; + int btn_alias; + std::string bg_image; + std::string hint; + button_label_cc(): button(NULL), text(std::string()), locale(NONEXISTANT_LOCALE){} +} button_label_cc_struct; + +#define CC_WIDTH_MIN CFrameBuffer::getInstance()->scale2Res(16) +#define CC_HEIGHT_MIN CC_WIDTH_MIN #define CC_SHADOW_OFF 0x0 #define CC_SHADOW_RIGHT 0x2 diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index 8dd342ed8..d62fa7487 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -69,7 +69,7 @@ void CImageInfo::Init(void) cc_sub_caption = NULL; b_info = NULL; btn_red = NULL; - item_offset = 10; + item_offset = OFFSET_INNER_MID; item_font = NULL; item_height = 0; y_tmp = 0; @@ -355,7 +355,7 @@ void CImageInfo::InitInfos() y_tmp = 0; for (size_t i=0; igetWidth(), 0, g_Locale->getText(v_info[i].caption), v_info[i].info_text); - item->setLabelWidthPercent(20); + item->setLabelWidthPercent(15); if (!item_font){ item_font = item->getFont(); diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 4fc768b19..323c671c2 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1627,12 +1627,12 @@ void CMovieBrowser::refreshDetailsLine(int pos) int hheight = m_pcBrowser->getHeaderListHeight(); int theight = m_pcBrowser->getTitleHeight(); - int xpos = m_cBoxFrameBrowserList.iX - ConnectLineBox_Width; + int xpos = m_cBoxFrameBrowserList.iX - DETAILSLINE_WIDTH; int ypos1 = m_cBoxFrameBrowserList.iY + hheight + theight + OFFSET_INNER_MID + pos*fheight + (fheight/2); int ypos2 = m_cBoxFrameInfo1.iY + (m_cBoxFrameInfo1.iHeight/2); if (m_detailsLine == NULL) - m_detailsLine = new CComponentsDetailLine(); + m_detailsLine = new CComponentsDetailsLine(); m_detailsLine->setDimensionsAll(xpos, ypos1, ypos2, fheight/2, m_cBoxFrameInfo1.iHeight-2*RADIUS_LARGE); m_detailsLine->paint(true); diff --git a/src/gui/moviebrowser/mb.h b/src/gui/moviebrowser/mb.h index 4d0ec91b0..38b1d07bf 100644 --- a/src/gui/moviebrowser/mb.h +++ b/src/gui/moviebrowser/mb.h @@ -165,7 +165,7 @@ class CMovieBrowser : public CMenuTarget, public CProgressSignals CBox m_cBoxFrameTitleRel; CComponentsHeader *m_header; - CComponentsDetailLine *m_detailsLine; + CComponentsDetailsLine *m_detailsLine; CComponentsChannelLogo *m_channelLogo; CComponentsPicture *m_movieCover; diff --git a/src/gui/scan_setup.cpp b/src/gui/scan_setup.cpp index 7eca091ec..edc320887 100644 --- a/src/gui/scan_setup.cpp +++ b/src/gui/scan_setup.cpp @@ -90,7 +90,7 @@ const CMenuOptionChooser::keyval SCANTS_ZAPIT_SCANTYPE[SCANTS_ZAPIT_SCANTYPE_COU { CServiceScan::SCAN_ALL , LOCALE_ZAPIT_SCANTYPE_ALL } }; -#define SATSETUP_DISEQC_OPTION_COUNT 6 +#define SATSETUP_DISEQC_OPTION_COUNT 7 const CMenuOptionChooser::keyval SATSETUP_DISEQC_OPTIONS[SATSETUP_DISEQC_OPTION_COUNT] = { { NO_DISEQC, LOCALE_SATSETUP_NODISEQC }, @@ -99,7 +99,8 @@ const CMenuOptionChooser::keyval SATSETUP_DISEQC_OPTIONS[SATSETUP_DISEQC_OPTION_ { DISEQC_1_1, LOCALE_SATSETUP_DISEQC11 }, /*{ DISEQC_1_2, LOCALE_SATSETUP_DISEQC12 },*/ { DISEQC_ADVANCED, LOCALE_SATSETUP_DISEQC_ADVANCED }, - { DISEQC_UNICABLE, LOCALE_SATSETUP_UNICABLE } + { DISEQC_UNICABLE, LOCALE_SATSETUP_UNICABLE }, + { DISEQC_UNICABLE2, LOCALE_SATSETUP_UNICABLE2 } // { SMATV_REMOTE_TUNING, LOCALE_SATSETUP_SMATVREMOTE } }; @@ -878,7 +879,8 @@ void CScanSetup::setDiseqcOptions(int number) mfe_config.diseqcType == DISEQC_1_0 ? LOCALE_SATSETUP_DISEQC10 : mfe_config.diseqcType == DISEQC_1_1 ? LOCALE_SATSETUP_DISEQC11 : mfe_config.diseqcType == DISEQC_ADVANCED ? LOCALE_SATSETUP_DISEQC_ADVANCED : - LOCALE_SATSETUP_UNICABLE); + mfe_config.diseqcType == DISEQC_UNICABLE ? LOCALE_SATSETUP_UNICABLE : + LOCALE_SATSETUP_UNICABLE2); if (mode == CFrontend::FE_MODE_LINK_TWIN && mfe_config.diseqcType != DISEQC_UNICABLE) { count++; @@ -1023,7 +1025,7 @@ int CScanSetup::showFrontendSetup(int number) fsatSetup->setHint("", LOCALE_MENU_HINT_SCAN_SATSETUP); setupMenu->addItem(fsatSetup); - uniSetup = new CMenuForwarder(LOCALE_SATSETUP_UNI_SETTINGS, (dmode == DISEQC_UNICABLE), NULL, this, "unisetup", CRCInput::convertDigitToKey(shortcut++)); + uniSetup = new CMenuForwarder(LOCALE_SATSETUP_UNI_SETTINGS, (dmode == DISEQC_UNICABLE ? true : dmode == DISEQC_UNICABLE2), NULL, this, "unisetup", CRCInput::convertDigitToKey(shortcut++)); setupMenu->addItem(uniSetup); CMenuWidget * rotorMenu = new CMenuWidget(LOCALE_SATSETUP_EXTENDED_MOTOR, NEUTRINO_ICON_SETTINGS, width); @@ -1091,7 +1093,7 @@ int CScanSetup::showUnicableSetup() int unicable_scr = fe_config.uni_scr; int unicable_qrg = fe_config.uni_qrg; - CMenuOptionNumberChooser *uniscr = new CMenuOptionNumberChooser(LOCALE_UNICABLE_SCR, &unicable_scr, true, 0, 7); + CMenuOptionNumberChooser *uniscr = new CMenuOptionNumberChooser(LOCALE_UNICABLE_SCR, &unicable_scr, true, 0, dmode == DISEQC_UNICABLE ? 7 : 31); CIntInput *uniqrg = new CIntInput(LOCALE_UNICABLE_QRG, &unicable_qrg, 4, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); CMenuWidget *uni_setup = new CMenuWidget(LOCALE_SATSETUP_UNI_SETTINGS, NEUTRINO_ICON_SETTINGS, width); @@ -1332,7 +1334,6 @@ int CScanSetup::showScanMenuSatFind() //init tempsat menu void CScanSetup::addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t & satconfig) { - bool unicable = (dmode == DISEQC_UNICABLE); temp_sat->addIntroItems(); CMenuOptionNumberChooser *diseqc = NULL; @@ -1342,6 +1343,7 @@ void CScanSetup::addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t & satcon CMenuOptionNumberChooser *motor = NULL; CMenuOptionChooser *usals = NULL; CMenuForwarder *mf; + bool unicable = (dmode == DISEQC_UNICABLE ? true : dmode == DISEQC_UNICABLE2); if (!unicable) { diseqc = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQC_INPUT, &satconfig.diseqc, ((dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED)), -1, 15, this, CRCInput::RC_nokey, NULL, 1, -1, LOCALE_OPTIONS_OFF); @@ -1357,7 +1359,7 @@ void CScanSetup::addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t & satcon } else { if (satconfig.diseqc < 0) satconfig.diseqc = 0; - unilnb = new CMenuOptionNumberChooser(LOCALE_UNICABLE_LNB, &satconfig.diseqc, true, 0, 1); + unilnb = new CMenuOptionNumberChooser(LOCALE_UNICABLE_LNB, &satconfig.diseqc, true, 0, dmode == DISEQC_UNICABLE ? 1 : 3); } CIntInput* lofL = new CIntInput(LOCALE_SATSETUP_LOFL, (int*) &satconfig.lnbOffsetLow, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); @@ -1833,7 +1835,7 @@ bool CScanSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data* fe->setDiseqcType((diseqc_t) dmode); fe->setTsidOnid(0); - uniSetup->setActive(dmode == DISEQC_UNICABLE); + uniSetup->setActive(dmode == DISEQC_UNICABLE ? true : dmode == DISEQC_UNICABLE2); bool enable = (dmode < DISEQC_ADVANCED) && (dmode != NO_DISEQC); ojDiseqcRepeats->setActive(enable && !CFrontend::linked(femode) && femode != CFrontend::FE_MODE_UNUSED); dorder->setActive(!CFrontend::linked(femode) && femode != CFrontend::FE_MODE_UNUSED && dmode == DISEQC_ADVANCED); @@ -1855,7 +1857,7 @@ bool CScanSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data* linkfe->setActive(CFrontend::linked(femode)); /* leave diseqc type enabled for TWIN in case user need different unicable setup */ dtype->setActive(femode != CFrontend::FE_MODE_UNUSED && femode != CFrontend::FE_MODE_LINK_LOOP); - uniSetup->setActive(dmode == DISEQC_UNICABLE && femode != CFrontend::FE_MODE_UNUSED && femode != CFrontend::FE_MODE_LINK_LOOP); + uniSetup->setActive(dmode == DISEQC_UNICABLE ? true : dmode == DISEQC_UNICABLE2 && femode != CFrontend::FE_MODE_UNUSED && femode != CFrontend::FE_MODE_LINK_LOOP); dorder->setActive(!CFrontend::linked(femode) && femode != CFrontend::FE_MODE_UNUSED && dmode == DISEQC_ADVANCED); fsatSelect->setActive(!CFrontend::linked(femode) && femode != CFrontend::FE_MODE_UNUSED); fsatSetup->setActive(!CFrontend::linked(femode) && femode != CFrontend::FE_MODE_UNUSED); diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 928566353..15b3f50bd 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -150,8 +150,8 @@ void CUpnpBrowserGui::Init() footer.enableShadow(CC_SHADOW_ON, -1, true); m_x=getScreenStartX(m_width); - if (m_x < ConnectLineBox_Width) // shouldn't happen - m_x = ConnectLineBox_Width; + if (m_x < DETAILSLINE_WIDTH) // shouldn't happen + m_x = DETAILSLINE_WIDTH; m_y=getScreenStartY(m_height); // calc positions @@ -1241,14 +1241,14 @@ void CUpnpBrowserGui::paintItem2DetailsLine(int pos) if (pos < 0) return; - int xpos = m_x - ConnectLineBox_Width; + int xpos = m_x - DETAILSLINE_WIDTH; int ypos1 = m_item_y + pos*m_item_height; int ypos2 = infobox.getYPos() + infobox.getHeight() - infobox.getHeight()/2; int ypos1a = ypos1 + (m_item_height/2); if (!dline) - dline = new CComponentsDetailLine(); + dline = new CComponentsDetailsLine(); dline->setDimensionsAll(xpos, ypos1a, ypos2, m_item_height/2, infobox.getHeight() - RADIUS_LARGE*2); dline->paint(); } diff --git a/src/gui/upnpbrowser.h b/src/gui/upnpbrowser.h index 105ec5fa1..123c9fe0e 100644 --- a/src/gui/upnpbrowser.h +++ b/src/gui/upnpbrowser.h @@ -97,7 +97,7 @@ class CUpnpBrowserGui : public CMenuTarget, public CListHelpers time_t m_time_played; bool m_playing_entry_is_shown; time_t timeout; - CComponentsDetailLine * dline; + CComponentsDetailsLine * dline; CComponentsFooter footer; CComponentsInfoBox topbox, infobox, timebox; CComponentsPicture *image; diff --git a/src/gui/widget/colorchooser.cpp b/src/gui/widget/colorchooser.cpp index f7b90b371..589f49fe7 100644 --- a/src/gui/widget/colorchooser.cpp +++ b/src/gui/widget/colorchooser.cpp @@ -158,6 +158,7 @@ int CColorChooser::exec(CMenuTarget* parent, const std::string &) timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings ::TIMING_MENU]); + int val = (*value[selected]); switch ( msg ) { case CRCInput::RC_down: { @@ -190,12 +191,12 @@ int CColorChooser::exec(CMenuTarget* parent, const std::string &) } case CRCInput::RC_right: { - if ((*value[selected]) < 100) + if (val < 100) { - if ((*value[selected]) < 98) - (*value[selected]) += 2; + if (val < 98) + val += 2; else - (*value[selected]) = 100; + val = 100; paintSlider(x + 10, y + hheight + mheight * selected, value[selected], colorchooser_names[selected], iconnames[selected], true); setColor(); @@ -204,12 +205,12 @@ int CColorChooser::exec(CMenuTarget* parent, const std::string &) } case CRCInput::RC_left: { - if ((*value[selected]) > 0) + if (val > 0) { - if ((*value[selected]) > 2) - (*value[selected]) -= 2; + if (val > 2) + val -= 2; else - (*value[selected]) = 0; + val = 0; paintSlider(x + 10, y + hheight + mheight * selected, value[selected], colorchooser_names[selected], iconnames[selected], true); setColor(); diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 68be935fb..432b58e9d 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -615,6 +615,7 @@ void CMenuWidget::Init(const std::string &NameString, const std::string &Icon, c selected = (widget_index == NO_WIDGET_ID ? preselected : mglobal->v_selected[widget_index]); //dimension + mwidth_save = mwidth; min_width = 0; width = 0; /* is set in paint() */ if (mwidth > 100){ @@ -1113,6 +1114,13 @@ void CMenuWidget::checkHints() void CMenuWidget::calcSize() { + // recalc min_width + min_width = 0; + int mwidth = std::min(mwidth_save, 100); + min_width = frameBuffer->getScreenWidth(true) * mwidth / 100; + if (min_width > (int)frameBuffer->getScreenWidth()) + min_width = frameBuffer->getScreenWidth(); + width = min_width; int wi, hi; @@ -1121,35 +1129,35 @@ void CMenuWidget::calcSize() if (items[i]->iconName_Info_right) { frameBuffer->getIconSize(items[i]->iconName_Info_right, &wi, &hi); if ((wi > 0) && (hi > 0)) - wi += 10; + wi += OFFSET_INNER_MID; else wi = 0; } - int tmpw = items[i]->getWidth() + 10 + 10 + wi; /* 10 pixels to the left and right of the text */ + int tmpw = items[i]->getWidth() + 2*OFFSET_INNER_MID + wi; /* 10 pixels to the left and right of the text */ if (tmpw > width) width = tmpw; } hint_height = 0; if(g_settings.show_menu_hints && has_hints) { - hint_height = 60; //TODO: rework calculation of hint_height + hint_height = frameBuffer->scale2Res(60); //TODO: rework calculation of hint_height int fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]->getHeight(); - int h_tmp = 16 + 2*fheight; + int h_tmp = OFFSET_INNER_LARGE + 2*fheight; /* assuming all hint icons has the same size ! */ int iw, ih; frameBuffer->getIconSize(NEUTRINO_ICON_HINT_TVMODE, &iw, &ih); - h_tmp = std::max(h_tmp, ih+10); + h_tmp = std::max(h_tmp, ih+OFFSET_INNER_MID); hint_height = std::max(h_tmp, hint_height); } /* set the max height to 9/10 of usable screen height debatable, if the callers need a possibility to set this */ height = (frameBuffer->getScreenHeight() - fbutton_height - hint_height) / 20 * 18; /* make sure its a multiple of 2 */ - if(height > ((int)frameBuffer->getScreenHeight() - 10)) - height = frameBuffer->getScreenHeight() - 10; + if(height > ((int)frameBuffer->getScreenHeight() - OFFSET_INNER_MID)) + height = frameBuffer->getScreenHeight() - OFFSET_INNER_MID; int neededWidth = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getRenderWidth(getName()); - if (neededWidth > width-48) { - width= neededWidth+ 49; + if (neededWidth > width - frameBuffer->scale2Res(48)) { + width = neededWidth + frameBuffer->scale2Res(48)+1; } hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); @@ -1183,7 +1191,7 @@ void CMenuWidget::calcSize() iconOffset = w; } - iconOffset += 10; + iconOffset += OFFSET_INNER_MID; width += iconOffset; if (fbutton_count) @@ -1200,13 +1208,13 @@ void CMenuWidget::calcSize() if(total_pages > 1) sb_width=SCROLLBAR_WIDTH; - full_width = /*ConnectLineBox_Width+*/width+sb_width+OFFSET_SHADOW; + full_width = /*DETAILSLINE_WIDTH+*/width+sb_width+OFFSET_SHADOW; full_height = height+RADIUS_LARGE+OFFSET_SHADOW*2 /*+hint_height+OFFSET_INTER*/; - /* + ConnectLineBox_Width for the hintbox connection line + /* + DETAILSLINE_WIDTH for the hintbox connection line * + center_offset for symmetry * + 20 for setMenuPos calculates 10 pixels border left and right */ - int center_offset = (g_settings.menu_pos == MENU_POS_CENTER) ? ConnectLineBox_Width : 0; - int max_possible = (int)frameBuffer->getScreenWidth() - ConnectLineBox_Width - center_offset - 20; + int center_offset = (g_settings.menu_pos == MENU_POS_CENTER) ? DETAILSLINE_WIDTH : 0; + int max_possible = (int)frameBuffer->getScreenWidth() - DETAILSLINE_WIDTH - center_offset - 20; if (full_width > max_possible) { width = max_possible - sb_width - OFFSET_SHADOW; @@ -1286,13 +1294,13 @@ void CMenuWidget::setMenuPos(const int& menu_width) case MENU_POS_CENTER: x = offx + scr_x + ((scr_w - menu_width ) >> 1 ); y = offy + scr_y + ((scr_h - real_h) >> 1 ); - x += g_settings.show_menu_hints_line ? ConnectLineBox_Width : 0; //NI + x += g_settings.show_menu_hints_line ? DETAILSLINE_WIDTH : 0; //NI break; case MENU_POS_TOP_LEFT: y = offy + scr_y + 10; x = offx + scr_x + 10; - x += g_settings.show_menu_hints_line ? ConnectLineBox_Width : 0; //NI + x += g_settings.show_menu_hints_line ? DETAILSLINE_WIDTH : 0; //NI break; case MENU_POS_TOP_RIGHT: @@ -1303,7 +1311,7 @@ void CMenuWidget::setMenuPos(const int& menu_width) case MENU_POS_BOTTOM_LEFT: y = /*offy +*/ scr_y + scr_h - real_h - 10; x = offx + scr_x + 10; - x += g_settings.show_menu_hints_line ? ConnectLineBox_Width : 0; //NI + x += g_settings.show_menu_hints_line ? DETAILSLINE_WIDTH : 0; //NI break; case MENU_POS_BOTTOM_RIGHT: @@ -1403,14 +1411,14 @@ void CMenuWidget::saveScreen() saveScreen_x = x; background = new fb_pixel_t [saveScreen_height * saveScreen_width]; if(background) - frameBuffer->SaveScreen(saveScreen_x /*-ConnectLineBox_Width*/, saveScreen_y, saveScreen_width, saveScreen_height, background); + frameBuffer->SaveScreen(saveScreen_x /*-DETAILSLINE_WIDTH*/, saveScreen_y, saveScreen_width, saveScreen_height, background); } void CMenuWidget::restoreScreen() { if(background) { if(savescreen) - frameBuffer->RestoreScreen(saveScreen_x /*-ConnectLineBox_Width*/, saveScreen_y, saveScreen_width, saveScreen_height, background); + frameBuffer->RestoreScreen(saveScreen_x /*-DETAILSLINE_WIDTH*/, saveScreen_y, saveScreen_width, saveScreen_height, background); } } @@ -1467,7 +1475,7 @@ void CMenuWidget::paintHint(int pos) int iheight = item->getHeight(); int rad = RADIUS_LARGE; - int xpos = x - ConnectLineBox_Width; + int xpos = x - DETAILSLINE_WIDTH; int ypos2 = y + height + fbutton_height + rad + OFFSET_SHADOW + OFFSET_INTER; int iwidth = width+sb_width; @@ -1480,7 +1488,7 @@ void CMenuWidget::paintHint(int pos) //init details line if (details_line == NULL) - details_line = new CComponentsDetailLine(); + details_line = new CComponentsDetailsLine(); details_line->setXPos(xpos); details_line->setYPos(ypos1a); diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index bf784e3cb..ff4f3e008 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -494,7 +494,7 @@ class CMenuWidget : public CMenuTarget, public CComponentsSignals private: mn_widget_id_t widget_index; CMenuGlobal *mglobal; - CComponentsDetailLine *details_line; + CComponentsDetailsLine *details_line; CComponentsInfoBox *info_box; int hint_height; CComponentsHeader *header; @@ -513,6 +513,7 @@ class CMenuWidget : public CMenuTarget, public CComponentsSignals std::string iconfile; int min_width; + int mwidth_save; int width; int height; int hheight; // header diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 92be9680b..59060f501 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -958,7 +958,10 @@ int CNeutrinoApp::loadSetup(const char * fname) // USERMENU -> in system/settings.h //------------------------------------------- - + for(unsigned int i=0; iboxvendor); - std::string boxname(g_info.hw_caps->boxname); + /* stay compatible with present code in Y_Blocks.txt */ + if (boxvendor.compare("Coolstream") == 0) + boxvendor = "CST"; + std::string boxname(g_info.hw_caps->boxname); /* workaround for Neo2 */ if ((boxname.compare("Neo") == 0) && (CFEManager::getInstance()->getFrontendCount() > 1)) boxname += " Twin"; diff --git a/src/system/locals.h b/src/system/locals.h index 39b776c88..009968074 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -2452,6 +2452,7 @@ typedef enum LOCALE_SATSETUP_UNCOMM_INPUT, LOCALE_SATSETUP_UNI_SETTINGS, LOCALE_SATSETUP_UNICABLE, + LOCALE_SATSETUP_UNICABLE2, LOCALE_SATSETUP_USALS_REPEAT, LOCALE_SATSETUP_USE_BAT, LOCALE_SATSETUP_USE_FTA_FLAG, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 3e4fa363f..92949190b 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -2452,6 +2452,7 @@ const char * locale_real_names[] = "satsetup.uncomm_input", "satsetup.uni_settings", "satsetup.unicable", + "satsetup.unicable2", "satsetup.usals_repeat", "satsetup.use_bat", "satsetup.use_fta_flag", diff --git a/src/system/settings.h b/src/system/settings.h index 2d1cb2252..af9777965 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -997,6 +997,8 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO #define SCROLLBAR_WIDTH OFFSET_INNER_MID + 2*OFFSET_INNER_MIN +#define DETAILSLINE_WIDTH CFrameBuffer::getInstance()->scale2Res(16) + struct SglobalInfo { unsigned char box_Type; diff --git a/src/zapit/include/zapit/client/zapittypes.h b/src/zapit/include/zapit/client/zapittypes.h index ea3a50721..ab81f7e63 100644 --- a/src/zapit/include/zapit/client/zapittypes.h +++ b/src/zapit/include/zapit/client/zapittypes.h @@ -41,7 +41,8 @@ typedef enum { DISEQC_1_1, DISEQC_1_2, DISEQC_ADVANCED, - DISEQC_UNICABLE + DISEQC_UNICABLE, + DISEQC_UNICABLE2 #if 0 , DISEQC_2_0, DISEQC_2_1, diff --git a/src/zapit/include/zapit/frontend_c.h b/src/zapit/include/zapit/frontend_c.h index c513ced15..6c9a49ba8 100644 --- a/src/zapit/include/zapit/frontend_c.h +++ b/src/zapit/include/zapit/frontend_c.h @@ -167,6 +167,7 @@ class CFrontend void sendDiseqcReset(uint32_t ms = 40); void sendDiseqcSmatvRemoteTuningCommand(const uint32_t frequency); uint32_t sendEN50494TuningCommand(const uint32_t frequency, const int high_band, const int horizontal, const int bank); + uint32_t sendEN50607TuningCommand(const uint32_t frequency, const int high_band, const int horizontal, const int bank); void sendDiseqcZeroByteCommand(const uint8_t frm, const uint8_t addr, const uint8_t cmd, uint32_t ms = 15); void sendToneBurst(const fe_sec_mini_cmd_t burst, const uint32_t ms); int setFrontend(const FrontendParameters *feparams, bool nowait = false); diff --git a/src/zapit/src/femanager.cpp b/src/zapit/src/femanager.cpp index 5d648da42..e5a2700ed 100644 --- a/src/zapit/src/femanager.cpp +++ b/src/zapit/src/femanager.cpp @@ -382,7 +382,7 @@ void CFEManager::saveSettings(bool write) void CFEManager::copySettings(CFrontend * from, CFrontend * to) { INFO("Copy settings fe %d -> fe %d", from->fenumber, to->fenumber); - if (to->config.diseqcType != DISEQC_UNICABLE || to->getMode() == CFrontend::FE_MODE_LINK_LOOP) + if (to->config.diseqcType != DISEQC_UNICABLE || to->config.diseqcType != DISEQC_UNICABLE2 || to->getMode() == CFrontend::FE_MODE_LINK_LOOP) to->config.diseqcType = from->config.diseqcType; to->config.diseqcRepeats = from->config.diseqcRepeats; diff --git a/src/zapit/src/frontend.cpp b/src/zapit/src/frontend.cpp index 2c5fad47a..cc0acf8c1 100644 --- a/src/zapit/src/frontend.cpp +++ b/src/zapit/src/frontend.cpp @@ -1217,6 +1217,12 @@ bool CFrontend::buildProperties(const FrontendParameters *feparams, struct dtv_p currentVoltage == SEC_VOLTAGE_18, !!config.uni_lnb); + if (config.diseqcType == DISEQC_UNICABLE2) + cmdseq.props[FREQUENCY].u.data = sendEN50607TuningCommand(feparams->frequency, + currentToneMode == SEC_TONE_ON, + currentVoltage == SEC_VOLTAGE_18, + config.uni_lnb); + cmdseq.num += nrOfProps; return true; @@ -1374,6 +1380,9 @@ void CFrontend::setDiseqcType(const diseqc_t newDiseqcType, bool force) case DISEQC_UNICABLE: INFO("fe%d: DISEQC_UNICABLE", fenumber); break; + case DISEQC_UNICABLE2: + INFO("fe%d: DISEQC_UNICABLE2", fenumber); + break; #if 0 case DISEQC_2_0: INFO("DISEQC_2_0"); @@ -1390,7 +1399,7 @@ void CFrontend::setDiseqcType(const diseqc_t newDiseqcType, bool force) return; } - if (newDiseqcType == DISEQC_UNICABLE) { + if (newDiseqcType == DISEQC_UNICABLE || newDiseqcType == DISEQC_UNICABLE2) { secSetTone(SEC_TONE_OFF, 0); secSetVoltage(unicable_lowvolt, 0); } @@ -1501,7 +1510,7 @@ void CFrontend::setInput(t_satellite_position satellitePosition, uint32_t freque config.uni_lnb = sit->second.diseqc; setLnbOffsets(sit->second.lnbOffsetLow, sit->second.lnbOffsetHigh, sit->second.lnbSwitch); - if (config.diseqcType == DISEQC_UNICABLE) + if (config.diseqcType == DISEQC_UNICABLE || config.diseqcType == DISEQC_UNICABLE2) return; if (config.diseqcType != DISEQC_ADVANCED) { @@ -1567,6 +1576,39 @@ uint32_t CFrontend::sendEN50494TuningCommand(const uint32_t frequency, const int return ret; } +uint32_t CFrontend::sendEN50607TuningCommand(const uint32_t frequency, const int high_band, const int horizontal, const int bank) +{ + uint32_t bpf = config.uni_qrg; + struct dvb_diseqc_master_cmd cmd = { {0x70, 0x00, 0x00, 0x00, 0x00, 0x00}, 4 }; + + unsigned int t = frequency / 1000 - 100; + if (t < 0x800 && config.uni_scr >= 0 && config.uni_scr < 32) + { + uint32_t ret = bpf * 1000; + INFO("[unicable-JESS] 18V=%d TONE=%d, freq=%d qrg=%d scr=%d bank=%d ret=%d", currentVoltage == SEC_VOLTAGE_18, currentToneMode == SEC_TONE_ON, frequency, bpf, config.uni_scr, bank, ret); + if (!slave && info.type == FE_QPSK) + { + cmd.msg[1] = ((config.uni_scr & 0x1F) << 3) | /* user band adress ( 0 to 31) */ + /* max. possible tuning word = 0x7FF */ + ((t >> 8) & 0x07); /* highest 3 bits of t (MSB) */ + cmd.msg[2] = t & 0xFF; /* tuning word (LSB) */ + cmd.msg[3] = (0 << 4) | /* no uncommited switch */ + /* I really don't know if the combines of option and position bits are right here, + because I can'test it, assuming here 4 sat positions */ + ((bank & 0x03) << 2) | /* input 0/1/2/3 */ + (horizontal << 1) | /* horizontal == 0x02 */ + high_band; /* high_band == 0x01 */ + fop(ioctl, FE_SET_VOLTAGE, SEC_VOLTAGE_18); + usleep(15 * 1000); /* en50494 says: >4ms and < 22 ms */ + sendDiseqcCommand(&cmd, 50); /* en50494 says: >2ms and < 60 ms */ + fop(ioctl, FE_SET_VOLTAGE, SEC_VOLTAGE_13); + } + return ret; + } + WARN("ooops. t > 2047? (%d) or uni_scr out of range? (%d)", t, config.uni_scr); + return 0; +} + bool CFrontend::tuneChannel(CZapitChannel * /*channel*/, bool /*nvod*/) { transponder_list_t::iterator transponder = transponders.find(currentTransponder.getTransponderId()); @@ -1812,9 +1854,32 @@ void CFrontend::sendDiseqcReset(uint32_t ms) void CFrontend::sendDiseqcStandby(uint32_t ms) { printf("[fe%d] diseqc standby\n", fenumber); - if (config.diseqcType == DISEQC_UNICABLE) - sendEN50494TuningCommand(0, 0, 0, 2); - /* en50494 switches don't seem to be hurt by this */ + if (config.diseqcType > DISEQC_ADVANCED) + { + /* use ODU_Power_OFF command for unicable or jess here + to set the used UB frequency of the frontend to standby */ + struct dvb_diseqc_master_cmd cmd = {{0}, 6}; + printf("[fe%d] standby scr: %d\n", fenumber, config.uni_scr); + if (config.diseqcType == DISEQC_UNICABLE) + { + cmd.msg[0] = 0xe0; + cmd.msg[1] = 0x10; + cmd.msg[2] = 0x5a; + cmd.msg[3] = ((config.uni_scr & 0x07) << 5); + cmd.msg_len = 5; + } + if (config.diseqcType == DISEQC_UNICABLE2) + { + cmd.msg[0] = 0x70; + cmd.msg[1] = ((config.uni_scr & 0x1F) << 3); + cmd.msg_len = 4; + } + fop(ioctl, FE_SET_VOLTAGE, SEC_VOLTAGE_18); + usleep(15 * 1000); + sendDiseqcCommand(&cmd, ms); + fop(ioctl, FE_SET_VOLTAGE, SEC_VOLTAGE_13); + return; + } // Send power off to 'all' equipment sendDiseqcZeroByteCommand(0xe0, 0x00, 0x02, ms); }