Conflicts:
	src/gui/osd_setup.cpp


Origin commit data
------------------
Commit: c2506804b6
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-12-30 (Fri, 30 Dec 2016)
This commit is contained in:
vanhofen
2016-12-30 21:54:46 +01:00
17 changed files with 105 additions and 76 deletions

View File

@@ -753,6 +753,7 @@ fontmenu.scaling_x_hint2 Horizontal (in %) min 50 / max 200
fontmenu.scaling_y Vertikal (in %) fontmenu.scaling_y Vertikal (in %)
fontmenu.scaling_y_hint2 Vertikal (in %) min 50 / max 200 fontmenu.scaling_y_hint2 Vertikal (in %) min 50 / max 200
fontmenu.sizes Schriftgrößen fontmenu.sizes Schriftgrößen
fontsize.button_text Schaltflächen-Text
fontsize.channel_num_zap Direktauswahl fontsize.channel_num_zap Direktauswahl
fontsize.channellist Kanalliste fontsize.channellist Kanalliste
fontsize.channellist_descr Beschreibung fontsize.channellist_descr Beschreibung

View File

@@ -753,6 +753,7 @@ fontmenu.scaling_x_hint2 Horizontal (in %) min 50 / max 200
fontmenu.scaling_y Vertical (in %) fontmenu.scaling_y Vertical (in %)
fontmenu.scaling_y_hint2 Vertical (in %) min 50 / max 200 fontmenu.scaling_y_hint2 Vertical (in %) min 50 / max 200
fontmenu.sizes Font sizes fontmenu.sizes Font sizes
fontsize.button_text Button text
fontsize.channel_num_zap direct selection fontsize.channel_num_zap direct selection
fontsize.channellist Channellist fontsize.channellist Channellist
fontsize.channellist_descr Description fontsize.channellist_descr Description

View File

@@ -665,6 +665,7 @@ fontmenu.scaling_x_hint2 Horizontaal (in %) min 50 / max 200
fontmenu.scaling_y Verticaal (in %) fontmenu.scaling_y Verticaal (in %)
fontmenu.scaling_y_hint2 Verticaal (in %) min 50 / max 200 fontmenu.scaling_y_hint2 Verticaal (in %) min 50 / max 200
fontmenu.sizes Lettertype grootte fontmenu.sizes Lettertype grootte
fontsize.button_text Button text
fontsize.channel_num_zap directe selectie fontsize.channel_num_zap directe selectie
fontsize.channellist Kanalenlijst fontsize.channellist Kanalenlijst
fontsize.channellist_descr Omschrijving fontsize.channellist_descr Omschrijving

View File

@@ -712,6 +712,7 @@ fontmenu.scaling_x_hint2 Vodorovne (v %) min 50 / max 200
fontmenu.scaling_y Zvislo (v %) fontmenu.scaling_y Zvislo (v %)
fontmenu.scaling_y_hint2 Zvislo (v %) min 50 / max 200 fontmenu.scaling_y_hint2 Zvislo (v %) min 50 / max 200
fontmenu.sizes Veľkosti písma fontmenu.sizes Veľkosti písma
fontsize.button_text Button text
fontsize.channel_num_zap Priamy výber fontsize.channel_num_zap Priamy výber
fontsize.channellist Zoznam kanálov fontsize.channellist Zoznam kanálov
fontsize.channellist_descr Popis fontsize.channellist_descr Popis

View File

