From 999610dcd16c6d8745b5d16b78b61dfb6c8b9715 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Sun, 24 Jun 2018 23:07:02 +0200 Subject: [PATCH] - channellist: allow to show resolution icons Conflicts: data/locale/deutsch.locale data/locale/english.locale src/system/locals.h src/system/locals_intern.h Signed-off-by: Thilo Graf --- 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 | 14 ++++++++------ 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, 50 insertions(+), 6 deletions(-) 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()) @@ -1986,6 +1998,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 676a1b4a4..f9d0f38e6 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -1307,6 +1307,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 e044eb1c8..4c2a82845 100644 --- a/src/gui/widget/icons.h +++ b/src/gui/widget/icons.h @@ -207,6 +207,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" @@ -215,10 +216,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 162d033d5..be1518803 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -747,6 +747,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; @@ -1440,6 +1441,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 030b285ed..ac8d29f24 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -310,6 +310,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, @@ -1079,6 +1080,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_CHANNELS, LOCALE_MENU_HINT_CI, LOCALE_MENU_HINT_CLOCK_BACKGROUND, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 32a1cfb5e..1f59c0e20 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -310,6 +310,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", @@ -1079,6 +1080,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_channels", "menu.hint_ci", "menu.hint_clock_background", diff --git a/src/system/settings.h b/src/system/settings.h index 6117eedae..207cd322c 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -634,6 +634,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