From 55a6e247faa01d9a5d2d0a46969b2d335a70aff3 Mon Sep 17 00:00:00 2001 From: takotori Date: Mon, 4 Dec 2023 10:30:10 +0100 Subject: [PATCH] merge dashie --- src/components/bluetooth/bluetoothBox.rs | 12 +++++++++--- src/components/wifi/wifiEntry.rs | 4 +--- src/components/wifi/wifiOptions.rs | 2 -- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/components/bluetooth/bluetoothBox.rs b/src/components/bluetooth/bluetoothBox.rs index a5af1b6..94374f3 100644 --- a/src/components/bluetooth/bluetoothBox.rs +++ b/src/components/bluetooth/bluetoothBox.rs @@ -5,7 +5,7 @@ use std::time::{Duration, SystemTime}; use adw::glib; use adw::glib::Object; -use adw::prelude::ComboRowExt; +use adw::prelude::{ComboRowExt, ListModelExtManual}; use adw::subclass::prelude::ObjectSubclassIsExt; use dbus::blocking::Connection; use dbus::message::SignalArgs; @@ -13,7 +13,7 @@ use dbus::{Error, Path}; use glib::{clone, Cast}; use gtk::glib::Variant; use gtk::prelude::{ActionableExt, BoxExt, ListBoxRowExt, WidgetExt}; -use gtk::{gio, StringObject}; +use gtk::{gio, StringObject, Widget}; use ReSet_Lib::bluetooth::bluetooth::{BluetoothAdapter, BluetoothDevice}; use ReSet_Lib::signals::{BluetoothDeviceAdded, BluetoothDeviceChanged, BluetoothDeviceRemoved}; @@ -58,7 +58,13 @@ fn setupCallbacks( imp.resetBluetoothSwitch.connect_state_set(move |_, state| { if !state { let imp = bluetooth_box_ref.imp(); - imp.resetBluetoothConnectedDevices.remove_all(); + for x in imp.resetBluetoothConnectedDevices.observe_children().iter::() { + if let Ok(entry) = x { // todo test this + if let Some(item) = entry.downcast_ref::() { + imp.resetBluetoothAvailableDevices.remove(item); + } + } + }; listeners.bluetooth_listener.store(false, Ordering::SeqCst); set_adapter_enabled( imp.resetCurrentBluetoothAdapter.borrow().path.clone(), diff --git a/src/components/wifi/wifiEntry.rs b/src/components/wifi/wifiEntry.rs index fb77380..54efda3 100644 --- a/src/components/wifi/wifiEntry.rs +++ b/src/components/wifi/wifiEntry.rs @@ -204,9 +204,7 @@ pub fn click_new_network(entry: Arc) { let imp = entry_ref.imp(); imp.resetWifiPopup.popdown(); imp.resetWifiEditButton.set_sensitive(true); - imp.resetWifiConnected - .get() - .set_from_icon_name(Some("network-wireless-connected-symbolic")); + imp.resetWifiConnected.set_text("Connected"); imp.connected.replace(true); }); }); diff --git a/src/components/wifi/wifiOptions.rs b/src/components/wifi/wifiOptions.rs index 26fe9cb..837423f 100644 --- a/src/components/wifi/wifiOptions.rs +++ b/src/components/wifi/wifiOptions.rs @@ -12,9 +12,7 @@ use dbus::arg::PropMap; use glib::{clone, PropertySet}; use gtk::prelude::{ButtonExt, EditableExt, WidgetExt}; use ReSet_Lib::network::connection::{Connection, DNSMethod4, DNSMethod6, Enum, TypeSettings}; -use ReSet_Lib::network::network::AccessPoint; use IpProtocol::{IPv4, IPv6}; -use ReSet_Lib::network::connection::{Connection, DNSMethod4, DNSMethod6, Enum, TypeSettings}; use crate::components::wifi::utils::IpProtocol; use crate::components::wifi::wifiAddressEntry::WifiAddressEntry;