diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index de6fbe773..cfa60bac6 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1,5 +1,5 @@ AUDIOSelectMenue.head Auswahl der Tonspur -EPGMenu.epgplus Vorschauübersicht +EPGMenu.epgplus Vorschau-Übersicht EPGMenu.eventinfo Info zur Sendung EPGMenu.eventlist Vorschau aktuelles Programm EPGMenu.head EPG - Programminformation @@ -7,7 +7,7 @@ EPGMenu.streaminfo Technische Information EPGPlus.actions Aktionen EPGPlus.bybouquet_mode bouquetweise EPGPlus.bypage_mode seitenweise -EPGPlus.head Vorschau Übersicht (EPG Plus) +EPGPlus.head Vorschau-Übersicht (EPG Plus) EPGPlus.next_bouquet Bouquet vor EPGPlus.options Optionen EPGPlus.page_down Seite zurück @@ -19,7 +19,7 @@ EPGPlus.remind Vormerken EPGPlus.scroll_mode Scroll-Modus EPGPlus.stretch_mode Stretch-Modus EPGPlus.swap_mode Blättern -EPGPlus.view_mode Modus +EPGPlus.view_mode Ansicht GENRE.ALL aus GENRE.ARTS Kultur GENRE.ARTS.0 Kunst/Kultur diff --git a/data/locale/english.locale b/data/locale/english.locale index 1a0c06b4e..de722b8e6 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -2,24 +2,24 @@ AUDIOSelectMenue.head Audio Selection EPGMenu.epgplus Eventlist overview EPGMenu.eventinfo Details current program EPGMenu.eventlist Eventlist current programm -EPGMenu.head EPG - Program Information -EPGMenu.streaminfo technical information +EPGMenu.head EPG - Program information +EPGMenu.streaminfo Technical information EPGPlus.actions Actions EPGPlus.bybouquet_mode by bouquet EPGPlus.bypage_mode by page -EPGPlus.head Eventlist Overview (EPG Plus) -EPGPlus.next_bouquet next bouquet -EPGPlus.options options -EPGPlus.page_down page down -EPGPlus.page_up page up -EPGPlus.prev_bouquet prev bouquet +EPGPlus.head Eventlist overview (EPG Plus) +EPGPlus.next_bouquet Next bouquet +EPGPlus.options Options +EPGPlus.page_down Page down +EPGPlus.page_up Page up +EPGPlus.prev_bouquet Prev bouquet EPGPlus.record Record EPGPlus.refresh_epg Refresh EPGPlus.remind Schedule -EPGPlus.scroll_mode Scroll Mode -EPGPlus.stretch_mode Stretch Mode -EPGPlus.swap_mode swap mode -EPGPlus.view_mode view mode +EPGPlus.scroll_mode Scroll mode +EPGPlus.stretch_mode Stretch mode +EPGPlus.swap_mode Swap mode +EPGPlus.view_mode View mode GENRE.ALL off GENRE.ARTS Arts GENRE.ARTS.0 arts/culture diff --git a/src/gui/buildinfo.cpp b/src/gui/buildinfo.cpp index 6cd1241b8..2ffc959c4 100644 --- a/src/gui/buildinfo.cpp +++ b/src/gui/buildinfo.cpp @@ -53,7 +53,7 @@ void CBuildInfo::initVarBuildInfo() setWindowHeaderButtons(CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT); - shadow = true; + shadow = CC_SHADOW_ON; } diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index f6e20c5a0..da59a3b7f 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -302,13 +302,23 @@ void CComponentsHeader::initLogo() //right end int x_logo_right = width - cch_logo_obj->getWidth(); - if (cch_btn_obj) - x_logo_right -= cch_btn_obj->getWidth(); - if (cch_cl_obj) - x_logo_right -= cch_cl_obj->getWidth(); + if (cch_caption_align != CTextBox::RIGHT){ + if (cch_btn_obj) + x_logo_right -= cch_btn_obj->getWidth(); + if (cch_cl_obj) + x_logo_right -= cch_cl_obj->getWidth(); + }else{ + if (cch_icon_obj) + x_logo_right += cch_icon_obj->getWidth(); + } //left end - int x_logo_left = getCCItem(prev_id) ? getCCItem(prev_id)->getXPos() + getCCItem(prev_id)->getWidth() : 0; + int x_logo_left = cch_offset; + if (cch_caption_align != CTextBox::RIGHT) + x_logo_left = getCCItem(prev_id) ? getCCItem(prev_id)->getXPos() + getCCItem(prev_id)->getWidth() : 0; + else + if (cch_icon_obj) + x_logo_left += cch_icon_obj->getWidth(); //calculate available space int logo_space = x_logo_right + cch_logo_obj->getWidth() - x_logo_left; @@ -319,17 +329,30 @@ void CComponentsHeader::initLogo() //set final logo position int x_logo = 0; - if (cch_logo.Align == CC_LOGO_RIGHT) - x_logo = x_logo_right; + if (cch_logo.Align == CC_LOGO_RIGHT){ + if (cch_caption_align == CTextBox::RIGHT) + if (cch_text_obj) + x_logo = cch_text_obj->getXPos() - cch_logo_obj->getWidth(); + else + x_logo = x_logo_right; + } if (cch_logo.Align == CC_LOGO_LEFT) x_logo = x_logo_left; if (cch_logo.Align == CC_LOGO_CENTER){ x_logo = width/2 - cch_logo_obj->getWidth()/2; - //fallback if previous item and logo are overlapping - if (getCCItem(prev_id)){ - int x_tmp = x_logo_left + logo_space/2 - cch_logo_obj->getWidth()/2; - if (x_logo <= x_logo_left) - x_logo = x_tmp; + //fallback if adjacent item and logo are overlapping + if (cch_caption_align != CTextBox::RIGHT){ + if (getCCItem(prev_id)){ + int x_tmp = x_logo_left + logo_space/2 - cch_logo_obj->getWidth()/2; + if (x_logo <= x_logo_left) + x_logo = x_tmp; + } + }else{ + if (cch_text_obj){ + if (x_logo + cch_logo_obj->getWidth() >= cch_text_obj->getXPos()){ + x_logo = (x_logo_left + cch_text_obj->getXPos())/2 - cch_logo_obj->getWidth()/2; + } + } } } @@ -576,20 +599,26 @@ void CComponentsHeader::initCaption() //set header text properties if (cch_text_obj){ - //set alignment of text item in dependency from text alignment - if (cch_caption_align == CTextBox::CENTER) - cch_text_x = CC_CENTERED; + int w_free = cc_text_w; //recalc caption width cc_text_w = min(cc_text_w, cch_font->getRenderWidth(cch_text)+ OFFSET_INNER_MID); + //set alignment of text item in dependency from text alignment + if (cch_caption_align == CTextBox::CENTER) + cch_text_x = width/2 - cc_text_w/2; + + if (cch_caption_align == CTextBox::RIGHT){ + cch_text_x += w_free; + cch_text_x -= max(cc_text_w, cch_font->getRenderWidth(cch_text)+ OFFSET_INNER_MID); + } + //assign general properties cch_text_obj->setDimensionsAll(cch_text_x, cch_items_y, cc_text_w, height); cch_text_obj->setColorBody(col_body); if (cc_body_gradient_enable != cc_body_gradient_enable_old) cch_text_obj->getCTextBoxObject()->clearScreenBuffer(); - cch_text_obj->setTextColor(cch_col_text); - cch_text_obj->setText(cch_text, cch_caption_align, cch_font); + cch_text_obj->setText(cch_text, cch_caption_align, cch_font, cch_col_text); cch_text_obj->enableTboxSaveScreen(cc_body_gradient_enable || cc_txt_save_screen); //corner of text item diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 3d7c56e01..d8203b2da 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -263,6 +263,39 @@ void CEventList::readEvents(const t_channel_id channel_id) return; } +void CEventList::getChannelNames(t_channel_id &channel_id, std::string ¤t_channel_name, std::string &prev_channel_name, std::string &next_channel_name, neutrino_msg_t msg) +{ + t_bouquet_id current_bouquet_id = bouquetList->getActiveBouquetNumber(); + t_channel_id channel_id_tmp = channel_id; + const unsigned int channel_nr = bouquetList->Bouquets[current_bouquet_id]->channelList->getSize(); + if(channel_nr < 2){ + channel_id = 0; + return; + } + unsigned int tmp_channel = 0; + for(unsigned int channel = 0; channel < channel_nr; channel++) + { + channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(channel)->getChannelID(); + if(channel_id_tmp == channel_id){ + if ( msg==CRCInput::RC_right || msg==CRCInput::RC_forward ) { + channel = (channel+1) %channel_nr; + }else if ( msg==CRCInput::RC_left || msg==CRCInput::RC_rewind ){ //RC_rewind + channel = (channel == 0) ? channel_nr -1 : channel - 1; + } + channel_id = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(channel)->getChannelID(); + current_channel_name = CServiceManager::getInstance()->GetServiceName(channel_id); + + tmp_channel = (channel == 0) ? channel_nr - 1 : channel - 1; + channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(tmp_channel)->getChannelID(); + prev_channel_name = CServiceManager::getInstance()->GetServiceName(channel_id_tmp); + + tmp_channel = (channel+1) %channel_nr; + channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(tmp_channel)->getChannelID(); + next_channel_name = CServiceManager::getInstance()->GetServiceName(channel_id_tmp); + break; + } + } +} int CEventList::exec(const t_channel_id channel_id, const std::string& channelname, const std::string& channelname_prev, const std::string& channelname_next,const CChannelEventList &followlist) // UTF-8 { @@ -558,39 +591,15 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna } else if ( msg==CRCInput::RC_left || msg==CRCInput::RC_right || msg==CRCInput::RC_rewind || msg==CRCInput::RC_forward ) { // maybe remove RC_rewind and RC_forward in the future? - bgRightBoxPaint = false; - t_bouquet_id current_bouquet_id= bouquetList->getActiveBouquetNumber(); - t_channel_id channel_id_tmp, _channel_id = channel_id; - const unsigned int channel_nr = bouquetList->Bouquets[current_bouquet_id]->channelList->getSize(); - std::string next_channel_name; - std::string prev_channel_name ; - std::string current_channel_name; - unsigned int tmp_channel = 0; - for(unsigned int channel = 0; channel < channel_nr; channel++) - { - channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(channel)->getChannelID(); - if(channel_id_tmp == channel_id){ - if ( msg==CRCInput::RC_right || msg==CRCInput::RC_forward ) { - channel = (channel+1) %channel_nr; - }else { //RC_rewind - channel = (channel == 0) ? channel_nr -1 : channel - 1; - } - _channel_id = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(channel)->getChannelID(); - current_channel_name = CServiceManager::getInstance()->GetServiceName(_channel_id); - - tmp_channel = (channel == 0) ? channel_nr - 1 : channel - 1; - channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(tmp_channel)->getChannelID(); - prev_channel_name = CServiceManager::getInstance()->GetServiceName(channel_id_tmp); - - tmp_channel = (channel+1) %channel_nr; - channel_id_tmp = bouquetList->Bouquets[current_bouquet_id]->channelList->getChannelFromIndex(tmp_channel)->getChannelID(); - next_channel_name = CServiceManager::getInstance()->GetServiceName(channel_id_tmp); - break; - } + std::string next_channel_name, prev_channel_name, current_channel_name; + t_channel_id _channel_id = channel_id; + getChannelNames(_channel_id, current_channel_name, prev_channel_name, next_channel_name, msg); + if(_channel_id){ + bgRightBoxPaint = false; + loop = false; + dont_hide = true; + exec(_channel_id, current_channel_name, prev_channel_name, next_channel_name); } - loop = false; - dont_hide = true; - exec(_channel_id, current_channel_name, prev_channel_name, next_channel_name); } else if (msg == CRCInput::RC_0) { hide(); @@ -883,6 +892,10 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s header->paint(CC_SAVE_SCREEN_NO); + if(_channelname_prev.empty() && _channelname_next.empty()){ + getChannelNames(_channel_id, _channelname, _channelname_prev, _channelname_next, 0); + } + paintBottomBox(_channelname_prev, _channelname_next); } diff --git a/src/gui/eventlist.h b/src/gui/eventlist.h index 69cf7442c..55401bff9 100644 --- a/src/gui/eventlist.h +++ b/src/gui/eventlist.h @@ -116,7 +116,8 @@ class CEventList : public CListHelpers void showProgressBar(int pos); void hide(); void showFunctionBar(t_channel_id channel_id); - + void getChannelNames(t_channel_id &channel_id, std::string ¤t_channel_name, std::string &prev_channel_name, std::string &next_channel_name, neutrino_msg_t msg); + int timerPre; int timerPost; void UpdateTimerList(void); diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 078e88ef8..4320eacbe 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 73 +#define LUA_API_VERSION_MINOR 75 diff --git a/src/gui/lua/lua_cc_window.cpp b/src/gui/lua/lua_cc_window.cpp index 819fe18d2..490a48e37 100644 --- a/src/gui/lua/lua_cc_window.cpp +++ b/src/gui/lua/lua_cc_window.cpp @@ -89,12 +89,13 @@ int CLuaInstCCWindow::CCWindowNew(lua_State *L) tableLookup(L, "name", name) || tableLookup(L, "title", name) || tableLookup(L, "caption", name); tableLookup(L, "icon", icon); - bool has_shadow = false; + int has_shadow = CC_SHADOW_OFF; if (!tableLookup(L, "has_shadow", has_shadow)) { tmp1 = "false"; if (tableLookup(L, "has_shadow", tmp1)) paramBoolDeprecated(L, tmp1.c_str()); - has_shadow = (tmp1 == "true" || tmp1 == "1" || tmp1 == "yes"); + if ((tmp1 == "true" || tmp1 == "1" || tmp1 == "yes")) + has_shadow = CC_SHADOW_ON; } tableLookup(L, "color_frame" , color_frame); @@ -126,7 +127,7 @@ int CLuaInstCCWindow::CCWindowNew(lua_State *L) CLuaCCWindow **udata = (CLuaCCWindow **) lua_newuserdata(L, sizeof(CLuaCCWindow *)); *udata = new CLuaCCWindow(); - (*udata)->w = new CComponentsWindow(x, y, dx, dy, name.c_str(), icon.c_str(), 0, has_shadow, (fb_pixel_t)color_frame, (fb_pixel_t)color_body, (fb_pixel_t)color_shadow); + (*udata)->w = new CComponentsWindow(x, y, dx, dy, name.c_str(), icon.c_str(), NULL, has_shadow, (fb_pixel_t)color_frame, (fb_pixel_t)color_body, (fb_pixel_t)color_shadow); /* Ignore percent conversion of width and height to remain compatible with the Lua API */ (*udata)->w->setWidth(dx); @@ -223,7 +224,7 @@ int CLuaInstCCWindow::CCWindowSetCaption(lua_State *L) lua_Integer alignment = (lua_Integer)CTextBox::NO_AUTO_LINEBREAK; tableLookup(L, "alignment", alignment); - D->w->setWindowCaption(name, alignment | (lua_Integer)CTextBox::NO_AUTO_LINEBREAK); + D->w->setWindowCaption(name, alignment); return 0; } diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 3bba42f54..2077c4f67 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -455,14 +455,22 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.hdd_noise = configfile.getInt32( "hdd_noise", 254); g_settings.hdd_statfs_mode = configfile.getInt32( "hdd_statfs_mode", SNeutrinoSettings::HDD_STATFS_RECORDING); + /* + hw_caps needs CFEManager and CFEManager needs g_settings. + So loadSetup() cannot use hw_caps to init g_settings. + + For this reason we need this workaround. + */ + bool can_shutdown = (cs_get_revision() > 7); + g_settings.shutdown_real = false; - if (g_info.hw_caps->can_shutdown) + if (can_shutdown) //(g_info.hw_caps->can_shutdown) g_settings.shutdown_real = configfile.getBool("shutdown_real" , false ); g_settings.shutdown_real_rcdelay = configfile.getBool("shutdown_real_rcdelay", false ); g_settings.shutdown_count = configfile.getInt32("shutdown_count", 0); g_settings.shutdown_min = 0; - if (g_info.hw_caps->can_shutdown) + if (can_shutdown) //(g_info.hw_caps->can_shutdown) g_settings.shutdown_min = configfile.getInt32("shutdown_min", 180); g_settings.sleeptimer_min = configfile.getInt32("sleeptimer_min", 0); @@ -2143,8 +2151,6 @@ TIMER_START(); cs_new_auto_videosystem(); #endif - g_info.hw_caps = get_hwcaps(); - g_Locale = new CLocaleManager; int loadSettingsErg = loadSetup(NEUTRINO_SETTINGS_FILE); @@ -2232,6 +2238,9 @@ TIMER_START(); CheckFastScan(); + // init hw_caps *after* zapit start! + g_info.hw_caps = get_hwcaps(); + //timer start timer_wakeup = false;//init wake_up( timer_wakeup );