From a3866294af99645093316fed704371e542223f12 Mon Sep 17 00:00:00 2001 From: takotori Date: Sun, 3 Dec 2023 14:11:59 +0100 Subject: [PATCH] some things --- src/components/bluetooth/bluetoothBox.rs | 11 +- src/components/bluetooth/bluetoothBoxImpl.rs | 8 +- src/components/wifi/wifiBox.rs | 9 +- src/components/wifi/wifiEntry.rs | 10 +- src/components/wifi/wifiEntryImpl.rs | 2 +- src/resources/resetBluetooth.ui | 52 +++------ src/resources/resetUI.cmb | 117 +++++++++---------- src/resources/resetWiFi.ui | 25 +--- src/resources/resetWifiEntry.ui | 17 ++- 9 files changed, 105 insertions(+), 146 deletions(-) diff --git a/src/components/bluetooth/bluetoothBox.rs b/src/components/bluetooth/bluetoothBox.rs index c10aa6d..a5af1b6 100644 --- a/src/components/bluetooth/bluetoothBox.rs +++ b/src/components/bluetooth/bluetoothBox.rs @@ -12,7 +12,7 @@ use dbus::message::SignalArgs; use dbus::{Error, Path}; use glib::{clone, Cast}; use gtk::glib::Variant; -use gtk::prelude::{ActionableExt, ListBoxRowExt, WidgetExt}; +use gtk::prelude::{ActionableExt, BoxExt, ListBoxRowExt, WidgetExt}; use gtk::{gio, StringObject}; use ReSet_Lib::bluetooth::bluetooth::{BluetoothAdapter, BluetoothDevice}; use ReSet_Lib::signals::{BluetoothDeviceAdded, BluetoothDeviceChanged, BluetoothDeviceRemoved}; @@ -217,7 +217,6 @@ pub fn start_bluetooth_listener(listeners: Arc, bluetooth_box: Arc, bluetooth_box: Arc() { + if let Ok(entry) = x { // todo test this + if let Some(item) = entry.downcast_ref::() { + imp.resetBluetoothAvailableDevices.remove(item); + } + } + }; }); }); println!("stopping bluetooth listener"); diff --git a/src/components/bluetooth/bluetoothBoxImpl.rs b/src/components/bluetooth/bluetoothBoxImpl.rs index 46b2cc5..878f23a 100644 --- a/src/components/bluetooth/bluetoothBoxImpl.rs +++ b/src/components/bluetooth/bluetoothBoxImpl.rs @@ -1,7 +1,7 @@ use adw::{ActionRow, ComboRow}; use dbus::Path; use gtk::subclass::prelude::*; -use gtk::{glib, CompositeTemplate, ListBox, Switch}; +use gtk::{glib, CompositeTemplate, ListBox, Switch, Button}; use gtk::{prelude::*, StringList}; use std::cell::RefCell; use std::collections::HashMap; @@ -22,11 +22,13 @@ pub struct BluetoothBox { #[template_child] pub resetBluetoothSwitch: TemplateChild, #[template_child] - pub resetBluetoothAvailableDevices: TemplateChild, + pub resetBluetoothAvailableDevices: TemplateChild, + #[template_child] + pub resetBluetoothRefreshButton: TemplateChild