mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 07:51:11 +02:00
Merge branch 'cst-next' of git://coolstreamtech.de/cst-public-gui-neutrino into ni/cst-next
Origin commit data
------------------
Branch: ni/coolstream
Commit: c574728833
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-08-12 (Fri, 12 Aug 2016)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -236,7 +236,7 @@ class CCDraw : public COSDFader, public CComponentsSignals
|
||||
|
||||
///set corner types
|
||||
///Possible corner types are defined in CFrameBuffer (see: driver/framebuffer.h)
|
||||
///Note: default values are given from settings
|
||||
///Note: default values are given from settings and corner radius sizes are predefined in /system/settings.h
|
||||
virtual void setCornerType(const int& type);
|
||||
///set corner radius and type
|
||||
virtual void setCorner(const int& radius, const int& type = CORNER_ALL);
|
||||
|
@@ -2325,61 +2325,61 @@ bool CMovieBrowser::onButtonPressMovieInfoList(neutrino_msg_t msg)
|
||||
return (result);
|
||||
}
|
||||
|
||||
bool CMovieBrowser::onDeleteFile(MI_MOVIE_INFO *movieinfo, bool skipAsk)
|
||||
std::string CMovieBrowser::formatDeleteMsg(MI_MOVIE_INFO *movieinfo, Font *msgFont, const int boxWidth)
|
||||
{
|
||||
//TRACE("[onDeleteFile] ");
|
||||
bool result = false;
|
||||
#if 0
|
||||
int test= movieinfo->file.Name.find(".ts", movieinfo->file.Name.length()-3);
|
||||
if (test == -1) {
|
||||
// not a TS file, return!!!!!
|
||||
TRACE("show_ts_info: not a TS file ");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
size_t msgMax = 50;
|
||||
int msgWidth = boxWidth - 20;
|
||||
std::string msg = g_Locale->getText(LOCALE_FILEBROWSER_DODELETE1);
|
||||
msg += "\n ";
|
||||
msg += "\n";
|
||||
|
||||
if (!movieinfo->epgTitle.empty()) {
|
||||
if ((movieinfo->epgTitle.length() + movieinfo->epgInfo1.length()) <= msgMax) {
|
||||
msg += 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(" ()");
|
||||
}
|
||||
|
||||
if ((titleW+infoW+zW) <= msgWidth) {
|
||||
/* one line */
|
||||
msg += trim(movieinfo->epgTitle);
|
||||
if (!movieinfo->epgInfo1.empty()) {
|
||||
msg += " (";
|
||||
msg += movieinfo->epgInfo1;
|
||||
msg += trim(movieinfo->epgInfo1);
|
||||
msg += ")";
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (movieinfo->epgTitle.length() > msgMax) {
|
||||
msg += movieinfo->epgTitle.substr(0, msgMax);
|
||||
msg += "...";
|
||||
}
|
||||
else {
|
||||
msg += movieinfo->epgTitle;
|
||||
if (!movieinfo->epgInfo1.empty()) {
|
||||
msg += "\n (";
|
||||
if (movieinfo->epgInfo1.length() > msgMax) {
|
||||
msg = movieinfo->epgInfo1.substr(0, msgMax);
|
||||
msg += "...";
|
||||
}
|
||||
else
|
||||
msg += movieinfo->epgInfo1;
|
||||
/* two lines */
|
||||
msg += cutString(movieinfo->epgTitle, msgFont, msgWidth);
|
||||
if (!movieinfo->epgInfo1.empty()) {
|
||||
msg += "\n(";
|
||||
msg += cutString(movieinfo->epgInfo1, msgFont, msgWidth);
|
||||
msg += ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (movieinfo->file.Name.length() > msgMax) {
|
||||
msg += movieinfo->file.Name.substr(0, msgMax);
|
||||
msg += "...";
|
||||
}
|
||||
else
|
||||
msg += movieinfo->file.Name;
|
||||
}
|
||||
else
|
||||
msg += cutString(movieinfo->file.Name, msgFont, msgWidth);
|
||||
|
||||
msg += "\n";
|
||||
msg += g_Locale->getText(LOCALE_FILEBROWSER_DODELETE2);
|
||||
if ((skipAsk || !movieinfo->delAsk) || (ShowMsg(LOCALE_FILEBROWSER_DELETE, msg, CMessageBox::mbrYes, CMessageBox::mbYes|CMessageBox::mbNo)==CMessageBox::mbrYes))
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
bool CMovieBrowser::onDeleteFile(MI_MOVIE_INFO *movieinfo, bool skipAsk)
|
||||
{
|
||||
//TRACE("[onDeleteFile] ");
|
||||
bool result = false;
|
||||
|
||||
/* default font for ShowMsg */
|
||||
Font *msgFont = g_Font[SNeutrinoSettings::FONT_TYPE_MENU];
|
||||
/* default width for ShowMsg */
|
||||
int msgBoxWidth = 450;
|
||||
|
||||
std::string msg = formatDeleteMsg(movieinfo, msgFont, msgBoxWidth);
|
||||
if ((skipAsk || !movieinfo->delAsk) || (ShowMsg(LOCALE_FILEBROWSER_DELETE, msg, CMessageBox::mbrYes, CMessageBox::mbYes|CMessageBox::mbNo, NULL, msgBoxWidth)==CMessageBox::mbrYes))
|
||||
{
|
||||
CHintBox * hintBox = new CHintBox(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_MOVIEBROWSER_DELETE_INFO));
|
||||
hintBox->paint();
|
||||
|
@@ -430,6 +430,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);
|
||||
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);
|
||||
|
||||
|
@@ -1447,7 +1447,7 @@ void CMenuWidget::paintHint(int pos)
|
||||
/* clear info box */
|
||||
if ((info_box) && (pos < 0))
|
||||
savescreen ? info_box->hide() : info_box->kill();
|
||||
hint_painted = false;
|
||||
hint_painted = info_box->isPainted();
|
||||
}
|
||||
if (pos < 0)
|
||||
return;
|
||||
@@ -1457,7 +1457,7 @@ void CMenuWidget::paintHint(int pos)
|
||||
if (!item->hintIcon && item->hint == NONEXISTANT_LOCALE && item->hintText.empty()) {
|
||||
if (info_box) {
|
||||
savescreen ? info_box->hide() : info_box->kill();
|
||||
hint_painted = false;
|
||||
hint_painted = info_box->isPainted();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@@ -567,6 +567,27 @@ 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 ret = str;
|
||||
ret = trim(ret);
|
||||
int sw = msgFont->getRenderWidth(ret);
|
||||
if (sw <= width)
|
||||
return ret;
|
||||
else {
|
||||
std::string z = "...";
|
||||
int zw = msgFont->getRenderWidth(z);
|
||||
if (width <= 2*zw)
|
||||
return ret;
|
||||
do {
|
||||
ret = ret.substr(0, ret.length()-1);
|
||||
sw = msgFont->getRenderWidth(ret);
|
||||
} while (sw+zw > width);
|
||||
ret = trim(ret) + z;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::string strftime(const char *format, const struct tm *tm)
|
||||
{
|
||||
char buf[4096];
|
||||
|
@@ -37,6 +37,8 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <driver/fontrenderer.h>
|
||||
|
||||
int my_system(const char * cmd);
|
||||
int my_system(int argc, const char *arg, ...); /* argc is number of arguments including command */
|
||||
|
||||
@@ -69,6 +71,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 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);
|
||||
|
Reference in New Issue
Block a user