CChannelList/COsdSetup: use showOsdChanlistSetup() from OSD-Setup

This removes multiple code parts from COsdSetup without
loss of functionality.


Origin commit data
------------------
Branch: ni/coolstream
Commit: 253579909f
Author: Thilo Graf <dbt@novatux.de>
Date: 2014-06-07 (Sat, 07 Jun 2014)



------------------
This commit was generated by Migit
This commit is contained in:
2014-06-07 23:13:09 +02:00
committed by vanhofen
parent 4bfeb58ea3
commit 373dbba059
3 changed files with 10 additions and 64 deletions

View File

@@ -39,7 +39,7 @@
#include <global.h>
#include <neutrino.h>
#include <neutrino_menue.h>
#include <driver/fontrenderer.h>
#include <driver/screen_max.h>
#include <driver/rcinput.h>
@@ -371,6 +371,10 @@ int CChannelList::doChannelMenu(void)
menu->addItem(new CMenuForwarder(LOCALE_CHANNELLIST_RESET_ALL, reset_all, NULL, selector, cnt, CRCInput::convertDigitToKey(shortcut++)), old_selected == i++);
snprintf(cnt, sizeof(cnt), "%d", i);
menu->addItem(new CMenuSeparator(CMenuSeparator::LINE));
//use osd channel list settings widget from COsdSetup class
CMenuWidget osd_menu_chanlist(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_OSDSETUP_CHANNELLIST);
osd_menu_chanlist.suppressDetailsLine(true);
menu->addItem(new CMenuForwarder(LOCALE_MAINMENU_SETTINGS, true, NULL, selector, cnt, CRCInput::convertDigitToKey(shortcut++)), old_selected == i++);
menu->exec(NULL, "");
delete menu;
@@ -492,7 +496,7 @@ int CChannelList::doChannelMenu(void)
{
previous_channellist_additional = g_settings.channellist_additional;
COsdSetup osd_setup;
osd_setup.showContextChanlistMenu();
osd_setup.showContextChanlistMenu(&osd_menu_chanlist);
//FIXME check font/options changed ?
hide();
calcSize();

View File

@@ -1101,68 +1101,10 @@ bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data)
return false;
}
int COsdSetup::showContextChanlistMenu()
int COsdSetup::showContextChanlistMenu(CMenuWidget *menu_chanlist)
{
static int cselected = -1;
CMenuWidget * menu_chanlist = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width);
menu_chanlist->enableSaveScreen(true);
menu_chanlist->enableFade(false);
menu_chanlist->setSelected(cselected);
CMenuOptionChooser * mc;
menu_chanlist->addIntroItems(LOCALE_MISCSETTINGS_CHANNELLIST);//, NONEXISTANT_LOCALE, CMenuWidget::BTN_TYPE_CANCEL);
mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_ADDITIONAL, &g_settings.channellist_additional, CHANNELLIST_ADDITIONAL_OPTIONS, CHANNELLIST_ADDITIONAL_OPTION_COUNT, true);
mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_ADDITIONAL);
menu_chanlist->addItem(mc);
mc = 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);
mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_EPG_ALIGN);
menu_chanlist->addItem(mc);
mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_EXTENDED, &g_settings.channellist_extended, CHANNELLIST_EXTENDED_OPTIONS, CHANNELLIST_EXTENDED_OPTIONS_COUNT, true);
mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_EXTENDED);
menu_chanlist->addItem(mc);
mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_FOOT, &g_settings.channellist_foot, CHANNELLIST_FOOT_OPTIONS, CHANNELLIST_FOOT_OPTIONS_COUNT, true);
mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_FOOT);
menu_chanlist->addItem(mc);
mc = new CMenuOptionChooser(LOCALE_MISCSETTINGS_CHANNELLIST_COLORED_EVENTS, &g_settings.colored_events_channellist, OPTIONS_COLORED_EVENTS_OPTIONS, OPTIONS_COLORED_EVENTS_OPTION_COUNT, true);
mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_COLORED);
menu_chanlist->addItem(mc);
//show channel logo
mc = new CMenuOptionChooser(LOCALE_CHANNELLIST_SHOW_CHANNELLOGO, &g_settings.channellist_show_channellogo, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true);
mc->setHint("", LOCALE_MENU_HINT_CHANNELLIST_SHOW_CHANNELLOGO);
menu_chanlist->addItem(mc);
menu_chanlist->addItem(new CMenuSeparator(CMenuSeparator::LINE));
CMenuWidget *fontSettingsSubMenu = new CMenuWidget(LOCALE_FONTMENU_HEAD, NEUTRINO_ICON_KEYBINDING);
fontSettingsSubMenu->enableSaveScreen(true);
fontSettingsSubMenu->enableFade(false);
int i = 1;
fontSettingsSubMenu->addIntroItems(font_sizes_groups[i].groupname);//, NONEXISTANT_LOCALE, CMenuWidget::BTN_TYPE_CANCEL);
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));
CMenuForwarder * mf = new CMenuDForwarder(LOCALE_FONTMENU_HEAD, true, NULL, fontSettingsSubMenu, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED);
mf->setHint("", LOCALE_MENU_HINT_FONTS);
menu_chanlist->addItem(mf);
int res = menu_chanlist->exec(NULL, "");
cselected = menu_chanlist->getSelected();
delete menu_chanlist;
return res;
showOsdChanlistSetup(menu_chanlist);
return menu_chanlist->exec(NULL, "");
}
//screenshot

View File

@@ -101,7 +101,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();
int showContextChanlistMenu(CMenuWidget *menu_chanlist);
};
#endif