glcd: make glcd_show_logo themable

Origin commit data
------------------
Commit: 79702786d1
Author: vanhofen <vanhofen@gmx.de>
Date: 2020-07-11 (Sat, 11 Jul 2020)

Origin message was:
------------------
- glcd: make glcd_show_logo themable
This commit is contained in:
vanhofen
2020-07-11 00:22:41 +02:00
parent 679a6919d9
commit 0c39f16487
14 changed files with 25 additions and 20 deletions

View File

@@ -19,6 +19,7 @@ glcd_align_duration=0
glcd_align_start=0
glcd_align_end=0
glcd_align_time=2
glcd_show_logo=true
glcd_show_progressbar=true
glcd_show_duration=false
glcd_show_start=false

View File

@@ -19,6 +19,7 @@ glcd_align_duration=3
glcd_align_start=0
glcd_align_end=3
glcd_align_time=1
glcd_show_logo=true
glcd_show_progressbar=true
glcd_show_duration=true
glcd_show_start=false

View File

@@ -19,6 +19,7 @@ glcd_align_duration=0
glcd_align_start=0
glcd_align_end=0
glcd_align_time=2
glcd_show_logo=true
glcd_show_progressbar=true
glcd_show_duration=false
glcd_show_start=false

View File

@@ -19,6 +19,7 @@ glcd_align_duration=3
glcd_align_start=0
glcd_align_end=0
glcd_align_time=1
glcd_show_logo=true
glcd_show_progressbar=false
glcd_show_duration=true
glcd_show_start=false

View File

@@ -19,6 +19,7 @@ glcd_align_duration=3
glcd_align_start=0
glcd_align_end=3
glcd_align_time=1
glcd_show_logo=true
glcd_show_progressbar=true
glcd_show_duration=false
glcd_show_start=false

View File

@@ -19,6 +19,7 @@ glcd_align_duration=0
glcd_align_start=0
glcd_align_end=0
glcd_align_time=0
glcd_show_logo=true
glcd_show_progressbar=false
glcd_show_duration=false
glcd_show_start=false

View File

@@ -19,6 +19,7 @@ glcd_align_duration=3
glcd_align_start=0
glcd_align_end=3
glcd_align_time=1
glcd_show_logo=true
glcd_show_progressbar=true
glcd_show_duration=false
glcd_show_start=false

View File

@@ -19,6 +19,7 @@ glcd_align_duration=0
glcd_align_start=0
glcd_align_end=0
glcd_align_time=2
glcd_show_logo=true
glcd_show_progressbar=true
glcd_show_duration=false
glcd_show_start=false

View File

@@ -321,7 +321,7 @@ void cGLCD::Exec()
int icon_start_width = 0, icon_start_height = 0;
g_PicViewer->getSize(Logo.c_str(), &icon_start_width, &icon_start_height);
if (g_settings.glcd_show_logo && percent_logo &&
if (t.glcd_show_logo && percent_logo &&
showImage(channel_id, Channel, t.glcd_channel_x_position, t.glcd_channel_y_position, bitmap->Width(), percent_logo * bitmap->Height()/100, true, false)) {
doScrollChannel = false;
scrollChannelSkip = 0;

View File

@@ -258,13 +258,13 @@ bool GLCD_Menu::changeNotify (const neutrino_locale_t OptionName, void *Data)
csh->setActive(g_settings.glcd_time_in_standby == cGLCD::CLOCK_SIMPLE);
csy->setActive(g_settings.glcd_time_in_standby == cGLCD::CLOCK_SIMPLE);
break;
case LOCALE_GLCD_SHOW_LOGO:
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:
@@ -340,9 +340,6 @@ int GLCD_Menu::GLCD_Menu_Settings()
CRCInput::convertDigitToKey(shortcut++)));
gms->addItem(new CMenuForwarder(LOCALE_GLCD_STANDBY_SETTINGS, true, NULL, this, "standby_settings",
CRCInput::convertDigitToKey(shortcut++)));
gms->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++)));
gms->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SCROLL_SPEED,
&g_settings.glcd_scroll_speed, true, 1, 63, this));
gms->addItem(GenericMenuSeparatorLine);
@@ -480,22 +477,24 @@ int GLCD_Menu::GLCD_Theme_Position_Settings()
//sigc::slot0<void> slot_repaint = sigc::mem_fun(gtps, &CMenuWidget::paint); //we want to repaint after changed Option
gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_CHANNEL,
&t.glcd_percent_channel, !g_settings.glcd_show_logo, 0, 100, this));
&t.glcd_percent_channel, !t.glcd_show_logo, 0, 100, this));
gtps->addItem(new CMenuOptionChooser(LOCALE_GLCD_ALIGN_CHANNEL, &t.glcd_align_channel,
ONOFFPRI_OPTIONS, ONOFFPRI_OPTION_COUNT, !g_settings.glcd_show_logo, NULL));
ONOFFPRI_OPTIONS, ONOFFPRI_OPTION_COUNT, !t.glcd_show_logo, NULL));
gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_CHANNEL_X_POSITION,
&t.glcd_channel_x_position, !g_settings.glcd_show_logo, 0, 500, this));
&t.glcd_channel_x_position, !t.glcd_show_logo, 0, 500, this));
gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_CHANNEL_Y_POSITION,
&t.glcd_channel_y_position, !g_settings.glcd_show_logo, 0, 500, this));
&t.glcd_channel_y_position, !t.glcd_show_logo, 0, 500, this));
gtps->addItem(GenericMenuSeparatorLine);
gtps->addItem(new CMenuOptionChooser(LOCALE_GLCD_SHOW_LOGO, &t.glcd_show_logo,
OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this));
gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_LOGO,
&t.glcd_percent_logo, g_settings.glcd_show_logo, 0, 100, this));
&t.glcd_percent_logo, t.glcd_show_logo, 0, 100, this));
gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_LOGO_X_POSITION,
&t.glcd_logo_x_position, g_settings.glcd_show_logo, 0, 500, this));
&t.glcd_logo_x_position, t.glcd_show_logo, 0, 500, this));
gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_LOGO_Y_POSITION,
&t.glcd_logo_y_position, g_settings.glcd_show_logo, 0, 500, this));
&t.glcd_logo_y_position, t.glcd_show_logo, 0, 500, this));
gtps->addItem(GenericMenuSeparatorLine);

