neutrino: port personalize feature from tuxbox

This is a partial port of original neutrino personalize feature
and includes also moving of user menu settings from key setup into this setup,
but it's not completley yet in some details and so I think it's a lot to do.
I hope it works fine and the many user requests are justifying this feature.

TODO:
- doc into wiki
- adapt for yWeb
- some reworks for user menu settings and plugin management
- add timer and rework tv radio mode switch item(s)
and many more...

please report: http://www.dbox2world.net/board293-coolstream-hd1/board314-coolstream-development/9565-diskussion-neutrino-goes-neutrinohd-welche-features-funktionen-aus-dem-tuxbox-cvs-%C3%BCbernehmen/

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2010 e54a6e83-5905-42d5-8d5c-058d10e6a962


Origin commit data
------------------
Commit: aaa988db5f
Author: Thilo Graf <dbt@novatux.de>
Date: 2011-12-28 (Wed, 28 Dec 2011)

Origin message was:
------------------
*neutrino: port personalize feature from tuxbox

This is a partial port of original neutrino personalize feature
and includes also moving of user menu settings from key setup into this setup,
but it's not completley yet in some details and so I think it's a lot to do.
I hope it works fine and the many user requests are justifying this feature.

TODO:
- doc into wiki
- adapt for yWeb
- some reworks for user menu settings and plugin management
- add timer and rework tv radio mode switch item(s)
and many more...

please report: http://www.dbox2world.net/board293-coolstream-hd1/board314-coolstream-development/9565-diskussion-neutrino-goes-neutrinohd-welche-features-funktionen-aus-dem-tuxbox-cvs-%C3%BCbernehmen/

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@2010 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
2011-12-28 00:19:15 +00:00
parent b3a6068126
commit 07554a0dcc
28 changed files with 1780 additions and 223 deletions

View File

@@ -52,7 +52,7 @@ CUserMenuSetup::CUserMenuSetup(neutrino_locale_t menue_title, int menue_button)
{
local = menue_title;
button = menue_button;
max_char = 24;
width = w_max (40, 10);
}
@@ -91,8 +91,11 @@ int CUserMenuSetup::exec(CMenuTarget* parent, const std::string &)
{
if(parent != NULL)
parent->hide();
return showSetup();
int res = showSetup();
checkItem();
return res;
}
int CUserMenuSetup::showSetup()
@@ -104,25 +107,38 @@ int CUserMenuSetup::showSetup()
CStringInputSMS name(LOCALE_USERMENU_NAME, &g_settings.usermenu_text[button], 11, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzäöüß/- "/*, notify*/);
CMenuForwarder *mf = new CMenuForwarder(LOCALE_USERMENU_NAME, true, g_settings.usermenu_text[button],&name);
// notify->setItem(mf);
//-------------------------------------
ums->addIntroItems();
//-------------------------------------
ums->addItem(mf);
ums->addItem(GenericMenuSeparatorLine);
//-------------------------------------
char text[10];
char text[max_char];
for(int item = 0; item < SNeutrinoSettings::ITEM_MAX && item <13; item++) // Do not show more than 13 items
{
snprintf(text,10,"%d:",item);
text[9]=0;// terminate for sure
ums->addItem( new CMenuOptionChooser(text, &g_settings.usermenu[button][item], USERMENU_ITEM_OPTIONS, USERMENU_ITEM_OPTION_COUNT, true, NULL, CRCInput::RC_nokey, "", true));
snprintf(text,max_char,"%d.",item+1);
text[max_char-1]=0;// terminate for sure
ums->addItem( new CMenuOptionChooser(text, &g_settings.usermenu[button][item], USERMENU_ITEM_OPTIONS, USERMENU_ITEM_OPTION_COUNT,true, NULL, CRCInput::RC_nokey, "", true ));
}
int res = ums->exec(NULL, "");
ums->hide();
delete ums;
return res;
}
//check item for details like empty string and show an user message
void CUserMenuSetup::checkItem()
{
bool is_empty = g_settings.usermenu_text[button].empty();
if (is_empty)
{
std::string msg = g_Locale->getText(LOCALE_USERMENU_MSG_INFO_IS_EMPTY);
msg += g_Locale->getText(usermenu[button].def_name);
DisplayInfoMessage(msg.c_str());
g_settings.usermenu_text[button] = is_empty ? g_Locale->getText(usermenu[button].def_name) : g_settings.usermenu_text[button].c_str();
}
}