@@ -33,7 +33,6 @@
#include <system/debug.h> #include <system/debug.h>
#include "cc_frm_button.h" #include "cc_frm_button.h"
using namespace std; using namespace std;
CComponentsButton::CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, CComponentsButton::CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h,
@@ -44,7 +43,7 @@ CComponentsButton::CComponentsButton( const int& x_pos, const int& y_pos, const
int shadow_mode, int shadow_mode,
fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow)
{ {
cc_btn_capt_locale = NONEXISTANT_LOCALE; cc_btn_text_locale = NONEXISTANT_LOCALE;
initVarButton(x_pos, y_pos, w, h, caption, icon_name, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow); initVarButton(x_pos, y_pos, w, h, caption, icon_name, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow);
} }
@@ -56,8 +55,8 @@ CComponentsButton::CComponentsButton( const int& x_pos, const int& y_pos, const
int shadow_mode, int shadow_mode,
fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow)
{ {
cc_btn_capt_locale = caption_locale; cc_btn_text_locale = caption_locale;
initVarButton(x_pos, y_pos, w, h, g_Locale->getText(cc_btn_capt_locale), icon_name, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow); initVarButton(x_pos, y_pos, w, h, g_Locale->getText(cc_btn_text_locale), icon_name, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow);
} }
CComponentsButton::CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, CComponentsButton::CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h,
@@ -81,8 +80,8 @@ CComponentsButton::CComponentsButton( const int& x_pos, const int& y_pos, const
fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow)
{ {
string _icon_name = icon_name == NULL ? "" : string(icon_name); string _icon_name = icon_name == NULL ? "" : string(icon_name);
cc_btn_capt_locale = caption_locale; cc_btn_text_locale = caption_locale;
initVarButton(x_pos, y_pos, w, h, g_Locale->getText(cc_btn_capt_locale), _icon_name, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow); initVarButton(x_pos, y_pos, w, h, g_Locale->getText(cc_btn_text_locale), _icon_name, parent, selected, enabled, shadow_mode, color_frame, color_body, color_shadow);
} }
void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const int& w, const int& h, void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const int& w, const int& h,
@@ -116,14 +115,14 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const
append_y_offset = 0; append_y_offset = 0;
corner_rad = RADIUS_SMALL; corner_rad = RADIUS_SMALL;
cc_btn_capt_col = cc_body_gradient_enable ? COL_BUTTON_TEXT_ENABLED : COL_MENUFOOT_TEXT; cc_btn_text_col = cc_body_gradient_enable ? COL_BUTTON_TEXT_ENABLED : COL_MENUFOOT_TEXT;
cc_btn_capt_disable_col = cc_body_gradient_enable ? COL_BUTTON_TEXT_DISABLED : COL_MENUCONTENTINACTIVE_TEXT; cc_btn_text_disable_col = cc_body_gradient_enable ? COL_BUTTON_TEXT_DISABLED : COL_MENUCONTENTINACTIVE_TEXT;
cc_btn_icon_obj = NULL; cc_btn_icon_obj = NULL;
cc_btn_capt_obj = NULL; cc_btn_text_obj = NULL;
cc_btn_dy_font = CNeutrinoFonts::getInstance(); cc_btn_dy_font = CNeutrinoFonts::getInstance();
cc_btn_font = NULL; cc_btn_font = g_Font[SNeutrinoSettings::FONT_TYPE_BUTTON_TEXT];
cc_btn_icon = icon_name; cc_btn_icon = icon_name;
cc_btn_capt = caption; cc_btn_text = caption;
cc_directKey = CRCInput::RC_nokey; cc_directKey = CRCInput::RC_nokey;
cc_directKeyAlt = cc_directKey; cc_directKeyAlt = cc_directKey;
cc_btn_result = -1; cc_btn_result = -1;
@@ -172,30 +171,34 @@ void CComponentsButton::initIcon()
void CComponentsButton::initCaption() void CComponentsButton::initCaption()
{ {
//init label as caption object and add to container //init label as caption object and add to container
if (!cc_btn_capt.empty()){ if (!cc_btn_text.empty()){
if (cc_btn_capt_obj == NULL){ if (cc_btn_text_obj == NULL){
cc_btn_capt_obj = new CComponentsLabel(); cc_btn_text_obj = new CComponentsLabel();
cc_btn_capt_obj->doPaintBg(false); cc_btn_text_obj->doPaintBg(false);
cc_btn_capt_obj->doPaintTextBoxBg(false); cc_btn_text_obj->doPaintTextBoxBg(false);
cc_btn_capt_obj->enableTboxSaveScreen(cc_txt_save_screen); cc_btn_text_obj->enableTboxSaveScreen(cc_txt_save_screen);
addCCItem(cc_btn_capt_obj); addCCItem(cc_btn_text_obj);
} }
}else{ }else{
if (cc_btn_capt_obj){ if (cc_btn_text_obj){
delete cc_btn_capt_obj; delete cc_btn_text_obj;
cc_btn_capt_obj = NULL; cc_btn_text_obj = NULL;
} }
} }
//set basic properties //set basic properties
int w_frame = fr_thickness; int w_frame = fr_thickness;
if (cc_btn_capt_obj){ if (cc_btn_text_obj){
//position and size //position and size
int x_cap = w_frame; int x_cap = w_frame;
x_cap += cc_btn_icon_obj ? cc_btn_icon_obj->getWidth() : 0; x_cap += cc_btn_icon_obj ? cc_btn_icon_obj->getWidth() : 0;
/* use system defined font as default if not defined */
if (cc_btn_font == NULL)
cc_btn_font = g_Font[SNeutrinoSettings::FONT_TYPE_BUTTON_TEXT];
int w_cap = width - w_frame - append_x_offset - x_cap - w_frame; int w_cap = width - w_frame - append_x_offset - x_cap - w_frame;
int h_cap = (height*85/100) - 2*w_frame; int h_cap = min(height - 2*w_frame, cc_btn_font->getHeight());
/*NOTE: /*NOTE:
paint of centered text in y direction without y_offset paint of centered text in y direction without y_offset
looks unlovely displaced in y direction especially besides small icons and inside small areas, looks unlovely displaced in y direction especially besides small icons and inside small areas,
@@ -204,42 +207,37 @@ void CComponentsButton::initCaption()
*/ */
int y_cap = height/2 - h_cap/2; int y_cap = height/2 - h_cap/2;
cc_btn_capt_obj->setDimensionsAll(x_cap, y_cap, w_cap, h_cap); cc_btn_text_obj->setDimensionsAll(x_cap, y_cap, w_cap, h_cap);
//text and font //text and font
Font* def_font = *cc_btn_dy_font->getDynFont(w_cap, h_cap, cc_btn_capt); Font* def_font = *cc_btn_dy_font->getDynFont(w_cap, h_cap, cc_btn_text);
if (cc_btn_font == NULL){ /* If button dimension too small, use dynamic font, this ignores possible defined font
/* use dynamic font as default font if no font defined */ * Otherwise definied font will be used. Button dimensions are calculated from parent container (e.g. footer...).
cc_btn_font = def_font; * These dimensions must be enough to display complete content like possible icon and without truncated text.
}else{
/* if button dimension too small, use dynamic font as default font size, this ignores possible defined font
* Otherwise definied font will be used.
*/ */
if (cc_btn_font->getHeight() > h_cap){ if ((cc_btn_font->getHeight()- 2*w_frame) > h_cap && (cc_btn_font->getRenderWidth(cc_btn_text)- 2*w_frame) > w_cap)
cc_btn_font = def_font; cc_btn_font = def_font;
}
}
cc_btn_capt_obj->setText(cc_btn_capt, CTextBox::NO_AUTO_LINEBREAK, cc_btn_font); cc_btn_text_obj->setText(cc_btn_text, CTextBox::NO_AUTO_LINEBREAK, cc_btn_font);
cc_btn_capt_obj->forceTextPaint(); //here required; cc_btn_text_obj->forceTextPaint(); //here required;
cc_btn_capt_obj->getCTextBoxObject()->setTextBorderWidth(0,0); cc_btn_text_obj->getCTextBoxObject()->setTextBorderWidth(0,0);
//set color //set color
cc_btn_capt_obj->setTextColor(this->cc_item_enabled ? cc_btn_capt_col : cc_btn_capt_disable_col); cc_btn_text_obj->setTextColor(this->cc_item_enabled ? cc_btn_text_col : cc_btn_text_disable_col);
//corner of text item //corner of text item
cc_btn_capt_obj->setCorner(corner_rad-w_frame, corner_type); cc_btn_text_obj->setCorner(corner_rad-w_frame, corner_type);
} }
//handle common position of icon and text inside container required for alignment //handle common position of icon and text inside container required for alignment
int w_required = w_frame + append_x_offset; int w_required = w_frame + append_x_offset;
w_required += cc_btn_icon_obj ? cc_btn_icon_obj->getWidth() + append_x_offset : 0; w_required += cc_btn_icon_obj ? cc_btn_icon_obj->getWidth() + append_x_offset : 0;
w_required += cc_btn_font ? cc_btn_font->getRenderWidth(cc_btn_capt) : 0; w_required += cc_btn_font ? cc_btn_font->getRenderWidth(cc_btn_text) : 0;
w_required += append_x_offset + w_frame; w_required += append_x_offset + w_frame;
//dynamic width //dynamic width
if (w_required > width){ if (w_required > width){
dprintf(DEBUG_INFO, "[CComponentsButton] [%s - %d] width of button (%s) will be changed: defined width=%d, required width=%d\n", __func__, __LINE__, cc_btn_capt.c_str(), width, w_required); dprintf(DEBUG_INFO, "[CComponentsButton] [%s - %d] width of button (%s) will be changed: defined width=%d, required width=%d\n", __func__, __LINE__, cc_btn_text.c_str(), width, w_required);
width = max(w_required, width); width = max(w_required, width);
} }
@@ -256,22 +254,22 @@ void CComponentsButton::initCaption()
int y_icon = height/2 - cc_btn_icon_obj->getHeight()/2; int y_icon = height/2 - cc_btn_icon_obj->getHeight()/2;
cc_btn_icon_obj->setYPos(y_icon); cc_btn_icon_obj->setYPos(y_icon);
} }
if (cc_btn_capt_obj){ if (cc_btn_text_obj){
cc_btn_capt_obj->setXPos(x_icon + w_icon + append_x_offset); cc_btn_text_obj->setXPos(x_icon + w_icon + append_x_offset);
cc_btn_capt_obj->setWidth(width - cc_btn_capt_obj->getXPos()); cc_btn_text_obj->setWidth(width - cc_btn_text_obj->getXPos());
} }
} }
void CComponentsButton::setCaption(const std::string& text) void CComponentsButton::setCaption(const std::string& text)
{ {
cc_btn_capt = text; cc_btn_text = text;
initCCBtnItems(); initCCBtnItems();
} }
void CComponentsButton::setCaption(const neutrino_locale_t locale_text) void CComponentsButton::setCaption(const neutrino_locale_t locale_text)
{ {
cc_btn_capt_locale = locale_text; cc_btn_text_locale = locale_text;
setCaption(g_Locale->getText(cc_btn_capt_locale)); setCaption(g_Locale->getText(cc_btn_text_locale));
} }
void CComponentsButton::initCCBtnItems() void CComponentsButton::initCCBtnItems()