View File

@@ -295,6 +295,7 @@ void CGLCDThemes::setTheme(CConfigFile &configfile)
configfile.setInt32("glcd_color_bar_blue", t.glcd_color_bar_blue);
configfile.setString("glcd_font", t.glcd_font);
configfile.setString("glcd_background", t.glcd_background);
configfile.setBool("glcd_show_logo", t.glcd_show_logo);
configfile.setBool("glcd_show_progressbar", t.glcd_show_progressbar);
configfile.setBool("glcd_show_duration", t.glcd_show_duration);
configfile.setBool("glcd_show_start", t.glcd_show_start);
@@ -367,6 +368,7 @@ void CGLCDThemes::getTheme(CConfigFile &configfile)
t.glcd_color_bar_blue = configfile.getInt32("glcd_color_bar_blue", 0x62);
t.glcd_font = configfile.getString("glcd_font", "");
t.glcd_background = configfile.getString("glcd_background", "");
t.glcd_show_logo = configfile.getBool("glcd_show_logo", true);
t.glcd_show_progressbar = configfile.getBool("glcd_show_progressbar", false);
t.glcd_show_duration = configfile.getBool("glcd_show_duration", false);
t.glcd_show_start = configfile.getBool("glcd_show_start", false);

View File

@@ -699,7 +699,6 @@ int CNeutrinoApp::loadSetup(const char * fname)
g_settings.glcd_mirror_osd = configfile.getInt32("glcd_mirror_osd", 0);
g_settings.glcd_mirror_video = configfile.getInt32("glcd_mirror_video", 0);
g_settings.glcd_show_logo = configfile.getInt32("glcd_show_logo", 1);
g_settings.glcd_brightness = configfile.getInt32("glcd_brightness", GLCD_DEFAULT_BRIGHTNESS);
g_settings.glcd_brightness_dim = configfile.getInt32("glcd_brightness_dim", GLCD_DEFAULT_BRIGHTNESS_DIM);
g_settings.glcd_brightness_standby = configfile.getInt32("glcd_brightness_standby", GLCD_DEFAULT_BRIGHTNESS_STANDBY);
@@ -1399,12 +1398,10 @@ void CNeutrinoApp::upgradeSetup(const char * fname)
{
configfile.deleteKey("channellist_primetime");
}
if (g_settings.version_pseudo < "20200615000000")
if (g_settings.version_pseudo < "20170711000000")
{
#ifdef ENABLE_GRAPHLCD
// disable analog clock in standby mode
if (g_settings.glcd_time_in_standby > 1)
g_settings.glcd_time_in_standby = 1;
configfile.deleteKey("glcd_show_logo");
#endif
}
@@ -1677,7 +1674,6 @@ void CNeutrinoApp::saveSetup(const char * fname)
configfile.setInt32("glcd_standby_weather", g_settings.glcd_standby_weather);
configfile.setInt32("glcd_mirror_osd", g_settings.glcd_mirror_osd);
configfile.setInt32("glcd_mirror_video", g_settings.glcd_mirror_video);
configfile.setInt32("glcd_show_logo", g_settings.glcd_show_logo);
configfile.setInt32("glcd_brightness", g_settings.glcd_brightness);
configfile.setInt32("glcd_brightness_dim", g_settings.glcd_brightness_dim);
configfile.setInt32("glcd_brightness_standby", g_settings.glcd_brightness_standby);

View File

@@ -210,6 +210,7 @@ struct SNeutrinoGlcdTheme
std::string glcd_font;
std::string glcd_background;
int glcd_show_logo;
int glcd_show_progressbar;
int glcd_show_duration;
int glcd_show_start;
@@ -921,7 +922,6 @@ struct SNeutrinoSettings
int glcd_mirror_osd;
int glcd_mirror_video;
int glcd_show_logo;
int glcd_brightness;
int glcd_brightness_standby;
int glcd_brightness_dim;

View File

@@ -1 +1 @@
#define NEUTRINO_VERSION_PSEUDO "20200615000000"
#define NEUTRINO_VERSION_PSEUDO "20170711000000"