Merge pull request #44 from Xetibo/dashie

Add Wifi integration
This commit is contained in:
takotori 2023-11-11 11:13:13 +01:00 committed by GitHub
commit 179a2b44cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 1011 additions and 99 deletions

View file

@ -5,9 +5,21 @@ edition = "2021"
description = "A wip universal Linux settings application."
[dependencies]
adw = { version = "0.5.3", package = "libadwaita", features = ["v1_4"]}
reset_daemon = "0.1.0"
ReSet-Lib = "0.2.3"
adw = { version = "0.5.3", package = "libadwaita", features = ["v1_4"] }
dbus = "0.9.7"
gtk = { version = "0.7.3", package = "gtk4", features = ["v4_12"]}
gtk = { version = "0.7.3", package = "gtk4", features = ["v4_12"] }
glib = "0.18.3"
tokio = { version = "1.33.0", features = [
"rt",
"time",
"net",
"macros",
"rt-multi-thread",
"sync",
] }
fork = "0.1.22"
[build-dependencies]
glib-build-tools = "0.18.0"

View file

@ -1,4 +1,43 @@
[
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/ReSet-Lib/ReSet-Lib-0.2.3.crate",
"sha256": "3e3ef13734e2a2324ffed82ac9b24acab15306c2de644ac649d1ae3a16be0960",
"dest": "cargo/vendor/ReSet-Lib-0.2.3"
},
{
"type": "inline",
"contents": "{\"package\": \"3e3ef13734e2a2324ffed82ac9b24acab15306c2de644ac649d1ae3a16be0960\", \"files\": {}}",
"dest": "cargo/vendor/ReSet-Lib-0.2.3",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/addr2line/addr2line-0.21.0.crate",
"sha256": "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb",
"dest": "cargo/vendor/addr2line-0.21.0"
},
{
"type": "inline",
"contents": "{\"package\": \"8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb\", \"files\": {}}",
"dest": "cargo/vendor/addr2line-0.21.0",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/adler/adler-1.0.2.crate",
"sha256": "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe",
"dest": "cargo/vendor/adler-1.0.2"
},
{
"type": "inline",
"contents": "{\"package\": \"f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe\", \"files\": {}}",
"dest": "cargo/vendor/adler-1.0.2",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
@ -25,6 +64,32 @@
"dest": "cargo/vendor/autocfg-1.1.0",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/backtrace/backtrace-0.3.69.crate",
"sha256": "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837",
"dest": "cargo/vendor/backtrace-0.3.69"
},
{
"type": "inline",
"contents": "{\"package\": \"2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837\", \"files\": {}}",
"dest": "cargo/vendor/backtrace-0.3.69",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/bitflags/bitflags-1.3.2.crate",
"sha256": "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a",
"dest": "cargo/vendor/bitflags-1.3.2"
},
{
"type": "inline",
"contents": "{\"package\": \"bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a\", \"files\": {}}",
"dest": "cargo/vendor/bitflags-1.3.2",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
@ -64,6 +129,19 @@
"dest": "cargo/vendor/cairo-sys-rs-0.18.2",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/cc/cc-1.0.83.crate",
"sha256": "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0",
"dest": "cargo/vendor/cc-1.0.83"
},
{
"type": "inline",
"contents": "{\"package\": \"f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0\", \"files\": {}}",
"dest": "cargo/vendor/cc-1.0.83",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
@ -77,6 +155,19 @@
"dest": "cargo/vendor/cfg-expr-0.15.5",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/cfg-if/cfg-if-1.0.0.crate",
"sha256": "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd",
"dest": "cargo/vendor/cfg-if-1.0.0"
},
{
"type": "inline",
"contents": "{\"package\": \"baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd\", \"files\": {}}",
"dest": "cargo/vendor/cfg-if-1.0.0",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
@ -90,6 +181,58 @@
"dest": "cargo/vendor/dbus-0.9.7",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/dbus-crossroads/dbus-crossroads-0.5.2.crate",
"sha256": "3a4c83437187544ba5142427746835061b330446ca8902eabd70e4afb8f76de0",
"dest": "cargo/vendor/dbus-crossroads-0.5.2"
},
{
"type": "inline",
"contents": "{\"package\": \"3a4c83437187544ba5142427746835061b330446ca8902eabd70e4afb8f76de0\", \"files\": {}}",
"dest": "cargo/vendor/dbus-crossroads-0.5.2",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/dbus-tokio/dbus-tokio-0.7.6.crate",
"sha256": "007688d459bc677131c063a3a77fb899526e17b7980f390b69644bdbc41fad13",
"dest": "cargo/vendor/dbus-tokio-0.7.6"
},
{
"type": "inline",
"contents": "{\"package\": \"007688d459bc677131c063a3a77fb899526e17b7980f390b69644bdbc41fad13\", \"files\": {}}",
"dest": "cargo/vendor/dbus-tokio-0.7.6",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/directories-next/directories-next-2.0.0.crate",
"sha256": "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc",
"dest": "cargo/vendor/directories-next-2.0.0"
},
{
"type": "inline",
"contents": "{\"package\": \"339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc\", \"files\": {}}",
"dest": "cargo/vendor/directories-next-2.0.0",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/dirs-sys-next/dirs-sys-next-0.1.2.crate",
"sha256": "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d",
"dest": "cargo/vendor/dirs-sys-next-0.1.2"
},
{
"type": "inline",
"contents": "{\"package\": \"4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d\", \"files\": {}}",
"dest": "cargo/vendor/dirs-sys-next-0.1.2",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
@ -116,6 +259,19 @@
"dest": "cargo/vendor/field-offset-0.3.6",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/fork/fork-0.1.22.crate",
"sha256": "bf2ca97a59201425e7ee4d197c9c4fea282fe87a97d666a580bda889b95b8e88",
"dest": "cargo/vendor/fork-0.1.22"
},
{
"type": "inline",
"contents": "{\"package\": \"bf2ca97a59201425e7ee4d197c9c4fea282fe87a97d666a580bda889b95b8e88\", \"files\": {}}",
"dest": "cargo/vendor/fork-0.1.22",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
@ -259,6 +415,32 @@
"dest": "cargo/vendor/gdk4-sys-0.7.2",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/getrandom/getrandom-0.2.11.crate",
"sha256": "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f",
"dest": "cargo/vendor/getrandom-0.2.11"
},
{
"type": "inline",
"contents": "{\"package\": \"fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f\", \"files\": {}}",
"dest": "cargo/vendor/getrandom-0.2.11",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/gimli/gimli-0.28.0.crate",
"sha256": "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0",
"dest": "cargo/vendor/gimli-0.28.0"
},
{
"type": "inline",
"contents": "{\"package\": \"6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0\", \"files\": {}}",
"dest": "cargo/vendor/gimli-0.28.0",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
@ -288,14 +470,14 @@
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/glib/glib-0.18.2.crate",
"sha256": "1c316afb01ce8067c5eaab1fc4f2cd47dc21ce7b6296358605e2ffab23ccbd19",
"dest": "cargo/vendor/glib-0.18.2"
"url": "https://static.crates.io/crates/glib/glib-0.18.3.crate",
"sha256": "58cf801b6f7829fa76db37449ab67c9c98a2b1bf21076d9113225621e61a0fa6",
"dest": "cargo/vendor/glib-0.18.3"
},
{
"type": "inline",
"contents": "{\"package\": \"1c316afb01ce8067c5eaab1fc4f2cd47dc21ce7b6296358605e2ffab23ccbd19\", \"files\": {}}",
"dest": "cargo/vendor/glib-0.18.2",
"contents": "{\"package\": \"58cf801b6f7829fa76db37449ab67c9c98a2b1bf21076d9113225621e61a0fa6\", \"files\": {}}",
"dest": "cargo/vendor/glib-0.18.3",
"dest-filename": ".cargo-checksum.json"
},
{
@ -467,6 +649,19 @@
"dest": "cargo/vendor/heck-0.4.1",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/hermit-abi/hermit-abi-0.3.3.crate",
"sha256": "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7",
"dest": "cargo/vendor/hermit-abi-0.3.3"
},
{
"type": "inline",
"contents": "{\"package\": \"d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7\", \"files\": {}}",
"dest": "cargo/vendor/hermit-abi-0.3.3",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
@ -532,6 +727,45 @@
"dest": "cargo/vendor/libdbus-sys-0.2.5",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/libpulse-binding/libpulse-binding-2.28.1.crate",
"sha256": "ed3557a2dfc380c8f061189a01c6ae7348354e0c9886038dc6c171219c08eaff",
"dest": "cargo/vendor/libpulse-binding-2.28.1"
},
{
"type": "inline",
"contents": "{\"package\": \"ed3557a2dfc380c8f061189a01c6ae7348354e0c9886038dc6c171219c08eaff\", \"files\": {}}",
"dest": "cargo/vendor/libpulse-binding-2.28.1",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/libpulse-sys/libpulse-sys-1.21.0.crate",
"sha256": "bc19e110fbf42c17260d30f6d3dc545f58491c7830d38ecb9aaca96e26067a9b",
"dest": "cargo/vendor/libpulse-sys-1.21.0"
},
{
"type": "inline",
"contents": "{\"package\": \"bc19e110fbf42c17260d30f6d3dc545f58491c7830d38ecb9aaca96e26067a9b\", \"files\": {}}",
"dest": "cargo/vendor/libpulse-sys-1.21.0",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/libredox/libredox-0.0.1.crate",
"sha256": "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8",
"dest": "cargo/vendor/libredox-0.0.1"
},
{
"type": "inline",
"contents": "{\"package\": \"85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8\", \"files\": {}}",
"dest": "cargo/vendor/libredox-0.0.1",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
@ -558,6 +792,84 @@
"dest": "cargo/vendor/memoffset-0.9.0",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/miniz_oxide/miniz_oxide-0.7.1.crate",
"sha256": "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7",
"dest": "cargo/vendor/miniz_oxide-0.7.1"
},
{
"type": "inline",
"contents": "{\"package\": \"e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7\", \"files\": {}}",
"dest": "cargo/vendor/miniz_oxide-0.7.1",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"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\": \"3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0\", \"files\": {}}",
"dest": "cargo/vendor/mio-0.8.9",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/num-derive/num-derive-0.3.3.crate",
"sha256": "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d",
"dest": "cargo/vendor/num-derive-0.3.3"
},
{
"type": "inline",
"contents": "{\"package\": \"876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d\", \"files\": {}}",
"dest": "cargo/vendor/num-derive-0.3.3",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/num-traits/num-traits-0.2.17.crate",
"sha256": "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c",
"dest": "cargo/vendor/num-traits-0.2.17"
},
{
"type": "inline",
"contents": "{\"package\": \"39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c\", \"files\": {}}",
"dest": "cargo/vendor/num-traits-0.2.17",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/num_cpus/num_cpus-1.16.0.crate",
"sha256": "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43",
"dest": "cargo/vendor/num_cpus-1.16.0"
},
{
"type": "inline",
"contents": "{\"package\": \"4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43\", \"files\": {}}",
"dest": "cargo/vendor/num_cpus-1.16.0",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/object/object-0.32.1.crate",
"sha256": "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0",
"dest": "cargo/vendor/object-0.32.1"
},
{
"type": "inline",
"contents": "{\"package\": \"9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0\", \"files\": {}}",
"dest": "cargo/vendor/object-0.32.1",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
@ -701,6 +1013,58 @@
"dest": "cargo/vendor/quote-1.0.33",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/redox_syscall/redox_syscall-0.4.1.crate",
"sha256": "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa",
"dest": "cargo/vendor/redox_syscall-0.4.1"
},
{
"type": "inline",
"contents": "{\"package\": \"4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa\", \"files\": {}}",
"dest": "cargo/vendor/redox_syscall-0.4.1",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/redox_users/redox_users-0.4.4.crate",
"sha256": "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4",
"dest": "cargo/vendor/redox_users-0.4.4"
},
{
"type": "inline",
"contents": "{\"package\": \"a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4\", \"files\": {}}",
"dest": "cargo/vendor/redox_users-0.4.4",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/reset_daemon/reset_daemon-0.1.0.crate",
"sha256": "6c6c0fa05313f248b7283c371f1aa7eced0421a6dbeaf4aef0db3f291a75bec1",
"dest": "cargo/vendor/reset_daemon-0.1.0"
},
{
"type": "inline",
"contents": "{\"package\": \"6c6c0fa05313f248b7283c371f1aa7eced0421a6dbeaf4aef0db3f291a75bec1\", \"files\": {}}",
"dest": "cargo/vendor/reset_daemon-0.1.0",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/rustc-demangle/rustc-demangle-0.1.23.crate",
"sha256": "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76",
"dest": "cargo/vendor/rustc-demangle-0.1.23"
},
{
"type": "inline",
"contents": "{\"package\": \"d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76\", \"files\": {}}",
"dest": "cargo/vendor/rustc-demangle-0.1.23",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
@ -792,6 +1156,19 @@
"dest": "cargo/vendor/smallvec-1.11.1",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/socket2/socket2-0.5.5.crate",
"sha256": "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9",
"dest": "cargo/vendor/socket2-0.5.5"
},
{
"type": "inline",
"contents": "{\"package\": \"7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9\", \"files\": {}}",
"dest": "cargo/vendor/socket2-0.5.5",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
@ -870,6 +1247,32 @@
"dest": "cargo/vendor/thiserror-impl-1.0.49",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/tokio/tokio-1.34.0.crate",
"sha256": "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9",
"dest": "cargo/vendor/tokio-1.34.0"
},
{
"type": "inline",
"contents": "{\"package\": \"d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9\", \"files\": {}}",
"dest": "cargo/vendor/tokio-1.34.0",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/tokio-macros/tokio-macros-2.2.0.crate",
"sha256": "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b",
"dest": "cargo/vendor/tokio-macros-2.2.0"
},
{
"type": "inline",
"contents": "{\"package\": \"5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b\", \"files\": {}}",
"dest": "cargo/vendor/tokio-macros-2.2.0",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
@ -961,6 +1364,19 @@
"dest": "cargo/vendor/version_check-0.9.4",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/wasi/wasi-0.11.0+wasi-snapshot-preview1.crate",
"sha256": "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423",
"dest": "cargo/vendor/wasi-0.11.0+wasi-snapshot-preview1"
},
{
"type": "inline",
"contents": "{\"package\": \"9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423\", \"files\": {}}",
"dest": "cargo/vendor/wasi-0.11.0+wasi-snapshot-preview1",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
@ -1000,6 +1416,123 @@
"dest": "cargo/vendor/winapi-x86_64-pc-windows-gnu-0.4.0",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/windows-sys/windows-sys-0.48.0.crate",
"sha256": "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9",
"dest": "cargo/vendor/windows-sys-0.48.0"
},
{
"type": "inline",
"contents": "{\"package\": \"677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9\", \"files\": {}}",
"dest": "cargo/vendor/windows-sys-0.48.0",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/windows-targets/windows-targets-0.48.5.crate",
"sha256": "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c",
"dest": "cargo/vendor/windows-targets-0.48.5"
},
{
"type": "inline",
"contents": "{\"package\": \"9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c\", \"files\": {}}",
"dest": "cargo/vendor/windows-targets-0.48.5",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/windows_aarch64_gnullvm/windows_aarch64_gnullvm-0.48.5.crate",
"sha256": "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8",
"dest": "cargo/vendor/windows_aarch64_gnullvm-0.48.5"
},
{
"type": "inline",
"contents": "{\"package\": \"2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8\", \"files\": {}}",
"dest": "cargo/vendor/windows_aarch64_gnullvm-0.48.5",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/windows_aarch64_msvc/windows_aarch64_msvc-0.48.5.crate",
"sha256": "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc",
"dest": "cargo/vendor/windows_aarch64_msvc-0.48.5"
},
{
"type": "inline",
"contents": "{\"package\": \"dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc\", \"files\": {}}",
"dest": "cargo/vendor/windows_aarch64_msvc-0.48.5",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/windows_i686_gnu/windows_i686_gnu-0.48.5.crate",
"sha256": "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e",
"dest": "cargo/vendor/windows_i686_gnu-0.48.5"
},
{
"type": "inline",
"contents": "{\"package\": \"a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e\", \"files\": {}}",
"dest": "cargo/vendor/windows_i686_gnu-0.48.5",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/windows_i686_msvc/windows_i686_msvc-0.48.5.crate",
"sha256": "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406",
"dest": "cargo/vendor/windows_i686_msvc-0.48.5"
},
{
"type": "inline",
"contents": "{\"package\": \"8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406\", \"files\": {}}",
"dest": "cargo/vendor/windows_i686_msvc-0.48.5",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/windows_x86_64_gnu/windows_x86_64_gnu-0.48.5.crate",
"sha256": "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e",
"dest": "cargo/vendor/windows_x86_64_gnu-0.48.5"
},
{
"type": "inline",
"contents": "{\"package\": \"53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e\", \"files\": {}}",
"dest": "cargo/vendor/windows_x86_64_gnu-0.48.5",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/windows_x86_64_gnullvm/windows_x86_64_gnullvm-0.48.5.crate",
"sha256": "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc",
"dest": "cargo/vendor/windows_x86_64_gnullvm-0.48.5"
},
{
"type": "inline",
"contents": "{\"package\": \"0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc\", \"files\": {}}",
"dest": "cargo/vendor/windows_x86_64_gnullvm-0.48.5",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",
"url": "https://static.crates.io/crates/windows_x86_64_msvc/windows_x86_64_msvc-0.48.5.crate",
"sha256": "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538",
"dest": "cargo/vendor/windows_x86_64_msvc-0.48.5"
},
{
"type": "inline",
"contents": "{\"package\": \"ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538\", \"files\": {}}",
"dest": "cargo/vendor/windows_x86_64_msvc-0.48.5",
"dest-filename": ".cargo-checksum.json"
},
{
"type": "archive",
"archive-type": "tar-gzip",

View file

@ -10,10 +10,13 @@ glib::wrapper! {
@implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Actionable;
}
unsafe impl Send for ListEntry {}
unsafe impl Sync for ListEntry {}
impl ListEntry {
pub fn new(child: &impl IsA<Widget>) -> Self {
let entry: ListEntry = Object::builder().build();
entry.set_child(Some(child));
entry
}
}
}

