From 7d3f13c7b59f034edd24b3872895b95191620480 Mon Sep 17 00:00:00 2001 From: LordGrey <48840279+Lord-Grey@users.noreply.github.com> Date: Thu, 2 Nov 2023 20:23:04 +0100 Subject: [PATCH] Allow to enable/disable suspend & lock event handling --- assets/webconfig/content/conf_events.html | 11 + assets/webconfig/i18n/en.json | 10 + assets/webconfig/index.html | 1 + assets/webconfig/js/content_events.js | 37 ++ config/hyperion.config.json.default | 7 +- include/db/SettingsTable.h | 2 + include/hyperion/HyperionIManager.h | 8 +- include/utils/settings.h | 49 +- libsrc/hyperion/HyperionIManager.cpp | 10 + libsrc/hyperion/hyperion.schema.json | 4 + libsrc/hyperion/resource.qrc | 1 + .../hyperion/schema/schema-systemEvents.json | 34 ++ src/hyperiond/SuspendHandler.cpp | 482 ++++++++++++++---- src/hyperiond/SuspendHandler.h | 45 ++ src/hyperiond/hyperiond.cpp | 18 +- 15 files changed, 604 insertions(+), 115 deletions(-) create mode 100644 assets/webconfig/content/conf_events.html create mode 100644 assets/webconfig/js/content_events.js create mode 100644 libsrc/hyperion/schema/schema-systemEvents.json diff --git a/assets/webconfig/content/conf_events.html b/assets/webconfig/content/conf_events.html new file mode 100644 index 00000000..df98b737 --- /dev/null +++ b/assets/webconfig/content/conf_events.html @@ -0,0 +1,11 @@ +
+
+
+ +
+
+
+
+
+ + diff --git a/assets/webconfig/i18n/en.json b/assets/webconfig/i18n/en.json index 0b238935..c2ff8c2f 100644 --- a/assets/webconfig/i18n/en.json +++ b/assets/webconfig/i18n/en.json @@ -192,6 +192,8 @@ "conf_network_tok_intro": "Here you can create and delete tokens for API authentication. Created tokens will only be displayed once.", "conf_network_tok_lastuse": "Last use", "conf_network_tok_title": "Token Management", + "conf_system_events_heading_title": "System Events", + "conf_system_events_intro": "Settings related to diffent Operating System events Hyperion can handle", "conf_webconfig_label_intro": "Webconfiguration settings. Edit wisely.", "dashboard_active_instance": "Selected instance", "dashboard_alert_message_confedit": "Your Hyperion configuration has been modified. To apply it, restart Hyperion.", @@ -475,6 +477,12 @@ "edt_conf_smooth_updateDelay_title": "Output delay", "edt_conf_smooth_updateFrequency_expl": "The output speed to your LED controller.", "edt_conf_smooth_updateFrequency_title": "Update frequency", + "edt_conf_system_events_lockEnable_title": "Listen to lock events", + "edt_conf_system_events_lockEnable_expl": "Listen to screen lock/unlock events", + "edt_conf_system_events_suspendEnable_title": "Listen to suspend events", + "edt_conf_system_events_suspendEnable_expl": "Listen to system suspend/resume events", + "edt_conf_system_events_suspendOnLockEnable_title": "Suspend when locked", + "edt_conf_system_events_suspendOnLockEnable_expl": "Suspend when the screen is locked, otherwise go into idle mode", "edt_conf_v4l2_blueSignalThreshold_expl": "Darkens low blue values (recognized as black)", "edt_conf_v4l2_blueSignalThreshold_title": "Blue signal threshold", "edt_conf_v4l2_cecDetection_expl": "If enabled, USB capture will be temporarily disabled when CEC standby event received from HDMI bus.", @@ -983,6 +991,8 @@ "main_menu_dashboard_token": "Dashboard", "main_menu_effect_conf_token": "Effects", "main_menu_effectsconfigurator_token": "Effects Configurator", + "main_menu_events": "Event Services", + "main_menu_event_services_token": "Event Services", "main_menu_general_conf_token": "General", "main_menu_grabber_conf_token": "Capturing Hardware", "main_menu_input_selection_token": "Input Selection", diff --git a/assets/webconfig/index.html b/assets/webconfig/index.html index 9249eb39..88bf52b3 100644 --- a/assets/webconfig/index.html +++ b/assets/webconfig/index.html @@ -280,6 +280,7 @@
  • System