From 6e4d4c45fc388dc56fb7282521fe3d26fe690f5e Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sat, 13 Aug 2016 14:13:52 +0200 Subject: [PATCH 1/3] src/gui/moviebrowser.cpp refreshMovieInfo after sort Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/485cc671bc21912832ad29136349b6dc4c1bf97e Author: Jacek Jendrzej Date: 2016-08-13 (Sat, 13 Aug 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/moviebrowser.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index fe76b04af..f97c67263 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -1937,6 +1937,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) TRACE("[mb]->new sorting %d,%s\n",m_settings.sorting.item,g_Locale->getText(m_localizedItemName[m_settings.sorting.item])); refreshBrowserList(); + refreshMovieInfo(); refreshFoot(); } } From 8ef5e4b6107a3bcf151e2c316fd8e977186044d1 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sat, 13 Aug 2016 15:58:06 +0200 Subject: [PATCH 2/3] Fix commit c3a7bcfd5b39a6d2999373f481935bfffb705c13 - Use indexes for font parameter in formatDeleteMsg() & cutString() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/0d5edc29e62d693321ebf79ce846047a3ce99509 Author: Michael Liebmann Date: 2016-08-13 (Sat, 13 Aug 2016) ------------------ This commit was generated by Migit --- src/system/helpers.cpp | 10 ++++++---- src/system/helpers.h | 4 +--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index a45fcfc48..9a4b054f5 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -44,6 +44,7 @@ #include #include #include "debug.h" +#include #include #include using namespace std; @@ -438,21 +439,22 @@ std::string trim(std::string &str, const std::string &trimChars /*= " \n\r\t"*/) return result.erase(0, result.find_first_not_of(trimChars)); } -std::string cutString(const std::string str, Font *msgFont, const int width) +std::string cutString(const std::string str, int msgFont, const int width) { + Font *msgFont_ = g_Font[msgFont]; std::string ret = str; ret = trim(ret); - int sw = msgFont->getRenderWidth(ret); + int sw = msgFont_->getRenderWidth(ret); if (sw <= width) return ret; else { std::string z = "..."; - int zw = msgFont->getRenderWidth(z); + int zw = msgFont_->getRenderWidth(z); if (width <= 2*zw) return ret; do { ret = ret.substr(0, ret.length()-1); - sw = msgFont->getRenderWidth(ret); + sw = msgFont_->getRenderWidth(ret); } while (sw+zw > width); ret = trim(ret) + z; } diff --git a/src/system/helpers.h b/src/system/helpers.h index 5d9efa8d9..3b26a12a6 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -37,8 +37,6 @@ #include #include -#include - int my_system(const char * cmd); int my_system(int argc, const char *arg, ...); /* argc is number of arguments including command */ @@ -69,7 +67,7 @@ std::string getFileName(std::string &file); std::string getFileExt(std::string &file); std::string getNowTimeStr(const char* format); std::string trim(std::string &str, const std::string &trimChars = " \n\r\t"); -std::string cutString(const std::string str, Font *msgFont, const int width); +std::string cutString(const std::string str, int msgFont, const int width); std::string strftime(const char *format, const struct tm *tm); std::string strftime(const char *format, time_t when, bool gm = false); time_t toEpoch(std::string &date); From 7d8c29ac9d5be3c04fc75eae0a69e55ebcbdaf4c Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Sat, 13 Aug 2016 15:58:13 +0200 Subject: [PATCH 3/3] Fix commit c7be05d5db1ed09d0b9a41f5ec2c714434eceaf8 - Use indexes for font parameter in formatDeleteMsg() & cutString() Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f898c081540122278e9224cc97b1a1de0e589e35 Author: Michael Liebmann Date: 2016-08-13 (Sat, 13 Aug 2016) ------------------ This commit was generated by Migit --- src/gui/moviebrowser.cpp | 11 ++++++----- src/gui/moviebrowser.h | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index f97c67263..f79ba9083 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -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; diff --git a/src/gui/moviebrowser.h b/src/gui/moviebrowser.h index 01e3ca39a..55e3e8516 100644 --- a/src/gui/moviebrowser.h +++ b/src/gui/moviebrowser.h @@ -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& pv_handle_list, MB_INFO_ITEM sort_type, MB_DIRECTION direction);