View File

@@ -50,7 +50,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen
///object: picture object ///object: picture object
CComponentsPictureScalable *cc_btn_icon_obj; CComponentsPictureScalable *cc_btn_icon_obj;
///object: label object ///object: label object
CComponentsLabel *cc_btn_capt_obj; CComponentsLabel *cc_btn_text_obj;
///initialize all required attributes and objects ///initialize all required attributes and objects
void initVarButton( const int& x_pos, const int& y_pos, const int& w, const int& h, void initVarButton( const int& x_pos, const int& y_pos, const int& w, const int& h,
@@ -63,9 +63,9 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen
fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow); fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow);
///property: button text as string, see also setCaption() and getCaptionString() ///property: button text as string, see also setCaption() and getCaptionString()
std::string cc_btn_capt; std::string cc_btn_text;
///property: button text as locale, see also setCaption() and getCaptionLocale() ///property: button text as locale, see also setCaption() and getCaptionLocale()
neutrino_locale_t cc_btn_capt_locale; neutrino_locale_t cc_btn_text_locale;
///property: icon name, only icons supported, to find in gui/widget/icons.h ///property: icon name, only icons supported, to find in gui/widget/icons.h
std::string cc_btn_icon; std::string cc_btn_icon;
@@ -80,9 +80,9 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen
int cc_btn_alias; int cc_btn_alias;
///property: text color ///property: text color
fb_pixel_t cc_btn_capt_col; fb_pixel_t cc_btn_text_col;
///property: text color for disabled button ///property: text color for disabled button
fb_pixel_t cc_btn_capt_disable_col; fb_pixel_t cc_btn_text_disable_col;
///object: text font ///object: text font
Font* cc_btn_font; Font* cc_btn_font;
///object: dynamic font object handler ///object: dynamic font object handler
@@ -135,7 +135,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen
fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
///set text color ///set text color
inline virtual void setButtonTextColor(fb_pixel_t caption_color){cc_btn_capt_col = caption_color;}; inline virtual void setButtonTextColor(fb_pixel_t caption_color){cc_btn_text_col = caption_color;};
/**Member to modify background behavior of embeded caption object. /**Member to modify background behavior of embeded caption object.
* @param[in] mode * @param[in] mode
@@ -164,9 +164,9 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen
virtual void setCaption(const neutrino_locale_t locale_text); virtual void setCaption(const neutrino_locale_t locale_text);
///get caption, type as std::string ///get caption, type as std::string
inline virtual std::string getCaptionString(){return cc_btn_capt;}; inline virtual std::string getCaptionString(){return cc_btn_text;};
///get loacalized caption id, type = neutrino_locale_t ///get loacalized caption id, type = neutrino_locale_t
inline virtual neutrino_locale_t getCaptionLocale(){return cc_btn_capt_locale;}; inline virtual neutrino_locale_t getCaptionLocale(){return cc_btn_text_locale;};
///property: set font for label caption, parameter as font object, value NULL causes usaage of dynamic font ///property: set font for label caption, parameter as font object, value NULL causes usaage of dynamic font
virtual void setButtonFont(Font* font){cc_btn_font = font; initCCBtnItems();}; virtual void setButtonFont(Font* font){cc_btn_font = font; initCCBtnItems();};

View File

@@ -68,6 +68,12 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const
//init footer width //init footer width
width = w == 0 ? frameBuffer->getScreenWidth(true) : w; width = w == 0 ? frameBuffer->getScreenWidth(true) : w;
//init default fonts
initDefaultFonts();
//init default button text font
ccf_btn_font = g_Font[SNeutrinoSettings::FONT_TYPE_BUTTON_TEXT];
//init footer height //init footer height
initCaptionFont(); initCaptionFont();
height = max(h, cch_font->getHeight()); height = max(h, cch_font->getHeight());
@@ -88,7 +94,6 @@ void CComponentsFooter::initVarFooter( const int& x_pos, const int& y_pos, const
corner_type = CORNER_BOTTOM; corner_type = CORNER_BOTTOM;
ccf_enable_button_bg = false /*g_settings.theme.Button_gradient*/; //TODO: not implemented at the moment ccf_enable_button_bg = false /*g_settings.theme.Button_gradient*/; //TODO: not implemented at the moment
ccf_btn_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT];
chain = NULL; chain = NULL;
addContextButton(buttons); addContextButton(buttons);
@@ -426,3 +431,9 @@ void CComponentsFooter::enableButtonShadow(int mode, const int& shadow_width, bo
} }
} }
} }
void CComponentsFooter::initDefaultFonts()
{
l_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE];
s_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT];
}

