mirror of
https://github.com/Xetibo/ReSet.git
synced 2025-12-15 10:01:39 +01:00
feat: Add bluetooth changed event
This commit is contained in:
parent
ba49da2317
commit
f8c27fd498
6 changed files with 91 additions and 57 deletions
|
|
@ -1,3 +1,4 @@
|
|||
use adw::ActionRow;
|
||||
use dbus::Path;
|
||||
use gtk::prelude::*;
|
||||
use gtk::subclass::prelude::*;
|
||||
|
|
@ -5,12 +6,15 @@ use gtk::{glib, CompositeTemplate, ListBox, Switch};
|
|||
use std::cell::RefCell;
|
||||
use std::collections::HashMap;
|
||||
use std::sync::Arc;
|
||||
use adw::ActionRow;
|
||||
use ReSet_Lib::bluetooth::bluetooth::BluetoothDevice;
|
||||
|
||||
use crate::components::base::listEntry::ListEntry;
|
||||
use crate::components::bluetooth::bluetoothBox;
|
||||
use crate::components::bluetooth::bluetoothEntry::BluetoothEntry;
|
||||
|
||||
type BluetoothMap =
|
||||
RefCell<HashMap<Path<'static>, (Arc<BluetoothEntry>, Arc<ListEntry>, BluetoothDevice)>>;
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
#[derive(Default, CompositeTemplate)]
|
||||
#[template(resource = "/org/Xetibo/ReSet/resetBluetooth.ui")]
|
||||
|
|
@ -25,8 +29,8 @@ pub struct BluetoothBox {
|
|||
pub resetVisibility: TemplateChild<ActionRow>,
|
||||
#[template_child]
|
||||
pub resetBluetoothMainTab: TemplateChild<ListEntry>,
|
||||
pub availableDevices: RefCell<HashMap<Path<'static>, (Arc<BluetoothEntry>, Arc<ListEntry>)>>,
|
||||
pub connectedDevices: RefCell<HashMap<Path<'static>, (Arc<BluetoothEntry>, Arc<ListEntry>)>>,
|
||||
pub availableDevices: BluetoothMap,
|
||||
pub connectedDevices: BluetoothMap,
|
||||
}
|
||||
|
||||
#[glib::object_subclass]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue