mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 00:11:08 +02:00
Merge remote-tracking branch 'uncool/cst-next'
Origin commit data
------------------
Commit: 880115fa98
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2015-12-25 (Fri, 25 Dec 2015)
This commit is contained in:
@@ -60,6 +60,10 @@
|
||||
const bool item_mode = optional, default true, if you don't want to see this item in personalize menue, then set it to false
|
||||
CMenuItem *observer_Item = optional, default NULL, if you want to observe this item with another item (observer), then use this prameter.
|
||||
Effect: this observed item will be deactivated, if observer is set to 'visible' or 'pin-protected'
|
||||
menu_item_disable_cond_t& disable_condition = optional, default DCOND_MODE_NONE
|
||||
Effect: on used condition eg. DCOND_MODE_TS, this item is disabled in mode_ts
|
||||
Also usable are combined conditions: eg: DCOND_MODE_TV | DCOND_MODE_TS, this item is disabled in mode_tv and mode_ts
|
||||
More possible conditions are defined in menue.h.
|
||||
|
||||
Icon handling:
|
||||
If you define an icon in the item object, this will be shown in the personalized menu but not the personilazitions menue itself, otherwise a shortcut will be create
|
||||
@@ -155,7 +159,7 @@
|
||||
#include <neutrino.h>
|
||||
#include <neutrino_menue.h>
|
||||
#include <mymenu.h>
|
||||
|
||||
#include <sigc++/bind.h>
|
||||
#include <stdio.h>
|
||||
#include <sstream>
|
||||
#include <stdlib.h>
|
||||
@@ -628,7 +632,7 @@ int CPersonalizeGui::ShowMenuOptions(const int& widget)
|
||||
//found observer item and if found, then define 'this' as observer for current option chooser and run changeNotify
|
||||
bool is_observer = isObserver(v_item[i].widget, v_item[i].menuItem) ? true : false;
|
||||
CChangeObserver* observer = is_observer ? this : NULL;
|
||||
CMenuOptionChooser * opt = new CMenuOptionChooser(name, p_mode, PERSONALIZE_MODE_OPTIONS, PERSONALIZE_MODE_MAX, v_item[i].menuItem->active, observer);
|
||||
CMenuOptionChooser * opt = new CMenuOptionChooser(name, p_mode, PERSONALIZE_MODE_OPTIONS, PERSONALIZE_MODE_MAX, v_item[i].menuItem->current_active, observer);
|
||||
if (is_observer)
|
||||
changeNotify(name, (void*)p_mode);
|
||||
|
||||
@@ -832,20 +836,20 @@ void CPersonalizeGui::addIntroItems(CMenuWidget *widget)
|
||||
|
||||
|
||||
//overloaded version from 'addItem', first parameter is an id from widget collection 'v_widget'
|
||||
void CPersonalizeGui::addItem(const int& widget_id, CMenuItem *menu_Item, const int *personalize_mode, const bool defaultselected, const int& item_mode, CMenuItem *observer_Item)
|
||||
void CPersonalizeGui::addItem(const int& widget_id, CMenuItem *menu_Item, const int *personalize_mode, const bool defaultselected, const int& item_mode, CMenuItem *observer_Item, const menu_item_disable_cond_t& disable_condition)
|
||||
{
|
||||
addItem(v_widget[widget_id], menu_Item, personalize_mode, defaultselected, item_mode, observer_Item);
|
||||
addItem(v_widget[widget_id], menu_Item, personalize_mode, defaultselected, item_mode, observer_Item, disable_condition);
|
||||
}
|
||||
|
||||
//adds a personalized menu item object to menu with personalizing parameters
|
||||
void CPersonalizeGui::addItem(CMenuWidget *widget, CMenuItem *menu_Item, const int *personalize_mode, const bool defaultselected, const int& item_mode, CMenuItem *observer_Item)
|
||||
void CPersonalizeGui::addItem(CMenuWidget *widget, CMenuItem *menu_Item, const int *personalize_mode, const bool defaultselected, const int& item_mode, CMenuItem *observer_Item, const menu_item_disable_cond_t& disable_condition)
|
||||
{
|
||||
if (observer_Item != NULL)
|
||||
addObservedItem(widget, observer_Item, menu_Item);
|
||||
|
||||
CMenuForwarder *fw = static_cast <CMenuForwarder*> (menu_Item);
|
||||
CMenuForwarder *fw = static_cast <CMenuForwarder*> (menu_Item);
|
||||
|
||||
menu_item_t item = {widget, menu_Item, defaultselected, fw->getTextLocale(), (int*)personalize_mode, item_mode, observer_Item};
|
||||
menu_item_t item = {widget, menu_Item, defaultselected, fw->getTextLocale(), (int*)personalize_mode, item_mode, observer_Item, disable_condition};
|
||||
|
||||
if (item_mode == PERSONALIZE_SHOW_AS_ACCESS_OPTION)
|
||||
{
|
||||
@@ -873,10 +877,10 @@ void CPersonalizeGui::addSeparator(const int& widget_id, const neutrino_locale_t
|
||||
void CPersonalizeGui::addSeparator(CMenuWidget &widget, const neutrino_locale_t locale_text, const int& item_mode)
|
||||
{
|
||||
if (locale_text == NONEXISTANT_LOCALE) {
|
||||
menu_item_t to_add_sep = {&widget, GenericMenuSeparatorLine, false, locale_text, NULL, item_mode, NULL};
|
||||
menu_item_t to_add_sep = {&widget, GenericMenuSeparatorLine, false, locale_text, NULL, item_mode, NULL, DCOND_MODE_NONE };
|
||||
v_item.push_back(to_add_sep);
|
||||
} else {
|
||||
menu_item_t to_add_sep = {&widget, new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, locale_text), false, locale_text, NULL, item_mode, NULL};
|
||||
menu_item_t to_add_sep = {&widget, new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, locale_text), false, locale_text, NULL, item_mode, NULL, DCOND_MODE_NONE };
|
||||
v_item.push_back(to_add_sep);
|
||||
}
|
||||
}
|
||||
@@ -911,7 +915,7 @@ void CPersonalizeGui::addPersonalizedItems()
|
||||
//get current mode of personlize itself
|
||||
int in_pinmode = hasPinItems() ? PERSONALIZE_PROTECT_MODE_PIN_PROTECTED : PERSONALIZE_PROTECT_MODE_NOT_PROTECTED;
|
||||
|
||||
for (uint i = 0; i < v_item.size(); i++)
|
||||
for (uint i = 0; i < v_item.size(); i++)
|
||||
{
|
||||
int i_mode = v_item[i].item_mode;
|
||||
|
||||
@@ -941,6 +945,7 @@ void CPersonalizeGui::addPersonalizedItems()
|
||||
neutrino_msg_t d_key = fw->directKey;
|
||||
bool add_shortcut = false;
|
||||
|
||||
|
||||
//get shortcut
|
||||
if (fw->active && (d_key == CRCInput::RC_nokey || CRCInput::isNumeric(d_key))) //if RC_nokey or RC_key is digi and item is active, allow to generate a shortcut,
|
||||
{
|
||||
@@ -967,6 +972,14 @@ void CPersonalizeGui::addPersonalizedItems()
|
||||
use_pin, fw->active, NULL, fw->getTarget(), fw->getActionKey(), d_key, NULL, lock_icon);
|
||||
v_item[i].menuItem->hintIcon = fw->hintIcon;
|
||||
v_item[i].menuItem->hint = fw->hint;
|
||||
|
||||
//assign slot for items, causes disable/enable by condition eg: receiver mode
|
||||
if (v_item[i].condition != DCOND_MODE_NONE ){
|
||||
sigc::slot0<void> sl = sigc::bind<0>(sigc::mem_fun1(v_item[i].menuItem, &CMenuForwarder::disableByCondition), v_item[i].condition);
|
||||
v_item[i].menuItem->OnPaintItem.connect(sl);
|
||||
v_item[i].default_selected = false;
|
||||
}
|
||||
|
||||
//add item if it's set to visible or pin protected and allow to add an forwarder as next
|
||||
if (p_mode != PERSONALIZE_MODE_NOTVISIBLE || i_mode == PERSONALIZE_SHOW_AS_ACCESS_OPTION)
|
||||
{
|
||||
|
Reference in New Issue
Block a user