mirror of
https://github.com/Xetibo/ReSet.git
synced 2025-04-17 10:18:32 +02:00
feat: Allow pairings to be deleted
This commit is contained in:
parent
35d2174136
commit
ba49da2317
|
@ -6,7 +6,7 @@ description = "A wip universal Linux settings application."
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
reset_daemon = "0.3.3"
|
reset_daemon = "0.3.3"
|
||||||
ReSet-Lib = "0.4.9"
|
ReSet-Lib = "0.5.4"
|
||||||
adw = { version = "0.5.3", package = "libadwaita", features = ["v1_4"] }
|
adw = { version = "0.5.3", package = "libadwaita", features = ["v1_4"] }
|
||||||
dbus = "0.9.7"
|
dbus = "0.9.7"
|
||||||
gtk = { version = "0.7.3", package = "gtk4", features = ["v4_12"] }
|
gtk = { version = "0.7.3", package = "gtk4", features = ["v4_12"] }
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
use std::collections::HashMap;
|
||||||
use std::sync::atomic::Ordering;
|
use std::sync::atomic::Ordering;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::thread;
|
use std::thread;
|
||||||
|
@ -12,6 +13,7 @@ use dbus::{Error, Path};
|
||||||
use gtk::gio;
|
use gtk::gio;
|
||||||
use gtk::glib::Variant;
|
use gtk::glib::Variant;
|
||||||
use gtk::prelude::{ActionableExt, ListBoxRowExt};
|
use gtk::prelude::{ActionableExt, ListBoxRowExt};
|
||||||
|
use ReSet_Lib::bluetooth::bluetooth::BluetoothDevice;
|
||||||
use ReSet_Lib::signals::{BluetoothDeviceAdded, BluetoothDeviceRemoved};
|
use ReSet_Lib::signals::{BluetoothDeviceAdded, BluetoothDeviceRemoved};
|
||||||
|
|
||||||
use crate::components::base::listEntry::ListEntry;
|
use crate::components::base::listEntry::ListEntry;
|
||||||
|
@ -48,50 +50,33 @@ impl BluetoothBox {
|
||||||
.resetBluetoothMainTab
|
.resetBluetoothMainTab
|
||||||
.set_action_name(Some("navigation.pop"));
|
.set_action_name(Some("navigation.pop"));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn scanForDevices(&self) {
|
pub fn populate_conntected_bluetooth_devices(bluetooth_box: Arc<BluetoothBox>) {
|
||||||
// let selfImp = self.imp();
|
gio::spawn_blocking(move || {
|
||||||
// let mut wifiEntries = selfImp.availableDevices.borrow_mut();
|
let ref_box = bluetooth_box.clone();
|
||||||
// wifiEntries.push(ListEntry::new(&BluetoothEntry::new(
|
let devices = get_connected_devices();
|
||||||
// DeviceTypes::Mouse,
|
|
||||||
// "ina mouse",
|
|
||||||
// )));
|
|
||||||
// wifiEntries.push(ListEntry::new(&BluetoothEntry::new(
|
|
||||||
// DeviceTypes::Keyboard,
|
|
||||||
// "inaboard",
|
|
||||||
// )));
|
|
||||||
// wifiEntries.push(ListEntry::new(&BluetoothEntry::new(
|
|
||||||
// DeviceTypes::Controller,
|
|
||||||
// "ina controller",
|
|
||||||
// )));
|
|
||||||
// wifiEntries.push(
|
|
||||||
// ListEntry::new(&BluetoothEntry::new(
|
|
||||||
// DeviceTypes::Controller,
|
|
||||||
// "ina best waifu",
|
|
||||||
// ))
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// for wifiEntry in wifiEntries.iter() {
|
|
||||||
// selfImp.resetBluetoothAvailableDevices.append(wifiEntry);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn addConnectedDevices(&self) {
|
glib::spawn_future(async move {
|
||||||
// let selfImp = self.imp();
|
glib::idle_add_once(move || {
|
||||||
// let mut wifiEntries = selfImp.connectedDevices.borrow_mut();
|
let imp = ref_box.imp();
|
||||||
// wifiEntries.push(ListEntry::new(&BluetoothEntry::new(
|
for device in devices {
|
||||||
// DeviceTypes::Mouse,
|
let path = device.path.clone();
|
||||||
// "why are we still here?",
|
let connected = device.connected;
|
||||||
// )));
|
let bluetooth_entry = Arc::new(BluetoothEntry::new(device));
|
||||||
// wifiEntries.push(ListEntry::new(&BluetoothEntry::new(
|
let entry = Arc::new(ListEntry::new(&*bluetooth_entry));
|
||||||
// DeviceTypes::Keyboard,
|
imp.availableDevices
|
||||||
// "just to suffer?",
|
.borrow_mut()
|
||||||
// )));
|
.insert(path, (bluetooth_entry.clone(), entry.clone()));
|
||||||
//
|
if connected {
|
||||||
// for wifiEntry in wifiEntries.iter() {
|
imp.resetBluetoothConnectedDevices.append(&*entry);
|
||||||
// selfImp.resetBluetoothConnectedDevices.append(wifiEntry);
|
} else {
|
||||||
// }
|
imp.resetBluetoothAvailableDevices.append(&*entry);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn start_bluetooth_listener(listeners: Arc<Listeners>, bluetooth_box: Arc<BluetoothBox>) {
|
pub fn start_bluetooth_listener(listeners: Arc<Listeners>, bluetooth_box: Arc<BluetoothBox>) {
|
||||||
|
@ -110,7 +95,7 @@ pub fn start_bluetooth_listener(listeners: Arc<Listeners>, bluetooth_box: Arc<Bl
|
||||||
"org.Xetibo.ReSetBluetooth",
|
"org.Xetibo.ReSetBluetooth",
|
||||||
"StartBluetoothListener",
|
"StartBluetoothListener",
|
||||||
#[allow(clippy::unnecessary_cast)]
|
#[allow(clippy::unnecessary_cast)]
|
||||||
(10000 as u32,),
|
(25000 as u32,),
|
||||||
// leave me alone clippy, I am dealing with C code
|
// leave me alone clippy, I am dealing with C code
|
||||||
);
|
);
|
||||||
let device_added = BluetoothDeviceAdded::match_rule(
|
let device_added = BluetoothDeviceAdded::match_rule(
|
||||||
|
@ -127,6 +112,7 @@ pub fn start_bluetooth_listener(listeners: Arc<Listeners>, bluetooth_box: Arc<Bl
|
||||||
let device_removed_box = bluetooth_box.clone();
|
let device_removed_box = bluetooth_box.clone();
|
||||||
let loop_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 res = conn.add_match(device_added, move |ir: BluetoothDeviceAdded, _, _| {
|
||||||
let bluetooth_box = device_added_box.clone();
|
let bluetooth_box = device_added_box.clone();
|
||||||
println!("added");
|
println!("added");
|
||||||
|
@ -134,12 +120,17 @@ pub fn start_bluetooth_listener(listeners: Arc<Listeners>, bluetooth_box: Arc<Bl
|
||||||
glib::idle_add_once(move || {
|
glib::idle_add_once(move || {
|
||||||
let imp = bluetooth_box.imp();
|
let imp = bluetooth_box.imp();
|
||||||
let path = ir.bluetooth_device.path.clone();
|
let path = ir.bluetooth_device.path.clone();
|
||||||
|
let connected = ir.bluetooth_device.connected;
|
||||||
let bluetooth_entry = Arc::new(BluetoothEntry::new(ir.bluetooth_device));
|
let bluetooth_entry = Arc::new(BluetoothEntry::new(ir.bluetooth_device));
|
||||||
let entry = Arc::new(ListEntry::new(&*bluetooth_entry));
|
let entry = Arc::new(ListEntry::new(&*bluetooth_entry));
|
||||||
imp.availableDevices
|
imp.availableDevices
|
||||||
.borrow_mut()
|
.borrow_mut()
|
||||||
.insert(path, (bluetooth_entry.clone(), entry.clone()));
|
.insert(path, (bluetooth_entry.clone(), entry.clone()));
|
||||||
imp.resetBluetoothAvailableDevices.append(&*entry);
|
if connected {
|
||||||
|
imp.resetBluetoothConnectedDevices.append(&*entry);
|
||||||
|
} else {
|
||||||
|
imp.resetBluetoothAvailableDevices.append(&*entry);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
true
|
true
|
||||||
|
@ -159,7 +150,9 @@ pub fn start_bluetooth_listener(listeners: Arc<Listeners>, bluetooth_box: Arc<Bl
|
||||||
let list_entry = map.get(&ir.bluetooth_device);
|
let list_entry = map.get(&ir.bluetooth_device);
|
||||||
if list_entry.is_some() {
|
if list_entry.is_some() {
|
||||||
imp.resetBluetoothAvailableDevices
|
imp.resetBluetoothAvailableDevices
|
||||||
.remove(&*list_entry.unwrap().0);
|
.remove(&*list_entry.unwrap().1);
|
||||||
|
imp.resetBluetoothConnectedDevices
|
||||||
|
.remove(&*list_entry.unwrap().1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -171,17 +164,17 @@ pub fn start_bluetooth_listener(listeners: Arc<Listeners>, bluetooth_box: Arc<Bl
|
||||||
}
|
}
|
||||||
|
|
||||||
listeners.bluetooth_listener.store(true, Ordering::SeqCst);
|
listeners.bluetooth_listener.store(true, Ordering::SeqCst);
|
||||||
let _time = SystemTime::now();
|
let time = SystemTime::now();
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
let _ = conn.process(Duration::from_millis(1000));
|
let _ = conn.process(Duration::from_millis(1000));
|
||||||
if !listeners.bluetooth_listener.load(Ordering::SeqCst)
|
if !listeners.bluetooth_listener.load(Ordering::SeqCst)
|
||||||
// || time.elapsed().unwrap() > Duration::from_millis(5000)
|
|| time.elapsed().unwrap() > Duration::from_millis(25000)
|
||||||
{
|
{
|
||||||
glib::spawn_future(async move {
|
glib::spawn_future(async move {
|
||||||
glib::idle_add_once(move || {
|
glib::idle_add_once(move || {
|
||||||
let imp = loop_box.imp();
|
let imp = loop_box.imp();
|
||||||
imp.resetBluetoothConnectedDevices.remove_all();
|
imp.resetBluetoothAvailableDevices.remove_all();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
println!("stopping bluetooth listener");
|
println!("stopping bluetooth listener");
|
||||||
|
@ -191,3 +184,21 @@ pub fn start_bluetooth_listener(listeners: Arc<Listeners>, bluetooth_box: Arc<Bl
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn get_connected_devices() -> Vec<BluetoothDevice> {
|
||||||
|
let conn = Connection::new_session().unwrap();
|
||||||
|
let proxy = conn.with_proxy(
|
||||||
|
"org.Xetibo.ReSetDaemon",
|
||||||
|
"/org/Xetibo/ReSetDaemon",
|
||||||
|
Duration::from_millis(1000),
|
||||||
|
);
|
||||||
|
let res: Result<(Vec<BluetoothDevice>,), Error> = proxy.method_call(
|
||||||
|
"org.Xetibo.ReSetBluetooth",
|
||||||
|
"GetConnectedBluetoothDevices",
|
||||||
|
(),
|
||||||
|
);
|
||||||
|
if res.is_err() {
|
||||||
|
return Vec::new();
|
||||||
|
}
|
||||||
|
res.unwrap().0
|
||||||
|
}
|
||||||
|
|
|
@ -52,8 +52,6 @@ impl ObjectImpl for BluetoothBox {
|
||||||
self.parent_constructed();
|
self.parent_constructed();
|
||||||
let obj = self.obj();
|
let obj = self.obj();
|
||||||
obj.setupCallbacks();
|
obj.setupCallbacks();
|
||||||
obj.scanForDevices();
|
|
||||||
obj.addConnectedDevices();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
use std::rc::Rc;
|
||||||
|
use std::sync::Arc;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
use crate::components::bluetooth::bluetoothEntryImpl;
|
use crate::components::bluetooth::bluetoothEntryImpl;
|
||||||
|
@ -8,7 +10,7 @@ use adw::subclass::prelude::ObjectSubclassIsExt;
|
||||||
use dbus::blocking::Connection;
|
use dbus::blocking::Connection;
|
||||||
use dbus::{Error, Path};
|
use dbus::{Error, Path};
|
||||||
use glib::clone;
|
use glib::clone;
|
||||||
use gtk::prelude::WidgetExt;
|
use gtk::prelude::{ButtonExt, WidgetExt};
|
||||||
use gtk::{gio, GestureClick};
|
use gtk::{gio, GestureClick};
|
||||||
use ReSet_Lib::bluetooth::bluetooth::BluetoothDevice;
|
use ReSet_Lib::bluetooth::bluetooth::BluetoothDevice;
|
||||||
|
|
||||||
|
@ -23,10 +25,7 @@ impl BluetoothEntry {
|
||||||
let entry: BluetoothEntry = Object::builder().build();
|
let entry: BluetoothEntry = Object::builder().build();
|
||||||
let entryImp = entry.imp();
|
let entryImp = entry.imp();
|
||||||
entryImp.resetBluetoothLabel.get().set_text(&device.name);
|
entryImp.resetBluetoothLabel.get().set_text(&device.name);
|
||||||
entryImp
|
entryImp.resetBluetoothAddress.get().set_text(&device.alias);
|
||||||
.resetBluetoothAddress
|
|
||||||
.get()
|
|
||||||
.set_text(&device.address);
|
|
||||||
// entryImp
|
// entryImp
|
||||||
// .resetBluetoothDeviceType
|
// .resetBluetoothDeviceType
|
||||||
// .get()
|
// .get()
|
||||||
|
@ -37,9 +36,17 @@ impl BluetoothEntry {
|
||||||
// DeviceTypes::Controller => Some("input-gaming-symbolic"),
|
// DeviceTypes::Controller => Some("input-gaming-symbolic"),
|
||||||
// DeviceTypes::None => Some("text-x-generic-symbolic"), // no generic bluetooth device icon found
|
// DeviceTypes::None => Some("text-x-generic-symbolic"), // no generic bluetooth device icon found
|
||||||
// });
|
// });
|
||||||
|
if device.paired {
|
||||||
|
entryImp.resetBluetoothButton.set_sensitive(true);
|
||||||
|
} else {
|
||||||
|
entryImp.resetBluetoothButton.set_sensitive(false);
|
||||||
|
}
|
||||||
|
let path = Arc::new(device.path.clone());
|
||||||
|
entryImp.resetBluetoothButton.connect_clicked(move |_| {
|
||||||
|
remove_device_pairing((*path).clone());
|
||||||
|
});
|
||||||
let gesture = GestureClick::new();
|
let gesture = GestureClick::new();
|
||||||
let connected = false;
|
let connected = device.connected;
|
||||||
// TODO implement this connected
|
|
||||||
entryImp.device.replace(device);
|
entryImp.device.replace(device);
|
||||||
gesture.connect_released(clone!(@weak entryImp => move |_, _, _, _| {
|
gesture.connect_released(clone!(@weak entryImp => move |_, _, _, _| {
|
||||||
let device = entryImp.device.borrow_mut();
|
let device = entryImp.device.borrow_mut();
|
||||||
|
@ -48,7 +55,7 @@ impl BluetoothEntry {
|
||||||
} else if device.paired {
|
} else if device.paired {
|
||||||
connect_to_device(device.path.clone());
|
connect_to_device(device.path.clone());
|
||||||
} else {
|
} else {
|
||||||
pair_with_device(device.path.clone());
|
pair_with_device(device.path.clone());
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
entry.add_controller(gesture);
|
entry.add_controller(gesture);
|
||||||
|
@ -64,8 +71,11 @@ fn connect_to_device(path: Path<'static>) {
|
||||||
"/org/Xetibo/ReSetDaemon",
|
"/org/Xetibo/ReSetDaemon",
|
||||||
Duration::from_millis(1000),
|
Duration::from_millis(1000),
|
||||||
);
|
);
|
||||||
let _: Result<(bool,), Error> =
|
let _: Result<(bool,), Error> = proxy.method_call(
|
||||||
proxy.method_call("org.Xetibo.ReSetBluetooth", "ConnectToBluetoothDevice", (path,));
|
"org.Xetibo.ReSetBluetooth",
|
||||||
|
"ConnectToBluetoothDevice",
|
||||||
|
(path,),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,8 +87,11 @@ fn pair_with_device(path: Path<'static>) {
|
||||||
"/org/Xetibo/ReSetDaemon",
|
"/org/Xetibo/ReSetDaemon",
|
||||||
Duration::from_millis(1000),
|
Duration::from_millis(1000),
|
||||||
);
|
);
|
||||||
let _: Result<(bool,), Error> =
|
let _: Result<(bool,), Error> = proxy.method_call(
|
||||||
proxy.method_call("org.Xetibo.ReSetBluetooth", "PairWithBluetoothDevice", (path,));
|
"org.Xetibo.ReSetBluetooth",
|
||||||
|
"PairWithBluetoothDevice",
|
||||||
|
(path,),
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,7 +103,23 @@ fn disconnect_from_device(path: Path<'static>) {
|
||||||
"/org/Xetibo/ReSetDaemon",
|
"/org/Xetibo/ReSetDaemon",
|
||||||
Duration::from_millis(1000),
|
Duration::from_millis(1000),
|
||||||
);
|
);
|
||||||
let _: Result<(bool,), Error> =
|
let _: Result<(bool,), Error> = proxy.method_call(
|
||||||
proxy.method_call("org.Xetibo.ReSetBluetooth", "DisconnectFromBluetoothDevice", (path,));
|
"org.Xetibo.ReSetBluetooth",
|
||||||
|
"DisconnectFromBluetoothDevice",
|
||||||
|
(path,),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_device_pairing(path: Path<'static>) {
|
||||||
|
gio::spawn_blocking(move || {
|
||||||
|
let conn = Connection::new_session().unwrap();
|
||||||
|
let proxy = conn.with_proxy(
|
||||||
|
"org.Xetibo.ReSetDaemon",
|
||||||
|
"/org/Xetibo/ReSetDaemon",
|
||||||
|
Duration::from_millis(1000),
|
||||||
|
);
|
||||||
|
let _: Result<(bool,), Error> =
|
||||||
|
proxy.method_call("org.Xetibo.ReSetBluetooth", "RemoveDevicePairing", (path,));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ use std::sync::Arc;
|
||||||
|
|
||||||
use crate::components::base::settingBox::SettingBox;
|
use crate::components::base::settingBox::SettingBox;
|
||||||
use crate::components::base::utils::{start_audio_listener, Listeners};
|
use crate::components::base::utils::{start_audio_listener, Listeners};
|
||||||
use crate::components::bluetooth::bluetoothBox::{start_bluetooth_listener, BluetoothBox};
|
use crate::components::bluetooth::bluetoothBox::{start_bluetooth_listener, BluetoothBox, populate_conntected_bluetooth_devices};
|
||||||
use crate::components::input::sourceBox::{populate_sources, SourceBox};
|
use crate::components::input::sourceBox::{populate_sources, SourceBox};
|
||||||
use crate::components::output::sinkBox::{populate_sinks, SinkBox};
|
use crate::components::output::sinkBox::{populate_sinks, SinkBox};
|
||||||
use crate::components::wifi::wifiBox::{
|
use crate::components::wifi::wifiBox::{
|
||||||
|
@ -22,6 +22,7 @@ pub const HANDLE_CONNECTIVITY_CLICK: fn(Arc<Listeners>, FlowBox) =
|
||||||
scanForWifi(listeners.clone(), wifiBox.clone());
|
scanForWifi(listeners.clone(), wifiBox.clone());
|
||||||
let wifiFrame = wrapInFrame(SettingBox::new(&*wifiBox));
|
let wifiFrame = wrapInFrame(SettingBox::new(&*wifiBox));
|
||||||
let bluetooth_box = Arc::new(BluetoothBox::new());
|
let bluetooth_box = Arc::new(BluetoothBox::new());
|
||||||
|
populate_conntected_bluetooth_devices(bluetooth_box.clone());
|
||||||
start_bluetooth_listener(listeners.clone(), bluetooth_box.clone());
|
start_bluetooth_listener(listeners.clone(), bluetooth_box.clone());
|
||||||
let bluetoothFrame = wrapInFrame(SettingBox::new(&*bluetooth_box));
|
let bluetoothFrame = wrapInFrame(SettingBox::new(&*bluetooth_box));
|
||||||
resetMain.remove_all();
|
resetMain.remove_all();
|
||||||
|
@ -50,6 +51,7 @@ pub const HANDLE_BLUETOOTH_CLICK: fn(Arc<Listeners>, FlowBox) =
|
||||||
listeners.stop_audio_listener();
|
listeners.stop_audio_listener();
|
||||||
let bluetooth_box = Arc::new(BluetoothBox::new());
|
let bluetooth_box = Arc::new(BluetoothBox::new());
|
||||||
start_bluetooth_listener(listeners.clone(), bluetooth_box.clone());
|
start_bluetooth_listener(listeners.clone(), bluetooth_box.clone());
|
||||||
|
populate_conntected_bluetooth_devices(bluetooth_box.clone());
|
||||||
let bluetoothFrame = wrapInFrame(SettingBox::new(&*bluetooth_box));
|
let bluetoothFrame = wrapInFrame(SettingBox::new(&*bluetooth_box));
|
||||||
resetMain.remove_all();
|
resetMain.remove_all();
|
||||||
resetMain.insert(&bluetoothFrame, -1);
|
resetMain.insert(&bluetoothFrame, -1);
|
||||||
|
|
16
src/main.rs
16
src/main.rs
|
@ -34,6 +34,7 @@ async fn main() {
|
||||||
});
|
});
|
||||||
|
|
||||||
app.connect_activate(buildUI);
|
app.connect_activate(buildUI);
|
||||||
|
app.connect_shutdown(shutdown);
|
||||||
app.run();
|
app.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,6 +55,19 @@ fn buildUI(app: &Application) {
|
||||||
window.present();
|
window.present();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn shutdown(_: &Application) {
|
||||||
|
thread::spawn(|| {
|
||||||
|
let conn = Connection::new_session().unwrap();
|
||||||
|
let proxy = conn.with_proxy(
|
||||||
|
"org.Xetibo.ReSetDaemon",
|
||||||
|
"/org/Xetibo/ReSetDaemon",
|
||||||
|
Duration::from_millis(100),
|
||||||
|
);
|
||||||
|
let res: Result<(), Error> = proxy.method_call("org.Xetibo.ReSetDaemon", "UnregisterClient", ("ReSet",));
|
||||||
|
res
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async fn daemon_check() {
|
async fn daemon_check() {
|
||||||
let handle = thread::spawn(|| {
|
let handle = thread::spawn(|| {
|
||||||
let conn = Connection::new_session().unwrap();
|
let conn = Connection::new_session().unwrap();
|
||||||
|
@ -62,7 +76,7 @@ async fn daemon_check() {
|
||||||
"/org/Xetibo/ReSetDaemon",
|
"/org/Xetibo/ReSetDaemon",
|
||||||
Duration::from_millis(100),
|
Duration::from_millis(100),
|
||||||
);
|
);
|
||||||
let res: Result<(), Error> = proxy.method_call("org.Xetibo.ReSetDaemon", "Check", ());
|
let res: Result<(), Error> = proxy.method_call("org.Xetibo.ReSetDaemon", "RegisterClient", ("ReSet",));
|
||||||
res
|
res
|
||||||
});
|
});
|
||||||
let res = handle.join();
|
let res = handle.join();
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="resetBluetoothButton">
|
<object class="GtkButton" id="resetBluetoothButton">
|
||||||
<property name="has-frame">False</property>
|
<property name="has-frame">False</property>
|
||||||
<property name="icon-name">emblem-system-symbolic</property>
|
<property name="icon-name">user-trash-symbolic</property>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -165,9 +165,9 @@
|
||||||
(11,2,"GtkBox","resetBluetoothEntry",None,None,None,None,None,None),
|
(11,2,"GtkBox","resetBluetoothEntry",None,None,None,None,None,None),
|
||||||
(11,3,"GtkImage","resetBluetoothDeviceType",2,None,None,None,None,None),
|
(11,3,"GtkImage","resetBluetoothDeviceType",2,None,None,None,None,None),
|
||||||
(11,5,"GtkButton","resetBluetoothButton",2,None,None,None,3,None),
|
(11,5,"GtkButton","resetBluetoothButton",2,None,None,None,3,None),
|
||||||
(11,6,"GtkBox",None,2,None,None,None,2,None),
|
(11,6,"GtkBox",None,2,None,None,None,1,None),
|
||||||
(11,7,"GtkLabel","resetBluetoothLabel",6,None,None,None,None,None),
|
(11,7,"GtkLabel","resetBluetoothLabel",6,None,None,None,None,None),
|
||||||
(11,8,"GtkLabel","resetBluetoothAddress",6,None,None,None,1,None),
|
(11,8,"GtkLabel","resetBluetoothAddress",6,None,None,None,2,None),
|
||||||
(12,11,"GtkBox","resetAudioInput",None,None,None,None,None,None),
|
(12,11,"GtkBox","resetAudioInput",None,None,None,None,None,None),
|
||||||
(12,12,"GtkLabel",None,11,None,None,None,None,None),
|
(12,12,"GtkLabel",None,11,None,None,None,None,None),
|
||||||
(12,13,"AdwNavigationView",None,11,None,None,None,1,None),
|
(12,13,"AdwNavigationView",None,11,None,None,None,1,None),
|
||||||
|
@ -598,7 +598,7 @@
|
||||||
(11,3,"GtkImage","icon-name","input-mouse-symbolic",None,None,None,None,None,None,None,None,None),
|
(11,3,"GtkImage","icon-name","input-mouse-symbolic",None,None,None,None,None,None,None,None,None),
|
||||||
(11,3,"GtkWidget","margin-end","15",None,None,None,None,None,None,None,None,None),
|
(11,3,"GtkWidget","margin-end","15",None,None,None,None,None,None,None,None,None),
|
||||||
(11,5,"GtkButton","has-frame","False",None,None,None,None,None,None,None,None,None),
|
(11,5,"GtkButton","has-frame","False",None,None,None,None,None,None,None,None,None),
|
||||||
(11,5,"GtkButton","icon-name","emblem-system-symbolic",None,None,None,None,None,None,None,None,None),
|
(11,5,"GtkButton","icon-name","user-trash-symbolic",None,None,None,None,None,None,None,None,None),
|
||||||
(11,6,"GtkOrientable","orientation","vertical",None,None,None,None,None,None,None,None,None),
|
(11,6,"GtkOrientable","orientation","vertical",None,None,None,None,None,None,None,None,None),
|
||||||
(11,7,"GtkLabel","ellipsize","end",None,None,None,None,None,None,None,None,None),
|
(11,7,"GtkLabel","ellipsize","end",None,None,None,None,None,None,None,None,None),
|
||||||
(11,7,"GtkLabel","label","LoremIpsum Wireless Mouse",None,None,None,None,None,None,None,None,None),
|
(11,7,"GtkLabel","label","LoremIpsum Wireless Mouse",None,None,None,None,None,None,None,None,None),
|
||||||
|
|
Loading…
Reference in a new issue