chore: Use namespace with flatpak compatibility

This commit is contained in:
Fabio Lenherr / DashieTM 2023-12-12 22:35:16 +01:00
parent 770bdda317
commit 3ed909a5e4
21 changed files with 296 additions and 270 deletions

View file

@ -1,13 +1,13 @@
[package] [package]
name = "reset" name = "reset"
version = "0.1.0" version = "0.1.1"
edition = "2021" edition = "2021"
description = "A wip universal Linux settings application." description = "A wip universal Linux settings application."
repository = "https://github.com/Xetibo/ReSet" repository = "https://github.com/Xetibo/ReSet"
license = "GPL-3.0-only" license = "GPL-3.0-only"
[dependencies] [dependencies]
reset_daemon = "0.4.9" reset_daemon = "0.5.2"
re_set-lib = "0.7.9" re_set-lib = "0.7.9"
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"

View file

@ -1,5 +1,5 @@
#! /bin/bash #! /bin/bash
python3 flatpak-generator.py ../Cargo.lock -o cargo-sources.json python3 flatpak-generator.py ../Cargo.lock -o cargo-sources.json
flatpak-builder build org.xetibo.ReSet.json --force-clean flatpak-builder build org.Xetibo.ReSet.json --force-clean
flatpak build-export export build flatpak build-export export build
flatpak build-bundle export reset.flatpak org.xetibo.ReSet flatpak build-bundle export reset.flatpak org.Xetibo.ReSet

View file

