diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index ce321544b..f53fcc5e5 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -518,6 +518,344 @@ bool CEpgData::isCurrentEPG(const t_channel_id channel_id) return false; } +int CEpgData::show_mp(MI_MOVIE_INFO *mp_movie_info, int /*mp_position*/, int /*mp_duration*/, bool doLoop) +{ + int res = menu_return::RETURN_REPAINT; + static uint64_t channel_id = 0; + std::string tmdb_str = ""; + + if (mp_movie_info == NULL) + return res; + + channel_id = mp_movie_info->epgEpgId >>16; + + epgText.clear(); + + if (doLoop) + { + if (!bigFonts && g_settings.bigFonts) { + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]->getSize() * BIG_FONT_FAKTOR)); + g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->setSize((int)(g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO2]->getSize() * BIG_FONT_FAKTOR)); + } + bigFonts = g_settings.bigFonts; + start(); + } + + tmdbtoggle = false; + stars = 0; + tmdb_str = mp_movie_info->epgInfo2; + + CComponentsHeader* _header = NULL; + CComponentsPicture* headerPic = NULL; + CComponentsText* headerText = NULL; + + if (mp_movie_info->epgTitle.empty()) /* no epg info found */ + { + ShowHint(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_EPGVIEWER_NOTFOUND)); // UTF-8 + hide(); + return res; + } + // Calculate offset for the title when logo appears. + int pic_offx = 0; + std::string lname; + int logo_w = 0; + int logo_h = 0; + int logo_w_max = ox / 4; + if(channel_id) { + if(g_settings.infobar_show_channellogo && g_PicViewer->GetLogoName(channel_id, mp_movie_info->epgChannel, lname, &logo_w, &logo_h)) { + if((logo_h > (toph-4)) || (logo_w > logo_w_max)) { + g_PicViewer->rescaleImageDimensions(&logo_w, &logo_h, logo_w_max, toph-4); + } + pic_offx = logo_w + 10; + } + } + + int pos; + std::string text1 = mp_movie_info->epgTitle; + std::string text2 = ""; + if (g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->getRenderWidth(text1) > ox - pic_offx - 18) + { + do + { + pos = text1.find_last_of("[ .]+"); + if (pos != -1) + text1 = text1.substr(0, pos); + } while ((pos != -1) && (g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->getRenderWidth(text1) > ox - pic_offx - 18)); + if (mp_movie_info->epgTitle.length() > text1.length()) // shold never be false in this place + text2 = mp_movie_info->epgTitle.substr(text1.length()+ 1, uint(-1) ); + } + + const int pic_h = 39; + + if (!text2.empty()) + toph = 2 * topboxheight; + else + toph = topboxheight; + + toph = std::max(toph, pic_h); + + sb = oy - toph ; + + // 21.07.2005 - rainerk + // Only show info1 if it's not included in info2! + std::string strEpisode = ""; // Episode title in case info1 gets stripped + if (!mp_movie_info->epgInfo1.empty()) { + bool bHide = false; + if (false == mp_movie_info->epgInfo2.empty()) { + // Look for the first . in info1, usually this is the title of an episode. + std::string::size_type nPosDot = mp_movie_info->epgInfo1.find('.'); + if (std::string::npos != nPosDot) { + nPosDot += 2; // Skip dot and first blank + if (nPosDot < mp_movie_info->epgInfo2.length() && nPosDot < mp_movie_info->epgInfo1.length()) { // Make sure we don't overrun the buffer + + // Check if the stuff after the dot equals the beginning of info2 + if (0 == mp_movie_info->epgInfo2.find(mp_movie_info->epgInfo1.substr(nPosDot, mp_movie_info->epgInfo1.length() - nPosDot))) { + strEpisode = mp_movie_info->epgInfo1.substr(0, nPosDot) + "\n"; + bHide = true; + } + } + } + // Compare strings normally if not positively found to be equal before + if (false == bHide && 0 == mp_movie_info->epgInfo2.find(mp_movie_info->epgInfo1)) { + bHide = true; + } + } + if (false == bHide) { + processTextToArray(mp_movie_info->epgInfo1); + } + } + + info1_lines = epgText.size(); + + //scan epg-data - sort to list + if ((mp_movie_info->epgInfo2.empty()) && (info1_lines == 0)) + processTextToArray(g_Locale->getText(LOCALE_EPGVIEWER_NODETAILED)); // UTF-8 + else + processTextToArray(strEpisode + mp_movie_info->epgInfo2); + + // Add a blank line + processTextToArray(""); + + // Show FSK information + if (mp_movie_info->parentalLockAge > 0) + { + char fskInfo[4]; + sprintf(fskInfo, "%d", mp_movie_info->parentalLockAge); + processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_AGE_RATING)) + ": " + fskInfo); // UTF-8 + } + + // Show length information + char lengthInfo[11]; + sprintf(lengthInfo, "%d", mp_movie_info->length); + processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_LENGTH)) + ": " + lengthInfo); // UTF-8 + + // Show audio information + std::string audioInfo = ""; + std::vector tags = mp_movie_info->audioPids; + if (tags.size()) + { + for (unsigned int i = 0; i < tags.size(); i++) + if (!tags[i].epgAudioPidName.empty()) + audioInfo += tags[i].epgAudioPidName + ", "; + + if (!audioInfo.empty()) + { + audioInfo.erase(audioInfo.size()-2); + processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_AUDIO)) + ": " + audioInfo); // UTF-8 + } + } + + // Show genre information +#ifdef FULL_CONTENT_CLASSIFICATION + if (!mp_movie_info->genreMajor.empty()) + processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_GENRE)) + ": " + GetGenre(mp_movie_info->genreMajor[0])); // UTF-8 +// processTextToArray( epgData.userClassification.c_str() ); +#else + if (mp_movie_info->genreMajor) + processTextToArray(std::string(g_Locale->getText(LOCALE_EPGVIEWER_GENRE)) + ": " + GetGenre(mp_movie_info->genreMajor)); // UTF-8 +#endif + + COSDFader fader(g_settings.theme.menu_Content_alpha); + fader.StartFadeIn(); + + //show the epg + // header + logo + int header_h = std::max(toph, logo_h); + _header = new CComponentsHeader(sx, sy, ox, header_h); + if (pic_offx > 0) { + headerPic = new CComponentsPicture(sx+10, sy + (header_h-logo_h)/2, logo_w, logo_h, lname); + headerPic->doPaintBg(false); + } + std::string textAll = (!text2.empty()) ? text1 + "\n" + text2 : text1; + headerText = new CComponentsText(sx+15+pic_offx, sy, ox-15-pic_offx, header_h, textAll, CTextBox::NO_AUTO_LINEBREAK, g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]); + headerText->doPaintBg(false); + headerText->setTextColor(COL_MENUHEAD_TEXT); + _header->paint(CC_SAVE_SCREEN_NO); + headerText->paint(CC_SAVE_SCREEN_NO); + if (headerPic) + headerPic->paint(CC_SAVE_SCREEN_NO); + + int showPos = 0; + textCount = epgText.size(); + showText(showPos, sy + toph); + + // show Button + const struct button_label Button[] = + { + { NEUTRINO_ICON_BUTTON_RED , LOCALE_EPG_SAVING }, + { NEUTRINO_ICON_BUTTON_INFO_SMALL , LOCALE_CHANNELLIST_ADDITIONAL } + }; + int icol_w, icol_h; + int fh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getHeight(); + frameBuffer->getIconSize(NEUTRINO_ICON_BUTTON_RED, &icol_w, &icol_h); + int h = std::max(fh, icol_h+4); + int aw = ox - 20 - 2 * (ICON_LARGE_WIDTH + 2); + frameBuffer->paintBoxRel(sx,sy+oy,ox,h, COL_INFOBAR_SHADOW_PLUS_1, RADIUS_LARGE, CORNER_BOTTOM); + if (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") + ::paintButtons(sx + 10, sy+oy, 0, 2, Button, aw, h, "", false, COL_INFOBAR_SHADOW_TEXT, NULL, 1); + +#if 0 + int height = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight(); + //show progressbar + epg_done = mp_position/mp_duration*100; + if ( epg_done > 0 ) + { + int pbx = sx + 10 /*+ widthl */+ 10 + ((ox-104/*-widthr-widthl*/-10-10-20)>>1); + CProgressBar pb(pbx, sy+oy-height, 104, height-6); + pb.setType(CProgressBar::PB_TIMESCALE); + pb.setValues(epg_done, 100); + pb.paint(false); + } +#endif + + frameBuffer->blit(); + if ( doLoop ) + { + neutrino_msg_t msg = 0; + neutrino_msg_data_t data = 0; + + int scrollCount = 0; + + bool loop = true; + + uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); + + while (loop) + { + g_RCInput->getMsgAbsoluteTimeout( &msg, &data, &timeoutEnd ); + if ( msg <= CRCInput::RC_MaxRC ) + timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); + + scrollCount = medlinecount; + + switch ( msg ) + { + case NeutrinoMessages::EVT_TIMER: + if(data == fader.GetFadeTimer()) { + if(fader.FadeDone()) + loop = false; + } + else + CNeutrinoApp::getInstance()->handleMsg(msg, data); + break; + case CRCInput::RC_down: + if (showPos+scrollCountepgTitle); + if ((tmdb->getResults() > 0) && (!tmdb->getDescription().empty())) { + epgText_saved = epgText; + epgText.clear(); + tmdbtoggle = !tmdbtoggle; + tmdb_str = tmdb->getDescription(); + if (!tmdb->getCast().empty()) + tmdb_str += "\n\n"+(std::string)g_Locale->getText(LOCALE_EPGEXTENDED_ACTORS)+":\n"+ tmdb->getCast()+"\n"; + processTextToArray(tmdb->CreateEPGText(), 0, tmdb->hasCover()); + textCount = epgText.size(); + stars = tmdb->getStars(); + showText(showPos, sy + toph, tmdbtoggle); + } else { + ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_EPGVIEWER_NODETAILED, CMessageBox::mbrOk , CMessageBox::mbrOk); + } + delete tmdb; + } else { + epgText = epgText_saved; + textCount = epgText.size(); + tmdbtoggle = !tmdbtoggle; + stars=0; + showText(showPos, sy + toph); + } + } + break; + } + case CRCInput::RC_red: + { + if (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") + break; + else if (tmdbtoggle) { + mp_movie_info->epgInfo2 = tmdb_str; + } + } + case CRCInput::RC_help: + case CRCInput::RC_ok: + case CRCInput::RC_timeout: + if(fader.StartFadeOut()) { + timeoutEnd = CRCInput::calcTimeoutEnd( 1 ); + msg = 0; + } else + loop = false; + break; + + default: + // konfigurierbare Keys handlen... + if (msg == (neutrino_msg_t)g_settings.key_channelList_cancel) { + if(fader.StartFadeOut()) { + timeoutEnd = CRCInput::calcTimeoutEnd( 1 ); + msg = 0; + } else + loop = false; + } + else + { + if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) + { + loop = false; + res = menu_return::RETURN_EXIT_ALL; + } + } + } + frameBuffer->blit(); + } + hide(); + fader.StopFade(); + } + if (headerPic) + delete headerPic; + if (headerText) + delete headerText; + if (_header) + delete _header; + + return res; +} + int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_startzeit, bool doLoop, bool callFromfollowlist ) { int res = menu_return::RETURN_REPAINT; @@ -1012,27 +1350,29 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start epgText = epgText_saved; textCount = epgText.size(); } - showPos = 0; - if (!tmdbtoggle) { - cTmdb* tmdb = new cTmdb(epgData.title); - if ((tmdb->getResults() > 0) && (!tmdb->getDescription().empty())) { - epgText_saved = epgText; - epgText.clear(); - tmdbtoggle = !tmdbtoggle; - processTextToArray(tmdb->CreateEPGText(), 0, tmdb->hasCover()); - textCount = epgText.size(); - stars = tmdb->getStars(); - showText(showPos, sy + toph, tmdbtoggle); + if (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"){ + showPos = 0; + if (!tmdbtoggle) { + cTmdb* tmdb = new cTmdb(epgData.title); + if ((tmdb->getResults() > 0) && (!tmdb->getDescription().empty())) { + epgText_saved = epgText; + epgText.clear(); + tmdbtoggle = !tmdbtoggle; + processTextToArray(tmdb->CreateEPGText(), 0, tmdb->hasCover()); + textCount = epgText.size(); + stars = tmdb->getStars(); + showText(showPos, sy + toph, tmdbtoggle); + } else { + ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_EPGVIEWER_NODETAILED, CMessageBox::mbrOk , CMessageBox::mbrOk); + } + delete tmdb; } else { - ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_EPGVIEWER_NODETAILED, CMessageBox::mbrOk , CMessageBox::mbrOk); + epgText = epgText_saved; + textCount = epgText.size(); + tmdbtoggle = !tmdbtoggle; + stars=0; + showText(showPos, sy + toph); } - delete tmdb; - } else { - epgText = epgText_saved; - textCount = epgText.size(); - tmdbtoggle = !tmdbtoggle; - stars=0; - showText(showPos, sy + toph); } break; } diff --git a/src/gui/epgview.h b/src/gui/epgview.h index b33ec8fc6..71c8cff47 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -40,6 +40,7 @@ #include //NI #include +#include #include "widget/menue.h" #include @@ -109,6 +110,7 @@ class CEpgData ~CEpgData(); void start( ); int show(const t_channel_id channel_id, uint64_t id = 0, time_t* startzeit = NULL, bool doLoop = true, bool callFromfollowlist = false ); + int show_mp(MI_MOVIE_INFO *mp_movie_info, int mp_position = 1, int mp_duration = 1, bool doLoop = true); void hide(); }; diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 4cf390af8..ee20f30de 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1077,6 +1077,13 @@ void CInfoViewer::loop(bool show_dot) g_RCInput->postMsg (msg, 0); res = messages_return::cancel_info; } else if (msg == CRCInput::RC_info) { //NI + if (fileplay) + { + CMoviePlayerGui::getInstance().setFromInfoviewer(true); + g_RCInput->postMsg (msg, data); + hideIt = true; + } + else g_RCInput->postMsg (NeutrinoMessages::SHOW_EPG, 0); res = messages_return::cancel_info; } else if ((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetFadeTimer())) { diff --git a/src/gui/lua/lua_video.cpp b/src/gui/lua/lua_video.cpp index c7df7912d..fd25aeda2 100644 --- a/src/gui/lua/lua_video.cpp +++ b/src/gui/lua/lua_video.cpp @@ -153,6 +153,23 @@ int CLuaInstVideo::PlayFile(lua_State *L) printf("CLuaInstVideo::%s: not enough arguments (%d, expected 3)\n", __func__, numargs); return 0; } + const char *errmsg = "is not a string."; + if(!lua_isstring(L,2)){ + printf("CLuaInstVideo::%s: argument 1 %s\n", __func__, errmsg); + return 0; + } + if(!lua_isstring(L,3)){ + printf("CLuaInstVideo::%s: argument 2 %s\n", __func__, errmsg); + return 0; + } + if(numargs > 3 && !lua_isstring(L,4)){ + printf("CLuaInstVideo::%s: argument 3 %s\n", __func__, errmsg); + return 0; + } + if(numargs > 4 && !lua_isstring(L,5)){ + printf("CLuaInstVideo::%s: argument 4 %s\n", __func__, errmsg); + return 0; + } bool sp = false; if (luaL_testudata(L, 1, LUA_CLASSNAME) == NULL) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 632cfc7f0..6961e6108 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -46,6 +46,7 @@ #include "moviebrowser.h" #include "filebrowser.h" #include +#include #include #include #include @@ -1945,11 +1946,33 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) else if (msg == (neutrino_msg_t) g_settings.mbkey_cover) { if (m_movieSelectionHandler != NULL) { - if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_DELETE_SCREENSHOT, CMessageBox::mbrNo, CMessageBox:: mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { - std::string fname = getScreenshotName(m_movieSelectionHandler->file.Name, S_ISDIR(m_movieSelectionHandler->file.Mode)); - if (!fname.empty()) - unlink(fname.c_str()); - refresh(); + std::string fname = getScreenshotName(m_movieSelectionHandler->file.Name, S_ISDIR(m_movieSelectionHandler->file.Mode)); + if (!fname.empty()){ + //delete Cover + if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_DELETE_SCREENSHOT, CMessageBox::mbrNo, CMessageBox:: mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { + unlink(fname.c_str()); + refresh(); + } + }else if (g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"){ + //add TMDB Cover + fname = m_movieSelectionHandler->file.Name.c_str(); + int ext_pos = 0; + ext_pos = fname.rfind('.'); + if( ext_pos > 0) { + std::string extension; + extension = fname.substr(ext_pos + 1, fname.length() - ext_pos); + extension = "." + extension; + strReplace(fname, extension.c_str(), ".jpg"); + printf("TMDB: %s : %s\n",m_movieSelectionHandler->file.Name.c_str(),fname.c_str()); + cTmdb* tmdb = new cTmdb(m_movieSelectionHandler->epgTitle); + if ((tmdb->getResults() > 0) && (tmdb->hasCover())) { + if (!fname.empty()) + if (tmdb->getSmallCover(fname)) + refresh(); + } + if (tmdb) + delete tmdb; + } } } } @@ -2019,7 +2042,10 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) { if (m_movieSelectionHandler != NULL) { - m_movieInfo.showMovieInfo(*m_movieSelectionHandler); + if (m_settings.gui == MB_GUI_MOVIE_INFO && m_windowFocus == MB_FOCUS_MOVIE_INFO) + g_EpgData->show_mp(m_movieSelectionHandler,0,0); + else + m_movieInfo.showMovieInfo(*m_movieSelectionHandler); refresh(); } } @@ -2099,46 +2125,6 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) smsInput.resetOldKey(); } } - else if (msg == CRCInput::RC_favorites) - { - if (m_movieSelectionHandler != NULL) { -#if 0 - if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_DELETE_SCREENSHOT, CMessageBox::mbrNo, CMessageBox:: mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { - std::string fname = getScreenshotName(m_movieSelectionHandler->file.Name, S_ISDIR(m_movieSelectionHandler->file.Mode)); - if (!fname.empty()) - unlink(fname.c_str()); - refresh(); - } -#else - std::string fname = m_movieSelectionHandler->file.Name.c_str(); - int ext_pos = 0; - ext_pos = fname.rfind('.'); - if( ext_pos > 0) { - std::string extension; - extension = fname.substr(ext_pos + 1, fname.length() - ext_pos); - extension = "." + extension; - strReplace(fname, extension.c_str(), ".jpg"); - } - printf("TMDB: %s : %s\n",m_movieSelectionHandler->file.Name.c_str(),fname.c_str()); - if (!access(fname, F_OK)) { - if (ShowMsg(LOCALE_MESSAGEBOX_INFO, LOCALE_MOVIEBROWSER_DELETE_SCREENSHOT, CMessageBox::mbrNo, CMessageBox:: mbYes | CMessageBox::mbNo) == CMessageBox::mbrYes) { - if (!fname.empty()) - unlink(fname.c_str()); - refresh(); - } - } else { - cTmdb* tmdb = new cTmdb(m_movieSelectionHandler->epgTitle); - if ((tmdb->getResults() > 0) && (tmdb->hasCover())) { - if (!fname.empty()) - if (tmdb->getSmallCover(fname)) - refresh(); - } - if (tmdb) - delete tmdb; - } -#endif - } - } else { //TRACE("[mb]->onButtonPressMainFrame none\n"); diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 67918d23f..3096b94cf 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1560,6 +1560,12 @@ void CMoviePlayerGui::PlayFileLoop(void) SetPosition(1000 * (hh * 3600 + mm * 60 + ss), true); } else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) { + if (fromInfoviewer) + { + g_EpgData->show_mp(p_movie_info,GetPosition(),GetDuration()); + fromInfoviewer = false; + } + else callInfoViewer(); update_lcd = true; clearSubtitle(); diff --git a/src/gui/tmdb.h b/src/gui/tmdb.h index 0c4a45448..d9f8929d6 100644 --- a/src/gui/tmdb.h +++ b/src/gui/tmdb.h @@ -74,6 +74,7 @@ class cTmdb std::string getReleaseDate() { return minfo.release_date;} std::string getDescription() { return minfo.overview;} std::string getVote() { return minfo.vote_average;} + std::string getCast() { return minfo.cast;} bool hasCover() { return !minfo.poster_path.empty();} bool getBigCover(std::string cover) { return DownloadUrl("http://image.tmdb.org/t/p/w342" + minfo.poster_path, cover);} bool getSmallCover(std::string cover) { return DownloadUrl("http://image.tmdb.org/t/p/w185" + minfo.poster_path, cover);} diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index e736be178..7117810ff 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1329,9 +1329,9 @@ void CMenuWidget::paintItems() //Item not currently on screen if (selected >= 0) { - while (selected < page_start[current_page]) + while (current_page > 0 && selected < page_start[current_page]) current_page--; - while (selected >= page_start[current_page + 1]) + while (current_page+1 < page_start.size() && selected >= page_start[current_page + 1]) current_page++; } diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 45cffebf6..4f9821ebe 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -619,6 +619,13 @@ void CMsgBox::refresh(void) refreshTitle(); refreshFoot(); + //draw body + m_pcWindow->paintBoxRel( m_cBoxFrameText.iX, + m_cBoxFrameText.iY, + m_cBoxFrameText.iWidth, + m_cBoxFrameText.iHeight, + COL_MENUCONTENT_PLUS_0); + // rep-draw textbox if there is one if(m_pcTextBox != NULL) { @@ -750,7 +757,6 @@ bool CMsgBox::setText(const std::string* newText) // update text in textbox if there is one if(m_pcTextBox != NULL && newText != NULL) { - lresult = m_pcTextBox->setText(newText); if(m_nMode & AUTO_WIDTH || m_nMode & AUTO_HIGH) { /* window might changed in size ...*/ @@ -768,6 +774,8 @@ bool CMsgBox::setText(const std::string* newText) m_cBoxFrame.iY = g_settings.screen_StartY + ((g_settings.screen_EndY - g_settings.screen_StartY - m_cBoxFrame.iHeight) >>1); } } + + lresult = m_pcTextBox->setText(newText); } return(lresult);