mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-13 08:23:45 +02:00
- usermenu: formatting code using astyle; some manual code nicenings
Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
@@ -87,6 +87,7 @@
|
|||||||
#include <driver/record.h>
|
#include <driver/record.h>
|
||||||
#include <driver/screen_max.h>
|
#include <driver/screen_max.h>
|
||||||
|
|
||||||
|
#include <system/debug.h>
|
||||||
#include <system/helpers.h>
|
#include <system/helpers.h>
|
||||||
#include <zapit/zapit.h>
|
#include <zapit/zapit.h>
|
||||||
#include <hardware/video.h>
|
#include <hardware/video.h>
|
||||||
@@ -97,8 +98,6 @@ extern CPlugins * g_Plugins; /* neutrino.cpp */
|
|||||||
extern cVideo *videoDecoder;
|
extern cVideo *videoDecoder;
|
||||||
extern CCAMMenuHandler *g_CamHandler;
|
extern CCAMMenuHandler *g_CamHandler;
|
||||||
std::string CUserMenu::tmp;
|
std::string CUserMenu::tmp;
|
||||||
//
|
|
||||||
#include <system/debug.h>
|
|
||||||
|
|
||||||
CUserMenu::CUserMenu()
|
CUserMenu::CUserMenu()
|
||||||
{
|
{
|
||||||
@@ -115,7 +114,8 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
|||||||
int dummy = 0;
|
int dummy = 0;
|
||||||
unsigned ums = g_settings.usermenu.size();
|
unsigned ums = g_settings.usermenu.size();
|
||||||
for (unsigned int i = 0; i < ums; i++)
|
for (unsigned int i = 0; i < ums; i++)
|
||||||
if (g_settings.usermenu[i]->key == msg) {
|
if (g_settings.usermenu[i]->key == msg)
|
||||||
|
{
|
||||||
button = i;
|
button = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -124,7 +124,8 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
int pers = -1;
|
int pers = -1;
|
||||||
switch(msg) {
|
switch (msg)
|
||||||
|
{
|
||||||
case CRCInput::RC_red:
|
case CRCInput::RC_red:
|
||||||
pers = SNeutrinoSettings::P_MAIN_RED_BUTTON;
|
pers = SNeutrinoSettings::P_MAIN_RED_BUTTON;
|
||||||
button = SNeutrinoSettings::BUTTON_RED;
|
button = SNeutrinoSettings::BUTTON_RED;
|
||||||
@@ -145,7 +146,8 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
|||||||
|
|
||||||
CNeutrinoApp::getInstance()->StopSubtitles();
|
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);
|
ShowHint(LOCALE_MESSAGEBOX_INFO, g_Locale->getText(LOCALE_PERSONALIZE_MENUDISABLEDHINT), 450, 10);
|
||||||
CNeutrinoApp::getInstance()->StartSubtitles();
|
CNeutrinoApp::getInstance()->StartSubtitles();
|
||||||
return true;
|
return true;
|
||||||
@@ -196,13 +198,15 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
|||||||
bool _mode_webtv = (CNeutrinoApp::getInstance()->getMode() == NeutrinoModes::mode_webtv) &&
|
bool _mode_webtv = (CNeutrinoApp::getInstance()->getMode() == NeutrinoModes::mode_webtv) &&
|
||||||
(CZapit::getInstance()->GetCurrentChannel() && !CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty());
|
(CZapit::getInstance()->GetCurrentChannel() && !CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty());
|
||||||
|
|
||||||
|
// int rec_mode = (CRecordManager::getInstance()->GetRecordMode() & CRecordManager::RECMODE_REC_TSHIFT);
|
||||||
bool timeshift = CMoviePlayerGui::getInstance().timeshift;
|
bool timeshift = CMoviePlayerGui::getInstance().timeshift;
|
||||||
bool adzap_active = CAdZapMenu::getInstance()->isActive();
|
bool adzap_active = CAdZapMenu::getInstance()->isActive();
|
||||||
|
|
||||||
std::string itemstr_last("1");
|
std::string itemstr_last("1");
|
||||||
|
|
||||||
std::vector<std::string> items = ::split(g_settings.usermenu[button]->items, ',');
|
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())
|
if (it->empty())
|
||||||
continue;
|
continue;
|
||||||
if (*it == itemstr_last)
|
if (*it == itemstr_last)
|
||||||
@@ -274,7 +278,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
|||||||
break;
|
break;
|
||||||
if (_mode_webtv)
|
if (_mode_webtv)
|
||||||
break;
|
break;
|
||||||
// NVOD/SubService- Kanal!
|
// NVOD/SubService-Kanal
|
||||||
CMenuWidget *tmpNVODSelector = new CMenuWidget(g_RemoteControl->are_subchannels ? LOCALE_NVODSELECTOR_SUBSERVICE : LOCALE_NVODSELECTOR_STARTTIME, NEUTRINO_ICON_VIDEO);
|
CMenuWidget *tmpNVODSelector = new CMenuWidget(g_RemoteControl->are_subchannels ? LOCALE_NVODSELECTOR_SUBSERVICE : LOCALE_NVODSELECTOR_STARTTIME, NEUTRINO_ICON_VIDEO);
|
||||||
if (!subchanselect.getNVODMenu(tmpNVODSelector))
|
if (!subchanselect.getNVODMenu(tmpNVODSelector))
|
||||||
{
|
{
|
||||||
@@ -320,13 +324,13 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
|||||||
menu_item->setHint(NEUTRINO_ICON_HINT_TIMERS, LOCALE_MENU_HINT_TIMERS);
|
menu_item->setHint(NEUTRINO_ICON_HINT_TIMERS, LOCALE_MENU_HINT_TIMERS);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SNeutrinoSettings::ITEM_VTXT:
|
// case SNeutrinoSettings::ITEM_VTXT:
|
||||||
{
|
// {
|
||||||
keyhelper.get(&key,&icon, feat_key[g_settings.personalize[SNeutrinoSettings::P_FEAT_KEY_VTXT]].key); //CRCInput::RC_blue
|
// 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 = new CMenuForwarder(LOCALE_USERMENU_ITEM_VTXT, true, NULL, CPluginsExec::getInstance(), "teletext", key, icon);
|
||||||
// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
|
// menu_item->setHint(NEUTRINO_ICON_HINT_VTXT, LOCALE_USERMENU_ITEM_VTXT);
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
case SNeutrinoSettings::ITEM_FAVORITS:
|
case SNeutrinoSettings::ITEM_FAVORITS:
|
||||||
{
|
{
|
||||||
keyhelper.get(&key, &icon, feat_key[g_settings.personalize[SNeutrinoSettings::P_FEAT_KEY_FAVORIT]].key); // CRCInput::RC_green
|
keyhelper.get(&key, &icon, feat_key[g_settings.personalize[SNeutrinoSettings::P_FEAT_KEY_FAVORIT]].key); // CRCInput::RC_green
|
||||||
@@ -426,6 +430,27 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
|||||||
menu_item->setHint(NEUTRINO_ICON_HINT_SCRIPTS, LOCALE_MENU_HINT_SCRIPTS);
|
menu_item->setHint(NEUTRINO_ICON_HINT_SCRIPTS, LOCALE_MENU_HINT_SCRIPTS);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// case SNeutrinoSettings::ITEM_ECMINFO:
|
||||||
|
// {
|
||||||
|
// keyhelper.get(&key, &icon);
|
||||||
|
// menu_item = new CMenuForwarder(LOCALE_ECMINFO_SHOW, file_size("/tmp/ecm.info"), NULL, neutrino, "ecmInfo", key, icon);
|
||||||
|
// // FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// case SNeutrinoSettings::ITEM_CAMD_RESET:
|
||||||
|
// {
|
||||||
|
// keyhelper.get(&key, &icon);
|
||||||
|
// menu_item = new CMenuForwarder(LOCALE_CAMD_RESET, !rec_mode, NULL, neutrino, "camd_reset", key, icon);
|
||||||
|
// // FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// case SNeutrinoSettings::ITEM_INFOICONS:
|
||||||
|
// {
|
||||||
|
// keyhelper.get(&key, &icon);
|
||||||
|
// menu_item = new CMenuForwarder(!g_settings.mode_icons ? LOCALE_INFOICONS_SWITCH_ON : LOCALE_INFOICONS_SWITCH_OFF, g_settings.mode_icons_skin != INFOICONS_INFOVIEWER, NULL, new CInfoIconsSetup, "infoicons_switch", key, icon);
|
||||||
|
// // FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
#if ENABLE_YOUTUBE_PLAYER
|
#if ENABLE_YOUTUBE_PLAYER
|
||||||
case SNeutrinoSettings::ITEM_YOUTUBE:
|
case SNeutrinoSettings::ITEM_YOUTUBE:
|
||||||
{
|
{
|
||||||
@@ -463,6 +488,13 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
|||||||
// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
|
// FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// case SNeutrinoSettings::ITEM_TUNER_RESTART:
|
||||||
|
// {
|
||||||
|
// keyhelper.get(&key, &icon);
|
||||||
|
// menu_item = new CMenuForwarder(LOCALE_SERVICEMENU_RESTART_TUNER, true, NULL, neutrino, "restarttuner", key, icon);
|
||||||
|
// menu_item->setHint(NEUTRINO_ICON_HINT_RELOAD_CHANNELS, LOCALE_MENU_HINT_RESTART_TUNER);
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
case SNeutrinoSettings::ITEM_HDDMENU:
|
case SNeutrinoSettings::ITEM_HDDMENU:
|
||||||
{
|
{
|
||||||
keyhelper.get(&key, &icon);
|
keyhelper.get(&key, &icon);
|
||||||
@@ -523,15 +555,24 @@ 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);
|
menu_item->setHint(NEUTRINO_ICON_HINT_ADZAP, adzap_active ? LOCALE_MENU_HINT_ADZAP_ACTIVE : LOCALE_MENU_HINT_ADZAP);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// case SNeutrinoSettings::ITEM_TESTMENU:
|
||||||
|
// {
|
||||||
|
// keyhelper.get(&key, &icon);
|
||||||
|
// menu_item = new CMenuDForwarder(LOCALE_TESTMENU, true, NULL, new CTestMenu(), NULL, key, icon);
|
||||||
|
// // FIXME menu_item->setHint("", NONEXISTANT_LOCALE);
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
case -1: // plugin
|
case -1: // plugin
|
||||||
{
|
{
|
||||||
int number_of_plugins = g_Plugins->getNumberOfPlugins();
|
int number_of_plugins = g_Plugins->getNumberOfPlugins();
|
||||||
if (!number_of_plugins)
|
if (!number_of_plugins)
|
||||||
continue;
|
continue;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for(; count < number_of_plugins; count++) {
|
for (; count < number_of_plugins; count++)
|
||||||
|
{
|
||||||
const char *pname = g_Plugins->getFileName(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);
|
neutrino_msg_t d_key = g_Plugins->getKey(count);
|
||||||
keyhelper.get(&key, &icon, d_key);
|
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);
|
menu_item = new CMenuForwarder(g_Plugins->getName(count), true, NULL, CPluginsExec::getInstance(), to_string(count).c_str(), key, icon);
|
||||||
@@ -546,7 +587,8 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
|||||||
} // switch end
|
} // switch end
|
||||||
|
|
||||||
itemstr_last = *it;
|
itemstr_last = *it;
|
||||||
if (menu_item) {
|
if (menu_item)
|
||||||
|
{
|
||||||
menu_items++;
|
menu_items++;
|
||||||
menu->addItem(menu_item, false);
|
menu->addItem(menu_item, false);
|
||||||
last_menu_item = menu_item;
|
last_menu_item = menu_item;
|
||||||
@@ -554,6 +596,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
CInfoClock::getInstance()->enableInfoClock(false);
|
CInfoClock::getInstance()->enableInfoClock(false);
|
||||||
|
// CInfoIcons::getInstance()->enableInfoIcons(false);
|
||||||
// show menu if there are more than 2 items only
|
// show menu if there are more than 2 items only
|
||||||
// otherwise, we start the item directly (must be the last one)
|
// otherwise, we start the item directly (must be the last one)
|
||||||
if (menu_items > 1)
|
if (menu_items > 1)
|
||||||
@@ -562,6 +605,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg)
|
|||||||
last_menu_item->exec(NULL);
|
last_menu_item->exec(NULL);
|
||||||
|
|
||||||
CInfoClock::getInstance()->enableInfoClock(true);
|
CInfoClock::getInstance()->enableInfoClock(true);
|
||||||
|
// CInfoIcons::getInstance()->enableInfoIcons(true);
|
||||||
CNeutrinoApp::getInstance()->StartSubtitles();
|
CNeutrinoApp::getInstance()->StartSubtitles();
|
||||||
|
|
||||||
if (button < COL_BUTTONMAX)
|
if (button < COL_BUTTONMAX)
|
||||||
@@ -582,19 +626,24 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu
|
|||||||
const char *text = NULL;
|
const char *text = NULL;
|
||||||
int mode = CNeutrinoApp::getInstance()->getMode();
|
int mode = CNeutrinoApp::getInstance()->getMode();
|
||||||
std::vector<std::string> items = ::split(g_settings.usermenu[button]->items, ',');
|
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;
|
int item = -1;
|
||||||
if (it->find_first_not_of("0123456789") == std::string::npos)
|
if (it->find_first_not_of("0123456789") == std::string::npos)
|
||||||
item = atoi(*it);
|
item = atoi(*it);
|
||||||
|
|
||||||
switch(item) {
|
switch (item)
|
||||||
|
{
|
||||||
case -1:
|
case -1:
|
||||||
if (loc != NONEXISTANT_LOCALE || text)
|
if (loc != NONEXISTANT_LOCALE || text)
|
||||||
return_title = true;
|
return_title = true;
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
int nop = g_Plugins->getNumberOfPlugins();
|
int nop = g_Plugins->getNumberOfPlugins();
|
||||||
for(int count = 0; count < nop; count++) {
|
for (int count = 0; count < nop; count++)
|
||||||
if (std::string(g_Plugins->getFileName(count)) == *it) {
|
{
|
||||||
|
if (std::string(g_Plugins->getFileName(count)) == *it)
|
||||||
|
{
|
||||||
tmp = g_Plugins->getName(count);
|
tmp = g_Plugins->getName(count);
|
||||||
text = tmp.c_str();
|
text = tmp.c_str();
|
||||||
active = true;
|
active = true;
|
||||||
@@ -606,8 +655,10 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu
|
|||||||
case SNeutrinoSettings::ITEM_NONE:
|
case SNeutrinoSettings::ITEM_NONE:
|
||||||
case SNeutrinoSettings::ITEM_BAR:
|
case SNeutrinoSettings::ITEM_BAR:
|
||||||
case SNeutrinoSettings::ITEM_LIVESTREAM_RESOLUTION:
|
case SNeutrinoSettings::ITEM_LIVESTREAM_RESOLUTION:
|
||||||
if (mode == NeutrinoModes::mode_webtv && !CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty()) {
|
if (mode == NeutrinoModes::mode_webtv && !CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty())
|
||||||
if(loc == NONEXISTANT_LOCALE && !text) {
|
{
|
||||||
|
if (loc == NONEXISTANT_LOCALE && !text)
|
||||||
|
{
|
||||||
CWebTVResolution webtvres;
|
CWebTVResolution webtvres;
|
||||||
tmp = webtvres.getResolutionValue();
|
tmp = webtvres.getResolutionValue();
|
||||||
if (!(videoDecoder->getBlank()))
|
if (!(videoDecoder->getBlank()))
|
||||||
@@ -623,10 +674,13 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu
|
|||||||
text = tmp.c_str();
|
text = tmp.c_str();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
text = tmp.c_str();
|
text = tmp.c_str();
|
||||||
}
|
}
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
return_title = true;
|
return_title = true;
|
||||||
active = true;
|
active = true;
|
||||||
}
|
}
|
||||||
@@ -636,7 +690,8 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu
|
|||||||
active = true;
|
active = true;
|
||||||
continue;
|
continue;
|
||||||
case SNeutrinoSettings::ITEM_SUBCHANNEL:
|
case SNeutrinoSettings::ITEM_SUBCHANNEL:
|
||||||
if (!g_RemoteControl->subChannels.empty()) {
|
if (!g_RemoteControl->subChannels.empty())
|
||||||
|
{
|
||||||
if (loc == NONEXISTANT_LOCALE && !text)
|
if (loc == NONEXISTANT_LOCALE && !text)
|
||||||
loc = g_RemoteControl->are_subchannels ? LOCALE_NVODSELECTOR_SUBSERVICE : LOCALE_NVODSELECTOR_STARTTIME;
|
loc = g_RemoteControl->are_subchannels ? LOCALE_NVODSELECTOR_SUBSERVICE : LOCALE_NVODSELECTOR_STARTTIME;
|
||||||
else
|
else
|
||||||
@@ -655,17 +710,20 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu
|
|||||||
active = true;
|
active = true;
|
||||||
continue;
|
continue;
|
||||||
case SNeutrinoSettings::ITEM_AUDIO_SELECT:
|
case SNeutrinoSettings::ITEM_AUDIO_SELECT:
|
||||||
if(loc == NONEXISTANT_LOCALE && !text) {
|
if (loc == NONEXISTANT_LOCALE && !text)
|
||||||
if (mode == NeutrinoModes::mode_webtv){
|
{
|
||||||
|
if (mode == NeutrinoModes::mode_webtv)
|
||||||
|
{
|
||||||
tmp = CMoviePlayerGui::getInstance(true).CurrentAudioName(); // use instance_bg.
|
tmp = CMoviePlayerGui::getInstance(true).CurrentAudioName(); // use instance_bg.
|
||||||
text = tmp.c_str();
|
text = tmp.c_str();
|
||||||
}
|
}
|
||||||
else if (!g_RemoteControl->current_PIDs.APIDs.empty()){
|
else if (!g_RemoteControl->current_PIDs.APIDs.empty())
|
||||||
tmp = g_RemoteControl->current_PIDs.APIDs[
|
{
|
||||||
g_RemoteControl->current_PIDs.PIDs.selected_apid].desc;
|
tmp = g_RemoteControl->current_PIDs.APIDs[g_RemoteControl->current_PIDs.PIDs.selected_apid].desc;
|
||||||
text = tmp.c_str();
|
text = tmp.c_str();
|
||||||
}
|
}
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
return_title = true;
|
return_title = true;
|
||||||
active = true;
|
active = true;
|
||||||
continue;
|
continue;
|
||||||
@@ -681,12 +739,15 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (return_title) {
|
if (return_title)
|
||||||
|
{
|
||||||
if (!g_settings.usermenu[button]->title.empty())
|
if (!g_settings.usermenu[button]->title.empty())
|
||||||
return g_settings.usermenu[button]->title.c_str();
|
return g_settings.usermenu[button]->title.c_str();
|
||||||
if (button < USERMENU_ITEMS_COUNT)
|
if (button < USERMENU_ITEMS_COUNT)
|
||||||
return g_Locale->getText(usermenu[button].def_name);
|
return g_Locale->getText(usermenu[button].def_name);
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
if (text)
|
if (text)
|
||||||
return text;
|
return text;
|
||||||
if (loc != NONEXISTANT_LOCALE)
|
if (loc != NONEXISTANT_LOCALE)
|
||||||
@@ -696,12 +757,10 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************************
|
|
||||||
* changeNotify - features menu recording start / stop *
|
|
||||||
**************************************************************************************/
|
|
||||||
bool CUserMenu::changeNotify(const neutrino_locale_t OptionName, void *Data)
|
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);
|
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);
|
static const char *getUserMenuButtonName(int button, bool &active, bool return_title = false);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// This is just a quick helper for the usermenu and pluginlist.
|
// This is just a quick helper for the usermenu and pluginlist.
|
||||||
class CColorKeyHelper
|
class CColorKeyHelper
|
||||||
{
|
{
|
||||||
@@ -100,11 +99,13 @@ class CColorKeyHelper
|
|||||||
color_key_used[i] = false;
|
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
|
* definitions are returnd in msp and icon
|
||||||
* A color button could be requested as prefered button (other buttons are not supported yet).
|
* 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
|
* 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 get(neutrino_msg_t *msg, const char **icon, neutrino_msg_t prefered_key = CRCInput::RC_nokey)
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
@@ -121,7 +122,8 @@ class CColorKeyHelper
|
|||||||
*msg = CRCInput::RC_nokey;
|
*msg = CRCInput::RC_nokey;
|
||||||
*icon = "";
|
*icon = "";
|
||||||
if (button >= 0 && button < COL_BUTTONMAX)
|
if (button >= 0 && button < COL_BUTTONMAX)
|
||||||
{ // try to get color button
|
{
|
||||||
|
// try to get color button
|
||||||
if (color_key_used[button] == false)
|
if (color_key_used[button] == false)
|
||||||
{
|
{
|
||||||
color_key_used[button] = true;
|
color_key_used[button] = true;
|
||||||
|
Reference in New Issue
Block a user