mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-27 15:32:52 +02:00
update glcd
Origin commit data
------------------
Commit: 0c2dcc9eb1
Author: redblue.pkt <redblue.pkt@orange.pl>
Date: 2020-06-19 (Fri, 19 Jun 2020)
This commit is contained in:
@@ -30,12 +30,34 @@
|
||||
#include <driver/fontrenderer.h>
|
||||
#include <driver/rcinput.h>
|
||||
#include <daemonc/remotecontrol.h>
|
||||
#include <driver/nglcd.h>
|
||||
#include <driver/glcd.h>
|
||||
#include <driver/screen_max.h>
|
||||
#include <system/helpers.h>
|
||||
#include "glcdsetup.h"
|
||||
#include <mymenu.h>
|
||||
#include <gui/widget/colorchooser.h>
|
||||
#include <neutrino_menue.h>
|
||||
#include "glcdthemes.h"
|
||||
|
||||
#define ONOFFSEC_OPTION_COUNT 6
|
||||
static const CMenuOptionChooser::keyval ONOFFSEC_OPTIONS[ONOFFSEC_OPTION_COUNT] = {
|
||||
{ 0, LOCALE_OPTIONS_OFF },
|
||||
{ 1, LOCALE_OPTIONS_ON },
|
||||
{ 2, LOCALE_GLCD_STANDBY_LED_CLOCK },
|
||||
{ 3, LOCALE_GLCD_STANDBY_LCD_CLOCK },
|
||||
{ 4, LOCALE_GLCD_STANDBY_DIGITAL_CLOCK },
|
||||
{ 5, LOCALE_GLCD_STANDBY_ANALOG_CLOCK }
|
||||
};
|
||||
|
||||
#define ONOFFPRI_OPTION_COUNT 4
|
||||
static const CMenuOptionChooser::keyval ONOFFPRI_OPTIONS[ONOFFPRI_OPTION_COUNT] = {
|
||||
{ 0, LOCALE_GLCD_ALIGN_NONE },
|
||||
{ 1, LOCALE_GLCD_ALIGN_LEFT },
|
||||
{ 2, LOCALE_GLCD_ALIGN_CENTER },
|
||||
{ 3, LOCALE_GLCD_ALIGN_RIGHT },
|
||||
};
|
||||
|
||||
#if 0
|
||||
#define KEY_GLCD_BLACK 0
|
||||
#define KEY_GLCD_WHITE 1
|
||||
#define KEY_GLCD_RED 2
|
||||
@@ -120,6 +142,7 @@ int GLCD_Menu::color2index(uint32_t color) {
|
||||
uint32_t GLCD_Menu::index2color(int i) {
|
||||
return (i < GLCD_COLOR_OPTION_COUNT) ? colormap[i] : GLCD::cColor::ERRCOL;
|
||||
}
|
||||
#endif
|
||||
|
||||
GLCD_Menu::GLCD_Menu()
|
||||
{
|
||||
@@ -130,37 +153,57 @@ GLCD_Menu::GLCD_Menu()
|
||||
int GLCD_Menu::exec(CMenuTarget* parent, const std::string & actionKey)
|
||||
{
|
||||
int res = menu_return::RETURN_REPAINT;
|
||||
nGLCD *nglcd = nGLCD::getInstance();
|
||||
cGLCD *cglcd = cGLCD::getInstance();
|
||||
SNeutrinoGlcdTheme &t = g_settings.glcd_theme;
|
||||
if(parent)
|
||||
parent->hide();
|
||||
if(actionKey == "rescan") {
|
||||
nglcd->Rescan();
|
||||
cglcd->Rescan();
|
||||
return res;
|
||||
}
|
||||
#if 0
|
||||
if(actionKey == "select_driver") {
|
||||
if(parent)
|
||||
parent->hide();
|
||||
GLCD_Menu_Select_Driver();
|
||||
nglcd->Exit();
|
||||
cglcd->Exit();
|
||||
return menu_return::RETURN_EXIT;
|
||||
}
|
||||
#endif
|
||||
if(actionKey == "select_font") {
|
||||
if(parent)
|
||||
parent->hide();
|
||||
CFileBrowser fileBrowser;
|
||||
CFileFilter fileFilter;
|
||||
fileFilter.addFilter("ttf");
|
||||
fileBrowser.Filter = &fileFilter;
|
||||
if (fileBrowser.exec(FONTDIR) == true) {
|
||||
g_settings.glcd_font = fileBrowser.getSelectedFile()->Name;
|
||||
nglcd->Rescan();
|
||||
t.glcd_font = fileBrowser.getSelectedFile()->Name;
|
||||
cglcd->Rescan();
|
||||
}
|
||||
return res;
|
||||
} else if (actionKey == "theme_settings") {
|
||||
GLCD_Theme_Settings();
|
||||
return res;
|
||||
} else if (actionKey == "brightness_default") {
|
||||
g_settings.glcd_brightness = GLCD_DEFAULT_BRIGHTNESS;
|
||||
g_settings.glcd_brightness_standby = GLCD_DEFAULT_BRIGHTNESS_STANDBY;
|
||||
g_settings.glcd_brightness_dim = GLCD_DEFAULT_BRIGHTNESS_DIM;
|
||||
g_settings.glcd_brightness_dim_time = GLCD_DEFAULT_BRIGHTNESS_DIM_TIME;
|
||||
cglcd->UpdateBrightness();
|
||||
return res;
|
||||
} else if (actionKey == "brightness_settings") {
|
||||
GLCD_Brightness_Settings();
|
||||
return res;
|
||||
} else if (actionKey == "standby_settings") {
|
||||
GLCD_Standby_Settings();
|
||||
return res;
|
||||
} else if (actionKey == "position_settings") {
|
||||
GLCD_Theme_Position_Settings();
|
||||
return res;
|
||||
} else {
|
||||
GLCD_Menu_Settings();
|
||||
return res;
|
||||
}
|
||||
|
||||
if (parent)
|
||||
parent->hide();
|
||||
|
||||
GLCD_Menu_Settings();
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -172,155 +215,307 @@ bool GLCD_Menu::changeNotify (const neutrino_locale_t OptionName, void *Data)
|
||||
{
|
||||
if (!Data)
|
||||
return false;
|
||||
nGLCD *nglcd = nGLCD::getInstance();
|
||||
cGLCD *cglcd = cGLCD::getInstance();
|
||||
SNeutrinoGlcdTheme &t = g_settings.glcd_theme;
|
||||
switch(OptionName) {
|
||||
case LOCALE_GLCD_SELECT_FG:
|
||||
g_settings.glcd_color_fg = GLCD_Menu::index2color(*((int *) Data));
|
||||
break;
|
||||
case LOCALE_GLCD_SELECT_BG:
|
||||
g_settings.glcd_color_bg = GLCD_Menu::index2color(*((int *) Data));
|
||||
break;
|
||||
case LOCALE_GLCD_SELECT_BAR:
|
||||
g_settings.glcd_color_bar = GLCD_Menu::index2color(*((int *) Data));
|
||||
cglcd->Update();
|
||||
break;
|
||||
case LOCALE_GLCD_ENABLE:
|
||||
if (g_settings.glcd_enable)
|
||||
nglcd->Resume();
|
||||
cglcd->Resume();
|
||||
else
|
||||
nglcd->Suspend();
|
||||
cglcd->Suspend();
|
||||
return true;
|
||||
case LOCALE_GLCD_MIRROR_OSD:
|
||||
nglcd->MirrorOSD(*((int *) Data));
|
||||
cglcd->MirrorOSD(*((int *) Data));
|
||||
break;
|
||||
case LOCALE_GLCD_MIRROR_VIDEO:
|
||||
nglcd->Update();
|
||||
cglcd->Update();
|
||||
break;
|
||||
case LOCALE_GLCD_BRIGHTNESS:
|
||||
case LOCALE_GLCD_BRIGHTNESS_STANDBY:
|
||||
case LOCALE_GLCD_BRIGHTNESS_DIM:
|
||||
case LOCALE_GLCD_BRIGHTNESS_DIM_TIME:
|
||||
cglcd->Update();
|
||||
break;
|
||||
case LOCALE_GLCD_SHOW_PROGRESSBAR:
|
||||
case LOCALE_GLCD_SHOW_DURATION:
|
||||
case LOCALE_GLCD_SHOW_START:
|
||||
case LOCALE_GLCD_SHOW_END:
|
||||
case LOCALE_GLCD_SHOW_TIME:
|
||||
case LOCALE_GLCD_SHOW_WEATHER:
|
||||
case LOCALE_GLCD_SHOW_LOGO:
|
||||
case LOCALE_GLCD_SIZE_BAR:
|
||||
case LOCALE_GLCD_BAR_X_POSITION:
|
||||
case LOCALE_GLCD_BAR_Y_POSITION:
|
||||
case LOCALE_GLCD_BAR_WIDTH:
|
||||
case LOCALE_GLCD_SIZE_CHANNEL:
|
||||
case LOCALE_GLCD_CHANNEL_X_POSITION:
|
||||
case LOCALE_GLCD_CHANNEL_Y_POSITION:
|
||||
case LOCALE_GLCD_SIZE_EPG:
|
||||
case LOCALE_GLCD_EPG_X_POSITION:
|
||||
case LOCALE_GLCD_EPG_Y_POSITION:
|
||||
case LOCALE_GLCD_SIZE_DURATION:
|
||||
case LOCALE_GLCD_DURATION_X_POSITION:
|
||||
case LOCALE_GLCD_DURATION_Y_POSITION:
|
||||
case LOCALE_GLCD_SIZE_START:
|
||||
case LOCALE_GLCD_START_X_POSITION:
|
||||
case LOCALE_GLCD_START_Y_POSITION:
|
||||
case LOCALE_GLCD_SIZE_END:
|
||||
case LOCALE_GLCD_END_X_POSITION:
|
||||
case LOCALE_GLCD_END_Y_POSITION:
|
||||
case LOCALE_GLCD_SIZE_LOGO:
|
||||
case LOCALE_GLCD_LOGO_X_POSITION:
|
||||
case LOCALE_GLCD_LOGO_Y_POSITION:
|
||||
case LOCALE_GLCD_SIZE_TIME:
|
||||
case LOCALE_GLCD_SIZE_TIME_STANDBY:
|
||||
case LOCALE_GLCD_TIME_X_POSITION:
|
||||
case LOCALE_GLCD_TIME_Y_POSITION:
|
||||
case LOCALE_GLCD_TIME_IN_STANDBY:
|
||||
case LOCALE_GLCD_SCROLL_SPEED:
|
||||
case LOCALE_GLCD_THEME_POSITION_SETTINGS:
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
if (((OptionName == LOCALE_GLCD_TIME_IN_STANDBY || OptionName == LOCALE_GLCD_BRIGHTNESS_STANDBY) && g_settings.glcd_percent_time_standby) || OptionName == LOCALE_GLCD_SIZE_TIME_STANDBY)
|
||||
nglcd->StandbyMode(true);
|
||||
else
|
||||
nglcd->StandbyMode(false);
|
||||
|
||||
nglcd->Update();
|
||||
if (OptionName == LOCALE_GLCD_TIME_IN_STANDBY || OptionName == LOCALE_GLCD_BRIGHTNESS_STANDBY || OptionName == LOCALE_GLCD_STANDBY_LED_CLOCK || OptionName == LOCALE_GLCD_STANDBY_LCD_CLOCK
|
||||
|| OptionName == LOCALE_GLCD_STANDBY_DIGITAL_CLOCK || OptionName == LOCALE_GLCD_STANDBY_DIGITAL_CLOCK || OptionName == LOCALE_GLCD_STANDBY_ANALOG_CLOCK || OptionName == LOCALE_GLCD_STANDBY_WEATHER
|
||||
|| OptionName == LOCALE_GLCD_DIGITAL_CLOCK_Y_POSITION || OptionName == LOCALE_GLCD_SIZE_SIMPLE_CLOCK || OptionName == LOCALE_GLCD_SIMPLE_CLOCK_Y_POSITION)
|
||||
cglcd->StandbyMode(true);
|
||||
else
|
||||
cglcd->StandbyMode(false);
|
||||
|
||||
cglcd->Update();
|
||||
return true;
|
||||
}
|
||||
|
||||
static const CMenuOptionChooser::keyval GLCD_CLOCK_OPTIONS[] = {
|
||||
{ nGLCD::CLOCK_OFF, LOCALE_OPTIONS_OFF },
|
||||
{ nGLCD::CLOCK_DIGITAL_HM, LOCALE_GLCD_CLOCK_DIGITAL_HM },
|
||||
// { nGLCD::CLOCK_DIGITAL_HMS, LOCALE_GLCD_CLOCK_DIGITAL_HMS },
|
||||
// { nGLCD::CLOCK_ANALOG, LOCALE_GLCD_CLOCK_ANALOG }
|
||||
};
|
||||
#define GLCD_CLOCK_OPTIONS_COUNT (sizeof(GLCD_CLOCK_OPTIONS)/sizeof(CMenuOptionChooser::keyval))
|
||||
|
||||
void GLCD_Menu::GLCD_Menu_Settings()
|
||||
{
|
||||
int color_bg = color2index(g_settings.glcd_color_bg);
|
||||
int color_fg = color2index(g_settings.glcd_color_fg);
|
||||
int color_bar = color2index(g_settings.glcd_color_bar);
|
||||
|
||||
CMenuWidget m(LOCALE_GLCD_HEAD, NEUTRINO_ICON_SETTINGS, width);
|
||||
m.addIntroItems();
|
||||
m.setSelected(selected);
|
||||
|
||||
SNeutrinoGlcdTheme &t = g_settings.glcd_theme;
|
||||
sigc::slot0<void> slot_repaint = sigc::mem_fun(m, &CMenuWidget::paint); //we want to repaint after changed Option
|
||||
|
||||
m.addItem(new CMenuOptionChooser(LOCALE_GLCD_ENABLE, &g_settings.glcd_enable,
|
||||
OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this));
|
||||
|
||||
m.addItem(new CMenuForwarder(LOCALE_GLCD_DISPLAY, (nGLCD::getInstance()->GetConfigSize() > 1),
|
||||
nGLCD::getInstance()->GetConfigName(g_settings.glcd_selected_config).c_str(), this, "select_driver"));
|
||||
int shortcut = 1;
|
||||
m.addItem(GenericMenuSeparatorLine);
|
||||
m.addItem(new CMenuOptionChooser(LOCALE_GLCD_SELECT_FG, &color_fg,
|
||||
GLCD_COLOR_OPTIONS, GLCD_COLOR_OPTION_COUNT, true, this,
|
||||
CRCInput::convertDigitToKey(shortcut++), NULL, true));
|
||||
m.addItem(new CMenuOptionChooser(LOCALE_GLCD_SELECT_BG, &color_bg,
|
||||
GLCD_COLOR_OPTIONS, GLCD_COLOR_OPTION_COUNT, true, this,
|
||||
CRCInput::convertDigitToKey(shortcut++), NULL, true));
|
||||
m.addItem(new CMenuOptionChooser(LOCALE_GLCD_SELECT_BAR, &color_bar,
|
||||
GLCD_COLOR_OPTIONS, GLCD_COLOR_OPTION_COUNT, true, this,
|
||||
m.addItem(new CMenuForwarder(LOCALE_GLCD_THEME_SETTINGS, true, NULL, this, "theme_settings",
|
||||
CRCInput::convertDigitToKey(shortcut++)));
|
||||
m.addItem(new CMenuForwarder(LOCALE_GLCD_FONT, true, g_settings.glcd_font, this, "select_font",
|
||||
CRCInput::convertDigitToKey(shortcut++)));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_CHANNEL,
|
||||
&g_settings.glcd_percent_channel, true, 0, 100, this));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_EPG,
|
||||
&g_settings.glcd_percent_epg, true, 0, 100, this));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_BAR,
|
||||
&g_settings.glcd_percent_bar, true, 0, 100, this));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_TIME,
|
||||
&g_settings.glcd_percent_time, true, 0, 100, this));
|
||||
m.addItem(new CMenuOptionChooser(LOCALE_GLCD_SHOW_LOGO, &g_settings.glcd_show_logo,
|
||||
OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this,
|
||||
CRCInput::convertDigitToKey(shortcut++)));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_LOGO,
|
||||
&g_settings.glcd_percent_logo, true, 0, 100, this));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_BRIGHTNESS,
|
||||
&g_settings.glcd_brightness, true, 0, 100, this));
|
||||
m.addItem(GenericMenuSeparatorLine);
|
||||
m.addItem(new CMenuOptionChooser(LOCALE_GLCD_TIME_IN_STANDBY, &g_settings.glcd_time_in_standby,
|
||||
GLCD_CLOCK_OPTIONS, GLCD_CLOCK_OPTIONS_COUNT, true, this,
|
||||
m.addItem(new CMenuForwarder(LOCALE_GLCD_BRIGHTNESS_SETTINGS, true, NULL, this, "brightness_settings",
|
||||
CRCInput::convertDigitToKey(shortcut++)));
|
||||
m.addItem(GenericMenuSeparatorLine);
|
||||
m.addItem(new CMenuForwarder(LOCALE_GLCD_STANDBY_SETTINGS, true, NULL, this, "standby_settings",
|
||||
CRCInput::convertDigitToKey(shortcut++)));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_TIME_STANDBY,
|
||||
&g_settings.glcd_percent_time_standby, true, 0, 100, this));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_BRIGHTNESS_STANDBY,
|
||||
&g_settings.glcd_brightness_standby, true, 0, 100, this));
|
||||
m.addItem(GenericMenuSeparatorLine);
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SCROLL_SPEED,
|
||||
&g_settings.glcd_scroll_speed, true, 1, 63, this));
|
||||
m.addItem(GenericMenuSeparatorLine);
|
||||
m.addItem(new CMenuOptionChooser(LOCALE_GLCD_SHOW_LOGO, &g_settings.glcd_show_logo,
|
||||
OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this,
|
||||
CRCInput::convertDigitToKey(shortcut++)));
|
||||
m.addItem(GenericMenuSeparatorLine);
|
||||
m.addItem(new CMenuOptionChooser(LOCALE_GLCD_MIRROR_OSD, &g_settings.glcd_mirror_osd,
|
||||
OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this, CRCInput::RC_green));
|
||||
m.addItem(new CMenuOptionChooser(LOCALE_GLCD_MIRROR_VIDEO, &g_settings.glcd_mirror_video,
|
||||
OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this, CRCInput::RC_yellow));
|
||||
m.addItem(GenericMenuSeparatorLine);
|
||||
m.addItem(new CMenuForwarder(LOCALE_GLCD_RESTART, true, NULL, this, "rescan", CRCInput::RC_red));
|
||||
m.addItem(new CMenuForwarder(LOCALE_GLCD_RESTART, true, NULL, this, "rescan", CRCInput::RC_blue));
|
||||
|
||||
m.exec(NULL, "");
|
||||
selected = m.getSelected();
|
||||
nGLCD::getInstance()->StandbyMode(false);
|
||||
cGLCD::getInstance()->StandbyMode(false);
|
||||
m.hide();
|
||||
}
|
||||
|
||||
void GLCD_Menu::GLCD_Menu_Select_Driver()
|
||||
void GLCD_Menu::GLCD_Standby_Settings()
|
||||
{
|
||||
int select = 0;
|
||||
CMenuWidget m(LOCALE_GLCD_STANDBY_SETTINGS, NEUTRINO_ICON_SETTINGS, width);
|
||||
m.addIntroItems();
|
||||
m.setSelected(selected);
|
||||
|
||||
if (nGLCD::getInstance()->GetConfigSize() > 1)
|
||||
{
|
||||
CMenuWidget *m = new CMenuWidget(LOCALE_GLCD_HEAD, NEUTRINO_ICON_SETTINGS);
|
||||
CMenuSelectorTarget * selector = new CMenuSelectorTarget(&select);
|
||||
SNeutrinoGlcdTheme &t = g_settings.glcd_theme;
|
||||
sigc::slot0<void> slot_repaint = sigc::mem_fun(m, &CMenuWidget::paint); //we want to repaint after changed Option
|
||||
|
||||
// we don't show introitems, so we add a separator for a smoother view
|
||||
m->addItem(GenericMenuSeparator);
|
||||
|
||||
CMenuForwarder* mf;
|
||||
for (int i = 0; i < nGLCD::getInstance()->GetConfigSize(); i++)
|
||||
{
|
||||
mf = new CMenuForwarder(nGLCD::getInstance()->GetConfigName(i), true, NULL, selector,to_string(i).c_str());
|
||||
m->addItem(mf);
|
||||
}
|
||||
|
||||
m->enableSaveScreen();
|
||||
m->exec(NULL, "");
|
||||
|
||||
if (!m->gotAction())
|
||||
return;
|
||||
|
||||
delete selector;
|
||||
m->hide();
|
||||
int shortcut = 1;
|
||||
m.addItem(new CMenuOptionChooser(LOCALE_GLCD_TIME_IN_STANDBY, &g_settings.glcd_time_in_standby,
|
||||
ONOFFSEC_OPTIONS, ONOFFSEC_OPTION_COUNT, true, this,
|
||||
CRCInput::convertDigitToKey(shortcut++)));
|
||||
m.addItem(new CMenuOptionChooser(LOCALE_GLCD_STANDBY_WEATHER, &g_settings.glcd_standby_weather,
|
||||
OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this));
|
||||
if (t.glcd_position_settings) {
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_DIGITAL_CLOCK_Y_POSITION,
|
||||
&t.glcd_digital_clock_y_position, true, 0, 500, this));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_SIMPLE_CLOCK,
|
||||
&t.glcd_size_simple_clock, true, 0, 100, this));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SIMPLE_CLOCK_Y_POSITION,
|
||||
&t.glcd_simple_clock_y_position, true, 0, 500, this));
|
||||
}
|
||||
g_settings.glcd_selected_config = select;
|
||||
m.exec(NULL, "");
|
||||
selected = m.getSelected();
|
||||
cGLCD::getInstance()->StandbyMode(false);
|
||||
m.hide();
|
||||
}
|
||||
|
||||
void GLCD_Menu::GLCD_Brightness_Settings()
|
||||
{
|
||||
CMenuWidget m(LOCALE_GLCD_BRIGHTNESS_SETTINGS, NEUTRINO_ICON_SETTINGS, width);
|
||||
m.addIntroItems();
|
||||
m.setSelected(selected);
|
||||
|
||||
SNeutrinoGlcdTheme &t = g_settings.glcd_theme;
|
||||
sigc::slot0<void> slot_repaint = sigc::mem_fun(m, &CMenuWidget::paint); //we want to repaint after changed Option
|
||||
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_BRIGHTNESS,
|
||||
&g_settings.glcd_brightness, true, 0, 10, this, CRCInput::RC_nokey, NULL, 0, 0, NONEXISTANT_LOCALE, true));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_BRIGHTNESS_STANDBY,
|
||||
&g_settings.glcd_brightness_standby, true, 0, 10, this, CRCInput::RC_nokey, NULL, 0, 0, NONEXISTANT_LOCALE, true));
|
||||
m.addItem(GenericMenuSeparatorLine);
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_BRIGHTNESS_DIM,
|
||||
&g_settings.glcd_brightness_dim, true, 0, 10, this, CRCInput::RC_nokey, NULL, 0, 0, NONEXISTANT_LOCALE, true));
|
||||
CStringInput *dim_time = new CStringInput(LOCALE_GLCD_BRIGHTNESS_DIM_TIME, &g_settings.glcd_brightness_dim_time, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE,"0123456789 ");
|
||||
m.addItem(new CMenuForwarder(LOCALE_GLCD_BRIGHTNESS_DIM_TIME, true, g_settings.glcd_brightness_dim_time, dim_time));
|
||||
|
||||
m.addItem(GenericMenuSeparatorLine);
|
||||
m.addItem(new CMenuForwarder(LOCALE_OPTIONS_DEFAULT, true, NULL, this, "brightness_default", CRCInput::RC_nokey));
|
||||
|
||||
m.exec(NULL, "");
|
||||
selected = m.getSelected();
|
||||
cGLCD::getInstance()->StandbyMode(false);
|
||||
m.hide();
|
||||
}
|
||||
|
||||
void GLCD_Menu::GLCD_Theme_Settings()
|
||||
{
|
||||
CMenuWidget m(LOCALE_GLCD_THEME_SETTINGS, NEUTRINO_ICON_SETTINGS, width);
|
||||
m.addIntroItems();
|
||||
m.setSelected(selected);
|
||||
|
||||
int shortcut = 1;
|
||||
SNeutrinoGlcdTheme &t = g_settings.glcd_theme;
|
||||
sigc::slot0<void> slot_repaint = sigc::mem_fun(m, &CMenuWidget::paint); //we want to repaint after changed Option
|
||||
|
||||
m.addItem(new CMenuForwarder(LOCALE_GLCD_THEME, true, NULL, CGLCDThemes::getInstance(), NULL, CRCInput::convertDigitToKey(shortcut++)));
|
||||
|
||||
m.addItem(new CMenuForwarder(LOCALE_GLCD_FONT, true, t.glcd_font, this, "select_font",
|
||||
CRCInput::convertDigitToKey(shortcut++)));
|
||||
|
||||
m.addItem(GenericMenuSeparatorLine);
|
||||
CColorSetupNotifier *colorSetupNotifier = new CColorSetupNotifier();
|
||||
|
||||
CColorChooser* fg = new CColorChooser(LOCALE_GLCD_SELECT_FG, &t.glcd_color_fg_red, &t.glcd_color_fg_green, &t.glcd_color_fg_blue, NULL, colorSetupNotifier);
|
||||
m.addItem(new CMenuDForwarder(LOCALE_GLCD_SELECT_FG, true, NULL, fg));
|
||||
|
||||
CColorChooser* bg = new CColorChooser(LOCALE_GLCD_SELECT_BG, &t.glcd_color_bg_red, &t.glcd_color_bg_green, &t.glcd_color_bg_blue, NULL, colorSetupNotifier);
|
||||
m.addItem(new CMenuDForwarder(LOCALE_GLCD_SELECT_BG, true, NULL, bg));
|
||||
|
||||
CColorChooser* bar = new CColorChooser(LOCALE_GLCD_SELECT_BAR, &t.glcd_color_bar_red, &t.glcd_color_bar_green, &t.glcd_color_bar_blue, NULL, colorSetupNotifier);
|
||||
m.addItem(new CMenuDForwarder(LOCALE_GLCD_SELECT_BAR, true, NULL, bar));
|
||||
|
||||
if (t.glcd_position_settings)
|
||||
m.addItem(new CMenuForwarder(LOCALE_GLCD_POSITION_SETTINGS, true, NULL, this, "position_settings",
|
||||
CRCInput::convertDigitToKey(shortcut++)));
|
||||
|
||||
//delete colorSetupNotifier;
|
||||
m.exec(NULL, "");
|
||||
selected = m.getSelected();
|
||||
cGLCD::getInstance()->StandbyMode(false);
|
||||
m.hide();
|
||||
}
|
||||
|
||||
void GLCD_Menu::GLCD_Theme_Position_Settings()
|
||||
{
|
||||
CMenuWidget m(LOCALE_GLCD_THEME_POSITION_SETTINGS, NEUTRINO_ICON_SETTINGS, width);
|
||||
m.addIntroItems();
|
||||
m.setSelected(selected);
|
||||
|
||||
SNeutrinoGlcdTheme &t = g_settings.glcd_theme;
|
||||
sigc::slot0<void> slot_repaint = sigc::mem_fun(m, &CMenuWidget::paint); //we want to repaint after changed Option
|
||||
|
||||
m.addItem(new CMenuOptionChooser(LOCALE_GLCD_SHOW_PROGRESSBAR, &t.glcd_show_progressbar,
|
||||
OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this));
|
||||
m.addItem(new CMenuOptionChooser(LOCALE_GLCD_SHOW_DURATION, &t.glcd_show_duration,
|
||||
OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this));
|
||||
m.addItem(new CMenuOptionChooser(LOCALE_GLCD_SHOW_START, &t.glcd_show_start,
|
||||
OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this));
|
||||
m.addItem(new CMenuOptionChooser(LOCALE_GLCD_SHOW_END, &t.glcd_show_end,
|
||||
OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this));
|
||||
m.addItem(new CMenuOptionChooser(LOCALE_GLCD_SHOW_TIME, &t.glcd_show_time,
|
||||
OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this));
|
||||
m.addItem(new CMenuOptionChooser(LOCALE_GLCD_SHOW_WEATHER, &t.glcd_show_weather,
|
||||
OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this));
|
||||
m.addItem(GenericMenuSeparatorLine);
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_CHANNEL,
|
||||
&t.glcd_percent_channel, true, 0, 100, this));
|
||||
m.addItem(new CMenuOptionChooser(LOCALE_GLCD_ALIGN_CHANNEL, &t.glcd_align_channel,
|
||||
ONOFFPRI_OPTIONS, ONOFFPRI_OPTION_COUNT, true, NULL));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_CHANNEL_X_POSITION,
|
||||
&t.glcd_channel_x_position, true, 0, 500, this));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_CHANNEL_Y_POSITION,
|
||||
&t.glcd_channel_y_position, true, 0, 500, this));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_EPG,
|
||||
&t.glcd_percent_epg, true, 0, 100, this));
|
||||
m.addItem(new CMenuOptionChooser(LOCALE_GLCD_ALIGN_EPG, &t.glcd_align_epg,
|
||||
ONOFFPRI_OPTIONS, ONOFFPRI_OPTION_COUNT, true, NULL));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_EPG_X_POSITION,
|
||||
&t.glcd_epg_x_position, true, 0, 500, this));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_EPG_Y_POSITION,
|
||||
&t.glcd_epg_y_position, true, 0, 500, this));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_DURATION,
|
||||
&t.glcd_percent_duration, true, 0, 100, this));
|
||||
m.addItem(new CMenuOptionChooser(LOCALE_GLCD_ALIGN_DURATION, &t.glcd_align_duration,
|
||||
ONOFFPRI_OPTIONS, ONOFFPRI_OPTION_COUNT, true, this, NULL));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_DURATION_X_POSITION,
|
||||
&t.glcd_duration_x_position, true, 0, 500, this));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_DURATION_Y_POSITION,
|
||||
&t.glcd_duration_y_position, true, 0, 500, this));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_START,
|
||||
&t.glcd_percent_start, true, 0, 100, this));
|
||||
m.addItem(new CMenuOptionChooser(LOCALE_GLCD_ALIGN_START, &t.glcd_align_start,
|
||||
ONOFFPRI_OPTIONS, ONOFFPRI_OPTION_COUNT, true, NULL));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_START_X_POSITION,
|
||||
&t.glcd_start_x_position, true, 0, 500, this));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_START_Y_POSITION,
|
||||
&t.glcd_start_y_position, true, 0, 500, this));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_END,
|
||||
&t.glcd_percent_end, true, 0, 100, this));
|
||||
m.addItem(new CMenuOptionChooser(LOCALE_GLCD_ALIGN_END, &t.glcd_align_end,
|
||||
ONOFFPRI_OPTIONS, ONOFFPRI_OPTION_COUNT, true, NULL));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_END_X_POSITION,
|
||||
&t.glcd_end_x_position, true, 0, 500, this));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_END_Y_POSITION,
|
||||
&t.glcd_end_y_position, true, 0, 500, this));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_TIME,
|
||||
&t.glcd_percent_time, true, 0, 100, this));
|
||||
m.addItem(new CMenuOptionChooser(LOCALE_GLCD_ALIGN_TIME, &t.glcd_align_time,
|
||||
ONOFFPRI_OPTIONS, ONOFFPRI_OPTION_COUNT, true, NULL));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_TIME_X_POSITION,
|
||||
&t.glcd_time_x_position, true, 0, 500, this));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_TIME_Y_POSITION,
|
||||
&t.glcd_time_y_position, true, 0, 500, this));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_BAR,
|
||||
&t.glcd_percent_bar, true, 0, 100, this));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_BAR_X_POSITION,
|
||||
&t.glcd_bar_x_position, true, 0, 500, this));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_BAR_Y_POSITION,
|
||||
&t.glcd_bar_y_position, true, 0, 500, this));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_BAR_WIDTH,
|
||||
&t.glcd_bar_width, true, 0, 500, this));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_LOGO,
|
||||
&t.glcd_percent_logo, true, 0, 100, this));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_LOGO_X_POSITION,
|
||||
&t.glcd_logo_x_position, true, 0, 500, this));
|
||||
m.addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_LOGO_Y_POSITION,
|
||||
&t.glcd_logo_y_position, true, 0, 500, this));
|
||||
|
||||
m.exec(NULL, "");
|
||||
selected = m.getSelected();
|
||||
cGLCD::getInstance()->StandbyMode(false);
|
||||
m.hide();
|
||||
}
|
||||
|
Reference in New Issue
Block a user