mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 08:21:07 +02:00
user_menue_setup: don't override users title anymore
Origin commit data
------------------
Commit: 0c82bbe8d6
Author: vanhofen <vanhofen@gmx.de>
Date: 2015-12-29 (Tue, 29 Dec 2015)
Origin message was:
------------------
- user_menue_setup: don't override users title anymore
This commit is contained in:
@@ -262,37 +262,31 @@ int CUserMenuSetup::showSetup()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//check items of current button menu and set prefered menue name
|
//check button name for details like empty string and show an user message on issue
|
||||||
void CUserMenuSetup::checkButtonItems()
|
void CUserMenuSetup::checkButtonName()
|
||||||
{
|
{
|
||||||
//count of configured items
|
//count of configured items
|
||||||
int used_items = getUsedItemsCount();
|
int used_items = getUsedItemsCount();
|
||||||
|
|
||||||
//warn if no items defined and reset menu name, if empty
|
//warn if no items defined and reset menu name, if empty
|
||||||
if (used_items == 0){
|
if (used_items == 0)
|
||||||
|
{
|
||||||
if (!g_settings.usermenu[button]->title.empty()){
|
if (!g_settings.usermenu[button]->title.empty()){
|
||||||
// DisplayInfoMessage(g_Locale->getText(LOCALE_USERMENU_MSG_WARNING_NO_ITEMS));
|
// DisplayInfoMessage(g_Locale->getText(LOCALE_USERMENU_MSG_WARNING_NO_ITEMS));
|
||||||
g_settings.usermenu[button]->title = "";
|
g_settings.usermenu[button]->title = "";
|
||||||
}
|
}
|
||||||
|
//exit function
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
//if found only 1 configured item, ensure that the caption of usermenu is the same like this
|
//if found only 1 configured item, ensure that the caption of usermenu is the same like this
|
||||||
if (used_items == 1) {
|
if (used_items == 1) {
|
||||||
bool dummy;
|
bool dummy;
|
||||||
g_settings.usermenu[button]->title = CUserMenu::getUserMenuButtonName(button, dummy);
|
g_settings.usermenu[button]->title = CUserMenu::getUserMenuButtonName(button, dummy);
|
||||||
}
|
}
|
||||||
}
|
#endif
|
||||||
|
|
||||||
//check button name for details like empty string and show an user message on issue
|
|
||||||
void CUserMenuSetup::checkButtonName()
|
|
||||||
{
|
|
||||||
checkButtonItems();
|
|
||||||
|
|
||||||
//exit function, if no items found
|
|
||||||
if (getUsedItemsCount() == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (button < USERMENU_ITEMS_COUNT && g_settings.usermenu[button]->title.empty())
|
if (button < USERMENU_ITEMS_COUNT && g_settings.usermenu[button]->title.empty())
|
||||||
{
|
{
|
||||||
std::string msg(g_Locale->getText(LOCALE_USERMENU_MSG_INFO_IS_EMPTY));
|
std::string msg(g_Locale->getText(LOCALE_USERMENU_MSG_INFO_IS_EMPTY));
|
||||||
@@ -303,10 +297,8 @@ void CUserMenuSetup::checkButtonName()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//get count of used items
|
//get count of used items
|
||||||
int CUserMenuSetup::getUsedItemsCount()
|
int CUserMenuSetup::getUsedItemsCount()
|
||||||
{
|
{
|
||||||
return ::split(g_settings.usermenu[button]->items, ',').size();
|
return ::split(g_settings.usermenu[button]->items, ',').size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -76,7 +76,6 @@ class CUserMenuSetup : public CMenuTarget
|
|||||||
std::map<std::string,std::string> vals;
|
std::map<std::string,std::string> vals;
|
||||||
|
|
||||||
int showSetup();
|
int showSetup();
|
||||||
void checkButtonItems();
|
|
||||||
void checkButtonName();
|
void checkButtonName();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
Reference in New Issue
Block a user