View File

@@ -84,6 +84,9 @@ class CComponentsFooter : public CComponentsHeader
///property: set font for label caption, see also setButtonFont() ///property: set font for label caption, see also setButtonFont()
Font* ccf_btn_font; Font* ccf_btn_font;
///init default fonts for size modes
virtual void initDefaultFonts();
///container for button objects ///container for button objects
CComponentsFrmChain *chain; CComponentsFrmChain *chain;

View File

@@ -96,6 +96,7 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const
height = height_old = h; height = height_old = h;
cch_font = NULL; cch_font = NULL;
initDefaultFonts();
cch_size_mode = CC_HEADER_SIZE_LARGE; cch_size_mode = CC_HEADER_SIZE_LARGE;
CNeutrinoApp::getInstance()->OnAfterSetupFonts.connect(sigc::mem_fun(this, &CComponentsHeader::resetFont)); CNeutrinoApp::getInstance()->OnAfterSetupFonts.connect(sigc::mem_fun(this, &CComponentsHeader::resetFont));
@@ -165,16 +166,20 @@ void CComponentsHeader::setCaptionFont(Font* font)
void CComponentsHeader::resetFont() void CComponentsHeader::resetFont()
{ {
if (cch_font){ if (cch_font){
cch_font = NULL;
dprintf(DEBUG_DEBUG, "\033[33m[CComponentsHeader][%s - %d] reset header font \033[0m\n", __func__, __LINE__); dprintf(DEBUG_DEBUG, "\033[33m[CComponentsHeader][%s - %d] reset header font \033[0m\n", __func__, __LINE__);
cch_font = NULL;
} }
initDefaultFonts();
}
void CComponentsHeader::initDefaultFonts()
{
l_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE];
s_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU];
} }
void CComponentsHeader::initCaptionFont() void CComponentsHeader::initCaptionFont()
{ {
Font *l_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE];
Font *s_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU];
if (cch_font == NULL){ if (cch_font == NULL){
cch_font = (cch_size_mode == CC_HEADER_SIZE_LARGE? l_font : s_font); cch_font = (cch_size_mode == CC_HEADER_SIZE_LARGE? l_font : s_font);
//select matching height //select matching height

View File

@@ -67,7 +67,7 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen
///property: caption text color, see also setCaptionColor() ///property: caption text color, see also setCaptionColor()
fb_pixel_t cch_col_text; fb_pixel_t cch_col_text;
///property: caption font, see also setCaptionFont() ///property: caption font, see also setCaptionFont()
Font* cch_font; Font* cch_font, *l_font, *s_font;
///reset font ///reset font
void resetFont(); void resetFont();
@@ -102,6 +102,8 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen
///init font object and recalculates height if required ///init font object and recalculates height if required
void initCaptionFont(); void initCaptionFont();
///init default fonts for size modes
virtual void initDefaultFonts();
///sub: init icon object ///sub: init icon object
void initIcon(); void initIcon();
///sub: init caption object ///sub: init caption object

View File

@@ -145,7 +145,7 @@ void CComponentsWindow::initVarWindow( const int& x_pos, const int& y_pos, const
ccw_right_sidebar= NULL; ccw_right_sidebar= NULL;
ccw_body = NULL; ccw_body = NULL;
ccw_footer = NULL; ccw_footer = NULL;
ccw_button_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]; ccw_button_font = g_Font[SNeutrinoSettings::FONT_TYPE_BUTTON_TEXT];
ccw_buttons = 0; //no header buttons ccw_buttons = 0; //no header buttons
ccw_show_footer = true; ccw_show_footer = true;

View File

@@ -98,7 +98,8 @@ void CComponentsTimer::initThread()
if (res != 0){ if (res != 0){
dprintf(DEBUG_NORMAL,"\033[33m[CComponentsTimer] [%s - %d] ERROR! pthread_create\033[0m\n", __func__, __LINE__); dprintf(DEBUG_NORMAL,"\033[33m[CComponentsTimer] [%s - %d] ERROR! pthread_create\033[0m\n", __func__, __LINE__);
return; return;
} }else
dprintf(DEBUG_DEBUG,"\033[33m[CComponentsTimer] [%s - %d] started thread ID:%ld \033[0m\n", __func__, __LINE__, pthread_self());
if (res == 0) if (res == 0)
CNeutrinoApp::getInstance()->OnBeforeRestart.connect(sl_stop_timer); CNeutrinoApp::getInstance()->OnBeforeRestart.connect(sl_stop_timer);
@@ -111,17 +112,17 @@ void CComponentsTimer::stopThread()
while (!sl_stop_timer.empty()) while (!sl_stop_timer.empty())
sl_stop_timer.disconnect(); sl_stop_timer.disconnect();
if(tm_thread) { while(tm_thread) {
int thres = pthread_cancel(tm_thread); int thres = pthread_cancel(tm_thread);
if (thres != 0) if (thres != 0)
dprintf(DEBUG_NORMAL,"\033[33m[CComponentsTimer] [%s - %d] ERROR! pthread_cancel, [%d]\033[0m\n", __func__, __LINE__, thres); dprintf(DEBUG_NORMAL,"\033[33m[CComponentsTimer] [%s - %d] ERROR! pthread_cancel, error [%d] %s\033[0m\n", __func__, __LINE__, thres, strerror(thres));
thres = pthread_join(tm_thread, NULL); void* res;
thres = pthread_join(tm_thread, &res);
if (thres != 0) if (res != PTHREAD_CANCELED)
dprintf(DEBUG_NORMAL, "\033[33m[CComponentsTimer] [%s - %d] ERROR! pthread_join, [%d]\033[0m\n", __func__, __LINE__, thres); dprintf(DEBUG_NORMAL, "\033[33m[CComponentsTimer] [%s - %d] ERROR! pthread_join, thread ID:%ld, error [%d] %s\033[0m\n", __func__, __LINE__, pthread_self(), thres, strerror(thres));
else
if (thres == 0)
tm_thread = 0; tm_thread = 0;
} }
} }

