From d9600f1c2034a10b884e634652b388970972e039 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 29 Sep 2015 08:00:00 +0200 Subject: [PATCH] CMovieBrowser::onDeleteFile: Use epg info instead of filename for display Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/3b78f47756570ef000e8498503b22658103106a0 Author: Michael Liebmann Date: 2015-09-29 (Tue, 29 Sep 2015) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/moviebrowser.cpp | 48 ++++++++++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index feb686899..995d12ab0 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -2148,17 +2148,47 @@ void CMovieBrowser::onDeleteFile(MI_MOVIE_INFO *movieinfo, bool skipAsk) return; } #endif + size_t msgMax = 50; std::string msg = g_Locale->getText(LOCALE_FILEBROWSER_DODELETE1); - msg += "\n "; - if (movieinfo->file.Name.length() > 40) - { - msg += movieinfo->file.Name.substr(0,40); - msg += "..."; + msg += "\n "; + if (movieinfo->epgTitle != "") { + if ((movieinfo->epgTitle.length() + movieinfo->epgInfo1.length()) <= msgMax) { + msg += movieinfo->epgTitle; + if (movieinfo->epgInfo1 != "") { + msg += " ("; + msg += movieinfo->epgInfo1; + msg += ")"; + } + } + else { + if (movieinfo->epgTitle.length() > msgMax) { + msg += movieinfo->epgTitle.substr(0, msgMax); + msg += "..."; + } + else { + msg += movieinfo->epgTitle; + if (movieinfo->epgInfo1 != "") { + msg += "\n ("; + if (movieinfo->epgInfo1.length() > msgMax) { + msg = movieinfo->epgInfo1.substr(0, msgMax); + msg += "..."; + } + else + msg += movieinfo->epgInfo1; + msg += ")"; + } + } + } } - else - msg += movieinfo->file.Name; - - msg += "\n "; + else { + if (movieinfo->file.Name.length() > msgMax) { + msg += movieinfo->file.Name.substr(0, msgMax); + msg += "..."; + } + else + msg += movieinfo->file.Name; + } + msg += "\n"; msg += g_Locale->getText(LOCALE_FILEBROWSER_DODELETE2); if ((skipAsk) || (ShowMsg(LOCALE_FILEBROWSER_DELETE, msg, CMessageBox::mbrYes, CMessageBox::mbYes|CMessageBox::mbNo)==CMessageBox::mbrYes)) {