diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 65c56ab7a..8c0bf9ed3 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1669,6 +1669,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 641d0ddc3..710c63ada 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1669,6 +1669,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/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 77b69041c..7d5a01119 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1603,7 +1603,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..6c8486bc0 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); } diff --git a/src/gui/bookmarkmanager.cpp b/src/gui/bookmarkmanager.cpp index c46559423..7ea3d68c7 100644 --- a/src/gui/bookmarkmanager.cpp +++ b/src/gui/bookmarkmanager.cpp @@ -412,7 +412,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_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 e1dd05f66..1d634c3cd 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_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 1c4107a65..bcece667b 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 159be07cb..3bd6e1117 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -850,14 +850,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/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 b437c0c41..973da208f 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -2479,13 +2479,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.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; @@ -3312,12 +3319,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); @@ -3444,9 +3449,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 0789d781a..e1e330b00 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -702,7 +702,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/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 816bc5116..1899080a6 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 = ""; @@ -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; + 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,43 +1159,50 @@ 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); //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()) { CTimerd::responseGetTimer & timer = timerlist[currpos]; 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))) @@ -1200,23 +1212,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(""); @@ -1341,46 +1344,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() @@ -1390,24 +1394,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 + //replace info button with dummy if timer is not type REC or ZAP if (timer->eventType == CTimerd::TIMER_RECORD || timer->eventType == CTimerd::TIMER_REMOTEBOX || timer->eventType == CTimerd::TIMER_ZAPTO) TimerListButtons[4].button = NEUTRINO_ICON_BUTTON_INFO_SMALL; else TimerListButtons[4].button = NEUTRINO_ICON_BUTTON_DUMMY_SMALL; } } - //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() @@ -1429,7 +1434,7 @@ void CTimerList::paint() int total_pages; int current_page; getScrollBarData(&total_pages, ¤t_page, timerlist.size(), listmaxshow, selected); - paintScrollBar(x + width - SCROLLBAR_WIDTH, y + theight, SCROLLBAR_WIDTH, 2*fheight*listmaxshow, total_pages, current_page); + paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page); } paintFoot(); diff --git a/src/gui/timerlist.h b/src/gui/timerlist.h index d58b0a8a9..e8a30af1f 100644 --- a/src/gui/timerlist.h +++ b/src/gui/timerlist.h @@ -51,13 +51,15 @@ class CTimerList : public CMenuTarget, public CListHelpers int y; int width; int height; - int fheight; // fontheight content - int theight; // fontheight titel - int footerHeight; + int font_height; + int item_height; + int header_height; + int footer_height; int selected; int liststart; unsigned int listmaxshow; bool visible; + CComponentsHeader *header; int httpConnectTimeout; CTimerdClient *Timer; diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index b8c3d5878..dbfcf8aa7 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -986,7 +986,7 @@ void CUpnpBrowserGui::paintDevices() CVFD::getInstance()->setMode(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/system/locals.h b/src/system/locals.h index a7147a146..f62dff5e9 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1696,6 +1696,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 adb7a51b0..ea6d87aac 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1696,6 +1696,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/timermanager.cpp b/src/timerd/timermanager.cpp index 8998ea2d2..82051b394 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;