From 4c7cea95e9b93a2b05e36d2aa00f3ce02fadfe62 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Mon, 14 Dec 2015 23:04:04 +0100 Subject: [PATCH] - infoviewer_bb: use key-assignment from movieplayer --- src/gui/infoviewer_bb.cpp | 35 ++++++++++++++++++++++++++++------- src/gui/keybind_setup.cpp | 14 ++++++++++++++ src/gui/keybind_setup.h | 1 + 3 files changed, 43 insertions(+), 7 deletions(-) diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index af412c077..83f8988b2 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -45,6 +45,7 @@ #include #include +#include "gui/keybind_setup.h" #include #include #include @@ -222,16 +223,16 @@ void CInfoViewerBB::getBBButtonInfo() frameBuffer->getIconSize(icon.c_str(), &w, &h); mode = CNeutrinoApp::getInstance()->getMode(); if (mode == NeutrinoMessages::mode_ts) { - text = g_Locale->getText(LOCALE_EPGMENU_STREAMINFO); - active = true; - } else { - text = CUserMenu::getUserMenuButtonName(0, active); + text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_red, active); if (!text.empty()) break; - text = g_settings.usermenu[SNeutrinoSettings::BUTTON_RED]->title; - if (text.empty()) - text = g_Locale->getText(LOCALE_INFOVIEWER_EVENTLIST); } + text = CUserMenu::getUserMenuButtonName(0, active); + if (!text.empty()) + break; + text = g_settings.usermenu[SNeutrinoSettings::BUTTON_RED]->title; + if (text.empty()) + text = g_Locale->getText(LOCALE_INFOVIEWER_EVENTLIST); break; case CInfoViewerBB::BUTTON_GREEN: icon = NEUTRINO_ICON_BUTTON_GREEN; @@ -240,6 +241,12 @@ void CInfoViewerBB::getBBButtonInfo() mode = CNeutrinoApp::getInstance()->getMode(); if (!text.empty() && mode < NeutrinoMessages::mode_audio) break; + mode = CNeutrinoApp::getInstance()->getMode(); + if (mode == NeutrinoMessages::mode_ts) { + text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_green, active); + if (!text.empty()) + break; + } text = g_settings.usermenu[SNeutrinoSettings::BUTTON_GREEN]->title; if (text == g_Locale->getText(LOCALE_AUDIOSELECTMENUE_HEAD)) text = ""; @@ -255,6 +262,12 @@ void CInfoViewerBB::getBBButtonInfo() case CInfoViewerBB::BUTTON_YELLOW: icon = NEUTRINO_ICON_BUTTON_YELLOW; frameBuffer->getIconSize(icon.c_str(), &w, &h); + mode = CNeutrinoApp::getInstance()->getMode(); + if (mode == NeutrinoMessages::mode_ts) { + text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_yellow, active); + if (!text.empty()) + break; + } text = CUserMenu::getUserMenuButtonName(2, active); if (!text.empty()) break; @@ -265,6 +278,12 @@ void CInfoViewerBB::getBBButtonInfo() case CInfoViewerBB::BUTTON_BLUE: icon = NEUTRINO_ICON_BUTTON_BLUE; frameBuffer->getIconSize(icon.c_str(), &w, &h); + mode = CNeutrinoApp::getInstance()->getMode(); + if (mode == NeutrinoMessages::mode_ts) { + text = CKeybindSetup::getMoviePlayerButtonName(CRCInput::RC_blue, active); + if (!text.empty()) + break; + } text = CUserMenu::getUserMenuButtonName(3, active); if (!text.empty()) break; @@ -288,12 +307,14 @@ void CInfoViewerBB::getBBButtonInfo() bbButtonMaxX = g_InfoViewer->ChanInfoX + 10; int br = 0, count = 0; for (int i = 0; i < CInfoViewerBB::BUTTON_MAX; i++) { +#if 0 if ((i == CInfoViewerBB::BUTTON_YELLOW) && (g_RemoteControl->subChannels.empty())) { // no subchannels bbButtonInfo[i].paint = false; // bbButtonInfo[i].x = -1; // continue; } else +#endif { count++; bbButtonInfo[i].paint = true; diff --git a/src/gui/keybind_setup.cpp b/src/gui/keybind_setup.cpp index a267981fb..59b8f18a6 100644 --- a/src/gui/keybind_setup.cpp +++ b/src/gui/keybind_setup.cpp @@ -568,3 +568,17 @@ bool CKeybindSetup::changeNotify(const neutrino_locale_t OptionName, void * /* d } return false; } + +const char *CKeybindSetup::getMoviePlayerButtonName(const neutrino_msg_t key, bool &active) +{ + active = false; + for (unsigned int i = MPKEY_REWIND; i <= MPKEY_PLUGIN; i++) + { + if ((uint32_t)*key_settings[i].keyvalue_p == (unsigned int)key) + { + active = true; + return g_Locale->getText(key_settings[i].keydescription); + } + } + return ""; +} diff --git a/src/gui/keybind_setup.h b/src/gui/keybind_setup.h index 4e3785f1a..a43067ead 100644 --- a/src/gui/keybind_setup.h +++ b/src/gui/keybind_setup.h @@ -112,6 +112,7 @@ class CKeybindSetup : public CMenuTarget, public CChangeObserver ~CKeybindSetup(); int exec(CMenuTarget* parent, const std::string & actionKey); bool changeNotify(const neutrino_locale_t OptionName, void * data); + static const char *getMoviePlayerButtonName(const neutrino_msg_t key, bool &active); }; #endif