- lcd4l-setup: move type setup into own submenu to get different options for different types

Signed-off-by: GetAway <get-away@t-online.de>
This commit is contained in:
svenhoefer
2019-01-05 21:53:57 +01:00
committed by GetAway
parent 6145cabae1
commit 4b9740623e
6 changed files with 90 additions and 34 deletions

View File

@@ -929,6 +929,7 @@ lcd4l_brightness_standby Helligkeit im Standby-Modus
lcd4l_clock_a Analog-Uhr im Standby-Modus
lcd4l_convert Konvertiere Umlaute
lcd4l_display_type Display-Typ
lcd4l_display_type_setup Display-Typ einstellen
lcd4l_logodir Senderlogo-Verzeichnis
lcd4l_skin Display-Style
lcd4l_skin_0 Standard
@@ -1251,9 +1252,10 @@ menu.hint_lcd4l_brightness Regelt die Helligkeit des externen Displays im Normal
menu.hint_lcd4l_brightness_standby Regelt die Helligkeit des externen Displays im Standby-Modus
menu.hint_lcd4l_clock_a Zeigt im Standby-Betrieb eine Analog-Uhr anstatt einer Digital-Uhr
menu.hint_lcd4l_convert Konvertiert Umlaute für die eingebaute LCD4Linux-Schriftart
menu.hint_lcd4l_display_type Wählen Sie den Typ den externen Displays
menu.hint_lcd4l_display_type Wählen Sie den Typ des externen Displays
menu.hint_lcd4l_display_type_setup Einstellungen für den Typ des externen Displays
menu.hint_lcd4l_logodir Verzeichnis für Senderlogos\nBei ungültigem Eintrag Fallback auf Standard-Logoverzeichnis
menu.hint_lcd4l_skin Auswahl der verfügbaren Darstellungsarten
menu.hint_lcd4l_skin Auswahl der verfügbaren Darstellungsarten\nStandard, Benutzerdefiniert, etc.
menu.hint_lcd4l_skin_radio Wechselt die Darstellungsart, wenn der Radio-Modus aktiviert wird
menu.hint_lcd4l_support LCD4Linux aktivieren/deaktivieren\nUnterstützte Displays: Pearl DPF, Samsung DPF, VU+SOLO4K, PNG
menu.hint_leds_blink Die Power-LEDs blinken, wenn sich der Receiver im Deep-Standby befindet und ein Timer aktiv ist

View File

@@ -927,7 +927,8 @@ lcd4l_brightness Brightness
lcd4l_brightness_standby Brightness in standby
lcd4l_clock_a Analog clock in Standby-Mode
lcd4l_convert Convert umlauts
lcd4l_display_type Display Type
lcd4l_display_type Display type
lcd4l_display_type_setup Display type setup
lcd4l_logodir Channellogo-Directory
lcd4l_skin Display-Style
lcd4l_skin_0 Standard
@@ -1250,10 +1251,11 @@ menu.hint_lcd4l_brightness_standby Adjusts the brightness of external display in
menu.hint_lcd4l_clock_a Shows an analog clock instead of a digital clock on display at standby
menu.hint_lcd4l_convert Convert umlauts for the built-in LCD4Linux font
menu.hint_lcd4l_display_type Choose type of external display
menu.hint_lcd4l_display_type_setup Settings for the type of external display
menu.hint_lcd4l_logodir Logo directory.\nFallback to default on invalid entry.
menu.hint_lcd4l_skin Switch between modes
menu.hint_lcd4l_skin_radio Switch the mode, when Radio-Mode is activated
menu.hint_lcd4l_support Activate/deactivate LCD4Linux\nSupported displays: Pearl DPF, Samsung DPF, VU+SOLO4K, PNG
menu.hint_lcd4l_skin Switch between styles\nDefault, User defined, etc.
menu.hint_lcd4l_skin_radio Switch style when Radio-Mode is activated
menu.hint_lcd4l_support Activate/deactivate LCD4Linux\nSupported displays: Pearl DPF, Samsung SPF, VU+SOLO4K, PNG
menu.hint_leds_blink Blinking LEDs in deep-standby
menu.hint_leds_deepstandby LEDs state in deep-standby mode
menu.hint_leds_record LEDs state when box recording

