Add channel list settings to channel list menu

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


Origin commit data
------------------
Branch: ni/coolstream
Commit: 9c021d73f7
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2011-11-22 (Tue, 22 Nov 2011)



------------------
This commit was generated by Migit
This commit is contained in:
[CST] Focus
2011-11-22 11:03:38 +00:00
parent 7c52b2dbb1
commit 3151a87759
3 changed files with 48 additions and 0 deletions

View File

@@ -52,6 +52,7 @@
#include <gui/widget/menue.h>
#include <gui/widget/messagebox.h>
#include <gui/widget/progressbar.h>
#include <gui/osd_setup.h>
#include <system/settings.h>
#include <system/lastchannel.h>
@@ -345,6 +346,8 @@ int CChannelList::doChannelMenu(void)
menu->addItem(new CMenuForwarder(LOCALE_EXTRA_ADD_TO_BOUQUET, true, NULL, selector, cnt, CRCInput::RC_yellow, NEUTRINO_ICON_BUTTON_YELLOW), old_selected == i++);
snprintf(cnt, sizeof(cnt), "%d", i);
menu->addItem(new CMenuForwarder(LOCALE_FAVORITES_MENUEADD, true, NULL, selector, cnt, CRCInput::RC_blue, NEUTRINO_ICON_BUTTON_BLUE), old_selected == i++);
snprintf(cnt, sizeof(cnt), "%d", i);
menu->addItem(new CMenuForwarder(LOCALE_MAINMENU_SETTINGS, true, NULL, selector, cnt, CRCInput::convertDigitToKey(0)), old_selected == i++);
menu->exec(NULL, "");
delete menu;
delete selector;
@@ -428,6 +431,12 @@ int CChannelList::doChannelMenu(void)
return 1;
}
break;
case 4: // settings
{
COsdSetup osd_setup;
osd_setup.showContextChanlistMenu();
}
break;
default:
break;

View File

@@ -642,3 +642,41 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data*/
}
return false;
}
int COsdSetup::showContextChanlistMenu()
{
static int cselected = -1;
CMenuWidget * menu_chanlist = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width);
menu_chanlist->setSelected(cselected);
menu_chanlist->addIntroItems(LOCALE_MISCSETTINGS_CHANNELLIST);
menu_chanlist->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_CHANNELLIST_EPGTEXT_ALIGN, &g_settings.channellist_epgtext_align_right, CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS, CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS_COUNT, true));
menu_chanlist->addItem(new CMenuOptionChooser(LOCALE_CHANNELLIST_EXTENDED, &g_settings.channellist_extended, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
menu_chanlist->addItem(new CMenuOptionChooser(LOCALE_CHANNELLIST_FOOT, &g_settings.channellist_foot, CHANNELLIST_FOOT_OPTIONS, CHANNELLIST_FOOT_OPTIONS_COUNT, true));
menu_chanlist->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_CHANNELLIST_COLORED_EVENTS, &g_settings.colored_events_channellist, OPTIONS_COLORED_EVENTS_OPTIONS, OPTIONS_COLORED_EVENTS_OPTION_COUNT, true));
/* TODO ? problems:
* 1. channel list not re-calc sizes after menu;
* 2. font menu smaller and make hole in channel list */
#if 0
CMenuWidget *fontSettingsSubMenu = new CMenuWidget(LOCALE_FONTMENU_HEAD, NEUTRINO_ICON_KEYBINDING);
int i = 1;
fontSettingsSubMenu->addIntroItems(font_sizes_groups[i].groupname);
for (unsigned int j = 0; j < font_sizes_groups[i].count; j++)
{
AddFontSettingItem(*fontSettingsSubMenu, font_sizes_groups[i].content[j]);
}
fontSettingsSubMenu->addItem(GenericMenuSeparatorLine);
fontSettingsSubMenu->addItem(new CMenuForwarder(LOCALE_OPTIONS_DEFAULT, true, NULL, this, font_sizes_groups[i].actionkey));
menu_chanlist->addItem(new CMenuForwarder(LOCALE_FONTMENU_HEAD, true, NULL, fontSettingsSubMenu, "", CRCInput::convertDigitToKey(0)));
#endif
int res = menu_chanlist->exec(NULL, "");
menu_chanlist->hide();
cselected = menu_chanlist->getSelected();
return res;
}

View File

@@ -87,6 +87,7 @@ class COsdSetup : public CMenuTarget, public CChangeObserver
~COsdSetup();
int exec(CMenuTarget* parent, const std::string & actionKey);
bool changeNotify(const neutrino_locale_t OptionName, void * /*data*/);
int showContextChanlistMenu();
};