mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 17:01:08 +02:00
usermenu: formatting code using astyle; some manual code nicenings
Origin commit data
------------------
Branch: ni/coolstream
Commit: fc170d0cf2
Author: vanhofen <vanhofen@gmx.de>
Date: 2021-12-04 (Sat, 04 Dec 2021)
Origin message was:
------------------
- usermenu: formatting code using astyle; some manual code nicenings
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -60,7 +60,7 @@
|
||||
#include "movieplayer.h"
|
||||
#include "timerlist.h"
|
||||
#include "plugins.h"
|
||||
#include "imageinfo_ni.h" //NI
|
||||
#include "imageinfo_ni.h"
|
||||
#include "dboxinfo.h"
|
||||
#include "cam_menu.h"
|
||||
#include "pluginlist.h"
|
||||
@@ -73,13 +73,15 @@
|
||||
|
||||
#include <gui/widget/icons.h>
|
||||
#include <gui/adzap.h>
|
||||
#include <gui/infoicons.h>
|
||||
#include <gui/infoicons_setup.h>
|
||||
#include <gui/network_setup.h>
|
||||
#ifdef ENABLE_LCD4LINUX
|
||||
#include <gui/lcd4l_setup.h>
|
||||
#endif
|
||||
#include <gui/update_menue.h>
|
||||
#include <gui/hdd_menu.h>
|
||||
#include <gui/test_menu.h> //NI
|
||||
#include <gui/test_menu.h>
|
||||
#include <gui/webchannels_setup.h>
|
||||
#include <gui/miscsettings_menu.h>
|
||||
|
||||
@@ -87,6 +89,7 @@
|
||||
#include <driver/record.h>
|
||||
#include <driver/screen_max.h>
|
||||
|
||||
#include <system/debug.h>
|
||||
#include <system/helpers.h>
|
||||
#include <zapit/zapit.h>
|
||||
#include <hardware/video.h>
|
||||
@@ -97,13 +100,6 @@ extern CPlugins * g_Plugins; /* neutrino.cpp */
|
||||
extern cVideo *videoDecoder;
|
||||
extern CCAMMenuHandler *g_CamHandler;
|
||||
std::string CUserMenu::tmp;
|
||||
//
|
||||
#include <system/debug.h>
|
||||
|
||||
//NI
|
||||
#include <gui/infoicons_setup.h>
|
||||
|
||||
#include <gui/infoicons.h>
|
||||
|
||||
CUserMenu::CUserMenu()
|
||||
{
|
||||
@@ -120,7 +116,8 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
||||
int dummy = 0;
|
||||
unsigned ums = g_settings.usermenu.size();
|
||||
for (unsigned int i = 0; i < ums; i++)
|
||||
if (g_settings.usermenu[i]->key == msg) {
|
||||
if (g_settings.usermenu[i]->key == msg)
|
||||
{
|
||||
button = i;
|
||||
break;
|
||||
}
|
||||
@@ -129,7 +126,8 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
||||
return false;
|
||||
|
||||
int pers = -1;
|
||||
switch(msg) {
|
||||
switch (msg)
|
||||
{
|
||||
case CRCInput::RC_red:
|
||||
pers = SNeutrinoSettings::P_MAIN_RED_BUTTON;
|
||||
button = SNeutrinoSettings::BUTTON_RED;
|
||||
@@ -150,7 +148,8 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
||||
|
||||
CNeutrinoApp::getInstance()->StopSubtitles();
|
||||
|
||||
if (pers > -1 && (g_settings.personalize[pers] != CPersonalizeGui::PERSONALIZE_ACTIVE_MODE_ENABLED)) {
|
||||
if (pers > -1 && (g_settings.personalize[pers] != CPersonalizeGui::PERSONALIZE_ACTIVE_MODE_ENABLED))
|
||||
{
|
||||
ShowHint(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_PERSONALIZE_MENUDISABLEDHINT), 450, 10);
|
||||
CNeutrinoApp::getInstance()->StartSubtitles();
|
||||
return true;
|
||||
@@ -208,7 +207,8 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
||||
std::string itemstr_last("1");
|
||||
|
||||
std::vector<std::string> items = ::split(g_settings.usermenu[button]->items, ',');
|
||||
for (std::vector<std::string>::iterator it = items.begin(); it != items.end(); ++it) {
|
||||
for (std::vector<std::string>::iterator it = items.begin(); it != items.end(); ++it)
|
||||
{
|
||||
if (it->empty())
|
||||
continue;
|
||||
if (*it == itemstr_last)
|
||||
@@ -280,7 +280,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
||||
break;
|
||||
if (_mode_webtv)
|
||||
break;
|
||||
// NVOD/SubService- Kanal!
|
||||
// NVOD/SubService-Kanal
|
||||
CMenuWidget *tmpNVODSelector = new CMenuWidget(g_RemoteControl->are_subchannels ? LOCALE_NVODSELECTOR_SUBSERVICE : LOCALE_NVODSELECTOR_STARTTIME, NEUTRINO_ICON_VIDEO);
|
||||
if (!subchanselect.getNVODMenu(tmpNVODSelector))
|
||||
{
|
||||
@@ -330,7 +330,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
||||
{
|
||||
keyhelper.get(&key, &icon, feat_key[g_settings.personalize[SNeutrinoSettings::P_FEAT_KEY_VTXT]].key); // CRCInput::RC_blue
|
||||
menu_item = new CMenuForwarder(LOCALE_USERMENU_ITEM_VTXT, true, NULL, CPluginsExec::getInstance(), "teletext", key, icon);
|
||||
menu_item->setHint(NEUTRINO_ICON_HINT_VTXT, LOCALE_USERMENU_ITEM_VTXT); //NI
|
||||
menu_item->setHint(NEUTRINO_ICON_HINT_VTXT, LOCALE_USERMENU_ITEM_VTXT);
|
||||
break;
|
||||
}
|
||||
case SNeutrinoSettings::ITEM_FAVORITS:
|
||||
@@ -393,7 +393,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
||||
case SNeutrinoSettings::ITEM_IMAGEINFO:
|
||||
{
|
||||
keyhelper.get(&key, &icon);
|
||||
menu_item = new CMenuDForwarder(LOCALE_SERVICEMENU_IMAGEINFO, true, NULL, new CImageInfoNI, NULL, key, icon); //NI
|
||||
menu_item = new CMenuDForwarder(LOCALE_SERVICEMENU_IMAGEINFO, true, NULL, new CImageInfoNI, NULL, key, icon);
|
||||
menu_item->setHint(NEUTRINO_ICON_HINT_IMAGEINFO, LOCALE_MENU_HINT_IMAGEINFO);
|
||||
break;
|
||||
}
|
||||
@@ -432,7 +432,6 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
||||
menu_item->setHint(NEUTRINO_ICON_HINT_SCRIPTS, LOCALE_MENU_HINT_SCRIPTS);
|
||||
break;
|
||||
}
|
||||
//NI
|
||||
case SNeutrinoSettings::ITEM_ECMINFO:
|
||||
{
|
||||
keyhelper.get(&key, &icon);
|
||||
@@ -440,7 +439,6 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
||||
// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
|
||||
break;
|
||||
}
|
||||
//NI
|
||||
case SNeutrinoSettings::ITEM_CAMD_RESET:
|
||||
{
|
||||
keyhelper.get(&key, &icon);
|
||||
@@ -448,7 +446,6 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
||||
// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
|
||||
break;
|
||||
}
|
||||
//NI
|
||||
case SNeutrinoSettings::ITEM_INFOICONS:
|
||||
{
|
||||
keyhelper.get(&key, &icon);
|
||||
@@ -493,7 +490,6 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
||||
// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
|
||||
break;
|
||||
}
|
||||
//NI
|
||||
case SNeutrinoSettings::ITEM_TUNER_RESTART:
|
||||
{
|
||||
keyhelper.get(&key, &icon);
|
||||
@@ -561,7 +557,6 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
||||
menu_item->setHint(NEUTRINO_ICON_HINT_ADZAP, adzap_active ? LOCALE_MENU_HINT_ADZAP_ACTIVE : LOCALE_MENU_HINT_ADZAP);
|
||||
break;
|
||||
}
|
||||
//NI
|
||||
case SNeutrinoSettings::ITEM_TESTMENU:
|
||||
{
|
||||
keyhelper.get(&key, &icon);
|
||||
@@ -575,9 +570,11 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
||||
if (!number_of_plugins)
|
||||
continue;
|
||||
int count = 0;
|
||||
for(; count < number_of_plugins; count++) {
|
||||
for (; count < number_of_plugins; count++)
|
||||
{
|
||||
const char *pname = g_Plugins->getFileName(count);
|
||||
if (pname && (std::string(pname) == *it) && !g_Plugins->isHidden(count)) {
|
||||
if (pname && (std::string(pname) == *it) && !g_Plugins->isHidden(count))
|
||||
{
|
||||
neutrino_msg_t d_key = g_Plugins->getKey(count);
|
||||
keyhelper.get(&key, &icon, d_key);
|
||||
menu_item = new CMenuForwarder(g_Plugins->getName(count), true, NULL, CPluginsExec::getInstance(), to_string(count).c_str(), key, icon);
|
||||
@@ -592,7 +589,8 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
||||
} // switch end
|
||||
|
||||
itemstr_last = *it;
|
||||
if (menu_item) {
|
||||
if (menu_item)
|
||||
{
|
||||
menu_items++;
|
||||
menu->addItem(menu_item, false);
|
||||
last_menu_item = menu_item;
|
||||
@@ -600,7 +598,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
||||
}
|
||||
|
||||
CInfoClock::getInstance()->enableInfoClock(false);
|
||||
CInfoIcons::getInstance()->enableInfoIcons(false); //NI
|
||||
CInfoIcons::getInstance()->enableInfoIcons(false);
|
||||
// show menu if there are more than 2 items only
|
||||
// otherwise, we start the item directly (must be the last one)
|
||||
if (menu_items > 1)
|
||||
@@ -609,7 +607,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
||||
last_menu_item->exec(NULL);
|
||||
|
||||
CInfoClock::getInstance()->enableInfoClock(true);
|
||||
CInfoIcons::getInstance()->enableInfoIcons(true); //NI
|
||||
CInfoIcons::getInstance()->enableInfoIcons(true);
|
||||
CNeutrinoApp::getInstance()->StartSubtitles();
|
||||
|
||||
if (button < COL_BUTTONMAX)
|
||||
@@ -630,19 +628,24 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu
|
||||
const char *text = NULL;
|
||||
int mode = CNeutrinoApp::getInstance()->getMode();
|
||||
std::vector<std::string> items = ::split(g_settings.usermenu[button]->items, ',');
|
||||
for (std::vector<std::string>::iterator it = items.begin(); it != items.end(); ++it) {
|
||||
for (std::vector<std::string>::iterator it = items.begin(); it != items.end(); ++it)
|
||||
{
|
||||
int item = -1;
|
||||
if (it->find_first_not_of("0123456789") == std::string::npos)
|
||||
item = atoi(*it);
|
||||
|
||||
switch(item) {
|
||||
switch (item)
|
||||
{
|
||||
case -1:
|
||||
if (loc != NONEXISTANT_LOCALE || text)
|
||||
return_title = true;
|
||||
else {
|
||||
else
|
||||
{
|
||||
int nop = g_Plugins->getNumberOfPlugins();
|
||||
for(int count = 0; count < nop; count++) {
|
||||
if (std::string(g_Plugins->getFileName(count)) == *it) {
|
||||
for (int count = 0; count < nop; count++)
|
||||
{
|
||||
if (std::string(g_Plugins->getFileName(count)) == *it)
|
||||
{
|
||||
tmp = g_Plugins->getName(count);
|
||||
text = tmp.c_str();
|
||||
active = true;
|
||||
@@ -654,8 +657,10 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu
|
||||
case SNeutrinoSettings::ITEM_NONE:
|
||||
case SNeutrinoSettings::ITEM_BAR:
|
||||
case SNeutrinoSettings::ITEM_LIVESTREAM_RESOLUTION:
|
||||
if (mode == NeutrinoModes::mode_webtv && !CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty()) {
|
||||
if(loc == NONEXISTANT_LOCALE && !text) {
|
||||
if (mode == NeutrinoModes::mode_webtv && !CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty())
|
||||
{
|
||||
if (loc == NONEXISTANT_LOCALE && !text)
|
||||
{
|
||||
CWebTVResolution webtvres;
|
||||
tmp = webtvres.getResolutionValue();
|
||||
if (!(videoDecoder->getBlank()))
|
||||
@@ -671,10 +676,13 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu
|
||||
text = tmp.c_str();
|
||||
}
|
||||
}
|
||||
}else{
|
||||
}
|
||||
else
|
||||
{
|
||||
text = tmp.c_str();
|
||||
}
|
||||
} else
|
||||
}
|
||||
else
|
||||
return_title = true;
|
||||
active = true;
|
||||
}
|
||||
@@ -684,7 +692,8 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu
|
||||
active = true;
|
||||
continue;
|
||||
case SNeutrinoSettings::ITEM_SUBCHANNEL:
|
||||
if (!g_RemoteControl->subChannels.empty()) {
|
||||
if (!g_RemoteControl->subChannels.empty())
|
||||
{
|
||||
if (loc == NONEXISTANT_LOCALE && !text)
|
||||
loc = g_RemoteControl->are_subchannels ? LOCALE_NVODSELECTOR_SUBSERVICE : LOCALE_NVODSELECTOR_STARTTIME;
|
||||
else
|
||||
@@ -703,17 +712,20 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu
|
||||
active = true;
|
||||
continue;
|
||||
case SNeutrinoSettings::ITEM_AUDIO_SELECT:
|
||||
if(loc == NONEXISTANT_LOCALE && !text) {
|
||||
if (mode == NeutrinoModes::mode_webtv){
|
||||
if (loc == NONEXISTANT_LOCALE && !text)
|
||||
{
|
||||
if (mode == NeutrinoModes::mode_webtv)
|
||||
{
|
||||
tmp = CMoviePlayerGui::getInstance(true).CurrentAudioName(); // use instance_bg.
|
||||
text = tmp.c_str();
|
||||
}
|
||||
else if (!g_RemoteControl->current_PIDs.APIDs.empty()){
|
||||
tmp = g_RemoteControl->current_PIDs.APIDs[
|
||||
g_RemoteControl->current_PIDs.PIDs.selected_apid].desc;
|
||||
else if (!g_RemoteControl->current_PIDs.APIDs.empty())
|
||||
{
|
||||
tmp = g_RemoteControl->current_PIDs.APIDs[g_RemoteControl->current_PIDs.PIDs.selected_apid].desc;
|
||||
text = tmp.c_str();
|
||||
}
|
||||
} else
|
||||
}
|
||||
else
|
||||
return_title = true;
|
||||
active = true;
|
||||
continue;
|
||||
@@ -729,12 +741,15 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu
|
||||
break;
|
||||
}
|
||||
|
||||
if (return_title) {
|
||||
if (return_title)
|
||||
{
|
||||
if (!g_settings.usermenu[button]->title.empty())
|
||||
return g_settings.usermenu[button]->title.c_str();
|
||||
if (button < USERMENU_ITEMS_COUNT)
|
||||
return g_Locale->getText(usermenu[button].def_name);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
if (text)
|
||||
return text;
|
||||
if (loc != NONEXISTANT_LOCALE)
|
||||
@@ -744,12 +759,10 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu
|
||||
return "";
|
||||
}
|
||||
|
||||
/**************************************************************************************
|
||||
* changeNotify - features menu recording start / stop *
|
||||
**************************************************************************************/
|
||||
bool CUserMenu::changeNotify(const neutrino_locale_t OptionName, void *Data)
|
||||
{
|
||||
if (ARE_LOCALES_EQUAL(OptionName, LOCALE_MAINMENU_PAUSESECTIONSD)) {
|
||||
if (ARE_LOCALES_EQUAL(OptionName, LOCALE_MAINMENU_PAUSESECTIONSD))
|
||||
{
|
||||
g_Sectionsd->setPauseScanning((*((int *)Data)) == 0);
|
||||
}
|
||||
|
||||
|
@@ -80,7 +80,6 @@ class CUserMenu : public CChangeObserver
|
||||
static const char *getUserMenuButtonName(int button, bool &active, bool return_title = false);
|
||||
};
|
||||
|
||||
|
||||
// This is just a quick helper for the usermenu and pluginlist.
|
||||
class CColorKeyHelper
|
||||
{
|
||||
@@ -100,11 +99,13 @@ class CColorKeyHelper
|
||||
color_key_used[i] = false;
|
||||
};
|
||||
|
||||
/* Returns the next available button, to be used in menu as 'direct' keys. Appropriate
|
||||
/*
|
||||
* Returns the next available button, to be used in menu as 'direct' keys. Appropriate
|
||||
* definitions are returnd in msp and icon
|
||||
* A color button could be requested as prefered button (other buttons are not supported yet).
|
||||
* If the appropriate button is already in used, the next number_key button is returned instead
|
||||
* (first 1-9 and than 0). */
|
||||
* (first 1-9 and than 0).
|
||||
*/
|
||||
bool get(neutrino_msg_t *msg, const char **icon, neutrino_msg_t prefered_key = CRCInput::RC_nokey)
|
||||
{
|
||||
bool result = false;
|
||||
@@ -121,7 +122,8 @@ class CColorKeyHelper
|
||||
*msg = CRCInput::RC_nokey;
|
||||
*icon = "";
|
||||
if (button >= 0 && button < COL_BUTTONMAX)
|
||||
{ // try to get color button
|
||||
{
|
||||
// try to get color button
|
||||
if (color_key_used[button] == false)
|
||||
{
|
||||
color_key_used[button] = true;
|
||||
|
Reference in New Issue
Block a user