- Use indexes for font parameter in formatDeleteMsg() & cutString()


Origin commit data
------------------
Branch: ni/coolstream
Commit: f898c08154
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2016-08-13 (Sat, 13 Aug 2016)



------------------
This commit was generated by Migit
This commit is contained in:
Michael Liebmann
2016-08-13 15:58:13 +02:00
parent 8ef5e4b610
commit 7d8c29ac9d
2 changed files with 7 additions and 6 deletions

View File

@@ -2224,19 +2224,20 @@ bool CMovieBrowser::onButtonPressMovieInfoList(neutrino_msg_t msg)
return (result);
}
std::string CMovieBrowser::formatDeleteMsg(MI_MOVIE_INFO *movieinfo, Font *msgFont, const int boxWidth)
std::string CMovieBrowser::formatDeleteMsg(MI_MOVIE_INFO *movieinfo, int msgFont, const int boxWidth)
{
Font *msgFont_ = g_Font[msgFont];
int msgWidth = boxWidth - 20;
std::string msg = g_Locale->getText(LOCALE_FILEBROWSER_DODELETE1);
msg += "\n";
if (!movieinfo->epgTitle.empty()) {
int titleW = msgFont->getRenderWidth(movieinfo->epgTitle);
int titleW = msgFont_->getRenderWidth(movieinfo->epgTitle);
int infoW = 0;
int zW = 0;
if (!movieinfo->epgInfo1.empty()) {
infoW = msgFont->getRenderWidth(movieinfo->epgInfo1);
zW = msgFont->getRenderWidth(" ()");
infoW = msgFont_->getRenderWidth(movieinfo->epgInfo1);
zW = msgFont_->getRenderWidth(" ()");
}
if ((titleW+infoW+zW) <= msgWidth) {
@@ -2273,7 +2274,7 @@ bool CMovieBrowser::onDeleteFile(MI_MOVIE_INFO *movieinfo, bool skipAsk)
bool result = false;
/* default font for ShowMsg */
Font *msgFont = g_Font[SNeutrinoSettings::FONT_TYPE_MENU];
int msgFont = SNeutrinoSettings::FONT_TYPE_MENU;
/* default width for ShowMsg */
int msgBoxWidth = 450;

View File

@@ -428,7 +428,7 @@ class CMovieBrowser : public CMenuTarget
void onSetGUIWindowNext(void);
void onSetGUIWindowPrev(void);
bool onDelete(bool cursor_only = false);
std::string formatDeleteMsg(MI_MOVIE_INFO *movieinfo, Font *msgFont, const int boxWidth = 450);
std::string formatDeleteMsg(MI_MOVIE_INFO *movieinfo, int msgFont, const int boxWidth = 450);
bool onDeleteFile(MI_MOVIE_INFO *movieinfo, bool skipAsk = false); // P4
bool onSortMovieInfoHandleList(std::vector<MI_MOVIE_INFO*>& pv_handle_list, MB_INFO_ITEM sort_type, MB_DIRECTION direction);