View file

@ -2,3 +2,5 @@ pub mod settingBox;
pub mod settingBoxImpl;
pub mod listEntry;
pub mod listEntryImpl;
pub mod popup;
pub mod popupImpl;

View file

@ -0,0 +1,19 @@
use adw::glib;
use adw::glib::{IsA, Object};
use gtk::Widget;
use super::popupImpl;
glib::wrapper! {
pub struct Popup(ObjectSubclass<popupImpl::Popup>)
@extends adw::Window, gtk::Widget,
@implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Orientable;
}
impl Popup {
pub fn new(child: &impl IsA<Widget>) -> Self {
let popup: Popup = Object::builder().build();
// popup.set_child(child);
popup
}
}

View file

@ -0,0 +1,41 @@
use adw::subclass::window::AdwWindowImpl;
use gtk::subclass::prelude::*;
use gtk::{glib, CompositeTemplate};
use super::popup;
#[allow(non_snake_case)]
#[derive(Default, CompositeTemplate)]
#[template(resource = "/org/Xetibo/ReSet/resetPopup.ui")]
pub struct Popup {}
#[glib::object_subclass]
impl ObjectSubclass for Popup {
const NAME: &'static str = "resetPopup";
type Type = popup::Popup;
type ParentType = adw::Window;
fn class_init(klass: &mut Self::Class) {
klass.bind_template();
}
fn instance_init(obj: &glib::subclass::InitializingObject<Self>) {
obj.init_template();
}
}
impl ObjectImpl for Popup {
fn constructed(&self) {
self.parent_constructed();
}
}
impl BoxImpl for Popup {}
impl WidgetImpl for Popup {}
impl AdwWindowImpl for Popup {}
impl WindowImpl for Popup {}
impl ApplicationWindowImpl for Popup {}