@ -457,14 +457,14 @@
{ {
"type": "archive", "type": "archive",
"archive-type": "tar-gzip", "archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/glib/glib-0.18.3.crate", "url": "https://static.crates.io/crates/glib/glib-0.18.4.crate",
"sha256": "58cf801b6f7829fa76db37449ab67c9c98a2b1bf21076d9113225621e61a0fa6", "sha256": "951bbd7fdc5c044ede9f05170f05a3ae9479239c3afdfe2d22d537a3add15c4e",
"dest": "cargo/vendor/glib-0.18.3" "dest": "cargo/vendor/glib-0.18.4"
}, },
{ {
"type": "inline", "type": "inline",
"contents": "{\"package\": \"58cf801b6f7829fa76db37449ab67c9c98a2b1bf21076d9113225621e61a0fa6\", \"files\": {}}", "contents": "{\"package\": \"951bbd7fdc5c044ede9f05170f05a3ae9479239c3afdfe2d22d537a3add15c4e\", \"files\": {}}",
"dest": "cargo/vendor/glib-0.18.3", "dest": "cargo/vendor/glib-0.18.4",
"dest-filename": ".cargo-checksum.json" "dest-filename": ".cargo-checksum.json"
}, },
{ {
@ -808,14 +808,14 @@
{ {
"type": "archive", "type": "archive",
"archive-type": "tar-gzip", "archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/mio/mio-0.8.10.crate", "url": "https://static.crates.io/crates/mio/mio-0.8.9.crate",
"sha256": "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09", "sha256": "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0",
"dest": "cargo/vendor/mio-0.8.10" "dest": "cargo/vendor/mio-0.8.9"
}, },
{ {
"type": "inline", "type": "inline",
"contents": "{\"package\": \"8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09\", \"files\": {}}", "contents": "{\"package\": \"3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0\", \"files\": {}}",
"dest": "cargo/vendor/mio-0.8.10", "dest": "cargo/vendor/mio-0.8.9",
"dest-filename": ".cargo-checksum.json" "dest-filename": ".cargo-checksum.json"
}, },
{ {
@ -873,14 +873,14 @@
{ {
"type": "archive", "type": "archive",
"archive-type": "tar-gzip", "archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/once_cell/once_cell-1.19.0.crate", "url": "https://static.crates.io/crates/once_cell/once_cell-1.18.0.crate",
"sha256": "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92", "sha256": "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d",
"dest": "cargo/vendor/once_cell-1.19.0" "dest": "cargo/vendor/once_cell-1.18.0"
}, },
{ {
"type": "inline", "type": "inline",
"contents": "{\"package\": \"3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92\", \"files\": {}}", "contents": "{\"package\": \"dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d\", \"files\": {}}",
"dest": "cargo/vendor/once_cell-1.19.0", "dest": "cargo/vendor/once_cell-1.18.0",
"dest-filename": ".cargo-checksum.json" "dest-filename": ".cargo-checksum.json"
}, },
{ {
@ -964,14 +964,14 @@
{ {
"type": "archive", "type": "archive",
"archive-type": "tar-gzip", "archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/proc-macro-crate/proc-macro-crate-2.0.1.crate", "url": "https://static.crates.io/crates/proc-macro-crate/proc-macro-crate-2.0.0.crate",
"sha256": "97dc5fea232fc28d2f597b37c4876b348a40e33f3b02cc975c8d006d78d94b1a", "sha256": "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8",
"dest": "cargo/vendor/proc-macro-crate-2.0.1" "dest": "cargo/vendor/proc-macro-crate-2.0.0"
}, },
{ {
"type": "inline", "type": "inline",
"contents": "{\"package\": \"97dc5fea232fc28d2f597b37c4876b348a40e33f3b02cc975c8d006d78d94b1a\", \"files\": {}}", "contents": "{\"package\": \"7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8\", \"files\": {}}",
"dest": "cargo/vendor/proc-macro-crate-2.0.1", "dest": "cargo/vendor/proc-macro-crate-2.0.0",
"dest-filename": ".cargo-checksum.json" "dest-filename": ".cargo-checksum.json"
}, },
{ {
@ -1029,14 +1029,14 @@
{ {
"type": "archive", "type": "archive",
"archive-type": "tar-gzip", "archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/re_set-lib/re_set-lib-0.6.5.crate", "url": "https://static.crates.io/crates/re_set-lib/re_set-lib-0.7.9.crate",
"sha256": "56e82abb32ee1fc61de5bea404bf768eaee4bc349f47a42fa1d303710efabb98", "sha256": "6b3393da22503efafbc751b28385c85a9cc1bfa06370c1f6e5796a127946a651",
"dest": "cargo/vendor/re_set-lib-0.6.5" "dest": "cargo/vendor/re_set-lib-0.7.9"
}, },
{ {
"type": "inline", "type": "inline",
"contents": "{\"package\": \"56e82abb32ee1fc61de5bea404bf768eaee4bc349f47a42fa1d303710efabb98\", \"files\": {}}", "contents": "{\"package\": \"6b3393da22503efafbc751b28385c85a9cc1bfa06370c1f6e5796a127946a651\", \"files\": {}}",
"dest": "cargo/vendor/re_set-lib-0.6.5", "dest": "cargo/vendor/re_set-lib-0.7.9",
"dest-filename": ".cargo-checksum.json" "dest-filename": ".cargo-checksum.json"
}, },
{ {
@ -1068,14 +1068,14 @@
{ {
"type": "archive", "type": "archive",
"archive-type": "tar-gzip", "archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/reset_daemon/reset_daemon-0.4.6.crate", "url": "https://static.crates.io/crates/reset_daemon/reset_daemon-0.5.1.crate",
"sha256": "b1c708537cf84c4e8af54deeb23b12d7747ef652e91a07e80d3bfedc45947393", "sha256": "7326eed336797a56223ae33fc5dc67de29001678a933ba34c5e01c3bdf00be2b",
"dest": "cargo/vendor/reset_daemon-0.4.6" "dest": "cargo/vendor/reset_daemon-0.5.1"
}, },
{ {
"type": "inline", "type": "inline",
"contents": "{\"package\": \"b1c708537cf84c4e8af54deeb23b12d7747ef652e91a07e80d3bfedc45947393\", \"files\": {}}", "contents": "{\"package\": \"7326eed336797a56223ae33fc5dc67de29001678a933ba34c5e01c3bdf00be2b\", \"files\": {}}",
"dest": "cargo/vendor/reset_daemon-0.4.6", "dest": "cargo/vendor/reset_daemon-0.5.1",
"dest-filename": ".cargo-checksum.json" "dest-filename": ".cargo-checksum.json"
}, },
{ {
@ -1302,27 +1302,27 @@
{ {
"type": "archive", "type": "archive",
"archive-type": "tar-gzip", "archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/toml/toml-0.8.2.crate", "url": "https://static.crates.io/crates/toml/toml-0.8.8.crate",
"sha256": "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d", "sha256": "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35",
"dest": "cargo/vendor/toml-0.8.2" "dest": "cargo/vendor/toml-0.8.8"
}, },
{ {
"type": "inline", "type": "inline",
"contents": "{\"package\": \"185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d\", \"files\": {}}", "contents": "{\"package\": \"a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35\", \"files\": {}}",
"dest": "cargo/vendor/toml-0.8.2", "dest": "cargo/vendor/toml-0.8.8",
"dest-filename": ".cargo-checksum.json" "dest-filename": ".cargo-checksum.json"
}, },
{ {
"type": "archive", "type": "archive",
"archive-type": "tar-gzip", "archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/toml_datetime/toml_datetime-0.6.3.crate", "url": "https://static.crates.io/crates/toml_datetime/toml_datetime-0.6.5.crate",
"sha256": "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b", "sha256": "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1",
"dest": "cargo/vendor/toml_datetime-0.6.3" "dest": "cargo/vendor/toml_datetime-0.6.5"
}, },
{ {
"type": "inline", "type": "inline",
"contents": "{\"package\": \"7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b\", \"files\": {}}", "contents": "{\"package\": \"3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1\", \"files\": {}}",
"dest": "cargo/vendor/toml_datetime-0.6.3", "dest": "cargo/vendor/toml_datetime-0.6.5",
"dest-filename": ".cargo-checksum.json" "dest-filename": ".cargo-checksum.json"
}, },
{ {
@ -1341,14 +1341,27 @@
{ {
"type": "archive", "type": "archive",
"archive-type": "tar-gzip", "archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/toml_edit/toml_edit-0.20.2.crate", "url": "https://static.crates.io/crates/toml_edit/toml_edit-0.20.7.crate",
"sha256": "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338", "sha256": "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81",
"dest": "cargo/vendor/toml_edit-0.20.2" "dest": "cargo/vendor/toml_edit-0.20.7"
}, },
{ {
"type": "inline", "type": "inline",
"contents": "{\"package\": \"396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338\", \"files\": {}}", "contents": "{\"package\": \"70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81\", \"files\": {}}",
"dest": "cargo/vendor/toml_edit-0.20.2", "dest": "cargo/vendor/toml_edit-0.20.7",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/toml_edit/toml_edit-0.21.0.crate",
"sha256": "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03",
"dest": "cargo/vendor/toml_edit-0.21.0"
},
{
"type": "inline",
"contents": "{\"package\": \"d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03\", \"files\": {}}",
"dest": "cargo/vendor/toml_edit-0.21.0",
"dest-filename": ".cargo-checksum.json" "dest-filename": ".cargo-checksum.json"
}, },
{ {
@ -1562,14 +1575,14 @@
{ {
"type": "archive", "type": "archive",
"archive-type": "tar-gzip", "archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/winnow/winnow-0.5.26.crate", "url": "https://static.crates.io/crates/winnow/winnow-0.5.19.crate",
"sha256": "b67b5f0a4e7a27a64c651977932b9dc5667ca7fc31ac44b03ed37a0cf42fdfff", "sha256": "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b",
"dest": "cargo/vendor/winnow-0.5.26" "dest": "cargo/vendor/winnow-0.5.19"
}, },
{ {
"type": "inline", "type": "inline",
"contents": "{\"package\": \"b67b5f0a4e7a27a64c651977932b9dc5667ca7fc31ac44b03ed37a0cf42fdfff\", \"files\": {}}", "contents": "{\"package\": \"829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b\", \"files\": {}}",
"dest": "cargo/vendor/winnow-0.5.26", "dest": "cargo/vendor/winnow-0.5.19",
"dest-filename": ".cargo-checksum.json" "dest-filename": ".cargo-checksum.json"
}, },
{ {

View file

@ -6,6 +6,6 @@ Exec=reset
Terminal=false Terminal=false
Type=Application Type=Application
Keywords=settings;gtk; Keywords=settings;gtk;
Icon=org.xetibo.ReSet Icon=org.Xetibo.ReSet
Categories=Utility;GTK; Categories=Utility;GTK;
StartupNotify=false StartupNotify=false

View file

@ -1,5 +1,5 @@
{ {
"app-id": "org.xetibo.ReSet", "app-id": "org.Xetibo.ReSet",
"runtime": "org.gnome.Platform", "runtime": "org.gnome.Platform",
"runtime-version": "45", "runtime-version": "45",
"sdk": "org.gnome.Sdk", "sdk": "org.gnome.Sdk",
@ -8,9 +8,11 @@
], ],
"command": "reset", "command": "reset",
"finish-args": [ "finish-args": [
"--socket=session-bus", "--talk-name=org.Xetibo.ReSetDaemon",
"--socket=system-bus", "--system-talk-name=org.freedesktop.NetworkManager",
"--system-talk-name=org.bluez",
"--socket=pulseaudio", "--socket=pulseaudio",
"--share=network",
"--share=ipc", "--share=ipc",
"--socket=fallback-x11", "--socket=fallback-x11",
"--socket=wayland", "--socket=wayland",
@ -34,8 +36,8 @@
"cargo --offline fetch --manifest-path Cargo.toml --verbose", "cargo --offline fetch --manifest-path Cargo.toml --verbose",
"cargo --offline build --release --verbose", "cargo --offline build --release --verbose",
"install -Dm755 ./target/release/reset -t /app/bin/", "install -Dm755 ./target/release/reset -t /app/bin/",
"install -Dm644 ./src/resources/icons/ReSet.svg /app/share/icons/hicolor/scalable/apps/org.xetibo.ReSet.svg", "install -Dm644 ./src/resources/icons/ReSet.svg /app/share/icons/hicolor/scalable/apps/org.Xetibo.ReSet.svg",
"install -Dm644 ./flatpak/org.xetibo.ReSet.desktop /app/share/applications/org.xetibo.ReSet.desktop" "install -Dm644 ./flatpak/org.Xetibo.ReSet.desktop /app/share/applications/org.Xetibo.ReSet.desktop"
], ],
"sources": [ "sources": [
{ {

View file

@ -66,12 +66,12 @@ fn set_card_profile_of_device(device_index: u32, profile_name: String) -> bool {
gio::spawn_blocking(move || { gio::spawn_blocking(move || {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org.Xetibo.ReSet.Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let _: Result<(), Error> = proxy.method_call( let _: Result<(), Error> = proxy.method_call(
"org.Xetibo.ReSetAudio", "org.Xetibo.ReSet.Audio",
"SetCardProfileOfDevice", "SetCardProfileOfDevice",
(device_index, profile_name), (device_index, profile_name),
); );

View file

@ -53,12 +53,12 @@ impl Listeners {
thread::spawn(|| { thread::spawn(|| {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let _: Result<(bool,), Error> = let _: Result<(bool,), Error> =
proxy.method_call("org.Xetibo.ReSetWireless", "StopNetworkListener", ()); proxy.method_call("org.Xetibo.ReSet.Wireless", "StopNetworkListener", ());
}); });
} }
@ -90,7 +90,7 @@ impl arg::ReadAll for SinkAdded {
impl dbus::message::SignalArgs for SinkAdded { impl dbus::message::SignalArgs for SinkAdded {
const NAME: &'static str = "SinkAdded"; const NAME: &'static str = "SinkAdded";
const INTERFACE: &'static str = "org.Xetibo.ReSetAudio"; const INTERFACE: &'static str = "org.Xetibo.ReSet.Audio";
} }
impl GetVal<(Sink,)> for SinkAdded { impl GetVal<(Sink,)> for SinkAdded {
@ -118,7 +118,7 @@ impl arg::ReadAll for SinkChanged {
impl dbus::message::SignalArgs for SinkChanged { impl dbus::message::SignalArgs for SinkChanged {
const NAME: &'static str = "SinkChanged"; const NAME: &'static str = "SinkChanged";
const INTERFACE: &'static str = "org.Xetibo.ReSetAudio"; const INTERFACE: &'static str = "org.Xetibo.ReSet.Audio";
} }
impl GetVal<(Sink,)> for SinkChanged { impl GetVal<(Sink,)> for SinkChanged {
@ -146,7 +146,7 @@ impl arg::ReadAll for SinkRemoved {
impl dbus::message::SignalArgs for SinkRemoved { impl dbus::message::SignalArgs for SinkRemoved {
const NAME: &'static str = "SinkRemoved"; const NAME: &'static str = "SinkRemoved";
const INTERFACE: &'static str = "org.Xetibo.ReSetAudio"; const INTERFACE: &'static str = "org.Xetibo.ReSet.Audio";
} }
impl GetVal<(u32,)> for SinkRemoved { impl GetVal<(u32,)> for SinkRemoved {
@ -174,7 +174,7 @@ impl arg::ReadAll for InputStreamAdded {
impl dbus::message::SignalArgs for InputStreamAdded { impl dbus::message::SignalArgs for InputStreamAdded {
const NAME: &'static str = "InputStreamAdded"; const NAME: &'static str = "InputStreamAdded";
const INTERFACE: &'static str = "org.Xetibo.ReSetAudio"; const INTERFACE: &'static str = "org.Xetibo.ReSet.Audio";
} }
impl GetVal<(InputStream,)> for InputStreamAdded { impl GetVal<(InputStream,)> for InputStreamAdded {
@ -202,7 +202,7 @@ impl arg::ReadAll for InputStreamChanged {
impl dbus::message::SignalArgs for InputStreamChanged { impl dbus::message::SignalArgs for InputStreamChanged {
const NAME: &'static str = "InputStreamChanged"; const NAME: &'static str = "InputStreamChanged";
const INTERFACE: &'static str = "org.Xetibo.ReSetAudio"; const INTERFACE: &'static str = "org.Xetibo.ReSet.Audio";
} }
#[derive(Debug)] #[derive(Debug)]
@ -224,7 +224,7 @@ impl arg::ReadAll for InputStreamRemoved {
impl dbus::message::SignalArgs for InputStreamRemoved { impl dbus::message::SignalArgs for InputStreamRemoved {
const NAME: &'static str = "InputStreamRemoved"; const NAME: &'static str = "InputStreamRemoved";
const INTERFACE: &'static str = "org.Xetibo.ReSetAudio"; const INTERFACE: &'static str = "org.Xetibo.ReSet.Audio";
} }
impl GetVal<(u32,)> for InputStreamRemoved { impl GetVal<(u32,)> for InputStreamRemoved {
@ -252,7 +252,7 @@ impl arg::ReadAll for SourceAdded {
impl dbus::message::SignalArgs for SourceAdded { impl dbus::message::SignalArgs for SourceAdded {
const NAME: &'static str = "SourceAdded"; const NAME: &'static str = "SourceAdded";
const INTERFACE: &'static str = "org.Xetibo.ReSetAudio"; const INTERFACE: &'static str = "org.Xetibo.ReSet.Audio";
} }
impl GetVal<(Source,)> for SourceAdded { impl GetVal<(Source,)> for SourceAdded {
@ -280,7 +280,7 @@ impl arg::ReadAll for SourceChanged {
impl dbus::message::SignalArgs for SourceChanged { impl dbus::message::SignalArgs for SourceChanged {
const NAME: &'static str = "SourceChanged"; const NAME: &'static str = "SourceChanged";
const INTERFACE: &'static str = "org.Xetibo.ReSetAudio"; const INTERFACE: &'static str = "org.Xetibo.ReSet.Audio";
} }
impl GetVal<(Source,)> for SourceChanged { impl GetVal<(Source,)> for SourceChanged {
@ -308,7 +308,7 @@ impl arg::ReadAll for SourceRemoved {
impl dbus::message::SignalArgs for SourceRemoved { impl dbus::message::SignalArgs for SourceRemoved {
const NAME: &'static str = "SourceRemoved"; const NAME: &'static str = "SourceRemoved";
const INTERFACE: &'static str = "org.Xetibo.ReSetAudio"; const INTERFACE: &'static str = "org.Xetibo.ReSet.Audio";
} }
impl GetVal<(u32,)> for SourceRemoved { impl GetVal<(u32,)> for SourceRemoved {
@ -336,7 +336,7 @@ impl arg::ReadAll for OutputStreamAdded {
impl dbus::message::SignalArgs for OutputStreamAdded { impl dbus::message::SignalArgs for OutputStreamAdded {
const NAME: &'static str = "OutputStreamAdded"; const NAME: &'static str = "OutputStreamAdded";
const INTERFACE: &'static str = "org.Xetibo.ReSetAudio"; const INTERFACE: &'static str = "org.Xetibo.ReSet.Audio";
} }
impl GetVal<(OutputStream,)> for OutputStreamAdded { impl GetVal<(OutputStream,)> for OutputStreamAdded {
@ -364,7 +364,7 @@ impl arg::ReadAll for OutputStreamChanged {
impl dbus::message::SignalArgs for OutputStreamChanged { impl dbus::message::SignalArgs for OutputStreamChanged {
const NAME: &'static str = "OutputStreamChanged"; const NAME: &'static str = "OutputStreamChanged";
const INTERFACE: &'static str = "org.Xetibo.ReSetAudio"; const INTERFACE: &'static str = "org.Xetibo.ReSet.Audio";
} }
#[derive(Debug)] #[derive(Debug)]
@ -386,7 +386,7 @@ impl arg::ReadAll for OutputStreamRemoved {
impl dbus::message::SignalArgs for OutputStreamRemoved { impl dbus::message::SignalArgs for OutputStreamRemoved {
const NAME: &'static str = "OutputStreamRemoved"; const NAME: &'static str = "OutputStreamRemoved";
const INTERFACE: &'static str = "org.Xetibo.ReSetAudio"; const INTERFACE: &'static str = "org.Xetibo.ReSet.Audio";
} }
impl GetVal<(u32,)> for OutputStreamRemoved { impl GetVal<(u32,)> for OutputStreamRemoved {
@ -431,19 +431,19 @@ pub fn start_audio_listener(
fn start_dbus_audio_listener(conn: Connection) -> Connection { fn start_dbus_audio_listener(conn: Connection) -> Connection {
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let _: Result<(), Error> = proxy.method_call("org.Xetibo.ReSetAudio", "StartAudioListener", ()); let _: Result<(), Error> = proxy.method_call("org.Xetibo.ReSet.Audio", "StartAudioListener", ());
conn conn
} }
fn stop_dbus_audio_listener(conn: Connection) { fn stop_dbus_audio_listener(conn: Connection) {
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let _: Result<(), Error> = proxy.method_call("org.Xetibo.ReSetAudio", "StopAudioListener", ()); let _: Result<(), Error> = proxy.method_call("org.Xetibo.ReSet.Audio", "StopAudioListener", ());
} }

View file

@ -123,6 +123,11 @@ pub fn populate_conntected_bluetooth_devices(bluetooth_box: Arc<BluetoothBox>) {
let list = imp.reset_model_list.write().unwrap(); let list = imp.reset_model_list.write().unwrap();
let mut model_index = imp.reset_model_index.write().unwrap(); let mut model_index = imp.reset_model_index.write().unwrap();
let mut map = imp.reset_bluetooth_adapters.write().unwrap(); let mut map = imp.reset_bluetooth_adapters.write().unwrap();
{
if imp.reset_bluetooth_adapters.read().unwrap().is_empty() {
return;
}
}
imp.reset_current_bluetooth_adapter imp.reset_current_bluetooth_adapter
.replace(adapters.last().unwrap().clone()); .replace(adapters.last().unwrap().clone());
for (index, adapter) in adapters.into_iter().enumerate() { for (index, adapter) in adapters.into_iter().enumerate() {
@ -204,25 +209,25 @@ pub fn start_bluetooth_listener(listeners: Arc<Listeners>, bluetooth_box: Arc<Bl
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Dameon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let _: Result<(), Error> = let _: Result<(), Error> =
proxy.method_call("org.Xetibo.ReSetBluetooth", "StartBluetoothListener", ()); proxy.method_call("org.Xetibo.ReSet.Bluetooth", "StartBluetoothListener", ());
let device_added = BluetoothDeviceAdded::match_rule( let device_added = BluetoothDeviceAdded::match_rule(
Some(&"org.Xetibo.ReSetDaemon".into()), Some(&"org.Xetibo.ReSet.Daemon".into()),
Some(&Path::from("/org/Xetibo/ReSetDaemon")), Some(&Path::from("/org/Xetibo/ReSet/Dameon")),
) )
.static_clone(); .static_clone();
let device_removed = BluetoothDeviceRemoved::match_rule( let device_removed = BluetoothDeviceRemoved::match_rule(
Some(&"org.Xetibo.ReSetDaemon".into()), Some(&"org.Xetibo.ReSet.Daemon".into()),
Some(&Path::from("/org/Xetibo/ReSetDaemon")), Some(&Path::from("/org/Xetibo/ReSet/Dameon")),
) )
.static_clone(); .static_clone();
let device_changed = BluetoothDeviceChanged::match_rule( let device_changed = BluetoothDeviceChanged::match_rule(
Some(&"org.Xetibo.ReSetDaemon".into()), Some(&"org.Xetibo.ReSet.Daemon".into()),
Some(&Path::from("/org/Xetibo/ReSetDaemon")), Some(&Path::from("/org/Xetibo/ReSet/Dameon")),
) )
.static_clone(); .static_clone();
let device_added_box = bluetooth_box.clone(); let device_added_box = bluetooth_box.clone();
@ -329,7 +334,7 @@ pub fn start_bluetooth_listener(listeners: Arc<Listeners>, bluetooth_box: Arc<Bl
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) {
let _: Result<(), Error> = let _: Result<(), Error> =
proxy.method_call("org.Xetibo.ReSetBluetooth", "StopBluetoothListener", ()); proxy.method_call("org.Xetibo.ReSet.Bluetooth", "StopBluetoothListener", ());
break; break;
} }
if listener_active && time.elapsed().unwrap() > Duration::from_millis(10000) { if listener_active && time.elapsed().unwrap() > Duration::from_millis(10000) {
@ -344,7 +349,7 @@ pub fn start_bluetooth_listener(listeners: Arc<Listeners>, bluetooth_box: Arc<Bl
}); });
}); });
let _: Result<(), Error> = let _: Result<(), Error> =
proxy.method_call("org.Xetibo.ReSetBluetooth", "StopBluetoothScan", ()); proxy.method_call("org.Xetibo.ReSet.Bluetooth", "StopBluetoothScan", ());
} }
if !listener_active && listeners.bluetooth_scan_requested.load(Ordering::SeqCst) { if !listener_active && listeners.bluetooth_scan_requested.load(Ordering::SeqCst) {
listeners listeners
@ -352,7 +357,7 @@ pub fn start_bluetooth_listener(listeners: Arc<Listeners>, bluetooth_box: Arc<Bl
.store(false, Ordering::SeqCst); .store(false, Ordering::SeqCst);
listener_active = true; listener_active = true;
let _: Result<(), Error> = let _: Result<(), Error> =
proxy.method_call("org.Xetibo.ReSetBluetooth", "StartBluetoothListener", ()); proxy.method_call("org.Xetibo.ReSet.Bluetooth", "StartBluetoothListener", ());
time = SystemTime::now(); time = SystemTime::now();
} }
thread::sleep(Duration::from_millis(100)); thread::sleep(Duration::from_millis(100));
@ -363,12 +368,12 @@ pub fn start_bluetooth_listener(listeners: Arc<Listeners>, bluetooth_box: Arc<Bl
fn get_connected_devices() -> Vec<BluetoothDevice> { fn get_connected_devices() -> Vec<BluetoothDevice> {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Dameon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let res: Result<(Vec<BluetoothDevice>,), Error> = proxy.method_call( let res: Result<(Vec<BluetoothDevice>,), Error> = proxy.method_call(
"org.Xetibo.ReSetBluetooth", "org.Xetibo.ReSet.Bluetooth",
"GetConnectedBluetoothDevices", "GetConnectedBluetoothDevices",
(), (),
); );
@ -381,12 +386,12 @@ fn get_connected_devices() -> Vec<BluetoothDevice> {
fn get_bluetooth_adapters() -> Vec<BluetoothAdapter> { fn get_bluetooth_adapters() -> Vec<BluetoothAdapter> {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Dameon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let res: Result<(Vec<BluetoothAdapter>,), Error> = let res: Result<(Vec<BluetoothAdapter>,), Error> =
proxy.method_call("org.Xetibo.ReSetBluetooth", "GetBluetoothAdapters", ()); proxy.method_call("org.Xetibo.ReSet.Bluetooth", "GetBluetoothAdapters", ());
if res.is_err() { if res.is_err() {
return Vec::new(); return Vec::new();
} }
@ -396,23 +401,23 @@ fn get_bluetooth_adapters() -> Vec<BluetoothAdapter> {
fn set_bluetooth_adapter(path: Path<'static>) { fn set_bluetooth_adapter(path: Path<'static>) {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Dameon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let _: Result<(Vec<BluetoothAdapter>,), Error> = let _: Result<(Vec<BluetoothAdapter>,), Error> =
proxy.method_call("org.Xetibo.ReSetBluetooth", "SetBluetoothAdapter", (path,)); proxy.method_call("org.Xetibo.ReSet.Bluetooth", "SetBluetoothAdapter", (path,));
} }
fn set_bluetooth_adapter_visibility(path: Path<'static>, visible: bool) { fn set_bluetooth_adapter_visibility(path: Path<'static>, visible: bool) {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Dameon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let _: Result<(bool,), Error> = proxy.method_call( let _: Result<(bool,), Error> = proxy.method_call(
"org.Xetibo.ReSetBluetooth", "org.Xetibo.ReSet.Bluetooth",
"SetBluetoothAdapterDiscoverability", "SetBluetoothAdapterDiscoverability",
(path, visible), (path, visible),
); );
@ -421,12 +426,12 @@ fn set_bluetooth_adapter_visibility(path: Path<'static>, visible: bool) {
fn set_bluetooth_adapter_pairability(path: Path<'static>, visible: bool) { fn set_bluetooth_adapter_pairability(path: Path<'static>, visible: bool) {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Dameon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let _: Result<(bool,), Error> = proxy.method_call( let _: Result<(bool,), Error> = proxy.method_call(
"org.Xetibo.ReSetBluetooth", "org.Xetibo.ReSet.Bluetooth",
"SetBluetoothAdapterPairability", "SetBluetoothAdapterPairability",
(path, visible), (path, visible),
); );
@ -435,12 +440,12 @@ fn set_bluetooth_adapter_pairability(path: Path<'static>, visible: bool) {
fn set_adapter_enabled(path: Path<'static>, enabled: bool) { fn set_adapter_enabled(path: Path<'static>, enabled: bool) {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Dameon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let _: Result<(Vec<BluetoothAdapter>,), Error> = proxy.method_call( let _: Result<(Vec<BluetoothAdapter>,), Error> = proxy.method_call(
"org.Xetibo.ReSetBluetooth", "org.Xetibo.ReSet.Bluetooth",
"SetBluetoothAdapterEnabled", "SetBluetoothAdapterEnabled",
(path, enabled), (path, enabled),
); );

View file

@ -87,12 +87,12 @@ fn connect_to_device(entry: Arc<BluetoothEntry>, path: Path<'static>) {
gio::spawn_blocking(move || { gio::spawn_blocking(move || {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let res: Result<(bool,), Error> = proxy.method_call( let res: Result<(bool,), Error> = proxy.method_call(
"org.Xetibo.ReSetBluetooth", "org.Xetibo.ReSet.Bluetooth",
"ConnectToBluetoothDevice", "ConnectToBluetoothDevice",
(path,), (path,),
); );
@ -118,12 +118,12 @@ fn connect_to_device(entry: Arc<BluetoothEntry>, path: Path<'static>) {
// gio::spawn_blocking(move || { // gio::spawn_blocking(move || {
// let conn = Connection::new_session().unwrap(); // let conn = Connection::new_session().unwrap();
// let proxy = conn.with_proxy( // let proxy = conn.with_proxy(
// "org.Xetibo.ReSetDaemon", // "org.Xetibo.ReSet.Daemon",
// "/org/Xetibo/ReSetDaemon", // "/org/Xetibo/ReSet/Daemon",
// Duration::from_millis(1000), // Duration::from_millis(1000),
// ); // );
// let _: Result<(bool,), Error> = proxy.method_call( // let _: Result<(bool,), Error> = proxy.method_call(
// "org.Xetibo.ReSetBluetooth", // "org.Xetibo.ReSet.Bluetooth",
// "PairWithBluetoothDevice", // "PairWithBluetoothDevice",
// (path,), // (path,),
// ); // );
@ -134,12 +134,12 @@ fn disconnect_from_device(entry: Arc<BluetoothEntry>, path: Path<'static>) {
gio::spawn_blocking(move || { gio::spawn_blocking(move || {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let res: Result<(bool,), Error> = proxy.method_call( let res: Result<(bool,), Error> = proxy.method_call(
"org.Xetibo.ReSetBluetooth", "org.Xetibo.ReSet.Bluetooth",
"DisconnectFromBluetoothDevice", "DisconnectFromBluetoothDevice",
(path,), (path,),
); );
@ -164,11 +164,11 @@ fn remove_device_pairing(path: Path<'static>) {
gio::spawn_blocking(move || { gio::spawn_blocking(move || {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let _: Result<(bool,), Error> = let _: Result<(bool,), Error> =
proxy.method_call("org.Xetibo.ReSetBluetooth", "RemoveDevicePairing", (path,)); proxy.method_call("org.Xetibo.ReSet.Bluetooth", "RemoveDevicePairing", (path,));
}); });
} }

View file

@ -134,12 +134,12 @@ fn set_outputstream_volume(value: f64, index: u32, channels: u16) -> bool {
gio::spawn_blocking(move || { gio::spawn_blocking(move || {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let _: Result<(), Error> = proxy.method_call( let _: Result<(), Error> = proxy.method_call(
"org.Xetibo.ReSetAudio", "org.Xetibo.ReSet.Audio",
"SetOutputStreamVolume", "SetOutputStreamVolume",
(index, channels, value as u32), (index, channels, value as u32),
); );
@ -155,12 +155,12 @@ fn toggle_output_stream_mute(index: u32, muted: bool) -> bool {
gio::spawn_blocking(move || { gio::spawn_blocking(move || {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let _: Result<(), Error> = proxy.method_call( let _: Result<(), Error> = proxy.method_call(
"org.Xetibo.ReSetAudio", "org.Xetibo.ReSet.Audio",
"SetOutputStreamMute", "SetOutputStreamMute",
(index, muted), (index, muted),
); );
@ -176,12 +176,12 @@ fn set_source_of_output_stream(stream: u32, source: u32) -> bool {
gio::spawn_blocking(move || { gio::spawn_blocking(move || {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let _: Result<(bool,), Error> = proxy.method_call( let _: Result<(bool,), Error> = proxy.method_call(
"org.Xetibo.ReSetAudio", "org.Xetibo.ReSet.Audio",
"SetSourceOfOutputStream", "SetSourceOfOutputStream",
(stream, source), (stream, source),
); );

View file

@ -312,12 +312,12 @@ pub fn populate_cards(input_box: Arc<SourceBox>) {
fn get_output_streams() -> Vec<OutputStream> { fn get_output_streams() -> Vec<OutputStream> {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let res: Result<(Vec<OutputStream>,), Error> = let res: Result<(Vec<OutputStream>,), Error> =
proxy.method_call("org.Xetibo.ReSetAudio", "ListOutputStreams", ()); proxy.method_call("org.Xetibo.ReSet.Audio", "ListOutputStreams", ());
if res.is_err() { if res.is_err() {
return Vec::new(); return Vec::new();
} }
@ -327,12 +327,12 @@ fn get_output_streams() -> Vec<OutputStream> {
fn get_sources() -> Vec<Source> { fn get_sources() -> Vec<Source> {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let res: Result<(Vec<Source>,), Error> = let res: Result<(Vec<Source>,), Error> =
proxy.method_call("org.Xetibo.ReSetAudio", "ListSources", ()); proxy.method_call("org.Xetibo.ReSet.Audio", "ListSources", ());
if res.is_err() { if res.is_err() {
return Vec::new(); return Vec::new();
} }
@ -342,12 +342,12 @@ fn get_sources() -> Vec<Source> {
fn get_cards() -> Vec<Card> { fn get_cards() -> Vec<Card> {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let res: Result<(Vec<Card>,), Error> = let res: Result<(Vec<Card>,), Error> =
proxy.method_call("org.Xetibo.ReSetAudio", "ListCards", ()); proxy.method_call("org.Xetibo.ReSet.Audio", "ListCards", ());
if res.is_err() { if res.is_err() {
return Vec::new(); return Vec::new();
} }
@ -357,12 +357,12 @@ fn get_cards() -> Vec<Card> {
fn get_default_source_name() -> String { fn get_default_source_name() -> String {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let res: Result<(String,), Error> = let res: Result<(String,), Error> =
proxy.method_call("org.Xetibo.ReSetAudio", "GetDefaultSourceName", ()); proxy.method_call("org.Xetibo.ReSet.Audio", "GetDefaultSourceName", ());
if res.is_err() { if res.is_err() {
return String::from(""); return String::from("");
} }
@ -372,12 +372,12 @@ fn get_default_source_name() -> String {
fn get_default_source() -> Source { fn get_default_source() -> Source {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let res: Result<(Source,), Error> = let res: Result<(Source,), Error> =
proxy.method_call("org.Xetibo.ReSetAudio", "GetDefaultSource", ()); proxy.method_call("org.Xetibo.ReSet.Audio", "GetDefaultSource", ());
if res.is_err() { if res.is_err() {
return Source::default(); return Source::default();
} }
@ -386,33 +386,33 @@ fn get_default_source() -> Source {
pub fn start_input_box_listener(conn: Connection, source_box: Arc<SourceBox>) -> Connection { pub fn start_input_box_listener(conn: Connection, source_box: Arc<SourceBox>) -> Connection {
let source_added = SourceAdded::match_rule( let source_added = SourceAdded::match_rule(
Some(&"org.Xetibo.ReSetDaemon".into()), Some(&"org.Xetibo.ReSet.Daemon".into()),
Some(&Path::from("/org/Xetibo/ReSetDaemon")), Some(&Path::from("/org/Xetibo/ReSet/Daemon")),
) )
.static_clone(); .static_clone();
let source_removed = SourceRemoved::match_rule( let source_removed = SourceRemoved::match_rule(
Some(&"org.Xetibo.ReSetDaemon".into()), Some(&"org.Xetibo.ReSet.Daemon".into()),
Some(&Path::from("/org/Xetibo/ReSetDaemon")), Some(&Path::from("/org/Xetibo/ReSet/Daemon")),
) )
.static_clone(); .static_clone();
let source_changed = SourceChanged::match_rule( let source_changed = SourceChanged::match_rule(
Some(&"org.Xetibo.ReSetDaemon".into()), Some(&"org.Xetibo.ReSet.Daemon".into()),
Some(&Path::from("/org/Xetibo/ReSetDaemon")), Some(&Path::from("/org/Xetibo/ReSet/Daemon")),
) )
.static_clone(); .static_clone();
let output_stream_added = OutputStreamAdded::match_rule( let output_stream_added = OutputStreamAdded::match_rule(
Some(&"org.Xetibo.ReSetDaemon".into()), Some(&"org.Xetibo.ReSet.Daemon".into()),
Some(&Path::from("/org/Xetibo/ReSetDaemon")), Some(&Path::from("/org/Xetibo/ReSet/Daemon")),
) )
.static_clone(); .static_clone();
let output_stream_removed = OutputStreamRemoved::match_rule( let output_stream_removed = OutputStreamRemoved::match_rule(
Some(&"org.Xetibo.ReSetDaemon".into()), Some(&"org.Xetibo.ReSet.Daemon".into()),
Some(&Path::from("/org/Xetibo/ReSetDaemon")), Some(&Path::from("/org/Xetibo/ReSet/Daemon")),
) )
.static_clone(); .static_clone();
let output_stream_changed = OutputStreamChanged::match_rule( let output_stream_changed = OutputStreamChanged::match_rule(
Some(&"org.Xetibo.ReSetDaemon".into()), Some(&"org.Xetibo.ReSet.Daemon".into()),
Some(&Path::from("/org/Xetibo/ReSetDaemon")), Some(&Path::from("/org/Xetibo/ReSet/Daemon")),
) )
.static_clone(); .static_clone();

View file

@ -105,12 +105,12 @@ pub fn set_source_volume(value: f64, index: u32, channels: u16) -> bool {
gio::spawn_blocking(move || { gio::spawn_blocking(move || {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let _: Result<(), Error> = proxy.method_call( let _: Result<(), Error> = proxy.method_call(
"org.Xetibo.ReSetAudio", "org.Xetibo.ReSet.Audio",
"SetSourceVolume", "SetSourceVolume",
(index, channels, value as u32), (index, channels, value as u32),
); );
@ -126,12 +126,12 @@ pub fn toggle_source_mute(index: u32, muted: bool) -> bool {
gio::spawn_blocking(move || { gio::spawn_blocking(move || {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let _: Result<(), Error> = let _: Result<(), Error> =
proxy.method_call("org.Xetibo.ReSetAudio", "SetSourceMute", (index, muted)); proxy.method_call("org.Xetibo.ReSet.Audio", "SetSourceMute", (index, muted));
// if res.is_err() { // if res.is_err() {
// return false; // return false;
// } // }
@ -143,12 +143,12 @@ pub fn toggle_source_mute(index: u32, muted: bool) -> bool {
pub fn set_default_source(name: Arc<String>) -> Option<Source> { pub fn set_default_source(name: Arc<String>) -> Option<Source> {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let res: Result<(Source,), Error> = proxy.method_call( let res: Result<(Source,), Error> = proxy.method_call(
"org.Xetibo.ReSetAudio", "org.Xetibo.ReSet.Audio",
"SetDefaultSource", "SetDefaultSource",
(name.as_str(),), (name.as_str(),),
); );

View file

@ -161,12 +161,12 @@ fn set_inputstream_volume(value: f64, index: u32, channels: u16) -> bool {
gio::spawn_blocking(move || { gio::spawn_blocking(move || {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let _: Result<(), Error> = proxy.method_call( let _: Result<(), Error> = proxy.method_call(
"org.Xetibo.ReSetAudio", "org.Xetibo.ReSet.Audio",
"SetInputStreamVolume", "SetInputStreamVolume",
(index, channels, value as u32), (index, channels, value as u32),
); );
@ -182,12 +182,12 @@ fn toggle_input_stream_mute(index: u32, muted: bool) -> bool {
gio::spawn_blocking(move || { gio::spawn_blocking(move || {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let _: Result<(), Error> = proxy.method_call( let _: Result<(), Error> = proxy.method_call(
"org.Xetibo.ReSetAudio", "org.Xetibo.ReSet.Audio",
"SetInputStreamMute", "SetInputStreamMute",
(index, muted), (index, muted),
); );
@ -203,12 +203,12 @@ fn set_sink_of_input_stream(stream: u32, sink: u32) -> bool {
gio::spawn_blocking(move || { gio::spawn_blocking(move || {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let _: Result<(), Error> = proxy.method_call( let _: Result<(), Error> = proxy.method_call(
"org.Xetibo.ReSetAudio", "org.Xetibo.ReSet.Audio",
"SetSinkOfInputStream", "SetSinkOfInputStream",
(stream, sink), (stream, sink),
); );

View file

@ -310,12 +310,12 @@ pub fn populate_cards(output_box: Arc<SinkBox>) {
fn get_input_streams() -> Vec<InputStream> { fn get_input_streams() -> Vec<InputStream> {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let res: Result<(Vec<InputStream>,), Error> = let res: Result<(Vec<InputStream>,), Error> =
proxy.method_call("org.Xetibo.ReSetAudio", "ListInputStreams", ()); proxy.method_call("org.Xetibo.ReSet.Audio", "ListInputStreams", ());
if res.is_err() { if res.is_err() {
return Vec::new(); return Vec::new();
} }
@ -325,12 +325,12 @@ fn get_input_streams() -> Vec<InputStream> {
fn get_sinks() -> Vec<Sink> { fn get_sinks() -> Vec<Sink> {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let res: Result<(Vec<Sink>,), Error> = let res: Result<(Vec<Sink>,), Error> =
proxy.method_call("org.Xetibo.ReSetAudio", "ListSinks", ()); proxy.method_call("org.Xetibo.ReSet.Audio", "ListSinks", ());
if res.is_err() { if res.is_err() {
return Vec::new(); return Vec::new();
} }
@ -340,12 +340,12 @@ fn get_sinks() -> Vec<Sink> {
fn get_cards() -> Vec<Card> { fn get_cards() -> Vec<Card> {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let res: Result<(Vec<Card>,), Error> = let res: Result<(Vec<Card>,), Error> =
proxy.method_call("org.Xetibo.ReSetAudio", "ListCards", ()); proxy.method_call("org.Xetibo.ReSet.Audio", "ListCards", ());
if res.is_err() { if res.is_err() {
return Vec::new(); return Vec::new();
} }
@ -355,12 +355,12 @@ fn get_cards() -> Vec<Card> {
fn get_default_sink_name() -> String { fn get_default_sink_name() -> String {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let res: Result<(String,), Error> = let res: Result<(String,), Error> =
proxy.method_call("org.Xetibo.ReSetAudio", "GetDefaultSinkName", ()); proxy.method_call("org.Xetibo.ReSet.Audio", "GetDefaultSinkName", ());
if res.is_err() { if res.is_err() {
return String::from(""); return String::from("");
} }
@ -370,12 +370,12 @@ fn get_default_sink_name() -> String {
fn get_default_sink() -> Sink { fn get_default_sink() -> Sink {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let res: Result<(Sink,), Error> = let res: Result<(Sink,), Error> =
proxy.method_call("org.Xetibo.ReSetAudio", "GetDefaultSink", ()); proxy.method_call("org.Xetibo.ReSet.Audio", "GetDefaultSink", ());
if res.is_err() { if res.is_err() {
return Sink::default(); return Sink::default();
} }
@ -384,33 +384,33 @@ fn get_default_sink() -> Sink {
pub fn start_output_box_listener(conn: Connection, sink_box: Arc<SinkBox>) -> Connection { pub fn start_output_box_listener(conn: Connection, sink_box: Arc<SinkBox>) -> Connection {
let sink_added = SinkAdded::match_rule( let sink_added = SinkAdded::match_rule(
Some(&"org.Xetibo.ReSetDaemon".into()), Some(&"org.Xetibo.ReSet.Daemon".into()),
Some(&Path::from("/org/Xetibo/ReSetDaemon")), Some(&Path::from("/org/Xetibo/ReSet/Daemon")),
) )
.static_clone(); .static_clone();
let sink_removed = SinkRemoved::match_rule( let sink_removed = SinkRemoved::match_rule(
Some(&"org.Xetibo.ReSetDaemon".into()), Some(&"org.Xetibo.ReSet.Daemon".into()),
Some(&Path::from("/org/Xetibo/ReSetDaemon")), Some(&Path::from("/org/Xetibo/ReSet/Daemon")),
) )
.static_clone(); .static_clone();
let sink_changed = SinkChanged::match_rule( let sink_changed = SinkChanged::match_rule(
Some(&"org.Xetibo.ReSetDaemon".into()), Some(&"org.Xetibo.ReSet.Daemon".into()),
Some(&Path::from("/org/Xetibo/ReSetDaemon")), Some(&Path::from("/org/Xetibo/ReSet/Daemon")),
) )
.static_clone(); .static_clone();
let input_stream_added = InputStreamAdded::match_rule( let input_stream_added = InputStreamAdded::match_rule(
Some(&"org.Xetibo.ReSetDaemon".into()), Some(&"org.Xetibo.ReSet.Daemon".into()),
Some(&Path::from("/org/Xetibo/ReSetDaemon")), Some(&Path::from("/org/Xetibo/ReSet/Daemon")),
) )
.static_clone(); .static_clone();
let input_stream_removed = InputStreamRemoved::match_rule( let input_stream_removed = InputStreamRemoved::match_rule(
Some(&"org.Xetibo.ReSetDaemon".into()), Some(&"org.Xetibo.ReSet.Daemon".into()),
Some(&Path::from("/org/Xetibo/ReSetDaemon")), Some(&Path::from("/org/Xetibo/ReSet/Daemon")),
) )
.static_clone(); .static_clone();
let input_stream_changed = InputStreamChanged::match_rule( let input_stream_changed = InputStreamChanged::match_rule(
Some(&"org.Xetibo.ReSetDaemon".into()), Some(&"org.Xetibo.ReSet.Daemon".into()),
Some(&Path::from("/org/Xetibo/ReSetDaemon")), Some(&Path::from("/org/Xetibo/ReSet/Daemon")),
) )
.static_clone(); .static_clone();

View file

@ -103,12 +103,12 @@ pub fn set_sink_volume(value: f64, index: u32, channels: u16) -> bool {
gio::spawn_blocking(move || { gio::spawn_blocking(move || {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let _: Result<(), Error> = proxy.method_call( let _: Result<(), Error> = proxy.method_call(
"org.Xetibo.ReSetAudio", "org.Xetibo.ReSet.Audio",
"SetSinkVolume", "SetSinkVolume",
(index, channels, value as u32), (index, channels, value as u32),
); );
@ -124,12 +124,12 @@ pub fn toggle_sink_mute(index: u32, muted: bool) -> bool {
gio::spawn_blocking(move || { gio::spawn_blocking(move || {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let _: Result<(), Error> = let _: Result<(), Error> =
proxy.method_call("org.Xetibo.ReSetAudio", "SetSinkMute", (index, muted)); proxy.method_call("org.Xetibo.ReSet.Audio", "SetSinkMute", (index, muted));
// if res.is_err() { // if res.is_err() {
// return false; // return false;
// } // }
@ -141,12 +141,12 @@ pub fn toggle_sink_mute(index: u32, muted: bool) -> bool {
pub fn set_default_sink(name: Arc<String>) -> Option<Sink> { pub fn set_default_sink(name: Arc<String>) -> Option<Sink> {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let res: Result<(Sink,), Error> = let res: Result<(Sink,), Error> =
proxy.method_call("org.Xetibo.ReSetAudio", "SetDefaultSink", (name.as_str(),)); proxy.method_call("org.Xetibo.ReSet.Audio", "SetDefaultSink", (name.as_str(),));
if res.is_err() { if res.is_err() {
return None; return None;
} }

View file

@ -66,11 +66,11 @@ fn delete_connection(path: Path<'static>) {
gio::spawn_blocking(move || { gio::spawn_blocking(move || {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let _: Result<(), Error> = let _: Result<(), Error> =
proxy.method_call("org.Xetibo.ReSetWireless", "DeleteConnection", (path,)); proxy.method_call("org.Xetibo.ReSet.Wireless", "DeleteConnection", (path,));
}); });
} }

View file

@ -19,12 +19,12 @@ type ResultType =
pub fn get_connection_settings(path: Path<'static>) -> ResetConnection { pub fn get_connection_settings(path: Path<'static>) -> ResetConnection {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let res: ResultType = let res: ResultType =
proxy.method_call("org.Xetibo.ReSetWireless", "GetConnectionSettings", (path,)); proxy.method_call("org.Xetibo.ReSet.Wireless", "GetConnectionSettings", (path,));
if res.is_err() { if res.is_err() {
ResetConnection::default(); ResetConnection::default();
} }

View file

@ -103,6 +103,11 @@ pub fn scan_for_wifi(wifi_box: Arc<WifiBox>) {
let list = imp.reset_model_list.write().unwrap(); let list = imp.reset_model_list.write().unwrap();
let mut model_index = imp.reset_model_index.write().unwrap(); let mut model_index = imp.reset_model_index.write().unwrap();
let mut map = imp.reset_wifi_devices.write().unwrap(); let mut map = imp.reset_wifi_devices.write().unwrap();
{
if imp.reset_current_wifi_device.borrow().path == Path::from("/") {
return;
}
}
imp.reset_current_wifi_device imp.reset_current_wifi_device
.replace(devices.last().unwrap().clone()); .replace(devices.last().unwrap().clone());
for (index, device) in devices.into_iter().enumerate() { for (index, device) in devices.into_iter().enumerate() {
@ -188,23 +193,23 @@ pub fn show_stored_connections(wifi_box: Arc<WifiBox>) {
pub fn dbus_start_network_events() { pub fn dbus_start_network_events() {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let _: Result<(), Error> = let _: Result<(), Error> =
proxy.method_call("org.Xetibo.ReSetWireless", "StartNetworkListener", ()); proxy.method_call("org.Xetibo.ReSet.Wireless", "StartNetworkListener", ());
} }
pub fn get_access_points() -> Vec<AccessPoint> { pub fn get_access_points() -> Vec<AccessPoint> {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let res: Result<(Vec<AccessPoint>,), Error> = let res: Result<(Vec<AccessPoint>,), Error> =
proxy.method_call("org.Xetibo.ReSetWireless", "ListAccessPoints", ()); proxy.method_call("org.Xetibo.ReSet.Wireless", "ListAccessPoints", ());
if res.is_err() { if res.is_err() {
return Vec::new(); return Vec::new();
} }
@ -215,23 +220,23 @@ pub fn get_access_points() -> Vec<AccessPoint> {
pub fn set_wifi_device(path: Path<'static>) { pub fn set_wifi_device(path: Path<'static>) {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let _: Result<(bool,), Error> = let _: Result<(bool,), Error> =
proxy.method_call("org.Xetibo.ReSetWireless", "SetWifiDevice", (path,)); proxy.method_call("org.Xetibo.ReSet.Wireless", "SetWifiDevice", (path,));
} }
pub fn get_wifi_devices() -> Vec<WifiDevice> { pub fn get_wifi_devices() -> Vec<WifiDevice> {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let res: Result<(Vec<WifiDevice>,), Error> = let res: Result<(Vec<WifiDevice>,), Error> =
proxy.method_call("org.Xetibo.ReSetWireless", "GetAllWifiDevices", ()); proxy.method_call("org.Xetibo.ReSet.Wireless", "GetAllWifiDevices", ());
if res.is_err() { if res.is_err() {
return Vec::new(); return Vec::new();
} }
@ -242,12 +247,12 @@ pub fn get_wifi_devices() -> Vec<WifiDevice> {
pub fn get_wifi_status() -> bool { pub fn get_wifi_status() -> bool {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let res: Result<(bool,), Error> = let res: Result<(bool,), Error> =
proxy.method_call("org.Xetibo.ReSetWireless", "GetWifiStatus", ()); proxy.method_call("org.Xetibo.ReSet.Wireless", "GetWifiStatus", ());
if res.is_err() { if res.is_err() {
return false; return false;
} }
@ -257,11 +262,12 @@ pub fn get_wifi_status() -> bool {
pub fn get_stored_connections() -> Vec<(Path<'static>, Vec<u8>)> { pub fn get_stored_connections() -> Vec<(Path<'static>, Vec<u8>)> {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let res: ResultMap = proxy.method_call("org.Xetibo.ReSetWireless", "ListStoredConnections", ()); let res: ResultMap =
proxy.method_call("org.Xetibo.ReSet.Wireless", "ListStoredConnections", ());
if res.is_err() { if res.is_err() {
return Vec::new(); return Vec::new();
} }
@ -272,12 +278,12 @@ pub fn get_stored_connections() -> Vec<(Path<'static>, Vec<u8>)> {
pub fn set_wifi_enabled(enabled: bool) { pub fn set_wifi_enabled(enabled: bool) {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let _: Result<(bool,), Error> = let _: Result<(bool,), Error> =
proxy.method_call("org.Xetibo.ReSetWireless", "SetWifiEnabled", (enabled,)); proxy.method_call("org.Xetibo.ReSet.Wireless", "SetWifiEnabled", (enabled,));
} }
pub fn start_event_listener(listeners: Arc<Listeners>, wifi_box: Arc<WifiBox>) { pub fn start_event_listener(listeners: Arc<Listeners>, wifi_box: Arc<WifiBox>) {
@ -295,23 +301,23 @@ pub fn start_event_listener(listeners: Arc<Listeners>, wifi_box: Arc<WifiBox>) {
let changed_ref = wifi_box.clone(); let changed_ref = wifi_box.clone();
let wifi_changed_ref = wifi_box.clone(); let wifi_changed_ref = wifi_box.clone();
let access_point_added = AccessPointAdded::match_rule( let access_point_added = AccessPointAdded::match_rule(
Some(&"org.Xetibo.ReSetDaemon".into()), Some(&"org.Xetibo.ReSet.Daemon".into()),
Some(&Path::from("/org/Xetibo/ReSetDaemon")), Some(&Path::from("/org/Xetibo/ReSet/Daemon")),
) )
.static_clone(); .static_clone();
let access_point_removed = AccessPointRemoved::match_rule( let access_point_removed = AccessPointRemoved::match_rule(
Some(&"org.Xetibo.ReSetDaemon".into()), Some(&"org.Xetibo.ReSet.Daemon".into()),
Some(&Path::from("/org/Xetibo/ReSetDaemon")), Some(&Path::from("/org/Xetibo/ReSet/Daemon")),
) )
.static_clone(); .static_clone();
let access_point_changed = AccessPointChanged::match_rule( let access_point_changed = AccessPointChanged::match_rule(
Some(&"org.Xetibo.ReSetDaemon".into()), Some(&"org.Xetibo.ReSet.Daemon".into()),
Some(&Path::from("/org/Xetibo/ReSetDaemon")), Some(&Path::from("/org/Xetibo/ReSet/Daemon")),
) )
.static_clone(); .static_clone();
let device_changed = WifiDeviceChanged::match_rule( let device_changed = WifiDeviceChanged::match_rule(
Some(&"org.Xetibo.ReSetDaemon".into()), Some(&"org.Xetibo.ReSet.Daemon".into()),
Some(&Path::from("/org/Xetibo/ReSetDaemon")), Some(&Path::from("/org/Xetibo/ReSet/Daemon")),
) )
.static_clone(); .static_clone();
let res = conn.add_match(access_point_added, move |ir: AccessPointAdded, _, _| { let res = conn.add_match(access_point_added, move |ir: AccessPointAdded, _, _| {

View file

@ -123,12 +123,12 @@ pub fn click_disconnect(entry: Arc<WifiEntry>) {
let imp = entry_ref.imp(); let imp = entry_ref.imp();
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(10000), Duration::from_millis(10000),
); );
let res: Result<(bool,), Error> = proxy.method_call( let res: Result<(bool,), Error> = proxy.method_call(
"org.Xetibo.ReSetWireless", "org.Xetibo.ReSet.Wireless",
"DisconnectFromCurrentAccessPoint", "DisconnectFromCurrentAccessPoint",
(), (),
); );
@ -154,12 +154,12 @@ pub fn click_stored_network(entry: Arc<WifiEntry>) {
gio::spawn_blocking(move || { gio::spawn_blocking(move || {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(10000), Duration::from_millis(10000),
); );
let res: Result<(bool,), Error> = proxy.method_call( let res: Result<(bool,), Error> = proxy.method_call(
"org.Xetibo.ReSetWireless", "org.Xetibo.ReSet.Wireless",
"ConnectToKnownAccessPoint", "ConnectToKnownAccessPoint",
(access_point,), (access_point,),
); );
@ -197,12 +197,12 @@ pub fn click_new_network(entry: Arc<WifiEntry>) {
gio::spawn_blocking(move || { gio::spawn_blocking(move || {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(10000), Duration::from_millis(10000),
); );
let res: Result<(bool,), Error> = proxy.method_call( let res: Result<(bool,), Error> = proxy.method_call(
"org.Xetibo.ReSetWireless", "org.Xetibo.ReSet.Wireless",
"ConnectToNewAccessPoint", "ConnectToNewAccessPoint",
(access_point, password), (access_point, password),
); );

View file

@ -389,12 +389,12 @@ fn set_connection_settings(path: Path<'static>, prop: HashMap<String, PropMap>)
gio::spawn_blocking(move || { gio::spawn_blocking(move || {
let conn = dbus::blocking::Connection::new_session().unwrap(); let conn = dbus::blocking::Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(1000), Duration::from_millis(1000),
); );
let _: Result<(bool,), Error> = proxy.method_call( let _: Result<(bool,), Error> = proxy.method_call(
"org.Xetibo.ReSetWireless", "org.Xetibo.ReSet.Wireless",
"SetConnectionSettings", "SetConnectionSettings",
(path, prop), (path, prop),
); );

View file

@ -53,12 +53,12 @@ fn shutdown(_: &Application) {
thread::spawn(|| { thread::spawn(|| {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(100), Duration::from_millis(100),
); );
let res: Result<(), Error> = let res: Result<(), Error> =
proxy.method_call("org.Xetibo.ReSetDaemon", "UnregisterClient", ("ReSet",)); proxy.method_call("org.Xetibo.ReSet.Daemon", "UnregisterClient", ("ReSet",));
res res
}); });
} }
@ -67,16 +67,16 @@ async fn daemon_check() {
let handle = thread::spawn(|| { let handle = thread::spawn(|| {
let conn = Connection::new_session().unwrap(); let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy( let proxy = conn.with_proxy(
"org.Xetibo.ReSetDaemon", "org.Xetibo.ReSet.Daemon",
"/org/Xetibo/ReSetDaemon", "/org/Xetibo/ReSet/Daemon",
Duration::from_millis(100), Duration::from_millis(100),
); );
let res: Result<(), Error> = let res: Result<(), Error> =
proxy.method_call("org.Xetibo.ReSetDaemon", "RegisterClient", ("ReSet",)); proxy.method_call("org.Xetibo.ReSet.Daemon", "RegisterClient", ("ReSet",));
res res
}); });
let res = handle.join(); let res = handle.join();
if res.unwrap().is_err() { if res.unwrap().is_err() {
run_daemon().await; run_daemon(APP_ID).await;
} }
} }