View File

@@ -168,7 +168,8 @@ size_t moviebrowser_font_items = sizeof(moviebrowser_font_sizes)/sizeof(moviebro
const SNeutrinoSettings::FONT_TYPES other_font_sizes[] = const SNeutrinoSettings::FONT_TYPES other_font_sizes[] =
{ {
SNeutrinoSettings::FONT_TYPE_SUBTITLES, SNeutrinoSettings::FONT_TYPE_SUBTITLES,
SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM,
SNeutrinoSettings::FONT_TYPE_BUTTON_TEXT
}; };
size_t other_font_items = sizeof(other_font_sizes)/sizeof(other_font_sizes[0]); size_t other_font_items = sizeof(other_font_sizes)/sizeof(other_font_sizes[0]);
@@ -223,7 +224,8 @@ font_sizes_struct neutrino_font[SNeutrinoSettings::FONT_TYPE_COUNT] =
{LOCALE_FONTSIZE_MOVIEBROWSER_LIST , 20, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, //NI {LOCALE_FONTSIZE_MOVIEBROWSER_LIST , 20, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, //NI
{LOCALE_FONTSIZE_MOVIEBROWSER_INFO , 16, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, //NI {LOCALE_FONTSIZE_MOVIEBROWSER_INFO , 16, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}, //NI
{LOCALE_FONTSIZE_SUBTITLES , 25, CNeutrinoFonts::FONT_STYLE_BOLD , 0}, {LOCALE_FONTSIZE_SUBTITLES , 25, CNeutrinoFonts::FONT_STYLE_BOLD , 0},
{LOCALE_FONTSIZE_MESSAGE_TEXT , 20, CNeutrinoFonts::FONT_STYLE_BOLD , 0} //NI {LOCALE_FONTSIZE_MESSAGE_TEXT , 20, CNeutrinoFonts::FONT_STYLE_BOLD , 0}, //NI
{LOCALE_FONTSIZE_BUTTON_TEXT , 14, CNeutrinoFonts::FONT_STYLE_REGULAR, 0}
}; };
int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey) int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey)