View file

@ -1,18 +1,25 @@
use std::sync::mpsc::{channel, Receiver, Sender};
use std::sync::{atomic::AtomicBool, Arc, Weak};
use std::thread;
use std::time::Duration;
use crate::components::base::listEntry::ListEntry;
use adw::glib;
use adw::glib::Object;
use adw::subclass::prelude::ObjectSubclassIsExt;
use dbus::blocking::Connection;
use dbus::Error;
use gtk::glib::Variant;
use dbus::Path;
use gtk::glib::{clone, Variant};
use gtk::prelude::ActionableExt;
use crate::components::base::listEntry::ListEntry;
use ReSet_Lib::network::network::{AccessPoint, WifiStrength};
use ReSet_Lib::signals::{
AccessPointAdded, AccessPointRemoved, BluetoothDeviceAdded, BluetoothDeviceRemoved,
};
use ReSet_Lib::utils::Events;
use crate::components::wifi::wifiBoxImpl;
use crate::components::wifi::wifiEntry::WifiEntry;
use crate::components::wifi::wifiEntryImpl::WifiStrength;
glib::wrapper! {
pub struct WifiBox(ObjectSubclass<wifiBoxImpl::WifiBox>)
@ -20,6 +27,9 @@ glib::wrapper! {
@implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Orientable;
}
unsafe impl Send for WifiBox {}
unsafe impl Sync for WifiBox {}
impl WifiBox {
pub fn new() -> Self {
Object::builder().build()
@ -28,21 +38,12 @@ impl WifiBox {
pub fn setupCallbacks(&self) {
let selfImp = self.imp();
selfImp.resetSavedNetworks.set_action_name(Some("navigation.push"));
selfImp.resetSavedNetworks.set_action_target_value(Some(&Variant::from("saved")));
}
pub fn scanForWifi(&self) {
let selfImp = self.imp();
let mut wifiEntries = selfImp.wifiEntries.borrow_mut();
wifiEntries.push(ListEntry::new(&WifiEntry::new(WifiStrength::Excellent, "ina internet", true)));
wifiEntries.push(ListEntry::new(&WifiEntry::new(WifiStrength::Excellent, "watch ina", true)));
wifiEntries.push(ListEntry::new(&WifiEntry::new(WifiStrength::Ok, "INANET", true)));
wifiEntries.push(ListEntry::new(&WifiEntry::new(WifiStrength::Weak, "ina best waifu", false)));
for wifiEntry in wifiEntries.iter() {
selfImp.resetWifiList.append(wifiEntry);
}
selfImp
.resetSavedNetworks
.set_action_name(Some("navigation.push"));
selfImp
.resetSavedNetworks
.set_action_target_value(Some(&Variant::from("saved")));
}
pub fn donotdisturb() {
@ -53,7 +54,73 @@ impl WifiBox {
"/org/freedesktop/Notifications",
Duration::from_millis(1000),
);
let _: Result<(), Error> = proxy.method_call("org.freedesktop.Notifications", "DoNotDisturb", ());
let _: Result<(), Error> =
proxy.method_call("org.freedesktop.Notifications", "DoNotDisturb", ());
});
}
}
pub fn scanForWifi(wifiBox: Arc<WifiBox>) {
let wifibox_ref = wifiBox.clone();
let wifiEntries = wifiBox.imp().wifiEntries.clone();
glib::spawn_future_local(async move {
let accessPoints = wat().await;
let wifiEntries = wifiEntries.clone();
{
let mut wifiEntries = wifiEntries.lock().unwrap();
for accessPoint in accessPoints {
wifiEntries.push(ListEntry::new(&*WifiEntry::new(accessPoint)));
}
}
glib::MainContext::default().spawn_local(async move {
glib::idle_add_once(move || {
let wifiEntries = wifiEntries.lock().unwrap();
let selfImp = wifibox_ref.imp();
for wifiEntry in wifiEntries.iter() {
selfImp.resetWifiList.append(wifiEntry);
}
});
});
let (sender, receiver): (
Sender<Events<(AccessPoint,), (Path<'static>,)>>,
Receiver<Events<(AccessPoint,), (Path<'static>,)>>,
) = channel();
let sender_ref = Arc::new(sender);
let listener_active = Arc::new(AtomicBool::new(false));
ReSet_Lib::utils::start_event_listener::<
(AccessPoint,),
(Path<'static>,),
AccessPointAdded,
AccessPointRemoved,
>(listener_active, sender_ref);
// handle receiver...
let res = receiver.try_recv();
if res.is_ok() {
let access_point = res.unwrap();
match access_point {
Events::AddedEvent(access_point) => {
dbg!(access_point);
}
_ => (),
};
} else {
println!("no message there :)");
}
});
}
pub async fn wat() -> Vec<AccessPoint> {
let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy(
"org.xetibo.ReSet",
"/org/xetibo/ReSet",
Duration::from_millis(1000),
);
let res: Result<(Vec<AccessPoint>,), Error> =
proxy.method_call("org.xetibo.ReSet", "ListAccessPoints", ());
if res.is_err() {
return Vec::new();
}
let (accessPoints,) = res.unwrap();
accessPoints
}

View file

@ -1,4 +1,5 @@
use std::cell::RefCell;
use std::sync::{Arc, Mutex};
use gtk::{Button, CompositeTemplate, glib, ListBox, Switch};
use gtk::prelude::*;
use gtk::subclass::prelude::*;
@ -7,6 +8,8 @@ use crate::components::wifi::wifiBox;
use crate::components::wifi::wifiEntry::WifiEntry;
use crate::components::base::listEntry::ListEntry;
use super::wifiBox::scanForWifi;
#[allow(non_snake_case)]
#[derive(Default, CompositeTemplate)]
#[template(resource = "/org/Xetibo/ReSet/resetWiFi.ui")]
@ -23,9 +26,12 @@ pub struct WifiBox {
pub resetWifiList: TemplateChild<ListBox>,
#[template_child]
pub resetWifiAdvanced: TemplateChild<Button>,
pub wifiEntries: RefCell<Vec<ListEntry>>,
pub wifiEntries: Arc<Mutex<Vec<ListEntry>>>,
}
unsafe impl Send for WifiBox {}
unsafe impl Sync for WifiBox {}
#[glib::object_subclass]
impl ObjectSubclass for WifiBox {
const NAME: &'static str = "resetWifi";
@ -49,7 +55,6 @@ impl ObjectImpl for WifiBox {
let obj = self.obj();
obj.setupCallbacks();
obj.scanForWifi();
}
}

View file

@ -2,8 +2,14 @@ use crate::components::wifi::wifiEntryImpl;
use adw::glib;
use adw::glib::{Object, PropertySet};
use adw::subclass::prelude::ObjectSubclassIsExt;
use dbus::blocking::Connection;
use dbus::Error;
use glib::clone;
use gtk::prelude::WidgetExt;
use crate::components::wifi::wifiEntryImpl::WifiStrength;
use gtk::GestureClick;
use std::sync::Arc;
use std::time::Duration;
use ReSet_Lib::network::network::{AccessPoint, WifiStrength};
glib::wrapper! {
pub struct WifiEntry(ObjectSubclass<wifiEntryImpl::WifiEntry>)
@ -11,23 +17,115 @@ glib::wrapper! {
@implements gtk::Accessible, gtk::Buildable, gtk::Actionable, gtk::ConstraintTarget;
}
unsafe impl Send for WifiEntry {}
unsafe impl Sync for WifiEntry {}
impl WifiEntry {
pub fn new(strength: WifiStrength, name: &str, isEncrypted: bool) -> Self {
let entry: WifiEntry = Object::builder().build();
pub fn new(access_point: AccessPoint) -> Arc<Self> {
let entry: Arc<WifiEntry> = Arc::new(Object::builder().build());
let stored_entry = entry.clone();
let new_entry = entry.clone();
let entryImp = entry.imp();
let strength = WifiStrength::from_u8(access_point.strength);
let ssid = access_point.ssid.clone();
let name_opt = String::from_utf8(ssid).unwrap_or_else(|_| String::from(""));
let name = name_opt.as_str();
let stored = access_point.stored;
entryImp.wifiStrength.set(strength);
entryImp.resetWifiLabel.get().set_text(name);
entryImp.resetWifiEncrypted.set_visible(isEncrypted);
entryImp.resetWifiStrength.get().set_from_icon_name(match strength {
WifiStrength::Excellent => Some("network-wireless-signal-excellent-symbolic"),
WifiStrength::Ok => Some("network-wireless-signal-ok-symbolic"),
WifiStrength::Weak => Some("network-wireless-signal-weak-symbolic"),
WifiStrength::None => Some("network-wireless-signal-none-symbolic"),
});
entryImp.resetWifiEncrypted.set_visible(false);
// TODO handle encryption thing
entryImp
.resetWifiStrength
.get()
.set_from_icon_name(match strength {
WifiStrength::Excellent => Some("network-wireless-signal-excellent-symbolic"),
WifiStrength::Ok => Some("network-wireless-signal-ok-symbolic"),
WifiStrength::Weak => Some("network-wireless-signal-weak-symbolic"),
WifiStrength::None => Some("network-wireless-signal-none-symbolic"),
});
if access_point.connected == true {
entryImp
.resetWifiConnected
.get()
.set_from_icon_name(Some("network-wireless-connected-symbolic"));
}
{
let mut wifiName = entryImp.wifiName.borrow_mut();
*wifiName = String::from(name);
}
entryImp.accessPoint.set(access_point);
let gesture = GestureClick::new();
if stored {
entryImp
.resetWifiStored
.get()
.set_from_icon_name(Some("document-save-symbolic"));
gesture.connect_released(move |_, _, _, _| {
click_stored_network(stored_entry.clone());
});
} else {
gesture.connect_released(move |_, _, _, _| {
click_new_network(new_entry.clone());
});
}
entry.add_controller(gesture);
entry
}
}
}
pub fn click_stored_network(entry: Arc<WifiEntry>) {
// TODO handle unknown access point -> should be done by having 2 different categories
let entryImp = entry.imp();
let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy(
"org.xetibo.ReSet",
"/org/xetibo/ReSet",
Duration::from_millis(1000),
);
let access_point = entryImp.accessPoint.clone().into_inner();
if access_point.connected == true {
let res: Result<(bool,), Error> =
proxy.method_call("org.xetibo.ReSet", "DisconnectFromCurrentAccessPoint", ());
if res.is_err() {
// TODO handle error
println!("no worky");
return;
}
let (res,) = res.unwrap();
if res == false {
} else {
entryImp.resetWifiConnected.get().set_from_icon_name(None);
let mut access_point = entryImp.accessPoint.borrow_mut();
(*access_point).connected = false;
}
return;
}
dbg!(access_point.clone());
let res: Result<(bool,), Error> = proxy.method_call(
"org.xetibo.ReSet",
"ConnectToKnownAccessPoint",
(access_point,),
);
if res.is_err() {
// TODO handle error
println!("no worky");
} else {
let (res,) = res.unwrap();
if res == false {
println!("no worky but it connected");
} else {
println!("worky");
entryImp
.resetWifiConnected
.get()
.set_from_icon_name(Some("network-wireless-connected-symbolic"));
let mut access_point = entryImp.accessPoint.borrow_mut();
(*access_point).connected = true;
}
}
}
pub fn click_new_network(entry: Arc<WifiEntry>) {
println!("Not implemented yet :)");
}

View file

@ -1,17 +1,9 @@
use std::cell::RefCell;
use gtk::{Button, CompositeTemplate, glib, Image, Label};
use ReSet_Lib::network::network::{WifiStrength, AccessPoint};
use gtk::{Button, CompositeTemplate, glib, Image, Label, Gesture, GestureClick};
use gtk::subclass::prelude::*;
use crate::components::wifi::wifiEntry;
#[derive(Default, Copy, Clone)]
pub enum WifiStrength {
Excellent,
Ok,
Weak,
#[default]
None,
}
#[allow(non_snake_case)]
#[derive(Default, CompositeTemplate)]
#[template(resource = "/org/Xetibo/ReSet/resetWifiEntry.ui")]
@ -24,10 +16,18 @@ pub struct WifiEntry {
pub resetWifiLabel: TemplateChild<Label>,
#[template_child]
pub resetWifiButton: TemplateChild<Button>,
#[template_child]
pub resetWifiConnected: TemplateChild<Image>,
#[template_child]
pub resetWifiStored: TemplateChild<Image>,
pub wifiName: RefCell<String>,
pub wifiStrength: RefCell<WifiStrength>,
pub accessPoint: RefCell<AccessPoint>,
}
unsafe impl Send for WifiEntry {}
unsafe impl Sync for WifiEntry {}
#[glib::object_subclass]
impl ObjectSubclass for WifiEntry {
const NAME: &'static str = "resetWifiEntry";

View file

@ -1,11 +1,15 @@
use std::sync::Arc;
use gtk::{FlowBox, Label};
use crate::components::audio::audioBox::AudioBox;
use crate::components::bluetooth::bluetoothBox::BluetoothBox;
use crate::components::base::settingBox::SettingBox;
use crate::components::wifi::wifiBox::WifiBox;
use crate::components::wifi::wifiBox::{WifiBox, scanForWifi};
pub const HANDLE_CONNECTIVITY_CLICK: fn(FlowBox) = |resetMain: FlowBox| {
let wifiBox = SettingBox::new(&WifiBox::new());
let wifiBox = Arc::new(WifiBox::new());
scanForWifi(wifiBox.clone());
let wifiBox = SettingBox::new(&*wifiBox);
let bluetoothBox = SettingBox::new(&BluetoothBox::new());
resetMain.remove_all();
resetMain.insert(&wifiBox, -1);

View file

@ -1,9 +1,9 @@
use adw::BreakpointCondition;
use adw::glib::clone;
use adw::subclass::prelude::ObjectSubclassIsExt;
use adw::BreakpointCondition;
use glib::Object;
use gtk::{Application, gio, glib, ListBoxRow, Orientation};
use gtk::prelude::*;
use gtk::{gio, glib, Application, ListBoxRow, Orientation};
use crate::components::window::handleSidebarClick::*;
use crate::components::window::sidebarEntry::SidebarEntry;
@ -17,6 +17,9 @@ glib::wrapper! {
gtk::ConstraintTarget, gtk::Native, gtk::Root, gtk::ShortcutManager;
}
unsafe impl Send for Window {}
unsafe impl Sync for Window {}
#[allow(non_snake_case)]
impl Window {
pub fn new(app: &Application) -> Self {
@ -26,13 +29,17 @@ impl Window {
pub fn setupCallback(&self) {
let selfImp = self.imp();
selfImp.resetSearchEntry.connect_search_changed(clone!(@ weak self as window => move |_| {
window.filterList();
}));
selfImp
.resetSearchEntry
.connect_search_changed(clone!(@ weak self as window => move |_| {
window.filterList();
}));
selfImp.resetSideBarToggle.connect_clicked(clone!(@ weak self as window => move |_| {
window.toggleSidebar();
}));
selfImp
.resetSideBarToggle
.connect_clicked(clone!(@ weak self as window => move |_| {
window.toggleSidebar();
}));
selfImp.resetSidebarList.connect_row_activated(
clone!(@ weak selfImp as flowbox => move |_, y| {
@ -42,7 +49,9 @@ impl Window {
}),
);
selfImp.resetClose.connect_clicked(clone!(@ weak self as window => move |_| {
selfImp
.resetClose
.connect_clicked(clone!(@ weak self as window => move |_| {
window.close();
}));
@ -54,7 +63,9 @@ impl Window {
pub fn handleDynamicSidebar(&self) {
let selfImp = self.imp();
selfImp.resetSidebarBreakpoint.set_condition(BreakpointCondition::parse("max-width: 700sp").as_ref().ok());
selfImp
.resetSidebarBreakpoint
.set_condition(BreakpointCondition::parse("max-width: 700sp").as_ref().ok());
selfImp.resetSidebarBreakpoint.add_setter(
&Object::from(selfImp.resetOverlaySplitView.get()),
"collapsed",
@ -77,13 +88,25 @@ impl Window {
}
continue;
}
if mainEntry.imp().name.borrow().to_lowercase().contains(&text.to_lowercase()) {
if mainEntry
.imp()
.name
.borrow()
.to_lowercase()
.contains(&text.to_lowercase())
{
mainEntry.set_visible(true);
} else {
mainEntry.set_visible(false);
}
for subEntry in subEntries {
if subEntry.imp().name.borrow().to_lowercase().contains(&text.to_lowercase()) {
if subEntry
.imp()
.name
.borrow()
.to_lowercase()
.contains(&text.to_lowercase())
{
subEntry.set_visible(true);
mainEntry.set_visible(true);
} else {
@ -218,24 +241,38 @@ impl Window {
pub fn setupPopoverButtons(&self) {
let selfImp = self.imp();
selfImp.resetAboutButton.connect_clicked(clone!(@ weak self as window => move |_| {
let dialog = adw::AboutWindow::builder()
.application_name("ReSet")
.application_icon("ReSet")
.developer_name("Xetibo")
.license("GPL-3.0")
.license_type(gtk::License::Gpl30)
.website("https://github.com/Xetibo/ReSet")
.issue_url("https://github.com/Xetibo/ReSet/issues")
.version("0.0.1")
.transient_for(&window)
.modal(true)
.copyright("© 2022-2023 Xetibo")
.developers(vec!["DashieTM".to_string(), "Takotori".to_string()])
.designers(vec!["DashieTM".to_string(), "Takotori".to_string()])
.build();
selfImp
.resetAboutButton
.connect_clicked(clone!(@ weak self as window => move |_| {
let dialog = adw::AboutWindow::builder()
.application_name("ReSet")
.application_icon("ReSet")
.developer_name("Xetibo")
.license("GPL-3.0")
.license_type(gtk::License::Gpl30)
.website("https://github.com/Xetibo/ReSet")
.issue_url("https://github.com/Xetibo/ReSet/issues")
.version("0.0.1")
.transient_for(&window)
.modal(true)
.copyright("© 2022-2023 Xetibo")
.developers(vec!["DashieTM".to_string(), "Takotori".to_string()])
.designers(vec!["DashieTM".to_string(), "Takotori".to_string()])
.build();
dialog.present();
}));
dialog.present();
}));
selfImp
.resetPreferenceButton
.connect_clicked(clone!(@weak self as window => move |_| {
let preferences = adw::PreferencesWindow::builder().build();
preferences.present();
}));
selfImp
.resetShortcutsButton
.connect_clicked(clone!(@weak self as window => move |_| {
let shortcuts = gtk::ShortcutsWindow::builder().build();
shortcuts.present();
}));
}
}

View file

@ -1,15 +1,15 @@
use std::cell::RefCell;
use adw::{Breakpoint, OverlaySplitView};
use adw::glib::StaticTypeExt;
use adw::subclass::prelude::AdwApplicationWindowImpl;
use adw::{Breakpoint, OverlaySplitView};
use glib::subclass::InitializingObject;
use gtk::{Box, Button, CompositeTemplate, FlowBox, glib, ListBox, PopoverMenu, SearchEntry};
use gtk::subclass::prelude::*;
use gtk::{glib, Box, Button, CompositeTemplate, FlowBox, ListBox, PopoverMenu, SearchEntry};
use crate::components::wifi::wifiBox::WifiBox;
use crate::components::window::window;
use crate::components::window::sidebarEntry::SidebarEntry;
use crate::components::window::window;
#[allow(non_snake_case)]
#[derive(CompositeTemplate, Default)]
@ -35,9 +35,16 @@ pub struct Window {
pub resetClose: TemplateChild<Button>,
#[template_child]
pub resetAboutButton: TemplateChild<Button>,
#[template_child]
pub resetPreferenceButton: TemplateChild<Button>,
#[template_child]
pub resetShortcutsButton: TemplateChild<Button>,
pub sidebarEntries: RefCell<Vec<(SidebarEntry, Vec<SidebarEntry>)>>,
}
unsafe impl Send for Window {}
unsafe impl Sync for Window {}
#[glib::object_subclass]
impl ObjectSubclass for Window {
const NAME: &'static str = "resetUI";
@ -72,4 +79,4 @@ impl WindowImpl for Window {}
impl ApplicationWindowImpl for Window {}
impl AdwApplicationWindowImpl for Window {}
impl AdwApplicationWindowImpl for Window {}

View file

@ -1,8 +1,14 @@
#![allow(non_snake_case)]
use gtk::{Application, CssProvider, gio};
use std::thread;
use std::time::Duration;
use dbus::blocking::Connection;
use dbus::Error;
use gtk::gdk::Display;
use gtk::prelude::*;
use gtk::{gio, Application, CssProvider};
use reset_daemon::run_daemon;
use crate::components::window::window::Window;
@ -10,13 +16,15 @@ mod components;
const APP_ID: &str = "org.Xetibo.ReSet";
fn main() {
#[tokio::main]
async fn main() {
// TODO is this the best way to handle this??
tokio::task::spawn(daemon_check());
gio::resources_register_include!("src.templates.gresource")
.expect("Failed to register resources.");
gio::resources_register_include!("src.icons.gresource")
.expect("Failed to register resources.");
gio::resources_register_include!("src.style.gresource")
.expect("Failed to register resources.");
gio::resources_register_include!("src.icons.gresource").expect("Failed to register resources.");
gio::resources_register_include!("src.style.gresource").expect("Failed to register resources.");
let app = Application::builder().application_id(APP_ID).build();
@ -38,7 +46,6 @@ fn loadCss() {
&provider,
gtk::STYLE_PROVIDER_PRIORITY_APPLICATION,
);
}
#[allow(non_snake_case)]
@ -47,3 +54,22 @@ fn buildUI(app: &Application) {
window.present();
}
async fn daemon_check() {
let handle = thread::spawn(|| {
let conn = Connection::new_session().unwrap();
let proxy = conn.with_proxy(
"org.xetibo.ReSet",
"/org/xetibo/ReSet",
Duration::from_millis(100),
);
let res: Result<(), Error> = proxy.method_call("org.xetibo.ReSet", "Check", ());
res
});
let res = handle.join();
if res.unwrap().is_err() {
println!("Daemon was not running");
run_daemon().await;
} else {
println!("Daemon was running");
}
}

View file

@ -89,7 +89,7 @@
<object class="GtkBox">
<property name="orientation">vertical</property>
<child>
<object class="GtkButton">
<object class="GtkButton" id="resetPreferenceButton">
<property name="has-frame">False</property>
<property name="label">Preferences</property>
</object>
@ -100,6 +100,12 @@
<property name="label">About</property>
</object>
</child>
<child>
<object class="GtkButton" id="resetShortcutsButton">
<property name="has-frame">False</property>
<property name="label">Shortcuts</property>
</object>
</child>
</object>
</property>
</object>

View file

@ -0,0 +1,23 @@
<?xml version='1.0' encoding='UTF-8'?>
<!-- Created with Cambalache 0.17.0 -->
<interface>
<requires lib="gtk" version="4.12"/>
<requires lib="libadwaita" version="1.0"/>
<template class="resetPasswordPopup" parent="AdwWindow">
<child>
<object class="GtkBox">
<child>
<object class="GtkEntry" id="resetWifiPasswordEntry">
<property name="activates-default">True</property>
<property name="invisible-char-set">True</property>
</object>
</child>
<child>
<object class="GtkButton" id="resetWifiPasswordButton">
<property name="label">connect</property>
</object>
</child>
</object>
</child>
</template>
</interface>

View file

@ -13,7 +13,8 @@
(12,1,None,"resetMicrophone.ui",None,None,None,None,None,None,None),
(13,1,None,"resetMicSourceEntry.ui",None,None,None,None,None,None,None),
(14,1,None,"resetSettingBox.ui",None,None,None,None,None,None,None),
(15,1,None,"resetListBoxRow.ui",None,None,None,None,None,None,None)
(15,1,None,"resetListBoxRow.ui",None,None,None,None,None,None,None),
(16,1,None,"resetPasswordPopup.ui",None,None,None,None,None,None,None)
</ui>
<object>
(3,1,"AdwApplicationWindow","resetUI",None,None,None,None,-1," &lt;child&gt;\n &lt;object id=\"resetSidebarBreakpoint\" class=\"AdwBreakpoint\"&gt;\n &lt;/object&gt;\n &lt;/child&gt;"),
@ -33,7 +34,7 @@
(3,34,"GtkBox","resetPath",25,None,None,None,3,None),
(3,35,"GtkPopoverMenu","resetPopoverMenu",33,None,None,None,-1,None),
(3,36,"GtkBox",None,35,None,None,None,-1,None),
(3,38,"GtkButton",None,36,None,None,None,1,None),
(3,38,"GtkButton","resetPreferenceButton",36,None,None,None,1,None),
(3,39,"GtkButton","resetAboutButton",36,None,None,None,2,None),
(3,40,"GtkScrolledWindow",None,18,None,None,None,1,None),
(3,41,"GtkViewport",None,40,None,None,None,None,None),
@ -46,6 +47,7 @@
(3,48,"GtkButton",None,34,None,None,None,4,None),
(3,49,"GtkLabel",None,34,None,None,None,1,None),
(3,50,"GtkLabel",None,34,None,None,None,3,None),
(3,51,"GtkButton","resetShortcutsButton",36,None,None,None,2,None),
(4,7,"GtkBox","resetWifi",None,None,None,None,None,None),
(4,70,"AdwNavigationView",None,7,None,None,None,-1,None),
(4,71,"AdwNavigationPage",None,70,None,None,None,-1,None),
@ -78,7 +80,9 @@
(5,4,"GtkImage","resetWifiStrength",3,None,None,None,None,None),
(5,5,"GtkImage","resetWifiEncrypted",3,None,None,None,1,None),
(5,6,"GtkLabel","resetWifiLabel",2,None,None,None,1,None),
(5,7,"GtkButton","resetWifiButton",2,None,None,None,2,None),
(5,7,"GtkButton","resetWifiButton",2,None,None,None,4,None),
(5,8,"GtkImage","resetWifiConnected",2,None,None,None,3,None),
(5,10,"GtkImage","resetWifiStored",2,None,None,None,2,None),
(6,1,"GtkListBoxRow","resetSidebarEntry",None,None,None,None,None,None),
(6,2,"GtkBox",None,1,None,None,None,-1,None),
(6,6,"GtkImage","resetSidebarImage",2,None,None,None,None,None),
@ -151,7 +155,11 @@
(13,9,"GtkLabel","resetMicPercentage",5,None,None,None,2,None),
(13,10,"GtkProgressBar","resetMicMeter",1,None,None,None,2,None),
(14,1,"GtkBox","resetSetting",None,None,None,None,-1,None),
(15,1,"GtkListBoxRow","resetListBoxRow",None,None,None,None,None,None)
(15,1,"GtkListBoxRow","resetListBoxRow",None,None,None,None,None,None),
(16,1,"AdwWindow","resetPasswordPopup",None,None,None,None,-1,None),
(16,2,"GtkBox",None,1,None,None,None,-1,None),
(16,3,"GtkEntry","resetWifiPasswordEntry",2,None,None,None,-1,None),
(16,4,"GtkButton","resetWifiPasswordButton",2,None,None,None,-1,None)
</object>
<object_property>
(3,1,"GtkWindow","default-height","500",None,None,None,None,None,None,None,None,None),
@ -222,6 +230,8 @@
(3,48,"GtkButton","label","Advanced",None,None,None,None,None,None,None,None,None),
(3,49,"GtkLabel","label","&gt;",None,None,None,None,None,None,None,None,None),
(3,50,"GtkLabel","label","&gt;",None,None,None,None,None,None,None,None,None),
(3,51,"GtkButton","has-frame","False",None,None,None,None,None,None,None,None,None),
(3,51,"GtkButton","label","Shortcuts",None,None,None,None,None,None,None,None,None),
(4,7,"GtkOrientable","orientation","vertical",None,None,None,None,None,None,None,None,None),
(4,7,"GtkWidget","hexpand","True",None,None,None,None,None,None,None,None,None),
(4,7,"GtkWidget","hexpand-set","True",None,None,None,None,None,None,None,None,None),
@ -304,6 +314,10 @@
(5,7,"GtkButton","icon-name","info-symbolic",None,None,None,None,None,None,None,None,None),
(5,7,"GtkWidget","halign","start",None,None,None,None,None,None,None,None,None),
(5,7,"GtkWidget","valign","center",None,None,None,None,None,None,None,None,None),
(5,8,"GtkWidget","halign","end",None,None,None,None,None,None,None,None,None),
(5,8,"GtkWidget","valign","center",None,None,None,None,None,None,None,None,None),
(5,10,"GtkWidget","halign","end",None,None,None,None,None,None,None,None,None),
(5,10,"GtkWidget","valign","center",None,None,None,None,None,None,None,None,None),
(6,1,"GtkListBoxRow","child",None,None,None,None,None,2,None,None,None,None),
(6,2,"GtkWidget","margin-bottom","10",None,None,None,None,None,None,None,None,None),
(6,2,"GtkWidget","margin-start","10",None,None,None,None,None,None,None,None,None),
@ -462,7 +476,10 @@
(14,1,"GtkWidget","valign","start",None,None,None,None,None,None,None,None,None),
(14,1,"GtkWidget","width-request","500",None,None,None,None,None,None,None,None,None),
(15,1,"GtkListBoxRow","selectable","False",None,None,None,None,None,None,None,None,None),
(15,1,"GtkWidget","height-request","40",None,None,None,None,None,None,None,None,None)
(15,1,"GtkWidget","height-request","40",None,None,None,None,None,None,None,None,None),
(16,3,"GtkEntry","activates-default","True",None,None,None,None,None,None,None,None,None),
(16,3,"GtkEntry","invisible-char-set","True",None,None,None,None,None,None,None,None,None),
(16,4,"GtkButton","label","connect",None,None,None,None,None,None,None,None,None)
</object_property>
<object_data>
(3,42,"GtkWidget",1,1,None,None,None,None,None,None),

View file

@ -34,6 +34,18 @@
<property name="xalign">0.0</property>
</object>
</child>
<child>
<object class="GtkImage" id="resetWifiStored">
<property name="halign">end</property>
<property name="valign">center</property>
</object>
</child>
<child>
<object class="GtkImage" id="resetWifiConnected">
<property name="halign">end</property>
<property name="valign">center</property>
</object>
</child>
<child>
<object class="GtkButton" id="resetWifiButton">
<property name="halign">start</property>