View File

@@ -90,6 +90,8 @@ const CMenuOptionChooser::keyval LCD4L_SKIN_OPTIONS[] =
CLCD4lSetup::CLCD4lSetup()
{
width = 40;
lcd4l_display_type_changed = false;
}
CLCD4lSetup::~CLCD4lSetup()
@@ -119,6 +121,10 @@ int CLCD4lSetup::exec(CMenuTarget* parent, const std::string &actionkey)
chooserDir(g_settings.lcd4l_logodir, false, action_str);
return menu_return::RETURN_REPAINT;
}
else if (actionkey == "typeSetup")
{
return showTypeSetup();
}
res = show();
@@ -140,6 +146,11 @@ bool CLCD4lSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data
if (g_settings.lcd4l_support)
LCD4l->StartLCD4l();
}
else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_LCD4L_DISPLAY_TYPE))
{
g_settings.lcd4l_display_type = temp_lcd4l_display_type;
lcd4l_display_type_changed = true;
}
return false;
}
@@ -148,42 +159,38 @@ int CLCD4lSetup::show()
{
int shortcut = 1;
int temp_lcd4l_display_type = g_settings.lcd4l_display_type;
int temp_lcd4l_skin = g_settings.lcd4l_skin;
int temp_lcd4l_brightness = g_settings.lcd4l_brightness;
temp_lcd4l_display_type = g_settings.lcd4l_display_type;
temp_lcd4l_skin = g_settings.lcd4l_skin;
temp_lcd4l_brightness = g_settings.lcd4l_brightness;
CMenuOptionChooser *mc;
CMenuForwarder *mf;
// lcd4l setup
CMenuWidget* lcd4lSetup = new CMenuWidget(LOCALE_LCD4L_SUPPORT, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_LCD4L_SETUP);
lcd4lSetup->addIntroItems();
CMenuWidget *lcd4lSetup = new CMenuWidget(LOCALE_MISCSETTINGS_HEAD, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_LCD4L_SETUP);
lcd4lSetup->addIntroItems(LOCALE_LCD4L_SUPPORT);
mc = new CMenuOptionChooser(LOCALE_LCD4L_SUPPORT, &g_settings.lcd4l_support, LCD4L_SUPPORT_OPTIONS, LCD4L_SUPPORT_OPTION_COUNT, true, this, CRCInput::RC_red);
mc->setHint(NEUTRINO_ICON_HINT_LCD4LINUX, LOCALE_MENU_HINT_LCD4L_SUPPORT);
lcd4lSetup->addItem(mc);
lcd4lSetup->addItem(GenericMenuSeparatorLine);
mc = new CMenuOptionChooser(LOCALE_LCD4L_DISPLAY_TYPE, &temp_lcd4l_display_type, LCD4L_DISPLAY_TYPE_OPTIONS, LCD4L_DISPLAY_TYPE_OPTION_COUNT, true, this, CRCInput::RC_green);
mc->setHint(NEUTRINO_ICON_HINT_LCD4LINUX, LOCALE_MENU_HINT_LCD4L_DISPLAY_TYPE);
lcd4lSetup->addItem(mc);
mf = new CMenuForwarder(LOCALE_LCD4L_DISPLAY_TYPE_SETUP, true, NULL, this, "typeSetup", CRCInput::RC_yellow);
mf->setHint(NEUTRINO_ICON_HINT_LCD4LINUX, LOCALE_MENU_HINT_LCD4L_DISPLAY_TYPE_SETUP);
lcd4lSetup->addItem(mf);
lcd4lSetup->addItem(GenericMenuSeparatorLine);
mf = new CMenuForwarder(LOCALE_LCD4L_LOGODIR, true, g_settings.lcd4l_logodir, this, "lcd4l_logodir", CRCInput::convertDigitToKey(shortcut++));
mf->setHint(NEUTRINO_ICON_HINT_LCD4LINUX, LOCALE_MENU_HINT_LCD4L_LOGODIR);
lcd4lSetup->addItem(mf);
mc = new CMenuOptionChooser(LOCALE_LCD4L_DISPLAY_TYPE, &temp_lcd4l_display_type, LCD4L_DISPLAY_TYPE_OPTIONS, LCD4L_DISPLAY_TYPE_OPTION_COUNT, true, NULL, CRCInput::convertDigitToKey(shortcut++));
mc->setHint(NEUTRINO_ICON_HINT_LCD4LINUX, LOCALE_MENU_HINT_LCD4L_DISPLAY_TYPE);
lcd4lSetup->addItem(mc);
mc = new CMenuOptionChooser(LOCALE_LCD4L_SKIN, &temp_lcd4l_skin, LCD4L_SKIN_OPTIONS, LCD4L_SKIN_OPTION_COUNT, true, NULL, CRCInput::convertDigitToKey(shortcut++));
mc->setHint(NEUTRINO_ICON_HINT_LCD4LINUX, LOCALE_MENU_HINT_LCD4L_SKIN);
lcd4lSetup->addItem(mc);
mc = new CMenuOptionChooser(LOCALE_LCD4L_SKIN_RADIO, &g_settings.lcd4l_skin_radio, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, NULL, CRCInput::convertDigitToKey(shortcut++));
mc->setHint(NEUTRINO_ICON_HINT_LCD4LINUX, LOCALE_MENU_HINT_LCD4L_SKIN_RADIO);
lcd4lSetup->addItem(mc);
nc = new CMenuOptionNumberChooser(LOCALE_LCD4L_BRIGHTNESS, (int *)&temp_lcd4l_brightness, true, 1, LCD4l->GetMaxBrightness(), this);
nc->setHint(NEUTRINO_ICON_HINT_LCD4LINUX, LOCALE_MENU_HINT_LCD4L_BRIGHTNESS);
lcd4lSetup->addItem(nc);
nc = new CMenuOptionNumberChooser(LOCALE_LCD4L_BRIGHTNESS_STANDBY, (int *)&g_settings.lcd4l_brightness_standby, true, 1, LCD4l->GetMaxBrightness(), this);
nc->setHint(NEUTRINO_ICON_HINT_LCD4LINUX, LOCALE_MENU_HINT_LCD4L_BRIGHTNESS_STANDBY);
lcd4lSetup->addItem(nc);
lcd4lSetup->addItem(GenericMenuSeparator);
const char *flag_lcd4l_clock_a = FLAGDIR "/.lcd-clock_a";
int fake_lcd4l_clock_a = file_exists(flag_lcd4l_clock_a);
@@ -210,9 +217,10 @@ int CLCD4lSetup::show()
bool initlcd4l = false;
if (g_settings.lcd4l_display_type != temp_lcd4l_display_type)
if ((g_settings.lcd4l_display_type != temp_lcd4l_display_type) || lcd4l_display_type_changed)
{
g_settings.lcd4l_display_type = temp_lcd4l_display_type;
lcd4l_display_type_changed = false;
initlcd4l = true;
}
@@ -233,3 +241,41 @@ int CLCD4lSetup::show()
return res;
}
int CLCD4lSetup::showTypeSetup()
{
if (temp_lcd4l_display_type == CLCD4l::PEARL320x240)
{
// fix brightness values for Pearl DPF
if (temp_lcd4l_brightness > 7)
temp_lcd4l_brightness = 7;
if (g_settings.lcd4l_brightness_standby > 7)
g_settings.lcd4l_brightness_standby = 7;
}
int shortcut = 1;
CMenuOptionChooser *mc;
CMenuOptionNumberChooser *nc;
CMenuWidget *typeSetup = new CMenuWidget(LOCALE_LCD4L_DISPLAY_TYPE_SETUP, NEUTRINO_ICON_SETTINGS, width);
typeSetup->addIntroItems(); //FIXME: show lcd4l display type
mc = new CMenuOptionChooser(LOCALE_LCD4L_SKIN, &temp_lcd4l_skin, LCD4L_SKIN_OPTIONS, LCD4L_SKIN_OPTION_COUNT, true, NULL, CRCInput::convertDigitToKey(shortcut++));
mc->setHint(NEUTRINO_ICON_HINT_LCD4LINUX, LOCALE_MENU_HINT_LCD4L_SKIN);
typeSetup->addItem(mc);
mc = new CMenuOptionChooser(LOCALE_LCD4L_SKIN_RADIO, &g_settings.lcd4l_skin_radio, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, NULL, CRCInput::convertDigitToKey(shortcut++));
mc->setHint(NEUTRINO_ICON_HINT_LCD4LINUX, LOCALE_MENU_HINT_LCD4L_SKIN_RADIO);
typeSetup->addItem(mc);
nc = new CMenuOptionNumberChooser(LOCALE_LCD4L_BRIGHTNESS, (int *)&temp_lcd4l_brightness, true, 1, LCD4l->GetMaxBrightness(), this);
nc->setHint(NEUTRINO_ICON_HINT_LCD4LINUX, LOCALE_MENU_HINT_LCD4L_BRIGHTNESS);
typeSetup->addItem(nc);
nc = new CMenuOptionNumberChooser(LOCALE_LCD4L_BRIGHTNESS_STANDBY, (int *)&g_settings.lcd4l_brightness_standby, true, 1, LCD4l->GetMaxBrightness(), this);
nc->setHint(NEUTRINO_ICON_HINT_LCD4LINUX, LOCALE_MENU_HINT_LCD4L_BRIGHTNESS_STANDBY);
typeSetup->addItem(nc);
return typeSetup->exec(NULL, "");
}