View File

@@ -780,6 +780,7 @@ typedef enum
LOCALE_FONTMENU_SCALING_Y, LOCALE_FONTMENU_SCALING_Y,
LOCALE_FONTMENU_SCALING_Y_HINT2, LOCALE_FONTMENU_SCALING_Y_HINT2,
LOCALE_FONTMENU_SIZES, LOCALE_FONTMENU_SIZES,
LOCALE_FONTSIZE_BUTTON_TEXT,
LOCALE_FONTSIZE_CHANNEL_NUM_ZAP, LOCALE_FONTSIZE_CHANNEL_NUM_ZAP,
LOCALE_FONTSIZE_CHANNELLIST, LOCALE_FONTSIZE_CHANNELLIST,
LOCALE_FONTSIZE_CHANNELLIST_DESCR, LOCALE_FONTSIZE_CHANNELLIST_DESCR,

View File

@@ -780,6 +780,7 @@ const char * locale_real_names[] =
"fontmenu.scaling_y", "fontmenu.scaling_y",
"fontmenu.scaling_y_hint2", "fontmenu.scaling_y_hint2",
"fontmenu.sizes", "fontmenu.sizes",
"fontsize.button_text",
"fontsize.channel_num_zap", "fontsize.channel_num_zap",
"fontsize.channellist", "fontsize.channellist",
"fontsize.channellist_descr", "fontsize.channellist_descr",

