diff --git a/Cargo.toml b/Cargo.toml index fcadde9..e0c8aa4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ description = "A wip universal Linux settings application." [dependencies] reset_daemon = "0.4.6" -re_set-lib = "0.6.6" +re_set-lib = { git = "https://github.com/Xetibo/ReSet-Lib", branch = "main" } adw = { version = "0.5.3", package = "libadwaita", features = ["v1_4"] } dbus = "0.9.7" gtk = { version = "0.7.3", package = "gtk4", features = ["v4_12"] } diff --git a/src/components/bluetooth/bluetooth_box.rs b/src/components/bluetooth/bluetooth_box.rs index f4246c5..292e72b 100644 --- a/src/components/bluetooth/bluetooth_box.rs +++ b/src/components/bluetooth/bluetooth_box.rs @@ -54,6 +54,7 @@ fn setup_callbacks( imp.reset_visibility .set_action_target_value(Some(&Variant::from("visibility"))); + imp.reset_bluetooth_main_tab.set_activatable(true); imp.reset_bluetooth_main_tab .set_action_name(Some("navigation.pop")); @@ -67,15 +68,13 @@ fn setup_callbacks( }); imp.reset_bluetooth_discoverable_switch - .connect_state_set(clone!(@weak imp => @default-return glib::Propagation::Proceed,move |_, state| { - set_bluetooth_adapter_visibility(imp.reset_current_bluetooth_adapter.borrow().path.clone(), state); - glib::Propagation::Proceed + .connect_active_notify(clone!(@weak imp => move |state| { + set_bluetooth_adapter_visibility(imp.reset_current_bluetooth_adapter.borrow().path.clone(), state.is_active()); })); imp.reset_bluetooth_pairable_switch - .connect_state_set(clone!(@weak imp => @default-return glib::Propagation::Proceed,move |_, state| { - set_bluetooth_adapter_pairability(imp.reset_current_bluetooth_adapter.borrow().path.clone(), state); - glib::Propagation::Proceed + .connect_active_notify(clone!(@weak imp => move |state| { + set_bluetooth_adapter_pairability(imp.reset_current_bluetooth_adapter.borrow().path.clone(), state.is_active()); })); imp.reset_bluetooth_switch @@ -151,11 +150,11 @@ pub fn populate_conntected_bluetooth_devices(bluetooth_box: Arc) { imp.reset_bluetooth_switch .set_active(current_adapter.powered); imp.reset_bluetooth_discoverable_switch - .set_state(current_adapter.discoverable); + .set_active(current_adapter.discoverable); imp.reset_bluetooth_discoverable_switch .set_active(current_adapter.discoverable); imp.reset_bluetooth_pairable_switch - .set_state(current_adapter.pairable); + .set_active(current_adapter.pairable); imp.reset_bluetooth_pairable_switch .set_active(current_adapter.pairable); } diff --git a/src/components/bluetooth/bluetooth_box_impl.rs b/src/components/bluetooth/bluetooth_box_impl.rs index 220a60a..40a3080 100644 --- a/src/components/bluetooth/bluetooth_box_impl.rs +++ b/src/components/bluetooth/bluetooth_box_impl.rs @@ -1,4 +1,4 @@ -use adw::{ActionRow, ComboRow, PreferencesGroup}; +use adw::{ActionRow, ComboRow, PreferencesGroup, SwitchRow}; use dbus::Path; use gtk::subclass::prelude::*; use gtk::{glib, Button, CompositeTemplate, Switch}; @@ -30,11 +30,11 @@ pub struct BluetoothBox { #[template_child] pub reset_visibility: TemplateChild, #[template_child] - pub reset_bluetooth_main_tab: TemplateChild, + pub reset_bluetooth_main_tab: TemplateChild, #[template_child] - pub reset_bluetooth_discoverable_switch: TemplateChild, + pub reset_bluetooth_discoverable_switch: TemplateChild, #[template_child] - pub reset_bluetooth_pairable_switch: TemplateChild, + pub reset_bluetooth_pairable_switch: TemplateChild, pub available_devices: BluetoothMap, pub connected_devices: BluetoothMap, pub reset_bluetooth_adapters: Arc>>, diff --git a/src/components/input/output_stream_entry_impl.rs b/src/components/input/output_stream_entry_impl.rs index 8b63808..15687b2 100644 --- a/src/components/input/output_stream_entry_impl.rs +++ b/src/components/input/output_stream_entry_impl.rs @@ -7,7 +7,7 @@ use std::time::SystemTime; use crate::components::input::output_stream_entry; use gtk::subclass::prelude::*; -use gtk::{glib, Button, CompositeTemplate, Label, ProgressBar, Scale}; +use gtk::{glib, Button, CompositeTemplate, Label, Scale}; #[derive(Default, CompositeTemplate)] #[template(resource = "/org/Xetibo/ReSet/resetOutputStreamEntry.ui")] @@ -20,8 +20,6 @@ pub struct OutputStreamEntry { pub reset_volume_slider: TemplateChild, #[template_child] pub reset_volume_percentage: TemplateChild