Fix: ROGCC: apply changes to correct fan curve profile

The fan curve profile changes were applying to the currently *active*
profile and not the GUI selected profile being changed. Fixed.

Also clarify the buttons for fan curve apply.
This commit is contained in:
Luke D. Jones
2022-12-06 09:45:42 +13:00
parent 616fb3aea6
commit f417032ed9
2 changed files with 22 additions and 4 deletions

View File

@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Changed
- Adjust how fan graph in ROGCC works, deny incorrect graphs
- Fix to apply the fan curve change in ROGCC to the correct profile
- Support for G713RS LED modes (Author: Peter Ivanov)
- Support for G713RM LED modes (Author: maxbachmann)
- Fix VivoBook detection

View File

@@ -137,26 +137,43 @@ pub fn fan_graphs(
});
let mut set = false;
let mut clear = false;
let mut reset = false;
ui.with_layout(egui::Layout::right_to_left(egui::Align::TOP), |ui| {
set = ui.add(egui::Button::new("Apply Fan-curve")).clicked();
reset = ui.add(egui::Button::new("Reset Profile")).clicked();
set = ui.add(egui::Button::new("Apply Profile")).clicked();
clear = ui.add(egui::Button::new("Clear Profile Changes")).clicked();
reset = ui.add(egui::Button::new("Factory Reset Profile")).clicked();
});
if set {
dbus.proxies()
.profile()
.set_fan_curve(profiles.current, data.clone())
.set_fan_curve(curves.show_curve, data.clone())
.map_err(|err| {
*do_error = Some(err.to_string());
})
.ok();
}
if clear {
if let Ok(curve) = dbus
.proxies()
.profile()
.fan_curve_data(curves.show_curve)
.map_err(|err| {
*do_error = Some(err.to_string());
})
{
if let Some(value) = curves.curves.get_mut(&curves.show_curve) {
*value = curve;
}
}
}
if reset {
dbus.proxies()
.profile()
.reset_profile_curves(profiles.current)
.reset_profile_curves(curves.show_curve)
.map_err(|err| {
*do_error = Some(err.to_string());
})