View File

@@ -706,6 +706,7 @@ struct SNeutrinoSettings
FONT_TYPE_MOVIEBROWSER_INFO, FONT_TYPE_MOVIEBROWSER_INFO,
FONT_TYPE_SUBTITLES, FONT_TYPE_SUBTITLES,
FONT_TYPE_MESSAGE_TEXT, FONT_TYPE_MESSAGE_TEXT,
FONT_TYPE_BUTTON_TEXT,
FONT_TYPE_COUNT FONT_TYPE_COUNT
}; };

View File

@@ -77,7 +77,7 @@ diseq_test_param_t diseqc_test[] = {
bool CServiceScan::TestDiseqcConfig(int num) bool CServiceScan::TestDiseqcConfig(int num)
{ {
if(num >= OPERATOR_MAX) { if(num >= OPERATOR_MAX || num < 0) {
INFO("[fast scan] invalid operator %d", num); INFO("[fast scan] invalid operator %d", num);
return false; return false;
} }
@@ -218,7 +218,7 @@ bool CServiceScan::ScanFast()
{ {
fast_scan_type_t * fast_type = (fast_scan_type_t *) scan_arg; fast_scan_type_t * fast_type = (fast_scan_type_t *) scan_arg;
fs_operator_t num = fast_type->op; fs_operator_t num = fast_type->op;
if(num >= OPERATOR_MAX) { if(num >= OPERATOR_MAX || num < 0) {
INFO("[fast scan] invalid operator %d", num); INFO("[fast scan] invalid operator %d", num);
return false; return false;
} }
@@ -231,7 +231,7 @@ bool CServiceScan::ScanFast()
bool CServiceScan::ScanFast(int num, bool reload) bool CServiceScan::ScanFast(int num, bool reload)
{ {
fast_scan_operator_t *op; fast_scan_operator_t *op;
if(num >= OPERATOR_MAX) { if(num >= OPERATOR_MAX || num < 0) {
INFO("[fast scan] invalid operator %d", num); INFO("[fast scan] invalid operator %d", num);
goto _err; goto _err;
} }