Fix: ROGCC: show option for LED notifications

This commit is contained in:
Luke D. Jones
2022-12-08 16:27:00 +13:00
parent c7893b16f9
commit 07daa0df61
4 changed files with 17 additions and 10 deletions

1
Cargo.lock generated
View File

@@ -2605,7 +2605,6 @@ dependencies = [
"log",
"nix 0.26.1",
"notify-rust",
"once_cell",
"png_pong",
"rog_anime",
"rog_aura",

View File

@@ -40,5 +40,3 @@ png_pong.workspace = true
nix = "^0.26.1"
tempfile = "3.3.0"
once_cell = "1.10.0"

View File

@@ -54,7 +54,7 @@ impl Default for EnabledNotifications {
receive_notify_charge_control_end_threshold: true,
receive_notify_mains_online: false,
receive_notify_profile: true,
receive_notify_led: false,
receive_notify_led: true,
receive_power_states: false,
receive_notify_gfx: false,
receive_notify_gfx_status: false,

View File

@@ -12,7 +12,8 @@ pub fn app_settings(config: &mut Config, states: &mut SystemState, ui: &mut Ui)
Default::default()
};
if ui
ui.label("Application settings");
let app_changed = ui
.checkbox(&mut config.run_in_background, "Run in Background")
.clicked()
|| ui
@@ -23,11 +24,19 @@ pub fn app_settings(config: &mut Config, states: &mut SystemState, ui: &mut Ui)
&mut enabled_notifications.all_enabled,
"Enable Notifications",
)
.clicked()
.clicked();
ui.label("Notification settings");
let notif_changed = ui
.checkbox(
&mut enabled_notifications.receive_notify_gfx_status,
"Enable dGPU status notification",
)
.clicked()
|| ui
.checkbox(
&mut enabled_notifications.receive_notify_gfx_status,
"Enable dGPU status notification",
&mut enabled_notifications.receive_notify_led,
"Enable LED mode change notification",
)
.clicked()
|| ui
@@ -71,8 +80,9 @@ pub fn app_settings(config: &mut Config, states: &mut SystemState, ui: &mut Ui)
&mut enabled_notifications.receive_notify_post_boot_sound,
"Enable BIOS post sound notification",
)
.clicked()
{
.clicked();
if app_changed || notif_changed {
if let Ok(mut lock) = states.enabled_notifications.lock() {
// Replace inner content before save
*lock = enabled_notifications;