mirror of
https://github.com/Xetibo/ReSet.git
synced 2025-07-03 08:47:45 +02:00
chore: Code cleanup
This commit is contained in:
parent
f8c27fd498
commit
921d5e7fe6
27 changed files with 304 additions and 234 deletions
|
@ -122,13 +122,12 @@ pub fn start_bluetooth_listener(listeners: Arc<Listeners>, bluetooth_box: Arc<Bl
|
|||
let device_changed_box = bluetooth_box.clone();
|
||||
let loop_box = bluetooth_box.clone();
|
||||
|
||||
// TODO handle device changed
|
||||
let res = conn.add_match(device_added, move |ir: BluetoothDeviceAdded, _, _| {
|
||||
let bluetooth_box = device_added_box.clone();
|
||||
println!("added");
|
||||
glib::spawn_future(async move {
|
||||
glib::idle_add_once(move || {
|
||||
println!("{}",ir.bluetooth_device.icon);
|
||||
println!("{}", ir.bluetooth_device.icon);
|
||||
let imp = bluetooth_box.imp();
|
||||
let path = ir.bluetooth_device.path.clone();
|
||||
let connected = ir.bluetooth_device.connected;
|
||||
|
|
|
@ -17,13 +17,19 @@ glib::wrapper! {
|
|||
@implements gtk::Accessible, gtk::Buildable, gtk::Actionable, gtk::ConstraintTarget;
|
||||
}
|
||||
|
||||
unsafe impl Send for BluetoothEntry {}
|
||||
unsafe impl Sync for BluetoothEntry {}
|
||||
|
||||
impl BluetoothEntry {
|
||||
pub fn new(device: &BluetoothDevice) -> Self {
|
||||
let entry: BluetoothEntry = Object::builder().build();
|
||||
let entryImp = entry.imp();
|
||||
entryImp.resetBluetoothLabel.get().set_text(&device.alias);
|
||||
entryImp.resetBluetoothAddress.get().set_text(&device.address);
|
||||
if device.icon == "" {
|
||||
entryImp
|
||||
.resetBluetoothAddress
|
||||
.get()
|
||||
.set_text(&device.address);
|
||||
if device.icon.is_empty() {
|
||||
entryImp
|
||||
.resetBluetoothDeviceType
|
||||
.set_icon_name(Some("dialog-question-symbolic"));
|
||||
|
|
|
@ -3,4 +3,3 @@ pub mod bluetoothBox;
|
|||
pub mod bluetoothBoxImpl;
|
||||
pub mod bluetoothEntry;
|
||||
pub mod bluetoothEntryImpl;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue