mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-01-22 17:33:19 +01:00
Update support for boot_sound kernel patch
This commit is contained in:
@@ -40,7 +40,7 @@ pub struct PlatformState {
|
||||
impl PlatformState {
|
||||
pub fn new(dbus: &RogDbusClientBlocking<'_>) -> Result<Self> {
|
||||
Ok(Self {
|
||||
post_sound: dbus.proxies().platform().post_animation_sound().ok(),
|
||||
post_sound: dbus.proxies().platform().boot_sound().ok(),
|
||||
gpu_mux_mode: dbus
|
||||
.proxies()
|
||||
.platform()
|
||||
|
||||
@@ -415,6 +415,7 @@ pub fn setup_system_page(ui: &MainWindow, _config: Arc<Mutex<Config>>) {
|
||||
nv_dynamic_boost: sys_props.contains(&Properties::NvDynamicBoost),
|
||||
nv_temp_target: sys_props.contains(&Properties::NvTempTarget),
|
||||
panel_od: sys_props.contains(&Properties::PanelOd),
|
||||
boot_sound: sys_props.contains(&Properties::PostAnimationSound),
|
||||
ppt_apu_sppt: sys_props.contains(&Properties::PptApuSppt),
|
||||
ppt_fppt: sys_props.contains(&Properties::PptFppt),
|
||||
ppt_pl1_spl: sys_props.contains(&Properties::PptPl1Spl),
|
||||
@@ -452,6 +453,7 @@ pub fn setup_system_page_callbacks(ui: &MainWindow, _states: Arc<Mutex<Config>>)
|
||||
set_ui_props_async!(handle, platform, SystemPageData, throttle_policy_on_ac);
|
||||
|
||||
set_ui_props_async!(handle, platform, SystemPageData, panel_od);
|
||||
set_ui_props_async!(handle, platform, SystemPageData, boot_sound);
|
||||
set_ui_props_async!(handle, platform, SystemPageData, mini_led_mode);
|
||||
set_ui_props_async!(handle, platform, SystemPageData, ppt_pl1_spl);
|
||||
set_ui_props_async!(handle, platform, SystemPageData, ppt_pl2_sppt);
|
||||
@@ -473,6 +475,7 @@ pub fn setup_system_page_callbacks(ui: &MainWindow, _states: Arc<Mutex<Config>>)
|
||||
nv_dynamic_boost: sys_props.contains(&Properties::NvDynamicBoost),
|
||||
nv_temp_target: sys_props.contains(&Properties::NvTempTarget),
|
||||
panel_od: sys_props.contains(&Properties::PanelOd),
|
||||
boot_sound: sys_props.contains(&Properties::PostAnimationSound),
|
||||
ppt_apu_sppt: sys_props.contains(&Properties::PptApuSppt),
|
||||
ppt_fppt: sys_props.contains(&Properties::PptFppt),
|
||||
ppt_pl1_spl: sys_props.contains(&Properties::PptPl1Spl),
|
||||
@@ -498,6 +501,13 @@ pub fn setup_system_page_callbacks(ui: &MainWindow, _states: Arc<Mutex<Config>>)
|
||||
"Panel OverDrive successfully set to {}",
|
||||
"Setting Panel OverDrive failed"
|
||||
);
|
||||
set_ui_callbacks!(
|
||||
handle,
|
||||
SystemPageData(),
|
||||
platform.boot_sound(),
|
||||
"POST Animation sound successfully set to {}",
|
||||
"Setting POST Animation sound failed"
|
||||
);
|
||||
set_ui_callbacks!(
|
||||
handle,
|
||||
SystemPageData(),
|
||||
|
||||
@@ -34,7 +34,7 @@ static mut POWER_BAT_CMD: Option<Command> = None;
|
||||
#[derive(Debug, Clone, Deserialize, Serialize)]
|
||||
#[serde(default)]
|
||||
pub struct EnabledNotifications {
|
||||
pub receive_post_animation_sound_changed: bool,
|
||||
pub receive_boot_sound_changed: bool,
|
||||
pub receive_panel_od_changed: bool,
|
||||
pub receive_mini_led_mode_changed: bool,
|
||||
pub receive_dgpu_disable_changed: bool,
|
||||
@@ -54,7 +54,7 @@ pub struct EnabledNotifications {
|
||||
impl Default for EnabledNotifications {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
receive_post_animation_sound_changed: false,
|
||||
receive_boot_sound_changed: false,
|
||||
receive_panel_od_changed: true,
|
||||
receive_mini_led_mode_changed: true,
|
||||
receive_dgpu_disable_changed: true,
|
||||
@@ -199,7 +199,7 @@ pub fn start_notifications(
|
||||
// BIOS notif
|
||||
recv_changed!(
|
||||
PlatformProxy,
|
||||
receive_post_animation_sound_changed,
|
||||
receive_boot_sound_changed,
|
||||
last_notification,
|
||||
enabled_notifications,
|
||||
page_states,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"POT-Creation-Date: 2024-03-09 10:30+0000\n"
|
||||
"POT-Creation-Date: 2024-03-09 10:49+0000\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
||||
@@ -201,8 +201,8 @@ export component PageAura inherits Rectangle {
|
||||
padding: 30px;
|
||||
padding-top: 10px;
|
||||
spacing: 10px;
|
||||
for power in AuraPageData.supported_power_zones: gr:= HorizontalLayout {
|
||||
if power == PowerZones.Keyboard: zone1:= AuraPowerGroup {
|
||||
for power in AuraPageData.supported_power_zones: gr := HorizontalLayout {
|
||||
if power == PowerZones.Keyboard: zone1 := AuraPowerGroup {
|
||||
title: @tr("Keyboard");
|
||||
boot_checked: AuraPageData.led_power.rog.keyboard.boot;
|
||||
boot_toggled => {
|
||||
@@ -225,7 +225,7 @@ export component PageAura inherits Rectangle {
|
||||
AuraPageData.set_led_power(AuraPageData.led_power);
|
||||
}
|
||||
}
|
||||
if power == PowerZones.Logo: zone2:= AuraPowerGroup {
|
||||
if power == PowerZones.Logo: zone2 := AuraPowerGroup {
|
||||
title: @tr("Lid Logo");
|
||||
boot_checked: AuraPageData.led_power.rog.logo.boot;
|
||||
boot_toggled => {
|
||||
@@ -248,7 +248,7 @@ export component PageAura inherits Rectangle {
|
||||
AuraPageData.set_led_power(AuraPageData.led_power);
|
||||
}
|
||||
}
|
||||
if power == PowerZones.Lightbar: zone3:= AuraPowerGroup {
|
||||
if power == PowerZones.Lightbar: zone3 := AuraPowerGroup {
|
||||
title: @tr("Lightbar");
|
||||
boot_checked: AuraPageData.led_power.rog.lightbar.boot;
|
||||
boot_toggled => {
|
||||
@@ -271,7 +271,7 @@ export component PageAura inherits Rectangle {
|
||||
AuraPageData.set_led_power(AuraPageData.led_power);
|
||||
}
|
||||
}
|
||||
if power == PowerZones.Lid: zone4:= AuraPowerGroup {
|
||||
if power == PowerZones.Lid: zone4 := AuraPowerGroup {
|
||||
title: @tr("Lid Zone");
|
||||
boot_checked: AuraPageData.led_power.rog.lid.boot;
|
||||
boot_toggled => {
|
||||
@@ -294,7 +294,7 @@ export component PageAura inherits Rectangle {
|
||||
AuraPageData.set_led_power(AuraPageData.led_power);
|
||||
}
|
||||
}
|
||||
if power == PowerZones.RearGlow: zone5:= AuraPowerGroup {
|
||||
if power == PowerZones.RearGlow: zone5 := AuraPowerGroup {
|
||||
title: @tr("Rear Glow");
|
||||
boot_checked: AuraPageData.led_power.rog.rear-glow.boot;
|
||||
boot_toggled => {
|
||||
|
||||
@@ -5,6 +5,7 @@ import { HorizontalBox , VerticalBox, ScrollView, Slider, Button, Switch, ComboB
|
||||
export struct AvailableSystemProperties {
|
||||
charge_control_end_threshold: bool,
|
||||
panel_od: bool,
|
||||
boot_sound: bool,
|
||||
mini_led_mode: bool,
|
||||
disable_nvidia_powerd_on_battery: bool,
|
||||
ac_command: bool,
|
||||
@@ -47,6 +48,8 @@ export global SystemPageData {
|
||||
callback set_throttle_policy_on_battery(int);
|
||||
in-out property <bool> panel_od;
|
||||
callback set_panel_od(bool);
|
||||
in-out property <bool> boot_sound;
|
||||
callback set_boot_sound(bool);
|
||||
in-out property <bool> mini_led_mode;
|
||||
callback set_mini_led_mode(bool);
|
||||
in-out property <float> ppt_pl1_spl: 5;
|
||||
@@ -66,6 +69,7 @@ export global SystemPageData {
|
||||
in-out property <AvailableSystemProperties> available: {
|
||||
charge_control_end_threshold: true,
|
||||
panel_od: true,
|
||||
boot_sound: true,
|
||||
mini_led_mode: true,
|
||||
disable_nvidia_powerd_on_battery: true,
|
||||
ac_command: true,
|
||||
@@ -153,6 +157,14 @@ export component PageSystem inherits Rectangle {
|
||||
SystemPageData.set_mini_led_mode(SystemPageData.mini_led_mode)
|
||||
}
|
||||
}
|
||||
|
||||
if SystemPageData.available.boot-sound: SystemToggle {
|
||||
text: @tr("POST boot sound");
|
||||
checked <=> SystemPageData.boot_sound;
|
||||
toggled => {
|
||||
SystemPageData.set_boot_sound(SystemPageData.boot_sound)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
|
||||
Reference in New Issue
Block a user