From b7153c49c8e06451f0ede70bbb315e56982782d4 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 15 Aug 2016 21:22:17 +0200 Subject: [PATCH 1/2] neutrinofonts: remove wrong name from signal_font struct Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c159fec182e9dfe6f05ae56327768b7fff8be17b Author: vanhofen Date: 2016-08-15 (Mon, 15 Aug 2016) Origin message was: ------------------ - neutrinofonts: remove wrong name from signal_font struct ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/neutrinofonts.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/driver/neutrinofonts.cpp b/src/driver/neutrinofonts.cpp index ae69f117d..2f4a3722c 100644 --- a/src/driver/neutrinofonts.cpp +++ b/src/driver/neutrinofonts.cpp @@ -48,7 +48,7 @@ extern font_sizes_groups_struct font_sizes_groups[]; extern font_sizes_struct neutrino_font[]; extern const char * locale_real_names[]; /* #include */ -const font_sizes_struct signal_font = {LOCALE_FONTSIZE_INFOBAR_SMALL, 14, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}; +const font_sizes_struct signal_font = {NONEXISTANT_LOCALE, 14, CNeutrinoFonts::FONT_STYLE_REGULAR, 1}; CNeutrinoFonts::CNeutrinoFonts() { From 4130ca11009bb919939473ac9fee280cf40e9be6 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 15 Aug 2016 22:14:31 +0200 Subject: [PATCH 2/2] osd_setup: auto-calc size of font_size structs Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/74345ecaa29bc4eb16d581c000310204ff85cec6 Author: vanhofen Date: 2016-08-15 (Mon, 15 Aug 2016) Origin message was: ------------------ - osd_setup: auto-calc size of font_size structs ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/osd_setup.cpp | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index cd2576c42..9d44bd386 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -100,7 +100,7 @@ COsdSetup::~COsdSetup() } //font settings -const SNeutrinoSettings::FONT_TYPES channellist_font_sizes[5] = +const SNeutrinoSettings::FONT_TYPES channellist_font_sizes[] = { SNeutrinoSettings::FONT_TYPE_CHANNELLIST, SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR, @@ -108,8 +108,9 @@ const SNeutrinoSettings::FONT_TYPES channellist_font_sizes[5] = SNeutrinoSettings::FONT_TYPE_CHANNELLIST_EVENT, SNeutrinoSettings::FONT_TYPE_CHANNEL_NUM_ZAP }; +size_t channellist_font_items = sizeof(channellist_font_sizes)/sizeof(channellist_font_sizes[0]); -const SNeutrinoSettings::FONT_TYPES eventlist_font_sizes[5] = +const SNeutrinoSettings::FONT_TYPES eventlist_font_sizes[] = { SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE, SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE, @@ -117,24 +118,27 @@ const SNeutrinoSettings::FONT_TYPES eventlist_font_sizes[5] = SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME, SNeutrinoSettings::FONT_TYPE_EVENTLIST_EVENT }; +size_t eventlist_font_items = sizeof(eventlist_font_sizes)/sizeof(eventlist_font_sizes[0]); -const SNeutrinoSettings::FONT_TYPES infobar_font_sizes[4] = +const SNeutrinoSettings::FONT_TYPES infobar_font_sizes[] = { SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER, SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME, SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO, SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL }; +size_t infobar_font_items = sizeof(infobar_font_sizes)/sizeof(infobar_font_sizes[0]); -const SNeutrinoSettings::FONT_TYPES epg_font_sizes[4] = +const SNeutrinoSettings::FONT_TYPES epg_font_sizes[] = { SNeutrinoSettings::FONT_TYPE_EPG_TITLE, SNeutrinoSettings::FONT_TYPE_EPG_INFO1, SNeutrinoSettings::FONT_TYPE_EPG_INFO2, SNeutrinoSettings::FONT_TYPE_EPG_DATE }; +size_t epg_font_items = sizeof(epg_font_sizes)/sizeof(epg_font_sizes[0]); -const SNeutrinoSettings::FONT_TYPES menu_font_sizes[5] = +const SNeutrinoSettings::FONT_TYPES menu_font_sizes[] = { SNeutrinoSettings::FONT_TYPE_MENU_TITLE, SNeutrinoSettings::FONT_TYPE_MENU, @@ -142,22 +146,25 @@ const SNeutrinoSettings::FONT_TYPES menu_font_sizes[5] = SNeutrinoSettings::FONT_TYPE_MENU_FOOT, SNeutrinoSettings::FONT_TYPE_MENU_HINT }; -const SNeutrinoSettings::FONT_TYPES other_font_sizes[2] = +size_t menu_font_items = sizeof(menu_font_sizes)/sizeof(menu_font_sizes[0]); + +const SNeutrinoSettings::FONT_TYPES other_font_sizes[] = { SNeutrinoSettings::FONT_TYPE_SUBTITLES, SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM }; +size_t other_font_items = sizeof(other_font_sizes)/sizeof(other_font_sizes[0]); -#define FONT_GROUP_COUNT 6 -font_sizes_groups font_sizes_groups[FONT_GROUP_COUNT] = +font_sizes_groups font_sizes_groups[] = { - {LOCALE_FONTMENU_MENU , 5, menu_font_sizes , "fontsize.dmen", LOCALE_MENU_HINT_MENU_FONTS }, - {LOCALE_FONTMENU_CHANNELLIST, 5, channellist_font_sizes, "fontsize.dcha", LOCALE_MENU_HINT_CHANNELLIST_FONTS }, - {LOCALE_FONTMENU_EVENTLIST , 5, eventlist_font_sizes , "fontsize.deve", LOCALE_MENU_HINT_EVENTLIST_FONTS }, - {LOCALE_FONTMENU_EPG , 4, epg_font_sizes , "fontsize.depg", LOCALE_MENU_HINT_EPG_FONTS }, - {LOCALE_FONTMENU_INFOBAR , 4, infobar_font_sizes , "fontsize.dinf", LOCALE_MENU_HINT_INFOBAR_FONTS }, - {LOCALE_FONTMENU_OTHER , 2, other_font_sizes , "fontsize.doth", LOCALE_MENU_HINT_OTHER_FONTS } + {LOCALE_FONTMENU_MENU , menu_font_items , menu_font_sizes , "fontsize.dmen", LOCALE_MENU_HINT_MENU_FONTS }, + {LOCALE_FONTMENU_CHANNELLIST, channellist_font_items, channellist_font_sizes, "fontsize.dcha", LOCALE_MENU_HINT_CHANNELLIST_FONTS }, + {LOCALE_FONTMENU_EVENTLIST , eventlist_font_items , eventlist_font_sizes , "fontsize.deve", LOCALE_MENU_HINT_EVENTLIST_FONTS }, + {LOCALE_FONTMENU_EPG , epg_font_items , epg_font_sizes , "fontsize.depg", LOCALE_MENU_HINT_EPG_FONTS }, + {LOCALE_FONTMENU_INFOBAR , infobar_font_items , infobar_font_sizes , "fontsize.dinf", LOCALE_MENU_HINT_INFOBAR_FONTS }, + {LOCALE_FONTMENU_OTHER , other_font_items , other_font_sizes , "fontsize.doth", LOCALE_MENU_HINT_OTHER_FONTS } }; +#define FONT_GROUP_COUNT (sizeof(font_sizes_groups)/sizeof(font_sizes_groups[0])) font_sizes_struct neutrino_font[SNeutrinoSettings::FONT_TYPE_COUNT] = { @@ -337,7 +344,7 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey) return res; } else if(strncmp(actionKey.c_str(), "fontsize.d", 10) == 0) { - for (int i = 0; i < FONT_GROUP_COUNT; i++) { + for (unsigned int i = 0; i < FONT_GROUP_COUNT; i++) { if (actionKey == font_sizes_groups[i].actionkey) { for (unsigned int j = 0; j < font_sizes_groups[i].count; j++) { SNeutrinoSettings::FONT_TYPES k = font_sizes_groups[i].content[j]; @@ -954,7 +961,7 @@ void COsdSetup::showOsdFontSizeSetup(CMenuWidget *menu_fonts) //fontSettings->addItem( new CMenuForwarder(LOCALE_EPGPLUS_SELECT_FONT_NAME, true, NULL, this, "select_font")); mn_widget_id_t w_index = MN_WIDGET_ID_OSDSETUP_FONTSIZE_MENU; - for (int i = 0; i < FONT_GROUP_COUNT; i++) + for (unsigned int i = 0; i < FONT_GROUP_COUNT; i++) { CMenuWidget *fontSettingsSubMenu = new CMenuWidget(LOCALE_FONTMENU_HEAD, NEUTRINO_ICON_KEYBINDING, width, w_index);