From bab8cf8e318dc57b481e6778b1ba7eb28486c5a1 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 24 Jun 2018 23:07:02 +0200 Subject: [PATCH] channellist: allow to show resolution icons Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/114bc9f4bef838cac42a9cf18666a91db79b51bc Author: vanhofen Date: 2018-06-24 (Sun, 24 Jun 2018) Origin message was: ------------------ - channellist: allow to show resolution icons ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/icons/status/markers/Makefile.am | 3 +++ data/icons/status/markers/marker_hd.png | Bin 0 -> 228 bytes data/icons/status/markers/marker_sd.png | Bin 0 -> 276 bytes data/icons/status/markers/marker_uhd.png | Bin 0 -> 194 bytes data/locale/deutsch.locale | 2 ++ data/locale/english.locale | 2 ++ src/gui/channellist.cpp | 22 ++++++++++++++++++++++ src/gui/osd_setup.cpp | 5 +++++ src/gui/widget/icons.h | 3 +++ src/neutrino.cpp | 2 ++ src/system/locals.h | 2 ++ src/system/locals_intern.h | 2 ++ src/system/settings.h | 1 + 13 files changed, 44 insertions(+) create mode 100644 data/icons/status/markers/marker_hd.png create mode 100644 data/icons/status/markers/marker_sd.png create mode 100644 data/icons/status/markers/marker_uhd.png diff --git a/data/icons/status/markers/Makefile.am b/data/icons/status/markers/Makefile.am index 3e6403349..80300b7a4 100644 --- a/data/icons/status/markers/Makefile.am +++ b/data/icons/status/markers/Makefile.am @@ -4,6 +4,7 @@ install_DATA = \ marker_dialog_off.png \ marker_dialog_ok.png \ marker_epg.png \ + marker_hd.png \ marker_hidden.png \ marker_lock.png \ marker_lock_passive.png \ @@ -12,10 +13,12 @@ install_DATA = \ marker_record.png \ marker_record_gray.png \ marker_scrambled.png \ + marker_sd.png \ marker_streaming.png \ marker_timeshift.png \ marker_timeshift_gray.png \ marker_tv.png \ + marker_uhd.png \ marker_update_available.png \ marker_warning.png \ marker_zap.png \ diff --git a/data/icons/status/markers/marker_hd.png b/data/icons/status/markers/marker_hd.png new file mode 100644 index 0000000000000000000000000000000000000000..2b21d40d88dbda5f8301278d8d4c5d4def0f2acd GIT binary patch literal 228 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+0wn(&ce?|mn3BBRT^Rni_n+Ah4nJ za0`PlBg3pY5H=O_D5_IyqvsRa_8cJLZzNAjv*T7&z?KT+w8#Oa`E}qZ4+W{ zzIve(@YzH#69Sru1>sOj!_v@@&-OaZt(`?rYJC-lf VMqB3Jc?)y^gQu&X%Q~loCII2iQbhm& literal 0 HcmV?d00001 diff --git a/data/icons/status/markers/marker_sd.png b/data/icons/status/markers/marker_sd.png new file mode 100644 index 0000000000000000000000000000000000000000..e7fca4fe3fc63f2cb21c38f488adecc56f157357 GIT binary patch literal 276 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+0wn(&ce?|mn3BBRT^Rni_n+Ah4nJ za0`PlBg3pY5H=O_D5_ILTp0jU#vBOLQ6ee978nDubp(4_mF`=vwe8%!q)96 zOZ+CzP2f7>ayI!C*VMjt6_E+Qnp^HK+AMpzTbP0l+XkK6Wn5; literal 0 HcmV?d00001 diff --git a/data/icons/status/markers/marker_uhd.png b/data/icons/status/markers/marker_uhd.png new file mode 100644 index 0000000000000000000000000000000000000000..4467b55e809571d66f6a28ca39c071640ebf7236 GIT binary patch literal 194 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+0wn(&ce?|mn3BBRT^Rni_n+Ah4nJ za0`PlBg3pY5H=O_D5_IyaFsI4&8qQ6bklqaSYKopPV4EisHD()) + res_icon = NEUTRINO_ICON_MARKER_HD; + else if (chan->isUHD()) + res_icon = NEUTRINO_ICON_MARKER_UHD; + else + res_icon = NEUTRINO_ICON_MARKER_SD; + } + //set webtv icon const char *webtv_icon = NULL; if (!chan->getUrl().empty()) @@ -2009,6 +2021,16 @@ void CChannelList::paintItem(int pos, const bool firstpaint) int offset_right = OFFSET_INNER_MID; int icon_x_right = x + width - SCROLLBAR_WIDTH - offset_right; + if (res_icon) + { + frameBuffer->getIconSize(res_icon, &icon_w, &icon_h); + if (frameBuffer->paintIcon(res_icon, icon_x_right - icon_w, ypos, fheight)) + { + offset_right += icon_w + OFFSET_INNER_MID; + icon_x_right -= icon_w + OFFSET_INNER_MID; + } + } + if (scramble_icon) { frameBuffer->getIconSize(scramble_icon, &icon_w, &icon_h); diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 620ddd5b8..65c5af971 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -1385,6 +1385,11 @@ void COsdSetup::showOsdChanlistSetup(CMenuWidget *menu_chanlist) mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_EPG_ALIGN); menu_chanlist->addItem(mc); + // show resolution icon + mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_SHOW_RES_ICON, &g_settings.channellist_show_res_icon, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true); + mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_SHOW_RES_ICON); + menu_chanlist->addItem(mc); + // extended channel list mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_EXTENDED, &g_settings.theme.progressbar_design_channellist, PROGRESSBAR_COLOR_OPTIONS, PROGRESSBAR_COLOR_OPTION_COUNT, true, this); mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_EXTENDED); diff --git a/src/gui/widget/icons.h b/src/gui/widget/icons.h index 46fd0b2b0..27d7bbc08 100644 --- a/src/gui/widget/icons.h +++ b/src/gui/widget/icons.h @@ -210,6 +210,7 @@ /* markers */ #define NEUTRINO_ICON_MARKER_EPG "marker_epg" +#define NEUTRINO_ICON_MARKER_HD "marker_hd" #define NEUTRINO_ICON_MARKER_HIDDEN "marker_hidden" #define NEUTRINO_ICON_MARKER_LOCK "marker_lock" #define NEUTRINO_ICON_MARKER_LOCK_PASSIVE "marker_lock_passive" @@ -218,10 +219,12 @@ #define NEUTRINO_ICON_MARKER_RECORD "marker_record" #define NEUTRINO_ICON_MARKER_RECORD_GRAY "marker_record_gray" #define NEUTRINO_ICON_MARKER_SCRAMBLED "marker_scrambled" +#define NEUTRINO_ICON_MARKER_SD "marker_sd" #define NEUTRINO_ICON_MARKER_STREAMING "marker_streaming" #define NEUTRINO_ICON_MARKER_TIMESHIFT "marker_timeshift" #define NEUTRINO_ICON_MARKER_TIMESHIFT_GRAY "marker_timeshift_gray" #define NEUTRINO_ICON_MARKER_TV "marker_tv" +#define NEUTRINO_ICON_MARKER_UHD "marker_uhd" #define NEUTRINO_ICON_MARKER_WARNING "marker_warning" #define NEUTRINO_ICON_MARKER_ZAP "marker_zap" diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 130829289..0a2d44539 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -807,6 +807,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.channellist_show_channellogo = configfile.getInt32("channellist_show_channellogo", 1); g_settings.channellist_show_infobox = configfile.getInt32("channellist_show_infobox", 1); g_settings.channellist_show_numbers = configfile.getInt32("channellist_show_numbers", 1); + g_settings.channellist_show_res_icon = configfile.getInt32("channellist_show_res_icon", 0); //screen configuration g_settings.osd_resolution = (osd_resolution_tmp == -1) ? configfile.getInt32("osd_resolution", 0) : osd_resolution_tmp; @@ -1588,6 +1589,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("channellist_show_channellogo", g_settings.channellist_show_channellogo); configfile.setInt32("channellist_show_infobox", g_settings.channellist_show_infobox); configfile.setInt32("channellist_show_numbers", g_settings.channellist_show_numbers); + configfile.setInt32("channellist_show_res_icon", g_settings.channellist_show_res_icon); //screen configuration configfile.setInt32("osd_resolution" , COsdHelpers::getInstance()->g_settings_osd_resolution_save); diff --git a/src/system/locals.h b/src/system/locals.h index d07570404..8c4fee0fe 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -344,6 +344,7 @@ typedef enum LOCALE_CHANNELLIST_SHOW_CHANNELNUMBER, LOCALE_CHANNELLIST_SHOW_EMPTY_FAVS, LOCALE_CHANNELLIST_SHOW_INFOBOX, + LOCALE_CHANNELLIST_SHOW_RES_ICON, LOCALE_CHANNELLIST_SINCE, LOCALE_CHANNELLIST_START, LOCALE_CI_CLOCK, @@ -1214,6 +1215,7 @@ typedef enum LOCALE_MENU_HINT_CHANNELLIST_SHOW_CHANNELNUMBER, LOCALE_MENU_HINT_CHANNELLIST_SHOW_EMPTY_FAVS, LOCALE_MENU_HINT_CHANNELLIST_SHOW_INFOBOX, + LOCALE_MENU_HINT_CHANNELLIST_SHOW_RES_ICON, LOCALE_MENU_HINT_CHANNELLOGOS_SETUP, LOCALE_MENU_HINT_CHANNELS, LOCALE_MENU_HINT_CI, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 88225f506..5b4c948a3 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -344,6 +344,7 @@ const char * locale_real_names[] = "channellist.show_channelnumber", "channellist.show_empty_favs", "channellist.show_infobox", + "channellist.show_res_icon", "channellist.since", "channellist.start", "ci.clock", @@ -1214,6 +1215,7 @@ const char * locale_real_names[] = "menu.hint_channellist_show_channelnumber", "menu.hint_channellist_show_empty_favs", "menu.hint_channellist_show_infobox", + "menu.hint_channellist_show_res_icon", "menu.hint_channellogos_setup", "menu.hint_channels", "menu.hint_ci", diff --git a/src/system/settings.h b/src/system/settings.h index 1c55515c7..01f2e9cfd 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -645,6 +645,7 @@ struct SNeutrinoSettings int channellist_show_channellogo; int channellist_show_infobox; int channellist_show_numbers; + int channellist_show_res_icon; int repeat_blocker; int repeat_genericblocker; #define LONGKEYPRESS_OFF 499