diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 10cc8e647..32850895e 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1853,6 +1853,7 @@ moviebrowser.cut_failed Fehler beim Schneiden. Sind Sprungmarken und genug freie moviebrowser.cutting Schneide Film, bitte warten ... moviebrowser.delete_all Alle markierten Filme ohne weitere Nachfrage löschen? moviebrowser.delete_info Lösche Dateien, bitte warten ... +moviebrowser.delete_movie Film löschen moviebrowser.delete_screenshot Lösche Screenshot? moviebrowser.dir Pfad moviebrowser.directories Verzeichnisse diff --git a/data/locale/english.locale b/data/locale/english.locale index 772a07ea8..cdd03f8f1 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1853,6 +1853,7 @@ moviebrowser.cut_failed Cut failed, are there jump bookmarks and enough free spa moviebrowser.cutting Cutting movie, please wait ... moviebrowser.delete_all Delete all selected movies without any questions? moviebrowser.delete_info Delete files, please wait ... +moviebrowser.delete_movie Delete movie moviebrowser.delete_screenshot Delete screenshot? moviebrowser.dir Path moviebrowser.directories Directories diff --git a/lib/libtuxtxt/tuxtxt.cpp b/lib/libtuxtxt/tuxtxt.cpp index 714494681..d5d093a6a 100644 --- a/lib/libtuxtxt/tuxtxt.cpp +++ b/lib/libtuxtxt/tuxtxt.cpp @@ -58,6 +58,10 @@ fb_pixel_t *getFBp(int *y) void FillRect(int x, int y, int w, int h, int color) { + if(color < 0 || SIZECOLTABLE < color){ + printf("FIXME array size %i color %i not in range\n",SIZECOLTABLE,color); + return; + } fb_pixel_t *p = getFBp(&y); MARK_FB(x, y, w, h); p += x + y * stride; diff --git a/src/driver/fontrenderer.cpp b/src/driver/fontrenderer.cpp index 86dfea4ea..b9927a508 100644 --- a/src/driver/fontrenderer.cpp +++ b/src/driver/fontrenderer.cpp @@ -69,7 +69,7 @@ FBFontRenderClass::FBFontRenderClass(const int xr, const int yr) int maxbytes= 4 *1024*1024; dprintf(DEBUG_INFO, "[FONT] Intializing font cache, using max. %dMB...\n", maxbytes/1024/1024); fflush(stdout); - if (FTC_Manager_New(library, 0, 0, maxbytes, myFTC_Face_Requester, this, &cacheManager)) + if (FTC_Manager_New(library, 10, 20, maxbytes, myFTC_Face_Requester, this, &cacheManager)) { dprintf(DEBUG_NORMAL, "[FONT] manager failed!\n"); return; diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 38010a3b0..6f3333bdf 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1640,7 +1640,7 @@ void CAudioPlayerGui::paintHead() if (!m_show_playlist || m_screensaver) return; - CComponentsHeaderLocalized header(m_x, m_y + m_title_height + OFFSET_SHADOW + OFFSET_INTER, m_width, m_header_height, LOCALE_AUDIOPLAYER_HEAD, NEUTRINO_ICON_AUDIO); + CComponentsHeader header(m_x, m_y + m_title_height + OFFSET_SHADOW + OFFSET_INTER, m_width, m_header_height, LOCALE_AUDIOPLAYER_HEAD, NEUTRINO_ICON_AUDIO); header.enableShadow( CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); header.setCorner(RADIUS_MID, CORNER_TOP); diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index fc2eb5994..a5b2d6ebc 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -133,7 +133,7 @@ void CBEBouquetWidget::paint() void CBEBouquetWidget::paintHead() { - CComponentsHeaderLocalized header(x, y, width, theight, LOCALE_BOUQUETLIST_HEAD, "" /*no header icon*/, CComponentsHeaderLocalized::CC_BTN_EXIT); + CComponentsHeader header(x, y, width, theight, LOCALE_BOUQUETLIST_HEAD, "" /*no header icon*/, CComponentsHeader::CC_BTN_EXIT); header.paint(CC_SAVE_SCREEN_NO); } @@ -150,7 +150,7 @@ const struct button_label CBEBouquetWidgetButtons[6] = void CBEBouquetWidget::paintFoot() { size_t numbuttons = sizeof(CBEBouquetWidgetButtons)/sizeof(CBEBouquetWidgetButtons[0]); - footer.paintButtons(x, y+height, width, ButtonHeight, numbuttons, CBEBouquetWidgetButtons, width/numbuttons-2*OFFSET_INNER_MID, 0, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]); + footer.paintButtons(x, y+height, width, ButtonHeight, numbuttons, CBEBouquetWidgetButtons, width/numbuttons-2*OFFSET_INNER_MID); } void CBEBouquetWidget::hide() diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 1600a59ab..26d7815cd 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -184,7 +184,7 @@ const struct button_label CBEChannelWidgetButtons[6] = void CBEChannelWidget::paintFoot() { size_t numbuttons = sizeof(CBEChannelWidgetButtons)/sizeof(CBEChannelWidgetButtons[0]); - footer.paintButtons(x, y + (height-footerHeight), width, footerHeight, numbuttons, CBEChannelWidgetButtons, width/numbuttons-2*OFFSET_INNER_MID, 0, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]); + footer.paintButtons(x, y + (height-footerHeight), width, footerHeight, numbuttons, CBEChannelWidgetButtons, width/numbuttons-2*OFFSET_INNER_MID); } std::string CBEChannelWidget::getInfoText(int index) diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp index 87227e8df..e9ee12385 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.cpp +++ b/src/gui/bedit/bouqueteditor_chanselect.cpp @@ -251,7 +251,7 @@ void CBEChannelSelectWidget::paintFoot() break; } - footer.paintButtons(x, y + (height-footerHeight), width, footerHeight, numbuttons, Button, width/numbuttons-20); + footer.paintButtons(x, y + (height-footerHeight), width, footerHeight, numbuttons, Button, width/numbuttons-2*OFFSET_INNER_MID); } std::string CBEChannelSelectWidget::getInfoText(int index) diff --git a/src/gui/bookmarkmanager.cpp b/src/gui/bookmarkmanager.cpp index ab2369838..cdb4c11b0 100644 --- a/src/gui/bookmarkmanager.cpp +++ b/src/gui/bookmarkmanager.cpp @@ -411,7 +411,7 @@ void CBookmarkManager::hide() //------------------------------------------------------------------------ void CBookmarkManager::paintHead() { - CComponentsHeaderLocalized header(x, y, width, theight, LOCALE_BOOKMARKMANAGER_NAME, NEUTRINO_ICON_BOOKMARK_MANAGER, CComponentsHeaderLocalized::CC_BTN_HELP); + CComponentsHeader header(x, y, width, theight, LOCALE_BOOKMARKMANAGER_NAME, NEUTRINO_ICON_BOOKMARK_MANAGER, CComponentsHeader::CC_BTN_HELP); header.paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index c0c0039b0..23d57bf3c 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -217,7 +217,7 @@ void CComponentsButton::initCaption() * These dimensions must be enough to display complete content like possible icon and without truncated text. */ Font *tmp_font = cc_btn_font; - if ((tmp_font->getHeight()-reduce) > (height-reduce) && (tmp_font->getRenderWidth(cc_btn_text)-reduce) > width-reduce) + if ((tmp_font->getHeight()-reduce) > (height-reduce) || (tmp_font->getRenderWidth(cc_btn_text)-reduce) > width-reduce) tmp_font = *cc_btn_dy_font->getDynFont(w_cap, h_cap, cc_btn_text); if ((cc_btn_font->getHeight()-reduce) > (height-reduce)) tmp_font = *cc_btn_dy_font->getDynFont(w_cap, h_cap, cc_btn_text); diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index a15c8a21e..8b70ee9b3 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -336,7 +336,7 @@ void CComponentsFooter::paintButtons(const int& x_pos, this->setDimensionsAll(x_pos, y_pos, w, h); this->setButtonFont(font); this->setContextButton(context_buttons); - this->setButtonLabels(content, label_count, 0, label_width ? label_width : w/label_count); + this->setButtonLabels(content, label_count, 0, label_width ? label_width : (w/label_count) - 2*cch_offset); this->paint(do_save_bg); } diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 080b4cf3d..8cfe29fa4 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -65,21 +65,18 @@ CComponentsHeader::CComponentsHeader( const int& x_pos, const int& y_pos, const initVarHeader(x_pos, y_pos, w, h, caption, icon_name, buttons, parent, shadow_mode, color_frame, color_body, color_shadow); } -CComponentsHeaderLocalized::CComponentsHeaderLocalized( const int& x_pos, const int& y_pos, const int& w, const int& h, - neutrino_locale_t caption_locale, - const std::string& icon_name, - const int& buttons, - CComponentsForm* parent, - int shadow_mode, - fb_pixel_t color_frame, - fb_pixel_t color_body, - fb_pixel_t color_shadow) - :CComponentsHeader( x_pos, y_pos, w, h, - g_Locale->getText(caption_locale), - icon_name, buttons, - parent, - shadow_mode, - color_frame, color_body, color_shadow){}; +CComponentsHeader::CComponentsHeader( const int& x_pos, const int& y_pos, const int& w, const int& h, + neutrino_locale_t caption_locale, + const std::string& icon_name, + const int& buttons, + CComponentsForm* parent, + int shadow_mode, + fb_pixel_t color_frame, + fb_pixel_t color_body, + fb_pixel_t color_shadow) +{ + initVarHeader(x_pos, y_pos, w, h, g_Locale->getText(caption_locale), icon_name, buttons, parent, shadow_mode, color_frame, color_body, color_shadow); +}; void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& caption, diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index 1ba972777..d054bf886 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -170,7 +170,17 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen, CCHeaderT CComponentsHeader(CComponentsForm *parent = NULL); CComponentsHeader( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, const std::string& caption = std::string(), - const std::string& = std::string(), + const std::string& icon_name = std::string(), + const int& buttons = 0, + CComponentsForm *parent = NULL, + int shadow_mode = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, + fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); + + CComponentsHeader( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, + neutrino_locale_t caption_locale = NONEXISTANT_LOCALE, + const std::string& icon_name = std::string(), const int& buttons = 0, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, @@ -346,23 +356,4 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen, CCHeaderT CComponentsChannelLogoScalable* getChannelLogoObject(){return cch_logo_obj;} }; -//! Sub class of CComponentsHeader. -/*! -CComponentsHeaderLocalized provides prepared items like icon, caption and context button icons, mostly for usage in menues or simple windows -Caption is defined with locales. -*/ -class CComponentsHeaderLocalized : public CComponentsHeader -{ - public: - CComponentsHeaderLocalized( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, - neutrino_locale_t caption_locale = NONEXISTANT_LOCALE, - const std::string& = "", - const int& buttons = 0, - CComponentsForm *parent = NULL, - int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_FRAME_PLUS_0, - fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, - fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); -}; - #endif diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index a2ea040a2..2e59a630f 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -94,7 +94,7 @@ void CComponentsScrollBar::initVarSbForm(const int& count, const fb_pixel_t& col sb_down_obj = NULL; sb_segments_obj = NULL; - setCorner(RADIUS_NONE, CORNER_ALL); //NI + corner_type = CORNER_NONE; sb_up_icon = frameBuffer->getIconPath(NEUTRINO_ICON_BUTTON_UP) ; sb_down_icon = frameBuffer->getIconPath(NEUTRINO_ICON_BUTTON_DOWN); diff --git a/src/gui/components/cc_types.h b/src/gui/components/cc_types.h index d73bd1549..3c32c0275 100644 --- a/src/gui/components/cc_types.h +++ b/src/gui/components/cc_types.h @@ -201,12 +201,16 @@ typedef struct button_label_cc #define CC_WIDTH_MIN CFrameBuffer::getInstance()->scale2Res(16) #define CC_HEIGHT_MIN CC_WIDTH_MIN +//shadow defines #define CC_SHADOW_OFF 0x0 #define CC_SHADOW_RIGHT 0x2 #define CC_SHADOW_BOTTOM 0x4 #define CC_SHADOW_CORNER_BOTTOM_LEFT 0x8 #define CC_SHADOW_CORNER_BOTTOM_RIGHT 0x10 #define CC_SHADOW_CORNER_TOP_RIGHT 0x20 +//prepared combined shadow defines +#define CC_SHADOW_RIGHT_CORNER_ALL CC_SHADOW_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT +#define CC_SHADOW_BOTTOM_CORNER_ALL CC_SHADOW_BOTTOM | CC_SHADOW_CORNER_BOTTOM_RIGHT | CC_SHADOW_CORNER_BOTTOM_LEFT #define CC_SHADOW_ON CC_SHADOW_RIGHT | CC_SHADOW_BOTTOM | CC_SHADOW_CORNER_BOTTOM_LEFT | CC_SHADOW_CORNER_BOTTOM_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT #define CC_SAVE_SCREEN_YES true diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 8fb22635a..05768c541 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -1443,7 +1443,7 @@ void EpgPlus::paint() this->maxNumberOfDisplayableEntries, this->selectedChannelEntry == NULL ? 0 : this->selectedChannelEntry->index); - paintScrollBar(this->sliderX, this->sliderY, this->sliderWidth, this->sliderHeight, total_pages, current_page, CC_SHADOW_ON); + paintScrollBar(this->sliderX, this->sliderY, this->sliderWidth, this->sliderHeight, total_pages, current_page, CC_SHADOW_RIGHT_CORNER_ALL); } // -- EPG+ Menue Handler Class diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 9152e2977..07915b910 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -895,14 +895,15 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start // show the epg // header + logo - if (!header){ - header = new CComponentsHeader(sx, sy, ox, toph); + if (!header) + { + header = new CComponentsHeader(); header->setColorBody(COL_MENUHEAD_PLUS_0); header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction); header->enableClock(true, "%H:%M", "%H %M", true); - }else - header->setDimensionsAll(sx, sy, ox, toph); + } + header->setDimensionsAll(sx, sy, ox, toph); header->setCaptionFont(font_title); header->setCaption(epgData.title); diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 29dac9b9e..3e19dc496 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -318,7 +318,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna height = frameBuffer->getScreenHeightRel(); // Calculate header_height - header_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); //NI + header_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); footer_height = header_height; const int pic_h = 39; header_height = std::max(header_height, pic_h); @@ -851,7 +851,6 @@ void CEventList::paintDescription(int index) else CEitManager::getInstance()->getActualEPGServiceKey(evtlist[index].channelID, &epgData ); - //NI infozone_text = ""; if (!epgData.info1.empty() && !epgData.info2.empty() && (epgData.info2.find(epgData.info1) != 0)) { infozone_text += epgData.info1; @@ -890,7 +889,7 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s if (header->isPainted()) header->getChannelLogoObject()->hide(); - if (g_settings.channellist_show_channellogo) //NI + if (g_settings.channellist_show_channellogo) header->setChannelLogo(_channel_id,_channelname); header->setCaption(_channelname, CCHeaderTypes::CC_TITLE_LEFT); @@ -991,7 +990,7 @@ void CEventList::paintFoot(t_channel_id channel_id) CColorKeyHelper keyhelper; //user_menue.h neutrino_msg_t dummy = CRCInput::RC_nokey; const char * icon = NULL; - struct button_label buttons[7]; //NI + struct button_label buttons[7]; //NI //TODO dbt: add directly into footer object with setButtonLabels() int btn_cnt = 0; int tID = -1; //any value, not NULL diff --git a/src/gui/motorcontrol.cpp b/src/gui/motorcontrol.cpp index 67adbf805..1b9e38e36 100644 --- a/src/gui/motorcontrol.cpp +++ b/src/gui/motorcontrol.cpp @@ -455,7 +455,7 @@ void CMotorControl::paintStatus() void CMotorControl::paintHead() { - CComponentsHeaderLocalized header(x, y, width, hheight, LOCALE_MOTORCONTROL_HEAD); + CComponentsHeader header(x, y, width, hheight, LOCALE_MOTORCONTROL_HEAD); header.paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index b60eb53cb..a45705234 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -2583,13 +2583,20 @@ bool CMovieBrowser::onDelete(bool cursor_only) MI_MOVIE_INFO *movieinfo; movieinfo = NULL; - filelist_it = filelist.end(); - if (!cursor_only && getSelectedFiles(filelist, movielist)) - filelist_it = filelist.begin(); - if (filelist.empty()) { //just add the m_movieSelectionHandler + + if (cursor_only || (filelist.empty() || movielist.empty())) + { + filelist.clear(); + movielist.clear(); + + // just add the m_movieSelectionHandler filelist.push_back(m_movieSelectionHandler->file); movielist.push_back(m_movieSelectionHandler); } + else + { + getSelectedFiles(filelist, movielist); + } MI_MOVIE_LIST dellist; MI_MOVIE_LIST::iterator dellist_it; @@ -3420,12 +3427,10 @@ int CMovieBrowser::showMovieCutMenu() movieCutMenu.addIntroItems(LOCALE_MOVIEBROWSER_MENU_CUT_HEAD); CMenuForwarder *mf; -#if 0 mf = new CMenuForwarder(m_movieSelectionHandler->epgTitle, false); mf->setHint(NEUTRINO_ICON_HINT_MOVIE, NONEXISTANT_LOCALE); movieCutMenu.addItem(mf); movieCutMenu.addItem(GenericMenuSeparator); -#endif mf = new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_COPY_ONEFILE, true, NULL, this, "copy_onefile", CRCInput::RC_red); mf->setHint(NEUTRINO_ICON_HINT_MOVIE, LOCALE_MOVIEBROWSER_HINT_COPY_ONEFILE); @@ -3552,9 +3557,11 @@ bool CMovieBrowser::showMenu(bool calledExternally) if (!calledExternally) { CMenuWidget mainMenu(LOCALE_MOVIEBROWSER_HEAD, NEUTRINO_ICON_MOVIEPLAYER); mainMenu.addIntroItems(LOCALE_MOVIEBROWSER_MENU_MAIN_HEAD); + mainMenu.addItem(new CMenuForwarder(m_movieSelectionHandler->epgTitle, false)); + mainMenu.addItem(GenericMenuSeparator); mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_HEAD, (m_movieSelectionHandler != NULL), NULL, this, "show_movie_info_menu", CRCInput::RC_red)); mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_CUT_HEAD, (m_movieSelectionHandler != NULL), NULL, this, "show_movie_cut_menu", CRCInput::RC_green)); - mainMenu.addItem(new CMenuForwarder(LOCALE_FILEBROWSER_DELETE, (m_movieSelectionHandler != NULL), NULL, this, "delete_movie", CRCInput::RC_yellow)); + mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_DELETE_MOVIE, (m_movieSelectionHandler != NULL), NULL, this, "delete_movie", CRCInput::RC_yellow)); mainMenu.addItem(GenericMenuSeparatorLine); mainMenu.addItem(new CMenuForwarder(LOCALE_EPGPLUS_OPTIONS, true, NULL, &optionsMenu,NULL, CRCInput::RC_1)); mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_DIRECTORIES_HEAD, true, NULL, &dirMenu, NULL, CRCInput::RC_2)); diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index d454ea0f9..b1cf1db3a 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -713,7 +713,7 @@ void CPictureViewerGui::paintItem(int pos) void CPictureViewerGui::paintHead() { - CComponentsHeaderLocalized header(x, y, width, header_height, LOCALE_PICTUREVIEWER_HEAD, NEUTRINO_ICON_PICTUREVIEWER, CComponentsHeaderLocalized::CC_BTN_HELP); + CComponentsHeader header(x, y, width, header_height, LOCALE_PICTUREVIEWER_HEAD, NEUTRINO_ICON_PICTUREVIEWER, CComponentsHeader::CC_BTN_HELP); header.enableShadow(CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); #ifdef ENABLE_GUI_MOUNT diff --git a/src/gui/record_setup.cpp b/src/gui/record_setup.cpp index 921aeab9d..5c9cf7a00 100644 --- a/src/gui/record_setup.cpp +++ b/src/gui/record_setup.cpp @@ -318,7 +318,7 @@ int CRecordSetup::showRecordSetup() void CRecordSetup::showRecordTimerSetup(CMenuWidget *menu_timersettings) { //recording start/end correcture - int pre,post; + int pre = 0,post = 0; g_Timerd->getRecordingSafety(pre,post); g_settings.record_safety_time_before = pre/60; g_settings.record_safety_time_after = post/60; diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index 49ba8ae1a..e679b4ba0 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -357,7 +357,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) perror(NEUTRINO_SCAN_STOP_SCRIPT " failed"); } if(!test) { - CComponentsHeaderLocalized header(x, y, width, hheight, success ? LOCALE_SCANTS_FINISHED : LOCALE_SCANTS_FAILED); + CComponentsHeader header(x, y, width, hheight, success ? LOCALE_SCANTS_FINISHED : LOCALE_SCANTS_FAILED); header.paint(CC_SAVE_SCREEN_NO); uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(0xFFFF); do { @@ -521,7 +521,7 @@ void CScanTs::paintLine(int px, int py, int w, const char * const txt) void CScanTs::paint(bool fortest) { - CComponentsHeaderLocalized header(x, y, width, hheight, fortest ? LOCALE_SCANTS_TEST : LOCALE_SCANTS_HEAD); + CComponentsHeader header(x, y, width, hheight, fortest ? LOCALE_SCANTS_TEST : LOCALE_SCANTS_HEAD); header.setCaptionAlignment(CCHeaderTypes::CC_TITLE_CENTER); header.paint(CC_SAVE_SCREEN_NO); diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 74bf9ea19..f0407ecc3 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -272,11 +272,14 @@ CTimerList::CTimerList() visible = false; x = y = 0; width = height = 0; - fheight = theight = 0; - footerHeight = 0; + header_height = 0; + font_height = 0; + item_height = 0; + footer_height = 0; selected = 0; liststart = 0; listmaxshow = 0; + header = NULL; Timer = new CTimerdClient(); timerNew_message = ""; timerNew_pluginName = ""; @@ -439,7 +442,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) } else if ((strcmp(key, "send_remotetimer") == 0) && RemoteBoxChanExists(timerlist[selected].channel_id)) { - int pre,post; + int pre = 0,post = 0; Timer->getRecordingSafety(pre,post); CHTTPTool httpTool; std::string r_url; @@ -673,27 +676,23 @@ void CTimerList::updateEvents(void) RemoteBoxTimerList (timerlist); sort(timerlist.begin(), timerlist.end()); - theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); - fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); - //get footerHeight from paintButtons - footerHeight = ::paintButtons(TimerListButtons, TimerListButtonsCount, 0, 0, 0, 0, 0, false); + header_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + font_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); + item_height = 2*font_height + 1; // + 1 for separationline + footer_height = header_height; - //width = w_max(g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getWidth()*56, 20); - width = frameBuffer->getScreenWidth()*0.9; - height = frameBuffer->getScreenHeight() - (2*theight); // max height - - listmaxshow = (height-theight)/(fheight*2); - height = theight+listmaxshow*fheight*2+footerHeight; // recalc height + width = frameBuffer->getScreenWidth()/100 * 90; + height = frameBuffer->getScreenHeight(); + listmaxshow = (height - header_height - footer_height - OFFSET_SHADOW) / item_height; if (timerlist.size() < listmaxshow) - { - listmaxshow=timerlist.size(); - height = theight+listmaxshow*fheight*2+footerHeight; // recalc height - } + listmaxshow = timerlist.size(); + + height = header_height + item_height*listmaxshow + footer_height + OFFSET_SHADOW; // recalc height if (!timerlist.empty() && selected == (int)timerlist.size()) { - selected=timerlist.size()-1; + selected = timerlist.size() - 1; liststart = (selected/listmaxshow)*listmaxshow; } @@ -1085,6 +1084,12 @@ void CTimerList::hide() { if (visible) { + if (header) + { + header->kill(); + delete header; + header = NULL; + } frameBuffer->paintBackgroundBoxRel(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW); visible = false; } @@ -1130,12 +1135,12 @@ bool CTimerList::RemoteBoxSetup() void CTimerList::paintItem(int pos) { - int ypos = y+ theight+ pos*fheight*2; + int ypos = y + header_height + pos*item_height; - int real_width=width; + int real_width = width; if (timerlist.size() > listmaxshow) { - real_width -= SCROLLBAR_WIDTH; //scrollbar + real_width -= SCROLLBAR_WIDTH; } unsigned int currpos = liststart + pos; @@ -1154,10 +1159,18 @@ void CTimerList::paintItem(int pos) i_radius = RADIUS_LARGE; if (i_radius) - frameBuffer->paintBoxRel(x, ypos, real_width, 2*fheight, COL_MENUCONTENT_PLUS_0); - frameBuffer->paintBoxRel(x, ypos, real_width, 2*fheight, bgcolor, i_radius); + frameBuffer->paintBoxRel(x, ypos, real_width, item_height, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x, ypos, real_width, item_height, bgcolor, i_radius); + // separationline + frameBuffer->paintHLineRel(x, real_width, ypos + item_height - 1, (pos + 1 == (int) listmaxshow) ? bgcolor : COL_MENUCONTENTDARK_PLUS_0); //shadow - frameBuffer->paintBoxRel(x + width, ypos, OFFSET_SHADOW, 2*fheight, COL_SHADOW_PLUS_0); + frameBuffer->paintBoxRel(x + width, ypos + OFFSET_SHADOW, OFFSET_SHADOW, item_height, COL_SHADOW_PLUS_0); + + int line1_y = ypos + 1*font_height; + int line2_y = ypos + 2*font_height; + + int digit_width = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getMaxDigitWidth(); + int time_width = 8*digit_width + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(".. :"); // keep in sync with strftime-lines below if (currpos < timerlist.size()) { @@ -1170,33 +1183,34 @@ void CTimerList::paintItem(int pos) } char zAlarmTime[25] = {0}; struct tm *alarmTime = localtime(&(timer.alarmTime)); - strftime(zAlarmTime,20,"%d.%m. %H:%M",alarmTime); + strftime(zAlarmTime, 20, "%d.%m. %H:%M", alarmTime); char zStopTime[25] = {0}; struct tm *stopTime = localtime(&(timer.stopTime)); - strftime(zStopTime,20,"%d.%m. %H:%M",stopTime); - int fw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getWidth(); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10,ypos+fheight, fw*12, zAlarmTime, color, fheight); - if (timer.stopTime != 0) - { - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10,ypos+2*fheight, fw*12, zStopTime, color, fheight); - } - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13,ypos+fheight, (real_width-fw*13)/2-5, convertTimerRepeat2String(timer.eventRepeat), color, fheight); + strftime(zStopTime, 20, "%d.%m. %H:%M", stopTime); + // paint start/stop times + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + OFFSET_INNER_MID, line1_y, time_width, zAlarmTime, color, font_height); + if (timer.stopTime != 0) + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + OFFSET_INNER_MID, line2_y, time_width, zStopTime, color, font_height); + + // paint timer-type + std::string t_type = (timer.eventType == CTimerd::TIMER_REMOTEBOX) ? std::string(convertTimerType2String(timer.eventType)) + " (" + std::string(timer.remotebox_name) + ")" : convertTimerType2String(timer.eventType); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + OFFSET_INNER_MID + time_width + OFFSET_INNER_MID, line1_y, real_width - time_width - 3*OFFSET_INNER_MID, t_type, color, font_height); + + // paint repeat-type/count + std::string t_repeat = convertTimerRepeat2String(timer.eventRepeat); if (timer.eventRepeat != CTimerd::TIMERREPEAT_ONCE) { - char srepeatcount[25] = {0}; if (timer.repeatCount == 0) - { - // Unicode 8734 (hex: 221E) not available in all fonts - //sprintf(srepeatcount,"∞"); - sprintf(srepeatcount,"00"); - } + t_repeat += ", oo"; // Unicode 8734 (hex: 221E) not available in all fonts else - sprintf(srepeatcount,"%ux",timer.repeatCount); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13+(real_width-fw*23)/2,ypos+fheight, (real_width-fw*13)/2-5, srepeatcount, color, fheight); + t_repeat += ", " + to_string(timer.repeatCount) + "x"; } - std::string t_type = (timer.eventType == CTimerd::TIMER_REMOTEBOX) ? std::string(convertTimerType2String(timer.eventType)) + " (" + std::string(timer.remotebox_name) + ")" : convertTimerType2String(timer.eventType); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13+(real_width-fw*13)/2,ypos+fheight, (real_width-fw*13)/2-5, t_type, color, fheight); + int t_repeat_width = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(t_repeat); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + real_width - OFFSET_INNER_MID - t_repeat_width, line1_y, t_repeat_width, t_repeat, color, font_height); + + int icon_w, icon_h; + frameBuffer->getIconSize(NEUTRINO_ICON_REC, &icon_w, &icon_h); // paint rec icon when recording in progress if ((timer.eventType == CTimerd::TIMER_RECORD) && (CRecordManager::getInstance()->RecordingStatus(timer.channel_id))) @@ -1206,23 +1220,14 @@ void CTimerList::paintItem(int pos) recinfo.eventID = timer.eventID; if (CRecordManager::getInstance()->IsRecording(&recinfo)) { - int icol_w, icol_h; - frameBuffer->getIconSize(NEUTRINO_ICON_REC, &icol_w, &icol_h); - if ((icol_w > 0) && (icol_h > 0)) - { - frameBuffer->paintIcon(NEUTRINO_ICON_REC, (x + real_width) - (icol_w + 8), ypos, 2*fheight); - } + if (icon_w && icon_h) + frameBuffer->paintIcon(NEUTRINO_ICON_REC, x + real_width - OFFSET_INNER_MID - icon_w, line1_y, font_height); } } - - if ((timer.eventType == CTimerd::TIMER_REMOTEBOX) && timer.eventState == CTimerd::TIMERSTATE_ISRUNNING) + else if ((timer.eventType == CTimerd::TIMER_REMOTEBOX) && timer.eventState == CTimerd::TIMERSTATE_ISRUNNING) { - int icol_w, icol_h; - frameBuffer->getIconSize(NEUTRINO_ICON_REC, &icol_w, &icol_h); - if ((icol_w > 0) && (icol_h > 0)) - { - frameBuffer->paintIcon(NEUTRINO_ICON_REC, (x + real_width) - (icol_w + 8), ypos, 2*fheight); - } + if (icon_w && icon_h) + frameBuffer->paintIcon(NEUTRINO_ICON_REC, x + real_width - OFFSET_INNER_MID - icon_w, line1_y, font_height); } std::string zAddData(""); @@ -1233,7 +1238,7 @@ void CTimerList::paintItem(int pos) case CTimerd::TIMER_RECORD : { zAddData = convertChannelId2String(timer.channel_id); // UTF-8 - zAddData += timer.channel_ci?"(CI)":""; //NI + zAddData += timer.channel_ci ? " (CI)" : ""; //NI if (timer.apids != TIMERD_APIDS_CONF) { std::string sep = ""; @@ -1348,46 +1353,47 @@ void CTimerList::paintItem(int pos) default: {} } - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13,ypos+2*fheight, real_width-(fw*13+5), zAddData, color, fheight); + + // paint timer-name + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + OFFSET_INNER_MID + time_width + OFFSET_INNER_MID, line2_y, real_width - time_width - 3*OFFSET_INNER_MID, zAddData, color, font_height); + // LCD Display if (currpos == (unsigned) selected) { - std::string line1 = convertTimerType2String(timer.eventType); // UTF-8 - //std::string line2 = zAlarmTime; + std::string line1 = convertTimerType2String(timer.eventType); switch (timer.eventType) { - case CTimerd::TIMER_RECORD : - // line2+= " -"; - // line2+= zStopTime+6; - //case CTimerd::TIMER_NEXTPROGRAM : - case CTimerd::TIMER_ZAPTO : - { - line1 += ' '; - line1 += convertChannelId2String(timer.channel_id); // UTF-8 + case CTimerd::TIMER_RECORD : + case CTimerd::TIMER_ZAPTO : + { + line1 += ' '; + line1 += convertChannelId2String(timer.channel_id); + break; + } + case CTimerd::TIMER_STANDBY : + { + if (timer.standby_on) + line1 += " ON"; + else + line1 += " OFF"; + break; + } + default: + ; } - break; - case CTimerd::TIMER_STANDBY : - { - if (timer.standby_on) - line1+=" ON"; - else - line1+=" OFF"; - } - break; - default: - ; - } - CVFD::getInstance()->showMenuText(0, line1.c_str(), -1, true); // UTF-8 - //CVFD::getInstance()->showMenuText(1, line2.c_str(), -1, true); // UTF-8 + CVFD::getInstance()->showMenuText(0, line1.c_str(), -1, true); } } } void CTimerList::paintHead() { - CComponentsHeaderLocalized header(x, y, width, theight, LOCALE_TIMERLIST_NAME, NEUTRINO_ICON_TIMER, CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT, NULL, CC_SHADOW_ON); - header.enableClock(true, " %d.%m.%Y %H:%M "); - header.paint(CC_SAVE_SCREEN_NO); + if (header == NULL) + { + header = new CComponentsHeader(x, y, width, header_height, LOCALE_TIMERLIST_NAME, NEUTRINO_ICON_TIMER, CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT, NULL, CC_SHADOW_ON); + header->enableClock(true, " %d.%m.%Y - %H:%M ", NULL, false); + } + header->paint(CC_SAVE_SCREEN_NO); } void CTimerList::paintFoot() @@ -1397,24 +1403,25 @@ void CTimerList::paintFoot() 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_ZAPTO) //NI + //replace info button with dummy if timer is not type REC or ZAP + if (timer->eventType == CTimerd::TIMER_RECORD || 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); int c = TimerListButtonsCount; if (g_settings.timer_remotebox_ip.size() == 0) c--; // reduce play button + CComponentsFooter footer; + footer.enableShadow(CC_SHADOW_ON, -1, true); + if (timerlist.empty()) - ::paintButtons(x, y + height - footerHeight, width, 2, &(TimerListButtons[1]), width); + footer.paintButtons(x, y + height - OFFSET_SHADOW - footer_height, width, footer_height, 2, &(TimerListButtons[1])); else - ::paintButtons(x, y + height - footerHeight, width, c, TimerListButtons, width); + footer.paintButtons(x, y + height - OFFSET_SHADOW - footer_height, width, footer_height, c, TimerListButtons); } void CTimerList::paint() @@ -1426,8 +1433,9 @@ void CTimerList::paint() CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, g_Locale->getText(LOCALE_TIMERLIST_NAME)); paintHead(); - frameBuffer->paintBoxRel(x, y + theight, width, height - theight - footerHeight, COL_MENUCONTENT_PLUS_0); //NI - paintFoot(); //NI + // paint plain background and footer first to avoid flicker effects while timerlist construction + frameBuffer->paintBoxRel(x, y + header_height, width, item_height*listmaxshow, COL_MENUCONTENT_PLUS_0); + paintFoot(); for (unsigned int count=0; countsetMode(CVFD::MODE_MENU_UTF8, "Select UPnP Device"); // Head - CComponentsHeaderLocalized header(m_x, m_header_y, m_width, m_header_height, LOCALE_UPNPBROWSER_HEAD, NEUTRINO_ICON_UPNP); + CComponentsHeader header(m_x, m_header_y, m_width, m_header_height, LOCALE_UPNPBROWSER_HEAD, NEUTRINO_ICON_UPNP); header.enableShadow( CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); if (CNeutrinoApp::getInstance()->isMuted()) //TODO: consider mute mode on runtime header.addContextButton(NEUTRINO_ICON_BUTTON_MUTE_SMALL); diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index 8cf301594..ee2985c04 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -124,6 +124,7 @@ CProgressBar* CProgressWindow::getProgressItem() pBar->setActiveColor(COL_PROGRESSBAR_ACTIVE_PLUS_0); pBar->setFrameThickness(1); pBar->setColorFrame(COL_PROGRESSBAR_ACTIVE_PLUS_0); + pBar->setType(CProgressBar::PB_TIMESCALE); addWindowItem(pBar); return pBar; @@ -132,7 +133,6 @@ CProgressBar* CProgressWindow::getProgressItem() void CProgressWindow::initStatus(const unsigned int prog, const unsigned int max, const string &statusText, CProgressBar *pBar) { pBar->allowPaint(true); - unsigned int cur_perc = prog*100/(max+1); pBar->setValues(prog, (int)max); if (!statusText.empty() && (cur_statusText != statusText)){ showStatusMessageUTF(statusText); diff --git a/src/system/locals.h b/src/system/locals.h index 590eb8b0d..7673ac49d 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1880,6 +1880,7 @@ typedef enum LOCALE_MOVIEBROWSER_CUTTING, LOCALE_MOVIEBROWSER_DELETE_ALL, LOCALE_MOVIEBROWSER_DELETE_INFO, + LOCALE_MOVIEBROWSER_DELETE_MOVIE, LOCALE_MOVIEBROWSER_DELETE_SCREENSHOT, LOCALE_MOVIEBROWSER_DIR, LOCALE_MOVIEBROWSER_DIRECTORIES, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 6026eb803..67055ca4a 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1880,6 +1880,7 @@ const char * locale_real_names[] = "moviebrowser.cutting", "moviebrowser.delete_all", "moviebrowser.delete_info", + "moviebrowser.delete_movie", "moviebrowser.delete_screenshot", "moviebrowser.dir", "moviebrowser.directories", diff --git a/src/timerd/timerd.cpp b/src/timerd/timerd.cpp index 7338d7935..8f2a03637 100644 --- a/src/timerd/timerd.cpp +++ b/src/timerd/timerd.cpp @@ -308,7 +308,7 @@ bool timerd_parse_command(CBasicMessage::Header &rmsg, int connfd) CBasicServer::receive_data(connfd, &recInfo, sizeof(CTimerd::TransferRecordingInfo)); if(recInfo.recordingSafety) { - int pre,post; + int pre = 0,post = 0; CTimerManager::getInstance()->getRecordingSafety(pre,post); msgAddTimer.announceTime -= pre; msgAddTimer.alarmTime -= pre; diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index feb437eb5..4b8e5a246 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -332,7 +332,7 @@ int CTimerManager::modifyEvent(int peventID, time_t announceTime, time_t alarmTi CTimerEvent *event = events[peventID]; event->announceTime = announceTime; event->alarmTime = alarmTime; - event->stopTime = stopTime; + event->stopTime = (event->eventType == CTimerd::TIMER_RECORD) ? stopTime : 0; if(event->eventState==CTimerd::TIMERSTATE_PREANNOUNCE) event->eventState = CTimerd::TIMERSTATE_SCHEDULED; event->eventRepeat = evrepeat; @@ -1359,7 +1359,7 @@ bool CTimerEvent_Record::adjustToCurrentEPG() CChannelEventList evtlist; CEitManager::getInstance()->getEventsServiceKey(eventInfo.channel_id, evtlist); - int pre, post; + int pre = 0, post = 0; CTimerManager::getInstance()->getRecordingSafety(pre, post); time_t _announceTime = announceTime;