diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 74780bbe1..44ff34690 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -861,7 +861,7 @@ glcd.align_none keine glcd.align_right rechts glcd.align_start Sendungsstart ausrichten glcd.align_time Uhrzeit ausrichten -glcd.background BG Bild +glcd.background Hintergrundbild glcd.bar_width Fortschrittsbalken Weite glcd.bar_x_position Fortschrittsbalken x-Position glcd.bar_y_position Fortschrittsbalken y-Position @@ -891,8 +891,8 @@ glcd.color.red Rot glcd.color.teal Teal glcd.color.white Weiß glcd.color.yellow Gelb -glcd.channel_x_position Sender x-Position -glcd.channel_y_position Sender y-Position +glcd.channel_x_position Sendername x-Position +glcd.channel_y_position Sendername y-Position glcd.digital_clock_y_position Digitaluhr y-Position glcd.display Display-Typ glcd.duration_x_position Sendungsdauer x-Position @@ -935,11 +935,11 @@ glcd.show_time Uhrzeit anzeigen glcd.show_weather Wetter anzeigen glcd.simple_clock_y_position Einfache Uhr y-Position glcd.size_bar Fortschrittsbalken Höhe -glcd.size_channel Sender Höhe +glcd.size_channel Sendername Höhe glcd.size_duration Sendungsdauer Höhe glcd.size_end Sendungsende Höhe glcd.size_epg EPG Höhe -glcd.size_logo Senderlogo Höhe +glcd.size_logo Senderlogo max. Höhe % glcd.size_simple_clock Einfache Uhr Höhe glcd.size_start Sendungsstart Höhe glcd.size_time Uhrzeit Höhe @@ -953,12 +953,21 @@ glcd.standby_led_clock LED-Uhr glcd.standby_settings Standby-Einstellungen glcd.standby_simple_clock Einfache Uhr glcd.standby_weather Wetter im Standby +glcd.standby_weather_percent Wetter Höhe +glcd.standby_weather_curr_x_position Wetter im Standby heute x-Position +glcd.standby_weather_next_x_position Wetter im Standby morgen x-Position +glcd.standby_weather_y_position Wetter im Standby y-Position glcd.start_x_position Sendungsstart x-Position glcd.start_y_position Sendungsstart y-Position glcd.time_in_standby Zeitanzeige im Standby glcd.time_x_position Uhrzeit x-Position glcd.time_y_position Uhrzeit y-Position glcd.volume Lautstärke +glcd.weather_percent Wetter Höhe +glcd.weather_curr_x_position Wetter heute x-Position +glcd.weather_next_x_position Wetter morgen x-Position +glcd.weather_y_position Wetter y-Position +glcd.width_logo Senderlogo max. Breite % hdd_10min 10 min. hdd_1min 1 min. hdd_20min 20 min. diff --git a/data/locale/english.locale b/data/locale/english.locale index 2458f3e3b..4215df930 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -862,9 +862,9 @@ glcd.align_right right glcd.align_start Event start arrangement glcd.align_time Time arrangement glcd.background BG Picture -glcd.bar_width Progressbar width -glcd.bar_x_position Progressbar x-position -glcd.bar_y_position Progressbar y-position +glcd.bar_width Progress bar width +glcd.bar_x_position Progress bar x-position +glcd.bar_y_position Progress bar y-position glcd.brightness Brightness glcd.brightness_standby Brightness standby glcd.brightness_dim Dim @@ -923,18 +923,18 @@ glcd.mirror_video Show video on GraphLCD glcd.position_settings Positions and dimensions glcd.restart Restart glcd.scroll_speed Scroll speed -glcd.select.bar Progressbar color +glcd.select.bar Progress bar color glcd.select.bg Background color glcd.select.fg Text color glcd.show_duration Event duration display glcd.show_end Event end display glcd.show_logo Channel logo display -glcd.show_progressbar Progressbar display +glcd.show_progressbar Progress bar display glcd.show_start Event start display glcd.show_time Time display glcd.show_weather Weather display glcd.simple_clock_y_position Simple clock y-position -glcd.size_bar Progressbar height +glcd.size_bar Progress bar height glcd.size_channel Channel height glcd.size_duration Event duration height glcd.size_end Event end height @@ -953,12 +953,20 @@ glcd.standby_led_clock LED-clock glcd.standby_settings Standby-settings glcd.standby_simple_clock Simple clock glcd.standby_weather Weather in standby mode +glcd.standby_weather_percent Weather height +glcd.standby_weather_curr_x_position Weather in standby mode current x-position +glcd.standby_weather_next_x_position Weather in standby mode next x-position +glcd.standby_weather_y_position Weather in standby mode y-position glcd.start_x_position Event start x-position glcd.start_y_position Event start y-position glcd.time_in_standby Time display in standby mode glcd.time_x_position Time x-position glcd.time_y_position Time y-position glcd.volume Volume +glcd.weather_percent Weather height +glcd.weather_curr_x_position Weather current x-position +glcd.weather_next_x_position Weather next x-position +glcd.weather_y_position Weather y-position hdd_10min 10 min. hdd_1min 1 min. hdd_20min 20 min. diff --git a/src/driver/glcd/Makefile.am b/src/driver/glcd/Makefile.am index c52e477fa..4fa3a12c7 100644 --- a/src/driver/glcd/Makefile.am +++ b/src/driver/glcd/Makefile.am @@ -8,6 +8,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/lib \ -I$(top_srcdir)/lib/libconfigfile \ -I$(top_srcdir)/lib/libeventserver \ + -I$(top_srcdir)/lib/jsoncpp \ @SIGC_CFLAGS@ \ @FREETYPE_CFLAGS@ \ @LUA_CFLAGS@ \ diff --git a/src/driver/glcd/digitalclock.cpp b/src/driver/glcd/digitalclock.cpp index e5d4bc0ea..267cb9695 100644 --- a/src/driver/glcd/digitalclock.cpp +++ b/src/driver/glcd/digitalclock.cpp @@ -130,7 +130,8 @@ found: void RenderTimeDigit(int _digit, int x, int y) { cGLCD *cglcd = cGLCD::getInstance(); - if (g_settings.glcd_standby_weather) + SNeutrinoGlcdTheme &t = g_settings.glcd_theme; + if (t.glcd_standby_weather) cglcd->imageShow(digit[_digit], x, y, 0, 0, false, false, false, false, false); else cglcd->imageShow(digit[_digit], x, y, 0, 0, false, false, false, false, true); @@ -139,7 +140,8 @@ void RenderTimeDigit(int _digit, int x, int y) void RenderDots(int x, int y) { cGLCD *cglcd = cGLCD::getInstance(); - if (g_settings.glcd_standby_weather) + SNeutrinoGlcdTheme &t = g_settings.glcd_theme; + if (t.glcd_standby_weather) cglcd->imageShow(digit[TIME_DOTS], x, y, 0, 0, false, false, false, true, false); else cglcd->imageShow(digit[TIME_DOTS], x, y, 0, 0, false, false, false, true, true); @@ -149,7 +151,7 @@ void ShowDigitalClock(int hour, int minute) { cGLCD *cglcd = cGLCD::getInstance(); SNeutrinoGlcdTheme &t = g_settings.glcd_theme; - int y = g_settings.glcd_standby_weather ? t.glcd_standby_clock_digital_y_position : cglcd->bitmap->Height() / 2; + int y = t.glcd_standby_weather ? t.glcd_standby_clock_digital_y_position : cglcd->bitmap->Height() / 2; int a = 10; int b = 117; @@ -159,7 +161,7 @@ void ShowDigitalClock(int hour, int minute) RenderTimeDigit(hour/10, a, y); RenderTimeDigit(hour%10, b, y); - RenderDots(c ,(g_settings.glcd_standby_weather ? (y + 35) : y)); + RenderDots(c ,(t.glcd_standby_weather ? (y + 35) : y)); RenderTimeDigit(minute/10, d, y); RenderTimeDigit(minute%10, e, y); } diff --git a/src/driver/glcd/glcd.cpp b/src/driver/glcd/glcd.cpp index c41502298..3a623f5ec 100644 --- a/src/driver/glcd/glcd.cpp +++ b/src/driver/glcd/glcd.cpp @@ -113,6 +113,7 @@ cGLCD::cGLCD() percent_epg = 0; percent_bar = 0; percent_logo = 0; + percent_logo_width = 0; power_state = 1; Scale = 0; bitmap = NULL; @@ -229,19 +230,19 @@ void cGLCD::Exec() if (doStandbyTime || doStandbyWeather) { - if (g_settings.glcd_time_in_standby == CLOCK_ANALOG) + if (t.glcd_time_in_standby == CLOCK_ANALOG) { ShowAnalogClock(tm->tm_hour, tm->tm_min, tm->tm_sec, bitmap->Width()/2, bitmap->Height()/2); } - else if (g_settings.glcd_time_in_standby == CLOCK_DIGITAL) + else if (t.glcd_time_in_standby == CLOCK_DIGITAL) { ShowDigitalClock(tm->tm_hour, tm->tm_min); } - else if (g_settings.glcd_time_in_standby > CLOCK_OFF) + else if (t.glcd_time_in_standby > CLOCK_OFF) { - ShowSimpleClock(strftime("%H:%M", tm), g_settings.glcd_time_in_standby); + ShowSimpleClock(strftime("%H:%M", tm), t.glcd_time_in_standby); } - if (g_settings.glcd_standby_weather == 1 && g_settings.glcd_time_in_standby != CLOCK_ANALOG) + if (t.glcd_standby_weather == 1 && t.glcd_time_in_standby != CLOCK_ANALOG) { ShowWeather(true); } @@ -324,11 +325,11 @@ void cGLCD::Exec() g_PicViewer->getSize(Logo.c_str(), &icon_start_width, &icon_start_height); if (t.glcd_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)) { + showImage(channel_id, Channel, t.glcd_logo_x_position+(bitmap->Width()-(percent_logo_width * bitmap->Width()/100))/2, t.glcd_logo_y_position, percent_logo_width * bitmap->Width()/100, percent_logo * bitmap->Height()/100, true, false)) { doScrollChannel = false; scrollChannelSkip = 0; } else if (percent_logo && icon_start_width && icon_start_height && - doShowLcdIcon && showImage(Logo, icon_start_width, icon_start_height, t.glcd_channel_x_position, t.glcd_channel_y_position, bitmap->Width(), percent_logo * bitmap->Height()/100, true, false)) { + doShowLcdIcon && showImage(Logo, icon_start_width, icon_start_height, t.glcd_logo_x_position, t.glcd_logo_y_position, bitmap->Width(), percent_logo * bitmap->Height()/100, true, false)) { doScrollChannel = false; scrollChannelSkip = 0; } else if (percent_channel) { @@ -579,6 +580,7 @@ void cGLCD::updateFonts() SNeutrinoGlcdTheme &t = g_settings.glcd_theme; percent_logo = std::min(t.glcd_logo_percent, 100); + percent_logo_width = std::min(t.glcd_logo_width_percent, 100); percent_channel = std::min(t.glcd_channel_percent, 100); percent_epg = std::min(t.glcd_epg_percent, 100); percent_bar = std::min(t.glcd_progressbar_percent, 100); @@ -795,6 +797,7 @@ void cGLCD::Run(void) struct timespec ts; CSectionsdClient::CurrentNextInfo info_CurrentNext; + t_channel_id epg_id = -1; channel_id = -1; info_CurrentNext.current_zeit.startzeit = 0; info_CurrentNext.current_zeit.dauer = 0; @@ -1056,6 +1059,7 @@ void cGLCD::Run(void) { Channel = channelList->getActiveChannelName (); ChannelWidth = font_channel.Width(Channel); + epg_id = channelList->getActiveChannel()->getEpgID(); Epg = ""; EpgWidth = 0; Scale = 0; @@ -1074,7 +1078,7 @@ void cGLCD::Run(void) info_CurrentNext.current_zeit.dauer = 0; } - CEitManager::getInstance()->getCurrentNextServiceKey(channel_id & 0xFFFFFFFFFFFFULL, info_CurrentNext); + CEitManager::getInstance()->getCurrentNextServiceKey(epg_id & 0xFFFFFFFFFFFFULL, info_CurrentNext); channel_id = new_channel_id; if (info_CurrentNext.current_name.compare(Epg)) @@ -1097,7 +1101,7 @@ void cGLCD::Run(void) if ((info_CurrentNext.current_zeit.dauer > 0) && (info_CurrentNext.current_zeit.dauer < 86400)) { Scale = (ts.tv_sec - info_CurrentNext.current_zeit.startzeit) * 100 / info_CurrentNext.current_zeit.dauer; - char tmp_duration[15] = {0}; + char tmp_duration[6] = {0}; int total = info_CurrentNext.current_zeit.dauer / 60; int done = (abs(time(NULL) - info_CurrentNext.current_zeit.startzeit) + 30) / 60; int todo = total - done; @@ -1178,16 +1182,17 @@ void cGLCD::Update() void cGLCD::StandbyMode(bool b) { + SNeutrinoGlcdTheme &t = g_settings.glcd_theme; if (cglcd) { - if (g_settings.glcd_time_in_standby || g_settings.glcd_standby_weather) + if (t.glcd_time_in_standby || t.glcd_standby_weather) { - if (g_settings.glcd_time_in_standby) + if (t.glcd_time_in_standby) cglcd->doStandbyTime = b; else cglcd->doStandbyTime = false; - if (g_settings.glcd_standby_weather) + if (t.glcd_standby_weather) cglcd->doStandbyWeather = b; else cglcd->doStandbyWeather = false; diff --git a/src/driver/glcd/glcd.h b/src/driver/glcd/glcd.h index e16930c75..27fde99a6 100644 --- a/src/driver/glcd/glcd.h +++ b/src/driver/glcd/glcd.h @@ -63,6 +63,7 @@ class cGLCD int percent_smalltext; int percent_bar; int percent_logo; + int percent_logo_width; int power_state; std::string Logo; std::string Channel; diff --git a/src/driver/glcd/simpleclock.cpp b/src/driver/glcd/simpleclock.cpp index f4a54b28d..fca034830 100644 --- a/src/driver/glcd/simpleclock.cpp +++ b/src/driver/glcd/simpleclock.cpp @@ -83,6 +83,6 @@ void ShowSimpleClock(std::string Time, int mode) { cGLCD *cglcd = cGLCD::getInstance(); SNeutrinoGlcdTheme &t = g_settings.glcd_theme; - int y = g_settings.glcd_standby_weather ? t.glcd_standby_clock_simple_y_position : (cglcd->bitmap->Height() - font_time_standby.Height(Time)) / 2; + int y = t.glcd_standby_weather ? t.glcd_standby_clock_simple_y_position : (cglcd->bitmap->Height() - font_time_standby.Height(Time)) / 2; RenderSimpleClock(Time, 255, y, mode); } diff --git a/src/driver/glcd/weather.cpp b/src/driver/glcd/weather.cpp index e9a43a910..694a5a5dc 100644 --- a/src/driver/glcd/weather.cpp +++ b/src/driver/glcd/weather.cpp @@ -27,50 +27,11 @@ #include #include -enum weathers -{ - CLEAR_DAY = 0, - CLEAR_NIGHT = 1, - CLOUDY = 2, - FOG = 3, - PARTLY_CLOUDY_DAY = 4, - PARTLY_CLOUDY_NIGHT = 5, - RAIN = 6, - SLEET = 7, - SNOW = 8, - WIND = 9, - WEATHER_UNKNOWN = 10 -}; - -const char * const weather_name[] = -{ - "clear-day", - "clear-night", - "cloudy", - "fog", - "partly-cloudy-day", - "partly-cloudy-night", - "rain", - "sleet", - "snow", - "wind", - "unknown" -}; -#define LCD_NUMBER_OF_WEATHERS (sizeof(weather_name)/sizeof(weather_name[0])) - -const char * const weather_path[] = -{ - ICONSDIR_VAR "/oled/weather/", - ICONSDIR "/oled/weather/" -}; -#define NUMBER_OF_PATHS (sizeof(weather_path)/sizeof(weather_path[0])) - static bool ForceUpdate = true; static bool fonts_initialized = false; GLCD::cFont font_temperature; - -static std::string weather[LCD_NUMBER_OF_WEATHERS] = {""}; +GLCD::cFont font_temperature_standby; static std::string st_current_wcity = ""; static std::string st_current_wtimestamp = ""; @@ -84,92 +45,48 @@ static std::string st_next_wtemp = ""; static std::string st_next_wwind = ""; static std::string st_next_wicon = ""; -void InitWeather(void) +int weather_percent; +int weather_fontsize; + +int standby_weather_percent; +int standby_weather_fontsize; + +void InitWeather() { - for (unsigned int i = 0; i < LCD_NUMBER_OF_WEATHERS; i++) - { - std::string weather_file; - for (unsigned int j = 0; j < NUMBER_OF_PATHS; j++) - { - std::string file_jpg = weather_path[j]; - file_jpg += weather_name[i]; - file_jpg += ".jpg"; - if (file_exists(file_jpg.c_str())) - { - weather_file = file_jpg; - goto found; - } - std::string file_jpeg = weather_path[j]; - file_jpeg += weather_name[i]; - file_jpeg += ".jpeg"; - if (file_exists(file_jpeg.c_str())) - { - weather_file = file_jpeg; - goto found; - } - std::string file_png = weather_path[j]; - file_png += weather_name[i]; - file_png += ".png"; - if (file_exists(file_png.c_str())) - { - weather_file = file_png; - goto found; - } - std::string file_bmp = weather_path[j]; - file_bmp += weather_name[i]; - file_bmp += ".bmp"; - if (file_exists(file_bmp.c_str())) - { - weather_file = file_bmp; - goto found; - } - std::string file_gif = weather_path[j]; - file_gif += weather_name[i]; - file_gif += ".gif"; - if (file_exists(file_gif.c_str())) - { - weather_file = file_gif; - goto found; - } - } -found: - //printf("[%s:%s] found file: %s\n", __file__, __func__, weather_file.c_str()); - weather[i] += std::string(weather_file); - } - //printf("[%s:%s] finish initialization\n", __file__, __func__); + WeatherUpdateFonts; } -void WeatherUpdateFonts(void) +void WeatherUpdateFonts() { cGLCD *cglcd = cGLCD::getInstance(); - int fontsize_temperature = 0; - int percent_temperature = std::min(24, 100); // WTF? - int fontsize_temperature_new = percent_temperature * cglcd->lcd->Height() / 100; - if (!fonts_initialized || (fontsize_temperature_new != fontsize_temperature)) { - fontsize_temperature = fontsize_temperature_new; - if (!font_temperature.LoadFT2(FONTDIR "/oled/pakenham.ttf", "UTF-8", fontsize_temperature)) { - font_temperature.LoadFT2(g_settings.font_file, "UTF-8", fontsize_temperature); - } - } - fonts_initialized = true; -} + SNeutrinoGlcdTheme &t = g_settings.glcd_theme; -int WeatherNameToNumber(std::string name) -{ - for (unsigned int i = 0; i < sizeof(weather_name); i++) - { - if (name.compare(weather_name[i]) == 0) - { - return i; - break; + weather_percent = std::min(t.glcd_weather_percent, 100); + int weather_fontsize_new = weather_percent * cglcd->lcd->Height() / 100; + + standby_weather_percent = std::min(t.glcd_standby_weather_percent, 100); + int standby_weather_fontsize_new = standby_weather_percent * cglcd->lcd->Height() / 100; + + if (!fonts_initialized || (weather_fontsize_new != weather_fontsize)) { + weather_fontsize = weather_fontsize_new; + if (!font_temperature.LoadFT2(t.glcd_font, "UTF-8", weather_fontsize)) { + font_temperature.LoadFT2(g_settings.font_file, "UTF-8", weather_fontsize); } } - return WEATHER_UNKNOWN; + + if (!fonts_initialized || (standby_weather_fontsize_new != standby_weather_fontsize)) { + standby_weather_fontsize = standby_weather_fontsize_new; + if (!font_temperature_standby.LoadFT2(t.glcd_font, "UTF-8", standby_weather_fontsize)) { + font_temperature_standby.LoadFT2(g_settings.font_file, "UTF-8", standby_weather_fontsize); + } + } + + fonts_initialized = true; } void RenderWeather(int cx, int cy, int nx, int ny, bool standby) { - int forecast = 0; + int forecast = 0; // 0 is current day std::string current_wcity = ""; std::string current_wtimestamp = ""; @@ -193,7 +110,7 @@ void RenderWeather(int cx, int cy, int nx, int ny, bool standby) current_wtimestamp = st_current_wtimestamp = to_string((int)CWeather::getInstance()->getCurrentTimestamp()); current_wtemp = st_current_wtemp = CWeather::getInstance()->getCurrentTemperature(); current_wwind = st_current_wwind = CWeather::getInstance()->getCurrentWindSpeed(); - current_wicon = st_current_wicon = CWeather::getInstance()->getCurrentIconOnlyName(); + current_wicon = st_current_wicon = CWeather::getInstance()->getCurrentIcon(); next_wcity = st_next_wcity = CWeather::getInstance()->getCity(); next_wtimestamp = st_next_wtimestamp = to_string((int)CWeather::getInstance()->getForecastWeekday(forecast)); @@ -201,7 +118,7 @@ void RenderWeather(int cx, int cy, int nx, int ny, bool standby) //next_wtemp = st_next_wtemp += "|" + CWeather::getInstance()->getForecastTemperatureMax(forecast); next_wtemp = st_next_wtemp = CWeather::getInstance()->getForecastTemperatureMax(forecast); next_wwind = st_next_wwind = CWeather::getInstance()->getForecastWindBearing(forecast); - next_wicon = st_next_wicon = CWeather::getInstance()->getForecastIconOnlyNane(forecast); + next_wicon = st_next_wicon = CWeather::getInstance()->getForecastIcon(forecast); } else { @@ -220,27 +137,35 @@ void RenderWeather(int cx, int cy, int nx, int ny, bool standby) if (current_wicon != "") { if (!standby) - cglcd->imageShow(weather[WeatherNameToNumber(current_wicon)], cx, cy, 64, 64, false, false, false, false, false); + cglcd->imageShow(current_wicon, cx, cy, weather_fontsize, weather_fontsize, false, false, false, false, false); else - cglcd->imageShow(weather[WeatherNameToNumber(current_wicon)], cx, cy, 0, 0, false, false, false, false, false); + cglcd->imageShow(current_wicon, cx, cy, standby_weather_fontsize, standby_weather_fontsize, false, false, false, false, false); } if (current_wtemp != "") { current_wtemp += "°"; WeatherUpdateFonts(); - cglcd->bitmap->DrawText(170, 240, cglcd->bitmap->Width() - 1, current_wtemp, - &font_temperature, cglcd->ColorConvert3to1(t.glcd_foreground_color_red, t.glcd_foreground_color_green, t.glcd_foreground_color_blue), GLCD::cColor::Transparent); + if (!standby) + cglcd->bitmap->DrawText(cx + 5 + weather_fontsize, cy + ((weather_fontsize - font_temperature.TotalHeight()) / 2 ), cglcd->bitmap->Width() - 1, current_wtemp, + &font_temperature, cglcd->ColorConvert3to1(t.glcd_foreground_color_red, t.glcd_foreground_color_green, t.glcd_foreground_color_blue), GLCD::cColor::Transparent); + else + cglcd->bitmap->DrawText(cx + 5 + standby_weather_fontsize, cy + ((standby_weather_fontsize - font_temperature_standby.TotalHeight()) / 2 ), cglcd->bitmap->Width() - 1, current_wtemp, + &font_temperature_standby, cglcd->ColorConvert3to1(t.glcd_foreground_color_red, t.glcd_foreground_color_green, t.glcd_foreground_color_blue), GLCD::cColor::Transparent); } if (next_wicon != "") { if (!standby) - cglcd->imageShow(weather[WeatherNameToNumber(next_wicon)], nx, ny, 64, 64, false, false, false, false, false); + cglcd->imageShow(next_wicon, nx, ny, weather_fontsize, weather_fontsize, false, false, false, false, false); else - cglcd->imageShow(weather[WeatherNameToNumber(next_wicon)], nx, ny, 0, 0, false, false, false, false, false); + cglcd->imageShow(next_wicon, nx, ny, standby_weather_fontsize, standby_weather_fontsize, false, false, false, false, false); } if (next_wtemp != "") { next_wtemp += "°"; WeatherUpdateFonts(); - cglcd->bitmap->DrawText(250, 240, cglcd->bitmap->Width() - 1, next_wtemp, - &font_temperature, cglcd->ColorConvert3to1(t.glcd_foreground_color_red, t.glcd_foreground_color_green, t.glcd_foreground_color_blue), GLCD::cColor::Transparent); + if (!standby) + cglcd->bitmap->DrawText(nx + 5 + weather_fontsize, ny + ((weather_fontsize - font_temperature.TotalHeight()) / 2 ), cglcd->bitmap->Width() - 1, next_wtemp, + &font_temperature, cglcd->ColorConvert3to1(t.glcd_foreground_color_red, t.glcd_foreground_color_green, t.glcd_foreground_color_blue), GLCD::cColor::Transparent); + else + cglcd->bitmap->DrawText(nx + 5 + standby_weather_fontsize, ny + ((standby_weather_fontsize - font_temperature_standby.TotalHeight()) / 2 ), cglcd->bitmap->Width() - 1, next_wtemp, + &font_temperature_standby, cglcd->ColorConvert3to1(t.glcd_foreground_color_red, t.glcd_foreground_color_green, t.glcd_foreground_color_blue), GLCD::cColor::Transparent); } } } diff --git a/src/driver/glcd/weather.h b/src/driver/glcd/weather.h index 156912d8e..3839321c5 100644 --- a/src/driver/glcd/weather.h +++ b/src/driver/glcd/weather.h @@ -30,6 +30,5 @@ void InitWeather(); void WeatherUpdateFonts(); -int WeatherNameToNumber(std::string name); void RenderWeather(int cx, int cy, int nx, int ny, bool standby); void ShowWeather(bool standby); diff --git a/src/gui/glcdsetup.cpp b/src/gui/glcdsetup.cpp index 33d8a0c1b..1f1e51328 100644 --- a/src/gui/glcdsetup.cpp +++ b/src/gui/glcdsetup.cpp @@ -189,7 +189,7 @@ int GLCD_Menu::exec(CMenuTarget* parent, const std::string & actionKey) fileFilter.addFilter("jpeg"); fileFilter.addFilter("png"); fileBrowser.Filter = &fileFilter; - if (fileBrowser.exec(THEMESDIR) == true) + if (fileBrowser.exec(THEMESDIR"/oled") == true) t.glcd_background_image = fileBrowser.getSelectedFile()->Name; else t.glcd_background_image = ""; @@ -219,10 +219,6 @@ int GLCD_Menu::exec(CMenuTarget* parent, const std::string & actionKey) else if (actionKey == "standby_settings") { return GLCD_Standby_Settings(); - } - else if (actionKey == "position_settings") - { - return GLCD_Theme_Position_Settings(); } else if (actionKey == "glcd_logodir") { @@ -248,13 +244,29 @@ bool GLCD_Menu::changeNotify (const neutrino_locale_t OptionName, void *Data) return false; cGLCD *cglcd = cGLCD::getInstance(); cglcd->unlockChannel(); + SNeutrinoGlcdTheme &t = g_settings.glcd_theme; + + ChannelLogoActivate.Activate(t.glcd_logo); + TimeActivate.Activate(t.glcd_time); + DurationActivate.Activate(t.glcd_duration); + StartActivate.Activate(t.glcd_start); + EndActivate.Activate(t.glcd_end); + ProgressActivate.Activate(t.glcd_progressbar); + WeatherActivate.Activate(t.glcd_weather); + WeatherSBActivate.Activate(t.glcd_standby_weather); switch(OptionName) { - case LOCALE_GLCD_SELECT_FG: - case LOCALE_GLCD_SELECT_BG: - case LOCALE_GLCD_SELECT_BAR: - cglcd->Update(); + case LOCALE_GLCD_CHANNEL_X_POSITION: + case LOCALE_GLCD_CHANNEL_Y_POSITION: + case LOCALE_GLCD_SIZE_CHANNEL: + case LOCALE_GLCD_ALIGN_CHANNEL: + cglcd->lockChannel(CNeutrinoApp::getInstance()->channelList->getActiveChannelName()); + break; + case LOCALE_GLCD_TIME_IN_STANDBY: + cdy->setActive(t.glcd_time_in_standby == cGLCD::CLOCK_DIGITAL); + csh->setActive(t.glcd_time_in_standby == cGLCD::CLOCK_SIMPLE); + csy->setActive(t.glcd_time_in_standby == cGLCD::CLOCK_SIMPLE); break; case LOCALE_GLCD_ENABLE: if (g_settings.glcd_enable) @@ -265,75 +277,11 @@ bool GLCD_Menu::changeNotify (const neutrino_locale_t OptionName, void *Data) case LOCALE_GLCD_MIRROR_OSD: cglcd->MirrorOSD(*((int *) Data)); break; - case LOCALE_GLCD_MIRROR_VIDEO: - 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_TIME_IN_STANDBY: - cdy->setActive(g_settings.glcd_time_in_standby == cGLCD::CLOCK_DIGITAL); - 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_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_TIME_X_POSITION: - case LOCALE_GLCD_TIME_Y_POSITION: - case LOCALE_GLCD_SCROLL_SPEED: - case LOCALE_GLCD_POSITION_SETTINGS: - break; default: - return false; + cglcd->Update(); + break; } - 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_ANALOG_CLOCK - || OptionName == LOCALE_GLCD_STANDBY_WEATHER - || OptionName == LOCALE_GLCD_DIGITAL_CLOCK_Y_POSITION - || OptionName == LOCALE_GLCD_SIMPLE_CLOCK_Y_POSITION - || OptionName == LOCALE_GLCD_SIZE_SIMPLE_CLOCK - ) - cglcd->StandbyMode(true); - else - cglcd->StandbyMode(false); - cglcd->Update(); return true; } @@ -349,32 +297,29 @@ int GLCD_Menu::GLCD_Menu_Settings() OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this, CRCInput::RC_red)); select_driver = new CMenuForwarder(LOCALE_GLCD_DISPLAY, (cGLCD::getInstance()->GetConfigSize() > 1), - cGLCD::getInstance()->GetConfigName(g_settings.glcd_selected_config).c_str(), this, "select_driver"); + cGLCD::getInstance()->GetConfigName(g_settings.glcd_selected_config).c_str(), this, "select_driver", CRCInput::RC_green); gms->addItem(select_driver); + gms->addItem(new CMenuForwarder(LOCALE_GLCD_THEME_SETTINGS, true, NULL, this, "theme_settings", + CRCInput::RC_yellow)); + gms->addItem(GenericMenuSeparatorLine); int shortcut = 1; + gms->addItem(new CMenuForwarder(LOCALE_GLCD_LOGODIR, true, g_settings.glcd_logodir, this, "glcd_logodir", CRCInput::convertDigitToKey(shortcut++))); gms->addItem(GenericMenuSeparator); - gms->addItem(new CMenuForwarder(LOCALE_GLCD_THEME_SETTINGS, true, NULL, this, "theme_settings", - CRCInput::convertDigitToKey(shortcut++))); gms->addItem(new CMenuForwarder(LOCALE_GLCD_BRIGHTNESS_SETTINGS, true, NULL, this, "brightness_settings", CRCInput::convertDigitToKey(shortcut++))); - gms->addItem(new CMenuForwarder(LOCALE_GLCD_STANDBY_SETTINGS, true, NULL, this, "standby_settings", - CRCInput::convertDigitToKey(shortcut++))); gms->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SCROLL_SPEED, &g_settings.glcd_scroll_speed, true, 1, 63, this)); - - gms->addItem(GenericMenuSeparatorLine); - gms->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)); + OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this, CRCInput::convertDigitToKey(shortcut++))); gms->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)); + OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this, CRCInput::convertDigitToKey(shortcut++))); gms->addItem(GenericMenuSeparatorLine); gms->addItem(new CMenuForwarder(LOCALE_GLCD_RESTART, true, NULL, this, "rescan", CRCInput::RC_blue)); @@ -387,34 +332,57 @@ int GLCD_Menu::GLCD_Menu_Settings() int GLCD_Menu::GLCD_Standby_Settings() { + cGLCD::getInstance()->StandbyMode(true); + WeatherSBActivate.Clear(); + CMenuOptionNumberChooser* nc; + int oled_width = cGLCD::getInstance()->lcd->Width(); + int oled_height = cGLCD::getInstance()->lcd->Height(); + CMenuWidget *gss = new CMenuWidget(LOCALE_GLCD_HEAD, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_GLCD_STANDBY_SETTINGS); gss->addIntroItems(LOCALE_GLCD_STANDBY_SETTINGS); SNeutrinoGlcdTheme &t = g_settings.glcd_theme; CMenuOptionChooser *mc; - mc = new CMenuOptionChooser(LOCALE_GLCD_TIME_IN_STANDBY, &g_settings.glcd_time_in_standby, ONOFFSEC_OPTIONS, ONOFFSEC_OPTION_COUNT, true, this); + mc = new CMenuOptionChooser(LOCALE_GLCD_TIME_IN_STANDBY, &t.glcd_time_in_standby, ONOFFSEC_OPTIONS, ONOFFSEC_OPTION_COUNT, true, this); //mc->setHint("", LOCALE_TODO); gss->addItem(mc); - cdy = new CMenuOptionNumberChooser(LOCALE_GLCD_DIGITAL_CLOCK_Y_POSITION, &t.glcd_standby_clock_digital_y_position, (t.glcd_position_settings && g_settings.glcd_time_in_standby == cGLCD::CLOCK_DIGITAL), 0, 500, this); + cdy = new CMenuOptionNumberChooser(LOCALE_GLCD_DIGITAL_CLOCK_Y_POSITION, &t.glcd_standby_clock_digital_y_position, (t.glcd_position_settings && t.glcd_time_in_standby == cGLCD::CLOCK_DIGITAL), 0, 500, this); //cdy->setHint("", LOCALE_TODO); gss->addItem(cdy); - csh = new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_SIMPLE_CLOCK, &t.glcd_standby_clock_simple_size, (t.glcd_position_settings && g_settings.glcd_time_in_standby == cGLCD::CLOCK_SIMPLE), 0, 100, this); + csh = new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_SIMPLE_CLOCK, &t.glcd_standby_clock_simple_size, (t.glcd_position_settings && t.glcd_time_in_standby == cGLCD::CLOCK_SIMPLE), 0, 100, this); //csh->setHint("", LOCALE_TODO); gss->addItem(csh); - csy = new CMenuOptionNumberChooser(LOCALE_GLCD_SIMPLE_CLOCK_Y_POSITION, &t.glcd_standby_clock_simple_y_position, (t.glcd_position_settings && g_settings.glcd_time_in_standby == cGLCD::CLOCK_SIMPLE), 0, 500, this); + csy = new CMenuOptionNumberChooser(LOCALE_GLCD_SIMPLE_CLOCK_Y_POSITION, &t.glcd_standby_clock_simple_y_position, (t.glcd_position_settings && t.glcd_time_in_standby == cGLCD::CLOCK_SIMPLE), 0, 500, this); //csy->setHint("", LOCALE_TODO); gss->addItem(csy); gss->addItem(GenericMenuSeparatorLine); - mc = new CMenuOptionChooser(LOCALE_GLCD_STANDBY_WEATHER, &g_settings.glcd_standby_weather, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this); + mc = new CMenuOptionChooser(LOCALE_GLCD_STANDBY_WEATHER, &t.glcd_standby_weather, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this); //mc->setHint("", LOCALE_TODO); gss->addItem(mc); + nc = new CMenuOptionNumberChooser(LOCALE_GLCD_STANDBY_WEATHER_PERCENT, + &t.glcd_standby_weather_percent, t.glcd_standby_weather, 0, 100, this); + gss->addItem(nc); + WeatherSBActivate.Add(nc); + nc = new CMenuOptionNumberChooser(LOCALE_GLCD_STANDBY_WEATHER_CURR_X_POSITION, + &t.glcd_standby_weather_curr_x_position, t.glcd_standby_weather, 0, oled_width, this); + gss->addItem(nc); + WeatherSBActivate.Add(nc); + nc = new CMenuOptionNumberChooser(LOCALE_GLCD_STANDBY_WEATHER_NEXT_X_POSITION, + &t.glcd_standby_weather_next_x_position, t.glcd_standby_weather, 0, oled_width, this); + gss->addItem(nc); + WeatherSBActivate.Add(nc); + nc = new CMenuOptionNumberChooser(LOCALE_GLCD_STANDBY_WEATHER_Y_POSITION, + &t.glcd_standby_weather_y_position, t.glcd_standby_weather, 0, oled_height, this); + gss->addItem(nc); + WeatherSBActivate.Add(nc); + int res = gss->exec(NULL, ""); delete gss; cGLCD::getInstance()->StandbyMode(false); @@ -463,23 +431,35 @@ int GLCD_Menu::GLCD_Brightness_Settings() int GLCD_Menu::GLCD_Theme_Settings() { - CColorSetupNotifier *colorSetupNotifier = new CColorSetupNotifier(); - CMenuWidget *gts = new CMenuWidget(LOCALE_GLCD_HEAD, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_GLCD_THEME_SETTINGS); gts->addIntroItems(LOCALE_GLCD_THEME_SETTINGS); - + ChannelLogoActivate.Clear(); + TimeActivate.Clear(); + DurationActivate.Clear(); + StartActivate.Clear(); + EndActivate.Clear(); + ProgressActivate.Clear(); + WeatherActivate.Clear(); + CMenuOptionNumberChooser* nc; + CMenuOptionChooser* oc; + CMenuDForwarder* mf; + CColorSetupNotifier *colorSetupNotifier = new CColorSetupNotifier(); + cGLCD::getInstance()->SetCfgMode(true); SNeutrinoGlcdTheme &t = g_settings.glcd_theme; - //sigc::slot0 slot_repaint = sigc::mem_fun(gts, &CMenuWidget::paint); //we want to repaint after changed Option + int oled_width = cGLCD::getInstance()->lcd->Width(); + int oled_height = cGLCD::getInstance()->lcd->Height(); - gts->addItem(new CMenuForwarder(LOCALE_GLCD_THEME, true, NULL, CGLCDThemes::getInstance(), NULL, CRCInput::RC_0)); + gts->addItem(new CMenuForwarder(LOCALE_GLCD_THEME, true, NULL, CGLCDThemes::getInstance(), NULL, CRCInput::RC_red)); gts->addItem(GenericMenuSeparatorLine); - gts->addItem(new CMenuForwarder(LOCALE_GLCD_FONT, true, t.glcd_font, this, "select_font", CRCInput::RC_red)); + gts->addItem(new CMenuForwarder(LOCALE_GLCD_STANDBY_SETTINGS, true, NULL, this, "standby_settings", CRCInput::RC_green)); - gts->addItem(new CMenuForwarder(LOCALE_GLCD_BACKGROUND, true, t.glcd_background_image, this, "select_background", CRCInput::RC_green)); + gts->addItem(GenericMenuSeparatorLine); - gts->addItem(new CMenuForwarder(LOCALE_GLCD_POSITION_SETTINGS, t.glcd_position_settings, NULL, this, "position_settings", CRCInput::RC_yellow)); + gts->addItem(new CMenuForwarder(LOCALE_GLCD_FONT, true, t.glcd_font, this, "select_font", CRCInput::RC_yellow)); + + gts->addItem(new CMenuForwarder(LOCALE_GLCD_BACKGROUND, true, t.glcd_background_image, this, "select_background", CRCInput::RC_blue)); gts->addItem(GenericMenuSeparatorLine); @@ -489,157 +469,203 @@ int GLCD_Menu::GLCD_Theme_Settings() CColorChooser* bg = new CColorChooser(LOCALE_GLCD_SELECT_BG, &t.glcd_background_color_red, &t.glcd_background_color_green, &t.glcd_background_color_blue, NULL, colorSetupNotifier); gts->addItem(new CMenuDForwarder(LOCALE_GLCD_SELECT_BG, true, NULL, bg)); - CColorChooser* bar = new CColorChooser(LOCALE_GLCD_SELECT_BAR, &t.glcd_progressbar_color_red, &t.glcd_progressbar_color_green, &t.glcd_progressbar_color_blue, NULL, colorSetupNotifier); - gts->addItem(new CMenuDForwarder(LOCALE_GLCD_SELECT_BAR, true, NULL, bar)); + gts->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_GLCD_POSITION_SETTINGS)); + gts->addItem(new CMenuOptionChooser(LOCALE_GLCD_SHOW_LOGO, &t.glcd_logo, + OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this)); + gts->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_CHANNEL, + &t.glcd_channel_percent, true, 0, 100, this)); + gts->addItem(new CMenuOptionChooser(LOCALE_GLCD_ALIGN_CHANNEL, &t.glcd_channel_align, + ONOFFPRI_OPTIONS, ONOFFPRI_OPTION_COUNT, true, NULL)); + gts->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_CHANNEL_X_POSITION, + &t.glcd_channel_x_position, true, 0, oled_width, this)); + gts->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_CHANNEL_Y_POSITION, + &t.glcd_channel_y_position, true, 0, oled_height, this)); + nc = new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_LOGO, + &t.glcd_logo_percent, t.glcd_logo, 0, 100, this); + gts->addItem(nc); + ChannelLogoActivate.Add(nc); + nc = new CMenuOptionNumberChooser(LOCALE_GLCD_WIDTH_LOGO, + &t.glcd_logo_width_percent, t.glcd_logo, 0, 100, this); + gts->addItem(nc); + ChannelLogoActivate.Add(nc); + nc = new CMenuOptionNumberChooser(LOCALE_GLCD_LOGO_X_POSITION, + &t.glcd_logo_x_position, t.glcd_logo, 0, oled_width, this); + gts->addItem(nc); + ChannelLogoActivate.Add(nc); + nc = new CMenuOptionNumberChooser(LOCALE_GLCD_LOGO_Y_POSITION, + &t.glcd_logo_y_position, t.glcd_logo, 0, oled_height, this); + gts->addItem(nc); + ChannelLogoActivate.Add(nc); + + gts->addItem(GenericMenuSeparatorLine); + + gts->addItem(new CMenuOptionChooser(LOCALE_GLCD_SHOW_TIME, &t.glcd_time, + OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this)); + nc = new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_TIME, + &t.glcd_time_percent, t.glcd_time, 0, 100, this); + gts->addItem(nc); + TimeActivate.Add(nc); + oc = new CMenuOptionChooser(LOCALE_GLCD_ALIGN_TIME, &t.glcd_time_align, + ONOFFPRI_OPTIONS, ONOFFPRI_OPTION_COUNT, t.glcd_time, NULL); + gts->addItem(oc); + TimeActivate.Add(oc); + nc = new CMenuOptionNumberChooser(LOCALE_GLCD_TIME_X_POSITION, + &t.glcd_time_x_position, t.glcd_time, 0, oled_width, this); + gts->addItem(nc); + TimeActivate.Add(nc); + nc = new CMenuOptionNumberChooser(LOCALE_GLCD_TIME_Y_POSITION, + &t.glcd_time_y_position, t.glcd_time, 0, oled_height, this); + gts->addItem(nc); + TimeActivate.Add(nc); + + gts->addItem(GenericMenuSeparatorLine); + + gts->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_EPG, + &t.glcd_epg_percent, true, 0, 100, this)); + gts->addItem(new CMenuOptionChooser(LOCALE_GLCD_ALIGN_EPG, &t.glcd_epg_align, + ONOFFPRI_OPTIONS, ONOFFPRI_OPTION_COUNT, true, NULL)); + gts->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_EPG_X_POSITION, + &t.glcd_epg_x_position, true, 0, oled_width, this)); + gts->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_EPG_Y_POSITION, + &t.glcd_epg_y_position, true, 0, oled_height, this)); + + gts->addItem(GenericMenuSeparatorLine); + + gts->addItem(new CMenuOptionChooser(LOCALE_GLCD_SHOW_DURATION, &t.glcd_duration, + OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this)); + nc = new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_DURATION, + &t.glcd_duration_percent, t.glcd_duration, 0, 100, this); + gts->addItem(nc); + DurationActivate.Add(nc); + oc = new CMenuOptionChooser(LOCALE_GLCD_ALIGN_DURATION, &t.glcd_duration_align, + ONOFFPRI_OPTIONS, ONOFFPRI_OPTION_COUNT, t.glcd_duration, NULL); + gts->addItem(oc); + DurationActivate.Add(oc); + nc = new CMenuOptionNumberChooser(LOCALE_GLCD_DURATION_X_POSITION, + &t.glcd_duration_x_position, t.glcd_duration, 0, oled_width, this); + gts->addItem(nc); + DurationActivate.Add(nc); + nc = new CMenuOptionNumberChooser(LOCALE_GLCD_DURATION_Y_POSITION, + &t.glcd_duration_y_position, t.glcd_duration, 0, oled_height, this); + gts->addItem(nc); + DurationActivate.Add(nc); + + gts->addItem(GenericMenuSeparatorLine); + + gts->addItem(new CMenuOptionChooser(LOCALE_GLCD_SHOW_START, &t.glcd_start, + OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this)); + nc = new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_START, + &t.glcd_start_percent, t.glcd_start, 0, 100, this); + gts->addItem(nc); + StartActivate.Add(nc); + oc = new CMenuOptionChooser(LOCALE_GLCD_ALIGN_START, &t.glcd_start_align, + ONOFFPRI_OPTIONS, ONOFFPRI_OPTION_COUNT, true, NULL); + gts->addItem(oc); + StartActivate.Add(oc); + nc = new CMenuOptionNumberChooser(LOCALE_GLCD_START_X_POSITION, + &t.glcd_start_x_position, t.glcd_start, 0, oled_width, this); + gts->addItem(nc); + StartActivate.Add(nc); + nc = new CMenuOptionNumberChooser(LOCALE_GLCD_START_Y_POSITION, + &t.glcd_start_y_position, t.glcd_start, 0, oled_height, this); + gts->addItem(nc); + StartActivate.Add(nc); + + gts->addItem(GenericMenuSeparatorLine); + + gts->addItem(new CMenuOptionChooser(LOCALE_GLCD_SHOW_END, &t.glcd_end, + OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this)); + nc = new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_END, + &t.glcd_end_percent, t.glcd_end, 0, 100, this); + gts->addItem(nc); + EndActivate.Add(nc); + oc =new CMenuOptionChooser(LOCALE_GLCD_ALIGN_END, &t.glcd_end_align, + ONOFFPRI_OPTIONS, ONOFFPRI_OPTION_COUNT, true, NULL); + gts->addItem(oc); + EndActivate.Add(oc); + nc = new CMenuOptionNumberChooser(LOCALE_GLCD_END_X_POSITION, + &t.glcd_end_x_position, t.glcd_end, 0, oled_width, this); + gts->addItem(nc); + EndActivate.Add(nc); + nc = new CMenuOptionNumberChooser(LOCALE_GLCD_END_Y_POSITION, + &t.glcd_end_y_position, t.glcd_end, 0, oled_height, this); + gts->addItem(nc); + EndActivate.Add(nc); + + gts->addItem(GenericMenuSeparatorLine); + + gts->addItem(new CMenuOptionChooser(LOCALE_GLCD_SHOW_PROGRESSBAR, &t.glcd_progressbar, + OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this)); + nc = new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_BAR, + &t.glcd_progressbar_percent, t.glcd_progressbar, 0, 100, this); + gts->addItem(nc); + ProgressActivate.Add(nc); + nc = new CMenuOptionNumberChooser(LOCALE_GLCD_BAR_WIDTH, + &t.glcd_progressbar_width, t.glcd_progressbar, 0, oled_width, this); + gts->addItem(nc); + ProgressActivate.Add(nc); + nc = new CMenuOptionNumberChooser(LOCALE_GLCD_BAR_X_POSITION, + &t.glcd_progressbar_x_position, t.glcd_progressbar, 0, oled_width, this); + gts->addItem(nc); + ProgressActivate.Add(nc); + nc = new CMenuOptionNumberChooser(LOCALE_GLCD_BAR_Y_POSITION, + &t.glcd_progressbar_y_position, t.glcd_progressbar, 0, oled_height, this); + gts->addItem(nc); + ProgressActivate.Add(nc); + CColorChooser* bar = new CColorChooser(LOCALE_GLCD_SELECT_BAR, &t.glcd_progressbar_color_red, &t.glcd_progressbar_color_green, &t.glcd_progressbar_color_blue, NULL, colorSetupNotifier); + mf = new CMenuDForwarder(LOCALE_GLCD_SELECT_BAR, t.glcd_progressbar, NULL, bar); + gts->addItem(mf); + ProgressActivate.Add(mf); + + gts->addItem(GenericMenuSeparatorLine); + + gts->addItem(new CMenuOptionChooser(LOCALE_GLCD_SHOW_WEATHER, &t.glcd_weather, + OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this)); + nc = new CMenuOptionNumberChooser(LOCALE_GLCD_WEATHER_PERCENT, + &t.glcd_weather_percent, t.glcd_weather, 0, 100, this); + gts->addItem(nc); + WeatherActivate.Add(nc); + nc = new CMenuOptionNumberChooser(LOCALE_GLCD_WEATHER_CURR_X_POSITION, + &t.glcd_weather_curr_x_position, t.glcd_weather, 0, oled_width, this); + gts->addItem(nc); + WeatherActivate.Add(nc); + nc = new CMenuOptionNumberChooser(LOCALE_GLCD_WEATHER_NEXT_X_POSITION, + &t.glcd_weather_next_x_position, t.glcd_weather, 0, oled_width, this); + gts->addItem(nc); + WeatherActivate.Add(nc); + nc = new CMenuOptionNumberChooser(LOCALE_GLCD_WEATHER_Y_POSITION, + &t.glcd_weather_y_position, t.glcd_weather, 0, oled_height, this); + gts->addItem(nc); + WeatherActivate.Add(nc); + + gts->addItem(GenericMenuSeparatorLine); + + gts->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_ICON_Y_PERCENT, + &t.glcd_icons_percent, true, 0, 100, this)); + gts->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_ICON_Y_POSITION, + &t.glcd_icons_y_position, true, 0, oled_height, this)); + gts->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_ICON_CAM_X_POSITION, + &t.glcd_icon_cam_x_position, true, 0, oled_width, this)); + gts->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_ICON_DD_X_POSITION, + &t.glcd_icon_dd_x_position, true, 0, oled_width, this)); + gts->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_ICON_ECM_X_POSITION, + &t.glcd_icon_ecm_x_position, true, 0, oled_width, this)); + gts->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_ICON_MUTE_X_POSITION, + &t.glcd_icon_mute_x_position, true, 0, oled_width, this)); + gts->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_ICON_REC_X_POSITION, + &t.glcd_icon_rec_x_position, true, 0, oled_width, this)); + gts->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_ICON_TIMER_X_POSITION, + &t.glcd_icon_timer_x_position, true, 0, oled_width, this)); + gts->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_ICON_TS_X_POSITION, + &t.glcd_icon_ts_x_position, true, 0, oled_width, this)); + gts->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_ICON_TXT_X_POSITION, + &t.glcd_icon_txt_x_position, true, 0, oled_width, this)); int res = gts->exec(NULL, ""); delete colorSetupNotifier; delete gts; cGLCD::getInstance()->StandbyMode(false); - return res; -} - -int GLCD_Menu::GLCD_Theme_Position_Settings() -{ - cGLCD::getInstance()->SetCfgMode(true); - - int oled_width = cGLCD::getInstance()->lcd->Width(); - int oled_height = cGLCD::getInstance()->lcd->Height(); - - CMenuWidget *gtps = new CMenuWidget(LOCALE_GLCD_THEME_SETTINGS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_GLCD_THEME_POSITION_SETTINGS); - gtps->addIntroItems(LOCALE_GLCD_POSITION_SETTINGS); - - SNeutrinoGlcdTheme &t = g_settings.glcd_theme; - //sigc::slot0 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_channel_percent, !t.glcd_logo, 0, 100, this)); - gtps->addItem(new CMenuOptionChooser(LOCALE_GLCD_ALIGN_CHANNEL, &t.glcd_channel_align, - ONOFFPRI_OPTIONS, ONOFFPRI_OPTION_COUNT, !t.glcd_logo, NULL)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_CHANNEL_X_POSITION, - &t.glcd_channel_x_position, !t.glcd_logo, 0, oled_width, this)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_CHANNEL_Y_POSITION, - &t.glcd_channel_y_position, !t.glcd_logo, 0, oled_height, this)); - - gtps->addItem(GenericMenuSeparatorLine); - - gtps->addItem(new CMenuOptionChooser(LOCALE_GLCD_SHOW_LOGO, &t.glcd_logo, - OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_LOGO, - &t.glcd_logo_percent, t.glcd_logo, 0, 100, this)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_LOGO_X_POSITION, - &t.glcd_logo_x_position, t.glcd_logo, 0, oled_width, this)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_LOGO_Y_POSITION, - &t.glcd_logo_y_position, t.glcd_logo, 0, oled_height, this)); - - gtps->addItem(GenericMenuSeparatorLine); - - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_EPG, - &t.glcd_epg_percent, true, 0, 100, this)); - gtps->addItem(new CMenuOptionChooser(LOCALE_GLCD_ALIGN_EPG, &t.glcd_epg_align, - ONOFFPRI_OPTIONS, ONOFFPRI_OPTION_COUNT, true, NULL)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_EPG_X_POSITION, - &t.glcd_epg_x_position, true, 0, oled_width, this)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_EPG_Y_POSITION, - &t.glcd_epg_y_position, true, 0, oled_height, this)); - - gtps->addItem(GenericMenuSeparatorLine); - - gtps->addItem(new CMenuOptionChooser(LOCALE_GLCD_SHOW_DURATION, &t.glcd_duration, - OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_DURATION, - &t.glcd_duration_percent, true, 0, 100, this)); - gtps->addItem(new CMenuOptionChooser(LOCALE_GLCD_ALIGN_DURATION, &t.glcd_duration_align, - ONOFFPRI_OPTIONS, ONOFFPRI_OPTION_COUNT, true, NULL)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_DURATION_X_POSITION, - &t.glcd_duration_x_position, true, 0, oled_width, this)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_DURATION_Y_POSITION, - &t.glcd_duration_y_position, true, 0, oled_height, this)); - - gtps->addItem(GenericMenuSeparatorLine); - - gtps->addItem(new CMenuOptionChooser(LOCALE_GLCD_SHOW_START, &t.glcd_start, - OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_START, - &t.glcd_start_percent, true, 0, 100, this)); - gtps->addItem(new CMenuOptionChooser(LOCALE_GLCD_ALIGN_START, &t.glcd_start_align, - ONOFFPRI_OPTIONS, ONOFFPRI_OPTION_COUNT, true, NULL)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_START_X_POSITION, - &t.glcd_start_x_position, true, 0, oled_width, this)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_START_Y_POSITION, - &t.glcd_start_y_position, true, 0, oled_height, this)); - - gtps->addItem(GenericMenuSeparatorLine); - - gtps->addItem(new CMenuOptionChooser(LOCALE_GLCD_SHOW_END, &t.glcd_end, - OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_END, - &t.glcd_end_percent, true, 0, 100, this)); - gtps->addItem(new CMenuOptionChooser(LOCALE_GLCD_ALIGN_END, &t.glcd_end_align, - ONOFFPRI_OPTIONS, ONOFFPRI_OPTION_COUNT, true, NULL)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_END_X_POSITION, - &t.glcd_end_x_position, true, 0, oled_width, this)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_END_Y_POSITION, - &t.glcd_end_y_position, true, 0, oled_height, this)); - - gtps->addItem(GenericMenuSeparatorLine); - - gtps->addItem(new CMenuOptionChooser(LOCALE_GLCD_SHOW_TIME, &t.glcd_time, - OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_TIME, - &t.glcd_time_percent, true, 0, 100, this)); - gtps->addItem(new CMenuOptionChooser(LOCALE_GLCD_ALIGN_TIME, &t.glcd_time_align, - ONOFFPRI_OPTIONS, ONOFFPRI_OPTION_COUNT, true, NULL)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_TIME_X_POSITION, - &t.glcd_time_x_position, true, 0, oled_width, this)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_TIME_Y_POSITION, - &t.glcd_time_y_position, true, 0, oled_height, this)); - - gtps->addItem(GenericMenuSeparatorLine); - - gtps->addItem(new CMenuOptionChooser(LOCALE_GLCD_SHOW_PROGRESSBAR, &t.glcd_progressbar, - OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_SIZE_BAR, - &t.glcd_progressbar_percent, true, 0, 100, this)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_BAR_WIDTH, - &t.glcd_progressbar_width, true, 0, oled_width, this)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_BAR_X_POSITION, - &t.glcd_progressbar_x_position, true, 0, oled_width, this)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_BAR_Y_POSITION, - &t.glcd_progressbar_y_position, true, 0, oled_height, this)); - - gtps->addItem(GenericMenuSeparatorLine); - - gtps->addItem(new CMenuOptionChooser(LOCALE_GLCD_SHOW_WEATHER, &t.glcd_weather, - OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this)); - - gtps->addItem(GenericMenuSeparatorLine); - - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_ICON_Y_PERCENT, - &t.glcd_icons_percent, true, 0, 100, this)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_ICON_Y_POSITION, - &t.glcd_icons_y_position, true, 0, oled_height, this)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_ICON_CAM_X_POSITION, - &t.glcd_icon_cam_x_position, true, 0, oled_width, this)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_ICON_DD_X_POSITION, - &t.glcd_icon_dd_x_position, true, 0, oled_width, this)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_ICON_ECM_X_POSITION, - &t.glcd_icon_ecm_x_position, true, 0, oled_width, this)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_ICON_MUTE_X_POSITION, - &t.glcd_icon_mute_x_position, true, 0, oled_width, this)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_ICON_REC_X_POSITION, - &t.glcd_icon_rec_x_position, true, 0, oled_width, this)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_ICON_TIMER_X_POSITION, - &t.glcd_icon_timer_x_position, true, 0, oled_width, this)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_ICON_TS_X_POSITION, - &t.glcd_icon_ts_x_position, true, 0, oled_width, this)); - gtps->addItem(new CMenuOptionNumberChooser(LOCALE_GLCD_ICON_TXT_X_POSITION, - &t.glcd_icon_txt_x_position, true, 0, oled_width, this)); - - int res = gtps->exec(NULL, ""); - delete gtps; - cGLCD::getInstance()->StandbyMode(false); cGLCD::getInstance()->SetCfgMode(false); return res; } diff --git a/src/gui/glcdsetup.h b/src/gui/glcdsetup.h index b28fae408..177a4263d 100644 --- a/src/gui/glcdsetup.h +++ b/src/gui/glcdsetup.h @@ -42,6 +42,14 @@ class GLCD_Menu : public CMenuTarget, public CChangeObserver CMenuOptionNumberChooser * cdy; CMenuOptionNumberChooser * csh; CMenuOptionNumberChooser * csy; + CGenericMenuActivate ChannelLogoActivate; + CGenericMenuActivate TimeActivate; + CGenericMenuActivate DurationActivate; + CGenericMenuActivate StartActivate; + CGenericMenuActivate EndActivate; + CGenericMenuActivate ProgressActivate; + CGenericMenuActivate WeatherActivate; + CGenericMenuActivate WeatherSBActivate; public: GLCD_Menu(); void hide(); @@ -51,7 +59,6 @@ class GLCD_Menu : public CMenuTarget, public CChangeObserver int GLCD_Standby_Settings(); int GLCD_Brightness_Settings(); int GLCD_Theme_Settings(); - int GLCD_Theme_Position_Settings(); }; #endif // __glcdsetup_h__ #endif // ENABLE_GRAPHLCD diff --git a/src/gui/glcdthemes.cpp b/src/gui/glcdthemes.cpp index 6623b754d..ea55df07e 100644 --- a/src/gui/glcdthemes.cpp +++ b/src/gui/glcdthemes.cpp @@ -298,6 +298,7 @@ void CGLCDThemes::setTheme(CConfigFile &configfile) configfile.setInt32("glcd_channel_y_position", t.glcd_channel_y_position); configfile.setBool("glcd_logo", t.glcd_logo); configfile.setInt32("glcd_logo_percent", t.glcd_logo_percent); + configfile.setInt32("glcd_logo_width_percent", t.glcd_logo_width_percent); configfile.setInt32("glcd_logo_x_position", t.glcd_logo_x_position); configfile.setInt32("glcd_logo_y_position", t.glcd_logo_y_position); configfile.setInt32("glcd_epg_percent", t.glcd_epg_percent); @@ -343,12 +344,16 @@ void CGLCDThemes::setTheme(CConfigFile &configfile) configfile.setInt32("glcd_icon_rec_x_position", t.glcd_icon_rec_x_position); configfile.setInt32("glcd_icon_ts_x_position", t.glcd_icon_ts_x_position); configfile.setBool("glcd_weather", t.glcd_weather); + configfile.setInt32("glcd_weather_percent", t.glcd_weather_percent); configfile.setInt32("glcd_weather_curr_x_position", t.glcd_weather_curr_x_position); configfile.setInt32("glcd_weather_next_x_position", t.glcd_weather_next_x_position); configfile.setInt32("glcd_weather_y_position", t.glcd_weather_y_position); + configfile.setInt32("glcd_time_in_standby", t.glcd_time_in_standby); + configfile.setInt32("glcd_standby_weather", t.glcd_standby_weather); configfile.setInt32("glcd_standby_clock_digital_y_position", t.glcd_standby_clock_digital_y_position); configfile.setInt32("glcd_standby_clock_simple_size", t.glcd_standby_clock_simple_size); configfile.setInt32("glcd_standby_clock_simple_y_position", t.glcd_standby_clock_simple_y_position); + configfile.setInt32("glcd_standby_weather_percent", t.glcd_standby_weather_percent); configfile.setInt32("glcd_standby_weather_curr_x_position", t.glcd_standby_weather_curr_x_position); configfile.setInt32("glcd_standby_weather_next_x_position", t.glcd_standby_weather_next_x_position); configfile.setInt32("glcd_standby_weather_y_position", t.glcd_standby_weather_y_position); @@ -371,6 +376,7 @@ void CGLCDThemes::getTheme(CConfigFile &configfile) t.glcd_channel_y_position = configfile.getInt32("glcd_channel_y_position", 60); t.glcd_logo = configfile.getBool("glcd_logo", true); t.glcd_logo_percent = configfile.getInt32("glcd_logo_percent", 25); + t.glcd_logo_width_percent = configfile.getInt32("glcd_logo_width_percent", 99); t.glcd_logo_x_position = configfile.getInt32("glcd_logo_x_position", 0); t.glcd_logo_y_position = configfile.getInt32("glcd_logo_y_position", 60); t.glcd_epg_percent = configfile.getInt32("glcd_epg_percent", 15); @@ -416,12 +422,16 @@ void CGLCDThemes::getTheme(CConfigFile &configfile) t.glcd_icon_rec_x_position = configfile.getInt32("glcd_icon_rec_x_position", 0); t.glcd_icon_ts_x_position = configfile.getInt32("glcd_icon_ts_x_position", 0); t.glcd_weather = configfile.getBool("glcd_weather", false); + t.glcd_weather_percent = configfile.getInt32("glcd_weather_percent", 15); t.glcd_weather_curr_x_position = configfile.getInt32("glcd_weather_curr_x_position", 0); t.glcd_weather_next_x_position = configfile.getInt32("glcd_weather_next_x_position", 0); t.glcd_weather_y_position = configfile.getInt32("glcd_weather_y_position", 0); + t.glcd_time_in_standby = configfile.getInt32("glcd_time_in_standby", 1); + t.glcd_standby_weather = configfile.getInt32("glcd_standby_weather", 1); t.glcd_standby_clock_digital_y_position = configfile.getInt32("glcd_standby_clock_digital_y_position", 0); t.glcd_standby_clock_simple_size = configfile.getInt32("glcd_standby_clock_simple_size", 0); t.glcd_standby_clock_simple_y_position = configfile.getInt32("glcd_standby_clock_simple_y_position", 0); + t.glcd_standby_weather_percent = configfile.getInt32("glcd_standby_weather_percent", 40); t.glcd_standby_weather_curr_x_position = configfile.getInt32("glcd_standby_weather_curr_x_position", 0); t.glcd_standby_weather_next_x_position = configfile.getInt32("glcd_standby_weather_next_x_position", 0); t.glcd_standby_weather_y_position = configfile.getInt32("glcd_standby_weather_y_position", 0); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 904ccf552..d6a20eeef 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -386,9 +386,6 @@ int CNeutrinoApp::loadSetup(const char *fname) g_settings.glcd_enable = configfile.getInt32("glcd_enable", strcmp(g_info.hw_caps->boxvendor, "VU+") == 0 || strcmp(g_info.hw_caps->boxvendor, "AXAS") == 0); g_settings.glcd_logodir = configfile.getString("glcd_logodir", "/media/sda1/logos"); - g_settings.glcd_time_in_standby = configfile.getInt32("glcd_time_in_standby", 1); - g_settings.glcd_standby_weather = configfile.getInt32("glcd_standby_weather", 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_dim_time = configfile.getString("glcd_brightness_dim_time", GLCD_DEFAULT_BRIGHTNESS_DIM_TIME); @@ -1511,9 +1508,6 @@ void CNeutrinoApp::saveSetup(const char *fname) configfile.setInt32("glcd_enable", g_settings.glcd_enable); configfile.setString("glcd_logodir", g_settings.glcd_logodir); - configfile.setInt32("glcd_time_in_standby", g_settings.glcd_time_in_standby); - configfile.setInt32("glcd_standby_weather", g_settings.glcd_standby_weather); - configfile.setInt32("glcd_brightness", g_settings.glcd_brightness); configfile.setInt32("glcd_brightness_dim", g_settings.glcd_brightness_dim); configfile.setString("glcd_brightness_dim_time", g_settings.glcd_brightness_dim_time); diff --git a/src/system/locals.h b/src/system/locals.h index c22cb4022..a324ba89d 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -980,12 +980,21 @@ typedef enum LOCALE_GLCD_STANDBY_SETTINGS, LOCALE_GLCD_STANDBY_SIMPLE_CLOCK, LOCALE_GLCD_STANDBY_WEATHER, + LOCALE_GLCD_STANDBY_WEATHER_PERCENT, + LOCALE_GLCD_STANDBY_WEATHER_CURR_X_POSITION, + LOCALE_GLCD_STANDBY_WEATHER_NEXT_X_POSITION, + LOCALE_GLCD_STANDBY_WEATHER_Y_POSITION, LOCALE_GLCD_START_X_POSITION, LOCALE_GLCD_START_Y_POSITION, LOCALE_GLCD_TIME_IN_STANDBY, LOCALE_GLCD_TIME_X_POSITION, LOCALE_GLCD_TIME_Y_POSITION, LOCALE_GLCD_VOLUME, + LOCALE_GLCD_WEATHER_PERCENT, + LOCALE_GLCD_WEATHER_CURR_X_POSITION, + LOCALE_GLCD_WEATHER_NEXT_X_POSITION, + LOCALE_GLCD_WEATHER_Y_POSITION, + LOCALE_GLCD_WIDTH_LOGO, LOCALE_HDD_10MIN, LOCALE_HDD_1MIN, LOCALE_HDD_20MIN, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 12fff632d..b31fdd04c 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -980,12 +980,21 @@ const char * locale_real_names[] = "glcd.standby_settings", "glcd.standby_simple_clock", "glcd.standby_weather", + "glcd.standby_weather_percent", + "glcd.standby_weather_curr_x_position", + "glcd.standby_weather_next_x_position", + "glcd.standby_weather_y_position", "glcd.start_x_position", "glcd.start_y_position", "glcd.time_in_standby", "glcd.time_x_position", "glcd.time_y_position", "glcd.volume", + "glcd.weather_percent", + "glcd.weather_curr_x_position", + "glcd.weather_next_x_position", + "glcd.weather_y_position", + "glcd.width_logo", "hdd_10min", "hdd_1min", "hdd_20min", diff --git a/src/system/settings.h b/src/system/settings.h index ebd7bb59f..75c958337 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -239,6 +239,7 @@ struct SNeutrinoGlcdTheme int glcd_logo; int glcd_logo_percent; + int glcd_logo_width_percent; int glcd_logo_x_position; int glcd_logo_y_position; @@ -293,14 +294,19 @@ struct SNeutrinoGlcdTheme int glcd_icon_ts_x_position; int glcd_weather; + int glcd_weather_percent; int glcd_weather_curr_x_position; int glcd_weather_next_x_position; int glcd_weather_y_position; + int glcd_time_in_standby; + int glcd_standby_weather; + int glcd_standby_clock_digital_y_position; int glcd_standby_clock_simple_size; int glcd_standby_clock_simple_y_position; + int glcd_standby_weather_percent; int glcd_standby_weather_curr_x_position; int glcd_standby_weather_next_x_position; int glcd_standby_weather_y_position; @@ -321,9 +327,6 @@ struct SNeutrinoSettings int glcd_enable; std::string glcd_logodir; - int glcd_time_in_standby; - int glcd_standby_weather; - int glcd_brightness; int glcd_brightness_dim; std::string glcd_brightness_dim_time;