diff --git a/Cargo.toml b/Cargo.toml index 6729802..304f13a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "reset" -version = "0.1.0" +version = "0.1.1" edition = "2021" description = "A wip universal Linux settings application." repository = "https://github.com/Xetibo/ReSet" license = "GPL-3.0-only" [dependencies] -reset_daemon = "0.4.9" +reset_daemon = "0.5.2" re_set-lib = "0.7.9" adw = { version = "0.5.3", package = "libadwaita", features = ["v1_4"] } dbus = "0.9.7" diff --git a/flatpak/build.sh b/flatpak/build.sh index 45426b3..f0e52c7 100755 --- a/flatpak/build.sh +++ b/flatpak/build.sh @@ -1,5 +1,5 @@ #! /bin/bash 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-bundle export reset.flatpak org.xetibo.ReSet +flatpak build-bundle export reset.flatpak org.Xetibo.ReSet diff --git a/flatpak/cargo-sources.json b/flatpak/cargo-sources.json index 7eabfb8..6f0eb3e 100644 --- a/flatpak/cargo-sources.json +++ b/flatpak/cargo-sources.json @@ -457,14 +457,14 @@ { "type": "archive", "archive-type": "tar-gzip", - "url": "https://static.crates.io/crates/glib/glib-0.18.3.crate", - "sha256": "58cf801b6f7829fa76db37449ab67c9c98a2b1bf21076d9113225621e61a0fa6", - "dest": "cargo/vendor/glib-0.18.3" + "url": "https://static.crates.io/crates/glib/glib-0.18.4.crate", + "sha256": "951bbd7fdc5c044ede9f05170f05a3ae9479239c3afdfe2d22d537a3add15c4e", + "dest": "cargo/vendor/glib-0.18.4" }, { "type": "inline", - "contents": "{\"package\": \"58cf801b6f7829fa76db37449ab67c9c98a2b1bf21076d9113225621e61a0fa6\", \"files\": {}}", - "dest": "cargo/vendor/glib-0.18.3", + "contents": "{\"package\": \"951bbd7fdc5c044ede9f05170f05a3ae9479239c3afdfe2d22d537a3add15c4e\", \"files\": {}}", + "dest": "cargo/vendor/glib-0.18.4", "dest-filename": ".cargo-checksum.json" }, { @@ -808,14 +808,14 @@ { "type": "archive", "archive-type": "tar-gzip", - "url": "https://static.crates.io/crates/mio/mio-0.8.10.crate", - "sha256": "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09", - "dest": "cargo/vendor/mio-0.8.10" + "url": "https://static.crates.io/crates/mio/mio-0.8.9.crate", + "sha256": "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0", + "dest": "cargo/vendor/mio-0.8.9" }, { "type": "inline", - "contents": "{\"package\": \"8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09\", \"files\": {}}", - "dest": "cargo/vendor/mio-0.8.10", + "contents": "{\"package\": \"3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0\", \"files\": {}}", + "dest": "cargo/vendor/mio-0.8.9", "dest-filename": ".cargo-checksum.json" }, { @@ -873,14 +873,14 @@ { "type": "archive", "archive-type": "tar-gzip", - "url": "https://static.crates.io/crates/once_cell/once_cell-1.19.0.crate", - "sha256": "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92", - "dest": "cargo/vendor/once_cell-1.19.0" + "url": "https://static.crates.io/crates/once_cell/once_cell-1.18.0.crate", + "sha256": "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d", + "dest": "cargo/vendor/once_cell-1.18.0" }, { "type": "inline", - "contents": "{\"package\": \"3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92\", \"files\": {}}", - "dest": "cargo/vendor/once_cell-1.19.0", + "contents": "{\"package\": \"dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d\", \"files\": {}}", + "dest": "cargo/vendor/once_cell-1.18.0", "dest-filename": ".cargo-checksum.json" }, { @@ -964,14 +964,14 @@ { "type": "archive", "archive-type": "tar-gzip", - "url": "https://static.crates.io/crates/proc-macro-crate/proc-macro-crate-2.0.1.crate", - "sha256": "97dc5fea232fc28d2f597b37c4876b348a40e33f3b02cc975c8d006d78d94b1a", - "dest": "cargo/vendor/proc-macro-crate-2.0.1" + "url": "https://static.crates.io/crates/proc-macro-crate/proc-macro-crate-2.0.0.crate", + "sha256": "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8", + "dest": "cargo/vendor/proc-macro-crate-2.0.0" }, { "type": "inline", - "contents": "{\"package\": \"97dc5fea232fc28d2f597b37c4876b348a40e33f3b02cc975c8d006d78d94b1a\", \"files\": {}}", - "dest": "cargo/vendor/proc-macro-crate-2.0.1", + "contents": "{\"package\": \"7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8\", \"files\": {}}", + "dest": "cargo/vendor/proc-macro-crate-2.0.0", "dest-filename": ".cargo-checksum.json" }, { @@ -1029,14 +1029,14 @@ { "type": "archive", "archive-type": "tar-gzip", - "url": "https://static.crates.io/crates/re_set-lib/re_set-lib-0.6.5.crate", - "sha256": "56e82abb32ee1fc61de5bea404bf768eaee4bc349f47a42fa1d303710efabb98", - "dest": "cargo/vendor/re_set-lib-0.6.5" + "url": "https://static.crates.io/crates/re_set-lib/re_set-lib-0.7.9.crate", + "sha256": "6b3393da22503efafbc751b28385c85a9cc1bfa06370c1f6e5796a127946a651", + "dest": "cargo/vendor/re_set-lib-0.7.9" }, { "type": "inline", - "contents": "{\"package\": \"56e82abb32ee1fc61de5bea404bf768eaee4bc349f47a42fa1d303710efabb98\", \"files\": {}}", - "dest": "cargo/vendor/re_set-lib-0.6.5", + "contents": "{\"package\": \"6b3393da22503efafbc751b28385c85a9cc1bfa06370c1f6e5796a127946a651\", \"files\": {}}", + "dest": "cargo/vendor/re_set-lib-0.7.9", "dest-filename": ".cargo-checksum.json" }, { @@ -1068,14 +1068,14 @@ { "type": "archive", "archive-type": "tar-gzip", - "url": "https://static.crates.io/crates/reset_daemon/reset_daemon-0.4.6.crate", - "sha256": "b1c708537cf84c4e8af54deeb23b12d7747ef652e91a07e80d3bfedc45947393", - "dest": "cargo/vendor/reset_daemon-0.4.6" + "url": "https://static.crates.io/crates/reset_daemon/reset_daemon-0.5.1.crate", + "sha256": "7326eed336797a56223ae33fc5dc67de29001678a933ba34c5e01c3bdf00be2b", + "dest": "cargo/vendor/reset_daemon-0.5.1" }, { "type": "inline", - "contents": "{\"package\": \"b1c708537cf84c4e8af54deeb23b12d7747ef652e91a07e80d3bfedc45947393\", \"files\": {}}", - "dest": "cargo/vendor/reset_daemon-0.4.6", + "contents": "{\"package\": \"7326eed336797a56223ae33fc5dc67de29001678a933ba34c5e01c3bdf00be2b\", \"files\": {}}", + "dest": "cargo/vendor/reset_daemon-0.5.1", "dest-filename": ".cargo-checksum.json" }, { @@ -1302,27 +1302,27 @@ { "type": "archive", "archive-type": "tar-gzip", - "url": "https://static.crates.io/crates/toml/toml-0.8.2.crate", - "sha256": "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d", - "dest": "cargo/vendor/toml-0.8.2" + "url": "https://static.crates.io/crates/toml/toml-0.8.8.crate", + "sha256": "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35", + "dest": "cargo/vendor/toml-0.8.8" }, { "type": "inline", - "contents": "{\"package\": \"185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d\", \"files\": {}}", - "dest": "cargo/vendor/toml-0.8.2", + "contents": "{\"package\": \"a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35\", \"files\": {}}", + "dest": "cargo/vendor/toml-0.8.8", "dest-filename": ".cargo-checksum.json" }, { "type": "archive", "archive-type": "tar-gzip", - "url": "https://static.crates.io/crates/toml_datetime/toml_datetime-0.6.3.crate", - "sha256": "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b", - "dest": "cargo/vendor/toml_datetime-0.6.3" + "url": "https://static.crates.io/crates/toml_datetime/toml_datetime-0.6.5.crate", + "sha256": "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1", + "dest": "cargo/vendor/toml_datetime-0.6.5" }, { "type": "inline", - "contents": "{\"package\": \"7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b\", \"files\": {}}", - "dest": "cargo/vendor/toml_datetime-0.6.3", + "contents": "{\"package\": \"3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1\", \"files\": {}}", + "dest": "cargo/vendor/toml_datetime-0.6.5", "dest-filename": ".cargo-checksum.json" }, { @@ -1341,14 +1341,27 @@ { "type": "archive", "archive-type": "tar-gzip", - "url": "https://static.crates.io/crates/toml_edit/toml_edit-0.20.2.crate", - "sha256": "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338", - "dest": "cargo/vendor/toml_edit-0.20.2" + "url": "https://static.crates.io/crates/toml_edit/toml_edit-0.20.7.crate", + "sha256": "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81", + "dest": "cargo/vendor/toml_edit-0.20.7" }, { "type": "inline", - "contents": "{\"package\": \"396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338\", \"files\": {}}", - "dest": "cargo/vendor/toml_edit-0.20.2", + "contents": "{\"package\": \"70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81\", \"files\": {}}", + "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" }, { @@ -1562,14 +1575,14 @@ { "type": "archive", "archive-type": "tar-gzip", - "url": "https://static.crates.io/crates/winnow/winnow-0.5.26.crate", - "sha256": "b67b5f0a4e7a27a64c651977932b9dc5667ca7fc31ac44b03ed37a0cf42fdfff", - "dest": "cargo/vendor/winnow-0.5.26" + "url": "https://static.crates.io/crates/winnow/winnow-0.5.19.crate", + "sha256": "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b", + "dest": "cargo/vendor/winnow-0.5.19" }, { "type": "inline", - "contents": "{\"package\": \"b67b5f0a4e7a27a64c651977932b9dc5667ca7fc31ac44b03ed37a0cf42fdfff\", \"files\": {}}", - "dest": "cargo/vendor/winnow-0.5.26", + "contents": "{\"package\": \"829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b\", \"files\": {}}", + "dest": "cargo/vendor/winnow-0.5.19", "dest-filename": ".cargo-checksum.json" }, { diff --git a/flatpak/org.xetibo.ReSet.desktop b/flatpak/org.Xetibo.ReSet.desktop similarity index 90% rename from flatpak/org.xetibo.ReSet.desktop rename to flatpak/org.Xetibo.ReSet.desktop index 66c6f12..2224aab 100644 --- a/flatpak/org.xetibo.ReSet.desktop +++ b/flatpak/org.Xetibo.ReSet.desktop @@ -6,6 +6,6 @@ Exec=reset Terminal=false Type=Application Keywords=settings;gtk; -Icon=org.xetibo.ReSet +Icon=org.Xetibo.ReSet Categories=Utility;GTK; StartupNotify=false diff --git a/flatpak/org.xetibo.ReSet.json b/flatpak/org.Xetibo.ReSet.json similarity index 74% rename from flatpak/org.xetibo.ReSet.json rename to flatpak/org.Xetibo.ReSet.json index 67aa329..75f7ee9 100644 --- a/flatpak/org.xetibo.ReSet.json +++ b/flatpak/org.Xetibo.ReSet.json @@ -1,5 +1,5 @@ { - "app-id": "org.xetibo.ReSet", + "app-id": "org.Xetibo.ReSet", "runtime": "org.gnome.Platform", "runtime-version": "45", "sdk": "org.gnome.Sdk", @@ -8,9 +8,11 @@ ], "command": "reset", "finish-args": [ - "--socket=session-bus", - "--socket=system-bus", + "--talk-name=org.Xetibo.ReSetDaemon", + "--system-talk-name=org.freedesktop.NetworkManager", + "--system-talk-name=org.bluez", "--socket=pulseaudio", + "--share=network", "--share=ipc", "--socket=fallback-x11", "--socket=wayland", @@ -34,8 +36,8 @@ "cargo --offline fetch --manifest-path Cargo.toml --verbose", "cargo --offline build --release --verbose", "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 ./flatpak/org.xetibo.ReSet.desktop /app/share/applications/org.xetibo.ReSet.desktop" + "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" ], "sources": [ { diff --git a/src/components/base/card_entry.rs b/src/components/base/card_entry.rs index 5f7f205..0c4068f 100644 --- a/src/components/base/card_entry.rs +++ b/src/components/base/card_entry.rs @@ -66,12 +66,12 @@ fn set_card_profile_of_device(device_index: u32, profile_name: String) -> bool { gio::spawn_blocking(move || { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org.Xetibo.ReSet.Daemon", Duration::from_millis(1000), ); let _: Result<(), Error> = proxy.method_call( - "org.Xetibo.ReSetAudio", + "org.Xetibo.ReSet.Audio", "SetCardProfileOfDevice", (device_index, profile_name), ); diff --git a/src/components/base/utils.rs b/src/components/base/utils.rs index 8a19bbb..ab71927 100644 --- a/src/components/base/utils.rs +++ b/src/components/base/utils.rs @@ -53,12 +53,12 @@ impl Listeners { thread::spawn(|| { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); 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 { 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 { @@ -118,7 +118,7 @@ impl arg::ReadAll for SinkChanged { impl dbus::message::SignalArgs for 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 { @@ -146,7 +146,7 @@ impl arg::ReadAll for SinkRemoved { impl dbus::message::SignalArgs for 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 { @@ -174,7 +174,7 @@ impl arg::ReadAll for InputStreamAdded { impl dbus::message::SignalArgs for 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 { @@ -202,7 +202,7 @@ impl arg::ReadAll for InputStreamChanged { impl dbus::message::SignalArgs for InputStreamChanged { const NAME: &'static str = "InputStreamChanged"; - const INTERFACE: &'static str = "org.Xetibo.ReSetAudio"; + const INTERFACE: &'static str = "org.Xetibo.ReSet.Audio"; } #[derive(Debug)] @@ -224,7 +224,7 @@ impl arg::ReadAll for InputStreamRemoved { impl dbus::message::SignalArgs for 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 { @@ -252,7 +252,7 @@ impl arg::ReadAll for SourceAdded { impl dbus::message::SignalArgs for 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 { @@ -280,7 +280,7 @@ impl arg::ReadAll for SourceChanged { impl dbus::message::SignalArgs for 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 { @@ -308,7 +308,7 @@ impl arg::ReadAll for SourceRemoved { impl dbus::message::SignalArgs for 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 { @@ -336,7 +336,7 @@ impl arg::ReadAll for OutputStreamAdded { impl dbus::message::SignalArgs for 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 { @@ -364,7 +364,7 @@ impl arg::ReadAll for OutputStreamChanged { impl dbus::message::SignalArgs for OutputStreamChanged { const NAME: &'static str = "OutputStreamChanged"; - const INTERFACE: &'static str = "org.Xetibo.ReSetAudio"; + const INTERFACE: &'static str = "org.Xetibo.ReSet.Audio"; } #[derive(Debug)] @@ -386,7 +386,7 @@ impl arg::ReadAll for OutputStreamRemoved { impl dbus::message::SignalArgs for 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 { @@ -431,19 +431,19 @@ pub fn start_audio_listener( fn start_dbus_audio_listener(conn: Connection) -> Connection { let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", 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 } fn stop_dbus_audio_listener(conn: Connection) { let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", 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", ()); } diff --git a/src/components/bluetooth/bluetooth_box.rs b/src/components/bluetooth/bluetooth_box.rs index 292e72b..8261bb5 100644 --- a/src/components/bluetooth/bluetooth_box.rs +++ b/src/components/bluetooth/bluetooth_box.rs @@ -123,6 +123,11 @@ pub fn populate_conntected_bluetooth_devices(bluetooth_box: Arc) { let list = imp.reset_model_list.write().unwrap(); let mut model_index = imp.reset_model_index.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 .replace(adapters.last().unwrap().clone()); for (index, adapter) in adapters.into_iter().enumerate() { @@ -204,25 +209,25 @@ pub fn start_bluetooth_listener(listeners: Arc, bluetooth_box: Arc = - proxy.method_call("org.Xetibo.ReSetBluetooth", "StartBluetoothListener", ()); + proxy.method_call("org.Xetibo.ReSet.Bluetooth", "StartBluetoothListener", ()); let device_added = BluetoothDeviceAdded::match_rule( - Some(&"org.Xetibo.ReSetDaemon".into()), - Some(&Path::from("/org/Xetibo/ReSetDaemon")), + Some(&"org.Xetibo.ReSet.Daemon".into()), + Some(&Path::from("/org/Xetibo/ReSet/Dameon")), ) .static_clone(); let device_removed = BluetoothDeviceRemoved::match_rule( - Some(&"org.Xetibo.ReSetDaemon".into()), - Some(&Path::from("/org/Xetibo/ReSetDaemon")), + Some(&"org.Xetibo.ReSet.Daemon".into()), + Some(&Path::from("/org/Xetibo/ReSet/Dameon")), ) .static_clone(); let device_changed = BluetoothDeviceChanged::match_rule( - Some(&"org.Xetibo.ReSetDaemon".into()), - Some(&Path::from("/org/Xetibo/ReSetDaemon")), + Some(&"org.Xetibo.ReSet.Daemon".into()), + Some(&Path::from("/org/Xetibo/ReSet/Dameon")), ) .static_clone(); let device_added_box = bluetooth_box.clone(); @@ -329,7 +334,7 @@ pub fn start_bluetooth_listener(listeners: Arc, bluetooth_box: Arc = - proxy.method_call("org.Xetibo.ReSetBluetooth", "StopBluetoothListener", ()); + proxy.method_call("org.Xetibo.ReSet.Bluetooth", "StopBluetoothListener", ()); break; } if listener_active && time.elapsed().unwrap() > Duration::from_millis(10000) { @@ -344,7 +349,7 @@ pub fn start_bluetooth_listener(listeners: Arc, bluetooth_box: Arc = - 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) { listeners @@ -352,7 +357,7 @@ pub fn start_bluetooth_listener(listeners: Arc, bluetooth_box: Arc = - proxy.method_call("org.Xetibo.ReSetBluetooth", "StartBluetoothListener", ()); + proxy.method_call("org.Xetibo.ReSet.Bluetooth", "StartBluetoothListener", ()); time = SystemTime::now(); } thread::sleep(Duration::from_millis(100)); @@ -363,12 +368,12 @@ pub fn start_bluetooth_listener(listeners: Arc, bluetooth_box: Arc Vec { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Dameon", Duration::from_millis(1000), ); let res: Result<(Vec,), Error> = proxy.method_call( - "org.Xetibo.ReSetBluetooth", + "org.Xetibo.ReSet.Bluetooth", "GetConnectedBluetoothDevices", (), ); @@ -381,12 +386,12 @@ fn get_connected_devices() -> Vec { fn get_bluetooth_adapters() -> Vec { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Dameon", Duration::from_millis(1000), ); let res: Result<(Vec,), Error> = - proxy.method_call("org.Xetibo.ReSetBluetooth", "GetBluetoothAdapters", ()); + proxy.method_call("org.Xetibo.ReSet.Bluetooth", "GetBluetoothAdapters", ()); if res.is_err() { return Vec::new(); } @@ -396,23 +401,23 @@ fn get_bluetooth_adapters() -> Vec { fn set_bluetooth_adapter(path: Path<'static>) { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Dameon", Duration::from_millis(1000), ); let _: Result<(Vec,), 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) { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Dameon", Duration::from_millis(1000), ); let _: Result<(bool,), Error> = proxy.method_call( - "org.Xetibo.ReSetBluetooth", + "org.Xetibo.ReSet.Bluetooth", "SetBluetoothAdapterDiscoverability", (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) { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Dameon", Duration::from_millis(1000), ); let _: Result<(bool,), Error> = proxy.method_call( - "org.Xetibo.ReSetBluetooth", + "org.Xetibo.ReSet.Bluetooth", "SetBluetoothAdapterPairability", (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) { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Dameon", Duration::from_millis(1000), ); let _: Result<(Vec,), Error> = proxy.method_call( - "org.Xetibo.ReSetBluetooth", + "org.Xetibo.ReSet.Bluetooth", "SetBluetoothAdapterEnabled", (path, enabled), ); diff --git a/src/components/bluetooth/bluetooth_entry.rs b/src/components/bluetooth/bluetooth_entry.rs index a095be5..298576f 100644 --- a/src/components/bluetooth/bluetooth_entry.rs +++ b/src/components/bluetooth/bluetooth_entry.rs @@ -87,12 +87,12 @@ fn connect_to_device(entry: Arc, path: Path<'static>) { gio::spawn_blocking(move || { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); let res: Result<(bool,), Error> = proxy.method_call( - "org.Xetibo.ReSetBluetooth", + "org.Xetibo.ReSet.Bluetooth", "ConnectToBluetoothDevice", (path,), ); @@ -118,12 +118,12 @@ fn connect_to_device(entry: Arc, path: Path<'static>) { // gio::spawn_blocking(move || { // let conn = Connection::new_session().unwrap(); // let proxy = conn.with_proxy( -// "org.Xetibo.ReSetDaemon", -// "/org/Xetibo/ReSetDaemon", +// "org.Xetibo.ReSet.Daemon", +// "/org/Xetibo/ReSet/Daemon", // Duration::from_millis(1000), // ); // let _: Result<(bool,), Error> = proxy.method_call( -// "org.Xetibo.ReSetBluetooth", +// "org.Xetibo.ReSet.Bluetooth", // "PairWithBluetoothDevice", // (path,), // ); @@ -134,12 +134,12 @@ fn disconnect_from_device(entry: Arc, path: Path<'static>) { gio::spawn_blocking(move || { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); let res: Result<(bool,), Error> = proxy.method_call( - "org.Xetibo.ReSetBluetooth", + "org.Xetibo.ReSet.Bluetooth", "DisconnectFromBluetoothDevice", (path,), ); @@ -164,11 +164,11 @@ 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", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); let _: Result<(bool,), Error> = - proxy.method_call("org.Xetibo.ReSetBluetooth", "RemoveDevicePairing", (path,)); + proxy.method_call("org.Xetibo.ReSet.Bluetooth", "RemoveDevicePairing", (path,)); }); } diff --git a/src/components/input/output_stream_entry.rs b/src/components/input/output_stream_entry.rs index 6ca3268..a3aaab8 100644 --- a/src/components/input/output_stream_entry.rs +++ b/src/components/input/output_stream_entry.rs @@ -134,12 +134,12 @@ fn set_outputstream_volume(value: f64, index: u32, channels: u16) -> bool { gio::spawn_blocking(move || { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); let _: Result<(), Error> = proxy.method_call( - "org.Xetibo.ReSetAudio", + "org.Xetibo.ReSet.Audio", "SetOutputStreamVolume", (index, channels, value as u32), ); @@ -155,12 +155,12 @@ fn toggle_output_stream_mute(index: u32, muted: bool) -> bool { gio::spawn_blocking(move || { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); let _: Result<(), Error> = proxy.method_call( - "org.Xetibo.ReSetAudio", + "org.Xetibo.ReSet.Audio", "SetOutputStreamMute", (index, muted), ); @@ -176,12 +176,12 @@ fn set_source_of_output_stream(stream: u32, source: u32) -> bool { gio::spawn_blocking(move || { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); let _: Result<(bool,), Error> = proxy.method_call( - "org.Xetibo.ReSetAudio", + "org.Xetibo.ReSet.Audio", "SetSourceOfOutputStream", (stream, source), ); diff --git a/src/components/input/source_box.rs b/src/components/input/source_box.rs index 6cbfd09..b1d2211 100644 --- a/src/components/input/source_box.rs +++ b/src/components/input/source_box.rs @@ -312,12 +312,12 @@ pub fn populate_cards(input_box: Arc) { fn get_output_streams() -> Vec { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); let res: Result<(Vec,), Error> = - proxy.method_call("org.Xetibo.ReSetAudio", "ListOutputStreams", ()); + proxy.method_call("org.Xetibo.ReSet.Audio", "ListOutputStreams", ()); if res.is_err() { return Vec::new(); } @@ -327,12 +327,12 @@ fn get_output_streams() -> Vec { fn get_sources() -> Vec { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); let res: Result<(Vec,), Error> = - proxy.method_call("org.Xetibo.ReSetAudio", "ListSources", ()); + proxy.method_call("org.Xetibo.ReSet.Audio", "ListSources", ()); if res.is_err() { return Vec::new(); } @@ -342,12 +342,12 @@ fn get_sources() -> Vec { fn get_cards() -> Vec { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); let res: Result<(Vec,), Error> = - proxy.method_call("org.Xetibo.ReSetAudio", "ListCards", ()); + proxy.method_call("org.Xetibo.ReSet.Audio", "ListCards", ()); if res.is_err() { return Vec::new(); } @@ -357,12 +357,12 @@ fn get_cards() -> Vec { fn get_default_source_name() -> String { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); let res: Result<(String,), Error> = - proxy.method_call("org.Xetibo.ReSetAudio", "GetDefaultSourceName", ()); + proxy.method_call("org.Xetibo.ReSet.Audio", "GetDefaultSourceName", ()); if res.is_err() { return String::from(""); } @@ -372,12 +372,12 @@ fn get_default_source_name() -> String { fn get_default_source() -> Source { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); let res: Result<(Source,), Error> = - proxy.method_call("org.Xetibo.ReSetAudio", "GetDefaultSource", ()); + proxy.method_call("org.Xetibo.ReSet.Audio", "GetDefaultSource", ()); if res.is_err() { return Source::default(); } @@ -386,33 +386,33 @@ fn get_default_source() -> Source { pub fn start_input_box_listener(conn: Connection, source_box: Arc) -> Connection { let source_added = SourceAdded::match_rule( - Some(&"org.Xetibo.ReSetDaemon".into()), - Some(&Path::from("/org/Xetibo/ReSetDaemon")), + Some(&"org.Xetibo.ReSet.Daemon".into()), + Some(&Path::from("/org/Xetibo/ReSet/Daemon")), ) .static_clone(); let source_removed = SourceRemoved::match_rule( - Some(&"org.Xetibo.ReSetDaemon".into()), - Some(&Path::from("/org/Xetibo/ReSetDaemon")), + Some(&"org.Xetibo.ReSet.Daemon".into()), + Some(&Path::from("/org/Xetibo/ReSet/Daemon")), ) .static_clone(); let source_changed = SourceChanged::match_rule( - Some(&"org.Xetibo.ReSetDaemon".into()), - Some(&Path::from("/org/Xetibo/ReSetDaemon")), + Some(&"org.Xetibo.ReSet.Daemon".into()), + Some(&Path::from("/org/Xetibo/ReSet/Daemon")), ) .static_clone(); let output_stream_added = OutputStreamAdded::match_rule( - Some(&"org.Xetibo.ReSetDaemon".into()), - Some(&Path::from("/org/Xetibo/ReSetDaemon")), + Some(&"org.Xetibo.ReSet.Daemon".into()), + Some(&Path::from("/org/Xetibo/ReSet/Daemon")), ) .static_clone(); let output_stream_removed = OutputStreamRemoved::match_rule( - Some(&"org.Xetibo.ReSetDaemon".into()), - Some(&Path::from("/org/Xetibo/ReSetDaemon")), + Some(&"org.Xetibo.ReSet.Daemon".into()), + Some(&Path::from("/org/Xetibo/ReSet/Daemon")), ) .static_clone(); let output_stream_changed = OutputStreamChanged::match_rule( - Some(&"org.Xetibo.ReSetDaemon".into()), - Some(&Path::from("/org/Xetibo/ReSetDaemon")), + Some(&"org.Xetibo.ReSet.Daemon".into()), + Some(&Path::from("/org/Xetibo/ReSet/Daemon")), ) .static_clone(); diff --git a/src/components/input/source_entry.rs b/src/components/input/source_entry.rs index 60a51e2..1edea34 100644 --- a/src/components/input/source_entry.rs +++ b/src/components/input/source_entry.rs @@ -105,12 +105,12 @@ pub fn set_source_volume(value: f64, index: u32, channels: u16) -> bool { gio::spawn_blocking(move || { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); let _: Result<(), Error> = proxy.method_call( - "org.Xetibo.ReSetAudio", + "org.Xetibo.ReSet.Audio", "SetSourceVolume", (index, channels, value as u32), ); @@ -126,12 +126,12 @@ pub fn toggle_source_mute(index: u32, muted: bool) -> bool { gio::spawn_blocking(move || { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); 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() { // return false; // } @@ -143,12 +143,12 @@ pub fn toggle_source_mute(index: u32, muted: bool) -> bool { pub fn set_default_source(name: Arc) -> Option { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); let res: Result<(Source,), Error> = proxy.method_call( - "org.Xetibo.ReSetAudio", + "org.Xetibo.ReSet.Audio", "SetDefaultSource", (name.as_str(),), ); diff --git a/src/components/output/input_stream_entry.rs b/src/components/output/input_stream_entry.rs index f9c9b5c..e06e0a6 100644 --- a/src/components/output/input_stream_entry.rs +++ b/src/components/output/input_stream_entry.rs @@ -161,12 +161,12 @@ fn set_inputstream_volume(value: f64, index: u32, channels: u16) -> bool { gio::spawn_blocking(move || { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); let _: Result<(), Error> = proxy.method_call( - "org.Xetibo.ReSetAudio", + "org.Xetibo.ReSet.Audio", "SetInputStreamVolume", (index, channels, value as u32), ); @@ -182,12 +182,12 @@ fn toggle_input_stream_mute(index: u32, muted: bool) -> bool { gio::spawn_blocking(move || { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); let _: Result<(), Error> = proxy.method_call( - "org.Xetibo.ReSetAudio", + "org.Xetibo.ReSet.Audio", "SetInputStreamMute", (index, muted), ); @@ -203,12 +203,12 @@ fn set_sink_of_input_stream(stream: u32, sink: u32) -> bool { gio::spawn_blocking(move || { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); let _: Result<(), Error> = proxy.method_call( - "org.Xetibo.ReSetAudio", + "org.Xetibo.ReSet.Audio", "SetSinkOfInputStream", (stream, sink), ); diff --git a/src/components/output/sink_box.rs b/src/components/output/sink_box.rs index 1729295..5ae7ee9 100644 --- a/src/components/output/sink_box.rs +++ b/src/components/output/sink_box.rs @@ -310,12 +310,12 @@ pub fn populate_cards(output_box: Arc) { fn get_input_streams() -> Vec { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); let res: Result<(Vec,), Error> = - proxy.method_call("org.Xetibo.ReSetAudio", "ListInputStreams", ()); + proxy.method_call("org.Xetibo.ReSet.Audio", "ListInputStreams", ()); if res.is_err() { return Vec::new(); } @@ -325,12 +325,12 @@ fn get_input_streams() -> Vec { fn get_sinks() -> Vec { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); let res: Result<(Vec,), Error> = - proxy.method_call("org.Xetibo.ReSetAudio", "ListSinks", ()); + proxy.method_call("org.Xetibo.ReSet.Audio", "ListSinks", ()); if res.is_err() { return Vec::new(); } @@ -340,12 +340,12 @@ fn get_sinks() -> Vec { fn get_cards() -> Vec { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); let res: Result<(Vec,), Error> = - proxy.method_call("org.Xetibo.ReSetAudio", "ListCards", ()); + proxy.method_call("org.Xetibo.ReSet.Audio", "ListCards", ()); if res.is_err() { return Vec::new(); } @@ -355,12 +355,12 @@ fn get_cards() -> Vec { fn get_default_sink_name() -> String { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); let res: Result<(String,), Error> = - proxy.method_call("org.Xetibo.ReSetAudio", "GetDefaultSinkName", ()); + proxy.method_call("org.Xetibo.ReSet.Audio", "GetDefaultSinkName", ()); if res.is_err() { return String::from(""); } @@ -370,12 +370,12 @@ fn get_default_sink_name() -> String { fn get_default_sink() -> Sink { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); let res: Result<(Sink,), Error> = - proxy.method_call("org.Xetibo.ReSetAudio", "GetDefaultSink", ()); + proxy.method_call("org.Xetibo.ReSet.Audio", "GetDefaultSink", ()); if res.is_err() { return Sink::default(); } @@ -384,33 +384,33 @@ fn get_default_sink() -> Sink { pub fn start_output_box_listener(conn: Connection, sink_box: Arc) -> Connection { let sink_added = SinkAdded::match_rule( - Some(&"org.Xetibo.ReSetDaemon".into()), - Some(&Path::from("/org/Xetibo/ReSetDaemon")), + Some(&"org.Xetibo.ReSet.Daemon".into()), + Some(&Path::from("/org/Xetibo/ReSet/Daemon")), ) .static_clone(); let sink_removed = SinkRemoved::match_rule( - Some(&"org.Xetibo.ReSetDaemon".into()), - Some(&Path::from("/org/Xetibo/ReSetDaemon")), + Some(&"org.Xetibo.ReSet.Daemon".into()), + Some(&Path::from("/org/Xetibo/ReSet/Daemon")), ) .static_clone(); let sink_changed = SinkChanged::match_rule( - Some(&"org.Xetibo.ReSetDaemon".into()), - Some(&Path::from("/org/Xetibo/ReSetDaemon")), + Some(&"org.Xetibo.ReSet.Daemon".into()), + Some(&Path::from("/org/Xetibo/ReSet/Daemon")), ) .static_clone(); let input_stream_added = InputStreamAdded::match_rule( - Some(&"org.Xetibo.ReSetDaemon".into()), - Some(&Path::from("/org/Xetibo/ReSetDaemon")), + Some(&"org.Xetibo.ReSet.Daemon".into()), + Some(&Path::from("/org/Xetibo/ReSet/Daemon")), ) .static_clone(); let input_stream_removed = InputStreamRemoved::match_rule( - Some(&"org.Xetibo.ReSetDaemon".into()), - Some(&Path::from("/org/Xetibo/ReSetDaemon")), + Some(&"org.Xetibo.ReSet.Daemon".into()), + Some(&Path::from("/org/Xetibo/ReSet/Daemon")), ) .static_clone(); let input_stream_changed = InputStreamChanged::match_rule( - Some(&"org.Xetibo.ReSetDaemon".into()), - Some(&Path::from("/org/Xetibo/ReSetDaemon")), + Some(&"org.Xetibo.ReSet.Daemon".into()), + Some(&Path::from("/org/Xetibo/ReSet/Daemon")), ) .static_clone(); diff --git a/src/components/output/sink_entry.rs b/src/components/output/sink_entry.rs index aa09a17..9c883d2 100644 --- a/src/components/output/sink_entry.rs +++ b/src/components/output/sink_entry.rs @@ -103,12 +103,12 @@ pub fn set_sink_volume(value: f64, index: u32, channels: u16) -> bool { gio::spawn_blocking(move || { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); let _: Result<(), Error> = proxy.method_call( - "org.Xetibo.ReSetAudio", + "org.Xetibo.ReSet.Audio", "SetSinkVolume", (index, channels, value as u32), ); @@ -124,12 +124,12 @@ pub fn toggle_sink_mute(index: u32, muted: bool) -> bool { gio::spawn_blocking(move || { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); 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() { // return false; // } @@ -141,12 +141,12 @@ pub fn toggle_sink_mute(index: u32, muted: bool) -> bool { pub fn set_default_sink(name: Arc) -> Option { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); 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() { return None; } diff --git a/src/components/wifi/saved_wifi_entry.rs b/src/components/wifi/saved_wifi_entry.rs index 7b78a25..ec5eacb 100644 --- a/src/components/wifi/saved_wifi_entry.rs +++ b/src/components/wifi/saved_wifi_entry.rs @@ -66,11 +66,11 @@ fn delete_connection(path: Path<'static>) { gio::spawn_blocking(move || { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); let _: Result<(), Error> = - proxy.method_call("org.Xetibo.ReSetWireless", "DeleteConnection", (path,)); + proxy.method_call("org.Xetibo.ReSet.Wireless", "DeleteConnection", (path,)); }); } diff --git a/src/components/wifi/utils.rs b/src/components/wifi/utils.rs index 883bec1..eda4767 100644 --- a/src/components/wifi/utils.rs +++ b/src/components/wifi/utils.rs @@ -19,12 +19,12 @@ type ResultType = pub fn get_connection_settings(path: Path<'static>) -> ResetConnection { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); let res: ResultType = - proxy.method_call("org.Xetibo.ReSetWireless", "GetConnectionSettings", (path,)); + proxy.method_call("org.Xetibo.ReSet.Wireless", "GetConnectionSettings", (path,)); if res.is_err() { ResetConnection::default(); } diff --git a/src/components/wifi/wifi_box.rs b/src/components/wifi/wifi_box.rs index 7c958d0..bca9f2b 100644 --- a/src/components/wifi/wifi_box.rs +++ b/src/components/wifi/wifi_box.rs @@ -103,6 +103,11 @@ pub fn scan_for_wifi(wifi_box: Arc) { let list = imp.reset_model_list.write().unwrap(); let mut model_index = imp.reset_model_index.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 .replace(devices.last().unwrap().clone()); for (index, device) in devices.into_iter().enumerate() { @@ -188,23 +193,23 @@ pub fn show_stored_connections(wifi_box: Arc) { pub fn dbus_start_network_events() { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); let _: Result<(), Error> = - proxy.method_call("org.Xetibo.ReSetWireless", "StartNetworkListener", ()); + proxy.method_call("org.Xetibo.ReSet.Wireless", "StartNetworkListener", ()); } pub fn get_access_points() -> Vec { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); let res: Result<(Vec,), Error> = - proxy.method_call("org.Xetibo.ReSetWireless", "ListAccessPoints", ()); + proxy.method_call("org.Xetibo.ReSet.Wireless", "ListAccessPoints", ()); if res.is_err() { return Vec::new(); } @@ -215,23 +220,23 @@ pub fn get_access_points() -> Vec { pub fn set_wifi_device(path: Path<'static>) { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); 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 { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); let res: Result<(Vec,), Error> = - proxy.method_call("org.Xetibo.ReSetWireless", "GetAllWifiDevices", ()); + proxy.method_call("org.Xetibo.ReSet.Wireless", "GetAllWifiDevices", ()); if res.is_err() { return Vec::new(); } @@ -242,12 +247,12 @@ pub fn get_wifi_devices() -> Vec { pub fn get_wifi_status() -> bool { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); let res: Result<(bool,), Error> = - proxy.method_call("org.Xetibo.ReSetWireless", "GetWifiStatus", ()); + proxy.method_call("org.Xetibo.ReSet.Wireless", "GetWifiStatus", ()); if res.is_err() { return false; } @@ -257,11 +262,12 @@ pub fn get_wifi_status() -> bool { pub fn get_stored_connections() -> Vec<(Path<'static>, Vec)> { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", 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() { return Vec::new(); } @@ -272,12 +278,12 @@ pub fn get_stored_connections() -> Vec<(Path<'static>, Vec)> { pub fn set_wifi_enabled(enabled: bool) { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); 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, wifi_box: Arc) { @@ -295,23 +301,23 @@ pub fn start_event_listener(listeners: Arc, wifi_box: Arc) { let changed_ref = wifi_box.clone(); let wifi_changed_ref = wifi_box.clone(); let access_point_added = AccessPointAdded::match_rule( - Some(&"org.Xetibo.ReSetDaemon".into()), - Some(&Path::from("/org/Xetibo/ReSetDaemon")), + Some(&"org.Xetibo.ReSet.Daemon".into()), + Some(&Path::from("/org/Xetibo/ReSet/Daemon")), ) .static_clone(); let access_point_removed = AccessPointRemoved::match_rule( - Some(&"org.Xetibo.ReSetDaemon".into()), - Some(&Path::from("/org/Xetibo/ReSetDaemon")), + Some(&"org.Xetibo.ReSet.Daemon".into()), + Some(&Path::from("/org/Xetibo/ReSet/Daemon")), ) .static_clone(); let access_point_changed = AccessPointChanged::match_rule( - Some(&"org.Xetibo.ReSetDaemon".into()), - Some(&Path::from("/org/Xetibo/ReSetDaemon")), + Some(&"org.Xetibo.ReSet.Daemon".into()), + Some(&Path::from("/org/Xetibo/ReSet/Daemon")), ) .static_clone(); let device_changed = WifiDeviceChanged::match_rule( - Some(&"org.Xetibo.ReSetDaemon".into()), - Some(&Path::from("/org/Xetibo/ReSetDaemon")), + Some(&"org.Xetibo.ReSet.Daemon".into()), + Some(&Path::from("/org/Xetibo/ReSet/Daemon")), ) .static_clone(); let res = conn.add_match(access_point_added, move |ir: AccessPointAdded, _, _| { diff --git a/src/components/wifi/wifi_entry.rs b/src/components/wifi/wifi_entry.rs index 5693e1c..030f13b 100644 --- a/src/components/wifi/wifi_entry.rs +++ b/src/components/wifi/wifi_entry.rs @@ -123,12 +123,12 @@ pub fn click_disconnect(entry: Arc) { let imp = entry_ref.imp(); let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(10000), ); let res: Result<(bool,), Error> = proxy.method_call( - "org.Xetibo.ReSetWireless", + "org.Xetibo.ReSet.Wireless", "DisconnectFromCurrentAccessPoint", (), ); @@ -154,12 +154,12 @@ pub fn click_stored_network(entry: Arc) { gio::spawn_blocking(move || { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(10000), ); let res: Result<(bool,), Error> = proxy.method_call( - "org.Xetibo.ReSetWireless", + "org.Xetibo.ReSet.Wireless", "ConnectToKnownAccessPoint", (access_point,), ); @@ -197,12 +197,12 @@ pub fn click_new_network(entry: Arc) { gio::spawn_blocking(move || { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(10000), ); let res: Result<(bool,), Error> = proxy.method_call( - "org.Xetibo.ReSetWireless", + "org.Xetibo.ReSet.Wireless", "ConnectToNewAccessPoint", (access_point, password), ); diff --git a/src/components/wifi/wifi_options.rs b/src/components/wifi/wifi_options.rs index b0063a7..14429e9 100644 --- a/src/components/wifi/wifi_options.rs +++ b/src/components/wifi/wifi_options.rs @@ -389,12 +389,12 @@ fn set_connection_settings(path: Path<'static>, prop: HashMap) gio::spawn_blocking(move || { let conn = dbus::blocking::Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(1000), ); let _: Result<(bool,), Error> = proxy.method_call( - "org.Xetibo.ReSetWireless", + "org.Xetibo.ReSet.Wireless", "SetConnectionSettings", (path, prop), ); diff --git a/src/main.rs b/src/main.rs index 3a3efe2..1ff8138 100644 --- a/src/main.rs +++ b/src/main.rs @@ -53,12 +53,12 @@ fn shutdown(_: &Application) { thread::spawn(|| { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(100), ); let res: Result<(), Error> = - proxy.method_call("org.Xetibo.ReSetDaemon", "UnregisterClient", ("ReSet",)); + proxy.method_call("org.Xetibo.ReSet.Daemon", "UnregisterClient", ("ReSet",)); res }); } @@ -67,16 +67,16 @@ async fn daemon_check() { let handle = thread::spawn(|| { let conn = Connection::new_session().unwrap(); let proxy = conn.with_proxy( - "org.Xetibo.ReSetDaemon", - "/org/Xetibo/ReSetDaemon", + "org.Xetibo.ReSet.Daemon", + "/org/Xetibo/ReSet/Daemon", Duration::from_millis(100), ); let res: Result<(), Error> = - proxy.method_call("org.Xetibo.ReSetDaemon", "RegisterClient", ("ReSet",)); + proxy.method_call("org.Xetibo.ReSet.Daemon", "RegisterClient", ("ReSet",)); res }); let res = handle.join(); if res.unwrap().is_err() { - run_daemon().await; + run_daemon(APP_ID).await; } }