View File

@@ -36,12 +36,14 @@
class CLCD4lSetup : public CMenuTarget, CChangeObserver
{
private:
CMenuOptionNumberChooser *nc;
CMenuOptionChooser *mc;
CMenuForwarder * mf;
bool lcd4l_display_type_changed;
int temp_lcd4l_display_type;
int temp_lcd4l_skin;
int temp_lcd4l_brightness;
int width;
int show();
int showTypeSetup();
public:
static CLCD4lSetup* getInstance();

View File

@@ -956,6 +956,7 @@ typedef enum
LOCALE_LCD4L_CLOCK_A,
LOCALE_LCD4L_CONVERT,
LOCALE_LCD4L_DISPLAY_TYPE,
LOCALE_LCD4L_DISPLAY_TYPE_SETUP,
LOCALE_LCD4L_LOGODIR,
LOCALE_LCD4L_SKIN,
LOCALE_LCD4L_SKIN_0,
@@ -1278,6 +1279,7 @@ typedef enum
LOCALE_MENU_HINT_LCD4L_CLOCK_A,
LOCALE_MENU_HINT_LCD4L_CONVERT,
LOCALE_MENU_HINT_LCD4L_DISPLAY_TYPE,
LOCALE_MENU_HINT_LCD4L_DISPLAY_TYPE_SETUP,
LOCALE_MENU_HINT_LCD4L_LOGODIR,
LOCALE_MENU_HINT_LCD4L_SKIN,
LOCALE_MENU_HINT_LCD4L_SKIN_RADIO,

View File

@@ -956,6 +956,7 @@ const char * locale_real_names[] =
"lcd4l_clock_a",
"lcd4l_convert",
"lcd4l_display_type",
"lcd4l_display_type_setup",
"lcd4l_logodir",
"lcd4l_skin",
"lcd4l_skin_0",
@@ -1278,6 +1279,7 @@ const char * locale_real_names[] =
"menu.hint_lcd4l_clock_a",
"menu.hint_lcd4l_convert",
"menu.hint_lcd4l_display_type",
"menu.hint_lcd4l_display_type_setup",
"menu.hint_lcd4l_logodir",
"menu.hint_lcd4l_skin",
"menu.hint_lcd4l_skin_radio",