feat: more improvements to network applet
This commit is contained in:
parent
13ccc03676
commit
c10087a55d
6 changed files with 363 additions and 128 deletions
261
Cargo.lock
generated
261
Cargo.lock
generated
|
|
@ -10,9 +10,9 @@ checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ab_glyph"
|
name = "ab_glyph"
|
||||||
version = "0.2.18"
|
version = "0.2.19"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4dcdbc68024b653943864d436fe8a24b028095bc1cf91a8926f8241e4aaffe59"
|
checksum = "e5568a4aa5ba8adf5175c5c460b030e27d8893412976cc37bef0e4fbc16cfbba"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ab_glyph_rasterizer",
|
"ab_glyph_rasterizer",
|
||||||
"owned_ttf_parser",
|
"owned_ttf_parser",
|
||||||
|
|
@ -208,9 +208,9 @@ checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "async-trait"
|
name = "async-trait"
|
||||||
version = "0.1.60"
|
version = "0.1.61"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "677d1d8ab452a3936018a687b20e6f7cf5363d713b732b8884001317b0e48aa3"
|
checksum = "705339e0e4a9690e2908d2b3d049d85682cf19fbd5782494498fbf7003a6a282"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
|
|
@ -551,7 +551,7 @@ dependencies = [
|
||||||
"rust-embed",
|
"rust-embed",
|
||||||
"smithay-client-toolkit",
|
"smithay-client-toolkit",
|
||||||
"tokio",
|
"tokio",
|
||||||
"zbus",
|
"zbus 3.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
@ -560,7 +560,7 @@ version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"libcosmic",
|
"libcosmic",
|
||||||
"smithay-client-toolkit",
|
"smithay-client-toolkit",
|
||||||
"zbus",
|
"zbus 3.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
@ -581,7 +581,7 @@ dependencies = [
|
||||||
"slotmap",
|
"slotmap",
|
||||||
"smithay-client-toolkit",
|
"smithay-client-toolkit",
|
||||||
"tokio",
|
"tokio",
|
||||||
"zbus",
|
"zbus 3.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
@ -605,7 +605,7 @@ dependencies = [
|
||||||
"nix 0.26.1",
|
"nix 0.26.1",
|
||||||
"smithay-client-toolkit",
|
"smithay-client-toolkit",
|
||||||
"tokio",
|
"tokio",
|
||||||
"zbus",
|
"zbus 3.7.0 (git+https://gitlab.freedesktop.org/dbus/zbus?branch=main)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
@ -655,20 +655,20 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-dbus-networkmanager"
|
name = "cosmic-dbus-networkmanager"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/dbus-settings-bindings?branch=deps#af1cc089ec08f4cb37d7d9448523963bf05995c6"
|
source = "git+https://github.com/pop-os/dbus-settings-bindings?branch=main#5adeb6dc11fd11d26d09ec35c25b93866bb21d31"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"derive_builder",
|
"derive_builder",
|
||||||
"procfs",
|
"procfs",
|
||||||
"time 0.3.17",
|
"time 0.3.17",
|
||||||
"zbus",
|
"zbus 3.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"zvariant 3.9.0",
|
"zvariant 3.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cosmic-panel-config"
|
name = "cosmic-panel-config"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/cosmic-panel#bab60b3883bd90b71b1be8bdf771fa11be0cf1dc"
|
source = "git+https://github.com/pop-os/cosmic-panel#b4e60dc30bb798d59cc57957291609e794d38821"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"ron",
|
"ron",
|
||||||
|
|
@ -1556,6 +1556,16 @@ dependencies = [
|
||||||
"version_check",
|
"version_check",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "gethostname"
|
||||||
|
version = "0.2.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
"winapi",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "getrandom"
|
name = "getrandom"
|
||||||
version = "0.2.8"
|
version = "0.2.8"
|
||||||
|
|
@ -1996,7 +2006,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced"
|
name = "iced"
|
||||||
version = "0.6.0"
|
version = "0.6.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic/?branch=master#357de5e9be4110fa3762cd7ec057760353505620"
|
source = "git+https://github.com/pop-os/libcosmic/?branch=master#5224c9b75c000fcf92a1851391fe1dc82486610a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iced_core",
|
"iced_core",
|
||||||
"iced_futures",
|
"iced_futures",
|
||||||
|
|
@ -2004,7 +2014,7 @@ dependencies = [
|
||||||
"iced_graphics",
|
"iced_graphics",
|
||||||
"iced_native",
|
"iced_native",
|
||||||
"iced_sctk",
|
"iced_sctk",
|
||||||
"iced_swbuf",
|
"iced_softbuffer",
|
||||||
"iced_wgpu",
|
"iced_wgpu",
|
||||||
"image",
|
"image",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
|
|
@ -2013,7 +2023,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_core"
|
name = "iced_core"
|
||||||
version = "0.6.2"
|
version = "0.6.2"
|
||||||
source = "git+https://github.com/pop-os/libcosmic/?branch=master#357de5e9be4110fa3762cd7ec057760353505620"
|
source = "git+https://github.com/pop-os/libcosmic/?branch=master#5224c9b75c000fcf92a1851391fe1dc82486610a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"palette",
|
"palette",
|
||||||
|
|
@ -2023,7 +2033,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_futures"
|
name = "iced_futures"
|
||||||
version = "0.5.1"
|
version = "0.5.1"
|
||||||
source = "git+https://github.com/pop-os/libcosmic/?branch=master#357de5e9be4110fa3762cd7ec057760353505620"
|
source = "git+https://github.com/pop-os/libcosmic/?branch=master#5224c9b75c000fcf92a1851391fe1dc82486610a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures",
|
"futures",
|
||||||
"log",
|
"log",
|
||||||
|
|
@ -2035,7 +2045,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_glow"
|
name = "iced_glow"
|
||||||
version = "0.5.1"
|
version = "0.5.1"
|
||||||
source = "git+https://github.com/pop-os/libcosmic/?branch=master#357de5e9be4110fa3762cd7ec057760353505620"
|
source = "git+https://github.com/pop-os/libcosmic/?branch=master#5224c9b75c000fcf92a1851391fe1dc82486610a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"euclid",
|
"euclid",
|
||||||
|
|
@ -2050,7 +2060,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_graphics"
|
name = "iced_graphics"
|
||||||
version = "0.5.0"
|
version = "0.5.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic/?branch=master#357de5e9be4110fa3762cd7ec057760353505620"
|
source = "git+https://github.com/pop-os/libcosmic/?branch=master#5224c9b75c000fcf92a1851391fe1dc82486610a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
|
|
@ -2070,7 +2080,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_lazy"
|
name = "iced_lazy"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic/?branch=master#357de5e9be4110fa3762cd7ec057760353505620"
|
source = "git+https://github.com/pop-os/libcosmic/?branch=master#5224c9b75c000fcf92a1851391fe1dc82486610a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iced_native",
|
"iced_native",
|
||||||
"ouroboros 0.13.0",
|
"ouroboros 0.13.0",
|
||||||
|
|
@ -2079,7 +2089,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_native"
|
name = "iced_native"
|
||||||
version = "0.7.0"
|
version = "0.7.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic/?branch=master#357de5e9be4110fa3762cd7ec057760353505620"
|
source = "git+https://github.com/pop-os/libcosmic/?branch=master#5224c9b75c000fcf92a1851391fe1dc82486610a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"iced_core",
|
"iced_core",
|
||||||
"iced_futures",
|
"iced_futures",
|
||||||
|
|
@ -2093,7 +2103,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_sctk"
|
name = "iced_sctk"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic/?branch=master#357de5e9be4110fa3762cd7ec057760353505620"
|
source = "git+https://github.com/pop-os/libcosmic/?branch=master#5224c9b75c000fcf92a1851391fe1dc82486610a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"enum-repr",
|
"enum-repr",
|
||||||
"futures",
|
"futures",
|
||||||
|
|
@ -2110,19 +2120,9 @@ dependencies = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_style"
|
name = "iced_softbuffer"
|
||||||
version = "0.5.1"
|
|
||||||
source = "git+https://github.com/pop-os/libcosmic/?branch=master#357de5e9be4110fa3762cd7ec057760353505620"
|
|
||||||
dependencies = [
|
|
||||||
"iced_core",
|
|
||||||
"once_cell",
|
|
||||||
"palette",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "iced_swbuf"
|
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic/?branch=master#357de5e9be4110fa3762cd7ec057760353505620"
|
source = "git+https://github.com/pop-os/libcosmic/?branch=master#5224c9b75c000fcf92a1851391fe1dc82486610a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cosmic-text",
|
"cosmic-text",
|
||||||
"iced_graphics",
|
"iced_graphics",
|
||||||
|
|
@ -2134,10 +2134,20 @@ dependencies = [
|
||||||
"softbuffer",
|
"softbuffer",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "iced_style"
|
||||||
|
version = "0.5.1"
|
||||||
|
source = "git+https://github.com/pop-os/libcosmic/?branch=master#5224c9b75c000fcf92a1851391fe1dc82486610a"
|
||||||
|
dependencies = [
|
||||||
|
"iced_core",
|
||||||
|
"once_cell",
|
||||||
|
"palette",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_wgpu"
|
name = "iced_wgpu"
|
||||||
version = "0.7.0"
|
version = "0.7.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic/?branch=master#357de5e9be4110fa3762cd7ec057760353505620"
|
source = "git+https://github.com/pop-os/libcosmic/?branch=master#5224c9b75c000fcf92a1851391fe1dc82486610a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
|
|
@ -2327,7 +2337,7 @@ checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libcosmic"
|
name = "libcosmic"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/libcosmic/?branch=master#357de5e9be4110fa3762cd7ec057760353505620"
|
source = "git+https://github.com/pop-os/libcosmic/?branch=master#5224c9b75c000fcf92a1851391fe1dc82486610a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"apply",
|
"apply",
|
||||||
"cosmic-panel-config",
|
"cosmic-panel-config",
|
||||||
|
|
@ -2470,7 +2480,7 @@ version = "3.0.3"
|
||||||
source = "git+https://github.com/pop-os/logind-zbus?branch=main#0789bde15b61b3f65b1e028841eeb5411f66f474"
|
source = "git+https://github.com/pop-os/logind-zbus?branch=main#0789bde15b61b3f65b1e028841eeb5411f66f474"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"zbus",
|
"zbus 3.7.0 (git+https://gitlab.freedesktop.org/dbus/zbus?branch=main)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
@ -2841,11 +2851,11 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "owned_ttf_parser"
|
name = "owned_ttf_parser"
|
||||||
version = "0.17.1"
|
version = "0.18.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "18904d3c65493a9f0d7542293d1a7f69bfdc309a6b9ef4f46dc3e58b0577edc5"
|
checksum = "2a5f3c7ca08b6879e7965fb25e24d1f5eeb32ea73f9ad99b3854778a38c57e93"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ttf-parser 0.17.1",
|
"ttf-parser 0.18.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
@ -3690,12 +3700,17 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "softbuffer"
|
name = "softbuffer"
|
||||||
version = "0.1.1"
|
version = "0.2.0"
|
||||||
source = "git+https://github.com/rust-windowing/softbuffer?rev=d5bb2c1#d5bb2c1c78811854d11225ff7cc29f0062781333"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3177eca2c15033e254b9b70c4915150200b1cf6fa777de18be9977ae5850077f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"bytemuck",
|
||||||
|
"cfg_aliases",
|
||||||
"cocoa",
|
"cocoa",
|
||||||
"core-graphics",
|
"core-graphics",
|
||||||
|
"fastrand",
|
||||||
"foreign-types",
|
"foreign-types",
|
||||||
|
"log",
|
||||||
"nix 0.26.1",
|
"nix 0.26.1",
|
||||||
"objc",
|
"objc",
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
|
|
@ -3708,6 +3723,7 @@ dependencies = [
|
||||||
"web-sys",
|
"web-sys",
|
||||||
"windows-sys 0.42.0",
|
"windows-sys 0.42.0",
|
||||||
"x11-dl",
|
"x11-dl",
|
||||||
|
"x11rb",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
@ -3952,9 +3968,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tokio"
|
name = "tokio"
|
||||||
version = "1.23.1"
|
version = "1.24.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "38a54aca0c15d014013256222ba0ebed095673f89345dd79119d912eb561b7a8"
|
checksum = "1d9f76183f91ecfb55e1d7d5602bd1d979e38a3a522fe900241cf195624d67ae"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"autocfg",
|
"autocfg",
|
||||||
"bytes",
|
"bytes",
|
||||||
|
|
@ -4035,6 +4051,12 @@ version = "0.17.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "375812fa44dab6df41c195cd2f7fecb488f6c09fbaafb62807488cefab642bff"
|
checksum = "375812fa44dab6df41c195cd2f7fecb488f6c09fbaafb62807488cefab642bff"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ttf-parser"
|
||||||
|
version = "0.18.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "dbf554b6e535f9a160b2ed4ea83f99000f21cbc0a693df26e258eaf2c226a151"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "twox-hash"
|
name = "twox-hash"
|
||||||
version = "1.6.3"
|
version = "1.6.3"
|
||||||
|
|
@ -4598,6 +4620,15 @@ dependencies = [
|
||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "winapi-wsapoll"
|
||||||
|
version = "0.1.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "44c17110f57155602a80dca10be03852116403c9ff3cd25b079d666f2aa3df6e"
|
||||||
|
dependencies = [
|
||||||
|
"winapi",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "winapi-x86_64-pc-windows-gnu"
|
name = "winapi-x86_64-pc-windows-gnu"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
|
|
@ -4715,6 +4746,31 @@ dependencies = [
|
||||||
"pkg-config",
|
"pkg-config",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "x11rb"
|
||||||
|
version = "0.11.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "cdf3c79412dd91bae7a7366b8ad1565a85e35dd049affc3a6a2c549e97419617"
|
||||||
|
dependencies = [
|
||||||
|
"gethostname",
|
||||||
|
"libc",
|
||||||
|
"libloading",
|
||||||
|
"nix 0.25.1",
|
||||||
|
"once_cell",
|
||||||
|
"winapi",
|
||||||
|
"winapi-wsapoll",
|
||||||
|
"x11rb-protocol",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "x11rb-protocol"
|
||||||
|
version = "0.11.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e0b1513b141123073ce54d5bb1d33f801f17508fbd61e02060b1214e96d39c56"
|
||||||
|
dependencies = [
|
||||||
|
"nix 0.25.1",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "xcursor"
|
name = "xcursor"
|
||||||
version = "0.3.4"
|
version = "0.3.4"
|
||||||
|
|
@ -4736,7 +4792,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "xdg-shell-wrapper-config"
|
name = "xdg-shell-wrapper-config"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+https://github.com/pop-os/xdg-shell-wrapper#82ce268c9c560be3728190a2255c849d3bae77e7"
|
source = "git+https://github.com/pop-os/xdg-shell-wrapper#95f6a663e383d3f6f13f689f9e9d7e691b9fe28b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"wayland-protocols-wlr",
|
"wayland-protocols-wlr",
|
||||||
|
|
@ -4784,8 +4840,9 @@ checksum = "c03b3e19c937b5b9bd8e52b1c88f30cce5c0d33d676cf174866175bb794ff658"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zbus"
|
name = "zbus"
|
||||||
version = "3.6.2"
|
version = "3.7.0"
|
||||||
source = "git+https://gitlab.freedesktop.org/dbus/zbus?branch=main#0b623738048395cdf398c18be24c9f00d8fdab58"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "379d587c0ccb632d1179cf44082653f682842f0535f0fdfaefffc34849cc855e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-broadcast",
|
"async-broadcast",
|
||||||
"async-executor",
|
"async-executor",
|
||||||
|
|
@ -4816,15 +4873,65 @@ dependencies = [
|
||||||
"tracing",
|
"tracing",
|
||||||
"uds_windows",
|
"uds_windows",
|
||||||
"winapi",
|
"winapi",
|
||||||
"zbus_macros",
|
"zbus_macros 3.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"zbus_names",
|
"zbus_names 2.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"zvariant 3.10.0",
|
"zvariant 3.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "zbus"
|
||||||
|
version = "3.7.0"
|
||||||
|
source = "git+https://gitlab.freedesktop.org/dbus/zbus?branch=main#e90e72eb2d0d5f77144bf40baa7337de89932a53"
|
||||||
|
dependencies = [
|
||||||
|
"async-broadcast",
|
||||||
|
"async-executor",
|
||||||
|
"async-io",
|
||||||
|
"async-lock",
|
||||||
|
"async-recursion",
|
||||||
|
"async-task",
|
||||||
|
"async-trait",
|
||||||
|
"byteorder",
|
||||||
|
"derivative",
|
||||||
|
"dirs 4.0.0",
|
||||||
|
"enumflags2",
|
||||||
|
"event-listener",
|
||||||
|
"futures-core",
|
||||||
|
"futures-sink",
|
||||||
|
"futures-util",
|
||||||
|
"hex",
|
||||||
|
"nix 0.25.1",
|
||||||
|
"once_cell",
|
||||||
|
"ordered-stream",
|
||||||
|
"rand",
|
||||||
|
"serde",
|
||||||
|
"serde_repr",
|
||||||
|
"sha1",
|
||||||
|
"static_assertions",
|
||||||
|
"tracing",
|
||||||
|
"uds_windows",
|
||||||
|
"winapi",
|
||||||
|
"zbus_macros 3.7.0 (git+https://gitlab.freedesktop.org/dbus/zbus?branch=main)",
|
||||||
|
"zbus_names 2.5.0 (git+https://gitlab.freedesktop.org/dbus/zbus?branch=main)",
|
||||||
|
"zvariant 3.10.0 (git+https://gitlab.freedesktop.org/dbus/zbus?branch=main)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zbus_macros"
|
name = "zbus_macros"
|
||||||
version = "3.6.2"
|
version = "3.7.0"
|
||||||
source = "git+https://gitlab.freedesktop.org/dbus/zbus?branch=main#0b623738048395cdf398c18be24c9f00d8fdab58"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "66492a2e90c0df7190583eccb8424aa12eb7ff06edea415a4fff6688fae18cf8"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro-crate",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"regex",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "zbus_macros"
|
||||||
|
version = "3.7.0"
|
||||||
|
source = "git+https://gitlab.freedesktop.org/dbus/zbus?branch=main#e90e72eb2d0d5f77144bf40baa7337de89932a53"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro-crate",
|
"proc-macro-crate",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
|
|
@ -4836,11 +4943,22 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zbus_names"
|
name = "zbus_names"
|
||||||
version = "2.5.0"
|
version = "2.5.0"
|
||||||
source = "git+https://gitlab.freedesktop.org/dbus/zbus?branch=main#0b623738048395cdf398c18be24c9f00d8fdab58"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "f34f314916bd89bdb9934154627fab152f4f28acdda03e7c4c68181b214fe7e3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"static_assertions",
|
"static_assertions",
|
||||||
"zvariant 3.10.0",
|
"zvariant 3.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "zbus_names"
|
||||||
|
version = "2.5.0"
|
||||||
|
source = "git+https://gitlab.freedesktop.org/dbus/zbus?branch=main#e90e72eb2d0d5f77144bf40baa7337de89932a53"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
"static_assertions",
|
||||||
|
"zvariant 3.10.0 (git+https://gitlab.freedesktop.org/dbus/zbus?branch=main)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|
@ -4849,37 +4967,38 @@ version = "0.2.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c110ba09c9b3a43edd4803d570df0da2414fed6e822e22b976a4e3ef50860701"
|
checksum = "c110ba09c9b3a43edd4803d570df0da2414fed6e822e22b976a4e3ef50860701"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "zvariant"
|
|
||||||
version = "3.9.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "56f8c89c183461e11867ded456db252eae90874bc6769b7adbea464caa777e51"
|
|
||||||
dependencies = [
|
|
||||||
"byteorder",
|
|
||||||
"libc",
|
|
||||||
"serde",
|
|
||||||
"static_assertions",
|
|
||||||
"zvariant_derive 3.9.0",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zvariant"
|
name = "zvariant"
|
||||||
version = "3.10.0"
|
version = "3.10.0"
|
||||||
source = "git+https://gitlab.freedesktop.org/dbus/zbus?branch=main#0b623738048395cdf398c18be24c9f00d8fdab58"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "576cc41e65c7f283e5460f5818073e68fb1f1631502b969ef228c2e03c862efb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"enumflags2",
|
"enumflags2",
|
||||||
"libc",
|
"libc",
|
||||||
"serde",
|
"serde",
|
||||||
"static_assertions",
|
"static_assertions",
|
||||||
"zvariant_derive 3.10.0",
|
"zvariant_derive 3.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "zvariant"
|
||||||
|
version = "3.10.0"
|
||||||
|
source = "git+https://gitlab.freedesktop.org/dbus/zbus?branch=main#e90e72eb2d0d5f77144bf40baa7337de89932a53"
|
||||||
|
dependencies = [
|
||||||
|
"byteorder",
|
||||||
|
"enumflags2",
|
||||||
|
"libc",
|
||||||
|
"serde",
|
||||||
|
"static_assertions",
|
||||||
|
"zvariant_derive 3.10.0 (git+https://gitlab.freedesktop.org/dbus/zbus?branch=main)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zvariant_derive"
|
name = "zvariant_derive"
|
||||||
version = "3.9.0"
|
version = "3.10.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "155247a5d1ab55e335421c104ccd95d64f17cebbd02f50cdbc1c33385f9c4d81"
|
checksum = "0fd4aafc0dee96ae7242a24249ce9babf21e1562822f03df650d4e68c20e41ed"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro-crate",
|
"proc-macro-crate",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
|
|
@ -4890,7 +5009,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "zvariant_derive"
|
name = "zvariant_derive"
|
||||||
version = "3.10.0"
|
version = "3.10.0"
|
||||||
source = "git+https://gitlab.freedesktop.org/dbus/zbus?branch=main#0b623738048395cdf398c18be24c9f00d8fdab58"
|
source = "git+https://gitlab.freedesktop.org/dbus/zbus?branch=main#e90e72eb2d0d5f77144bf40baa7337de89932a53"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro-crate",
|
"proc-macro-crate",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,5 @@ members = [
|
||||||
"cosmic-applet-workspaces",
|
"cosmic-applet-workspaces",
|
||||||
]
|
]
|
||||||
|
|
||||||
[patch.crates-io]
|
|
||||||
zbus = {git = "https://gitlab.freedesktop.org/dbus/zbus", branch = "main"}
|
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
lto = "fat"
|
lto = "fat"
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,13 @@ license = "GPL-3.0-or-later"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
once_cell = "1.16.0"
|
once_cell = "1.16.0"
|
||||||
cosmic-dbus-networkmanager = { git = "https://github.com/pop-os/dbus-settings-bindings", branch = "deps" }
|
cosmic-dbus-networkmanager = { git = "https://github.com/pop-os/dbus-settings-bindings", branch = "main" }
|
||||||
|
# cosmic-dbus-networkmanager = { path = "../../../dbus-settings-bindings/networkmanager" }
|
||||||
futures-util = "0.3.21"
|
futures-util = "0.3.21"
|
||||||
libcosmic = { git = "https://github.com/pop-os/libcosmic/", branch = "master", default-features = false, features = ["wayland", "applet", "tokio"] }
|
libcosmic = { git = "https://github.com/pop-os/libcosmic/", branch = "master", default-features = false, features = ["wayland", "applet", "tokio"] }
|
||||||
sctk = { package = "smithay-client-toolkit", git = "https://github.com/Smithay/client-toolkit", rev = "3776d4a" }
|
sctk = { package = "smithay-client-toolkit", git = "https://github.com/Smithay/client-toolkit", rev = "3776d4a" }
|
||||||
futures = "0.3"
|
futures = "0.3"
|
||||||
zbus = { version = "3.6.2", no-default-features = true }
|
zbus = { version = "3.7", no-default-features = true }
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
pretty_env_logger = "0.4"
|
pretty_env_logger = "0.4"
|
||||||
# Application i18n
|
# Application i18n
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ use cosmic::{
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
use cosmic_dbus_networkmanager::access_point;
|
use cosmic_dbus_networkmanager::{access_point, interface::enums::DeviceState};
|
||||||
use futures::channel::mpsc::UnboundedSender;
|
use futures::channel::mpsc::UnboundedSender;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
|
@ -80,6 +80,7 @@ struct CosmicNetworkApplet {
|
||||||
wifi: bool,
|
wifi: bool,
|
||||||
wireless_access_points: Vec<AccessPoint>,
|
wireless_access_points: Vec<AccessPoint>,
|
||||||
active_conns: Vec<ActiveConnectionInfo>,
|
active_conns: Vec<ActiveConnectionInfo>,
|
||||||
|
known_access_points: Vec<AccessPoint>,
|
||||||
nm_sender: Option<UnboundedSender<NetworkManagerRequest>>,
|
nm_sender: Option<UnboundedSender<NetworkManagerRequest>>,
|
||||||
show_visible_networks: bool,
|
show_visible_networks: bool,
|
||||||
new_connection: Option<NewConnectionState>,
|
new_connection: Option<NewConnectionState>,
|
||||||
|
|
@ -109,6 +110,7 @@ impl CosmicNetworkApplet {
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
enum Message {
|
enum Message {
|
||||||
|
ActivateKnownWifi(String),
|
||||||
TogglePopup,
|
TogglePopup,
|
||||||
ToggleAirplaneMode(bool),
|
ToggleAirplaneMode(bool),
|
||||||
ToggleWiFi(bool),
|
ToggleWiFi(bool),
|
||||||
|
|
@ -185,6 +187,7 @@ impl Application for CosmicNetworkApplet {
|
||||||
sender,
|
sender,
|
||||||
wireless_access_points,
|
wireless_access_points,
|
||||||
active_conns,
|
active_conns,
|
||||||
|
known_access_points,
|
||||||
wifi_enabled,
|
wifi_enabled,
|
||||||
airplane_mode,
|
airplane_mode,
|
||||||
} => {
|
} => {
|
||||||
|
|
@ -194,6 +197,7 @@ impl Application for CosmicNetworkApplet {
|
||||||
self.wifi = wifi_enabled;
|
self.wifi = wifi_enabled;
|
||||||
self.airplane_mode = airplane_mode;
|
self.airplane_mode = airplane_mode;
|
||||||
self.update_icon_name();
|
self.update_icon_name();
|
||||||
|
self.known_access_points = known_access_points;
|
||||||
}
|
}
|
||||||
NetworkManagerEvent::WiFiEnabled(enabled) => {
|
NetworkManagerEvent::WiFiEnabled(enabled) => {
|
||||||
self.wifi = enabled;
|
self.wifi = enabled;
|
||||||
|
|
@ -222,11 +226,6 @@ impl Application for CosmicNetworkApplet {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Message::SelectWirelessAccessPoint(access_point) => {
|
Message::SelectWirelessAccessPoint(access_point) => {
|
||||||
// if let Some(tx) = self.nm_sender.as_ref() {
|
|
||||||
// let _ = tx.unbounded_send(NetworkManagerRequest::SelectAccessPoint(
|
|
||||||
// access_point.ssid.clone(),
|
|
||||||
// ));
|
|
||||||
// }
|
|
||||||
self.new_connection
|
self.new_connection
|
||||||
.replace(NewConnectionState::EnterPassword {
|
.replace(NewConnectionState::EnterPassword {
|
||||||
access_point,
|
access_point,
|
||||||
|
|
@ -237,26 +236,28 @@ impl Application for CosmicNetworkApplet {
|
||||||
self.new_connection.take();
|
self.new_connection.take();
|
||||||
self.show_visible_networks = !self.show_visible_networks;
|
self.show_visible_networks = !self.show_visible_networks;
|
||||||
}
|
}
|
||||||
Message::Password(entered_pw) => {
|
Message::Password(entered_pw) => match &mut self.new_connection {
|
||||||
dbg!(&entered_pw);
|
Some(NewConnectionState::EnterPassword { password, .. }) => {
|
||||||
|
*password = entered_pw;
|
||||||
match &mut self.new_connection {
|
|
||||||
Some(NewConnectionState::EnterPassword { password, .. }) => {
|
|
||||||
*password = entered_pw;
|
|
||||||
}
|
|
||||||
_ => {}
|
|
||||||
}
|
}
|
||||||
}
|
_ => {}
|
||||||
|
},
|
||||||
Message::SubmitPassword => {
|
Message::SubmitPassword => {
|
||||||
// TODO setup connection
|
// TODO setup connection
|
||||||
match self.new_connection.take() {
|
match self.new_connection.take() {
|
||||||
Some(new_connection) => {
|
Some(new_connection) => {
|
||||||
self.new_connection
|
let ap: AccessPoint = new_connection.into();
|
||||||
.replace(NewConnectionState::Failure(new_connection.into()));
|
if let Some(tx) = self.nm_sender.as_ref() {
|
||||||
|
let _ = tx.unbounded_send(NetworkManagerRequest::SelectAccessPoint(
|
||||||
|
ap.ssid.clone(),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
self.new_connection.replace(NewConnectionState::Failure(ap));
|
||||||
}
|
}
|
||||||
None => {}
|
None => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Message::ActivateKnownWifi(ssid) => {}
|
||||||
Message::CancelNewConnection => {
|
Message::CancelNewConnection => {
|
||||||
self.new_connection.take();
|
self.new_connection.take();
|
||||||
}
|
}
|
||||||
|
|
@ -282,9 +283,10 @@ impl Application for CosmicNetworkApplet {
|
||||||
.on_press(Message::TogglePopup)
|
.on_press(Message::TogglePopup)
|
||||||
.into(),
|
.into(),
|
||||||
SurfaceIdWrapper::Popup(_) => {
|
SurfaceIdWrapper::Popup(_) => {
|
||||||
let mut list_col = column![];
|
let mut vpn_ethernet_col = column![];
|
||||||
|
let mut known_wifi = column![];
|
||||||
for conn in &self.active_conns {
|
for conn in &self.active_conns {
|
||||||
let el = match conn {
|
match conn {
|
||||||
ActiveConnectionInfo::Vpn { name, ip_addresses } => {
|
ActiveConnectionInfo::Vpn { name, ip_addresses } => {
|
||||||
let mut ipv4 = column![];
|
let mut ipv4 = column![];
|
||||||
for addr in ip_addresses {
|
for addr in ip_addresses {
|
||||||
|
|
@ -295,10 +297,11 @@ impl Application for CosmicNetworkApplet {
|
||||||
.size(12),
|
.size(12),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
std::net::IpAddr::V6(a) => {}
|
std::net::IpAddr::V6(_) => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
column![text(name), ipv4].spacing(4)
|
vpn_ethernet_col =
|
||||||
|
vpn_ethernet_col.push(column![text(name), ipv4].spacing(4));
|
||||||
}
|
}
|
||||||
ActiveConnectionInfo::Wired {
|
ActiveConnectionInfo::Wired {
|
||||||
name,
|
name,
|
||||||
|
|
@ -318,15 +321,17 @@ impl Application for CosmicNetworkApplet {
|
||||||
std::net::IpAddr::V6(a) => {}
|
std::net::IpAddr::V6(a) => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
column![
|
vpn_ethernet_col = vpn_ethernet_col.push(
|
||||||
row![
|
column![
|
||||||
text(name),
|
row![
|
||||||
text(format!("{speed} {}", fl!("megabits-per-second")))
|
text(name),
|
||||||
|
text(format!("{speed} {}", fl!("megabits-per-second")))
|
||||||
|
]
|
||||||
|
.spacing(16),
|
||||||
|
ipv4,
|
||||||
]
|
]
|
||||||
.spacing(16),
|
.spacing(4),
|
||||||
ipv4,
|
);
|
||||||
]
|
|
||||||
.spacing(4)
|
|
||||||
}
|
}
|
||||||
ActiveConnectionInfo::WiFi {
|
ActiveConnectionInfo::WiFi {
|
||||||
name, ip_addresses, ..
|
name, ip_addresses, ..
|
||||||
|
|
@ -340,10 +345,10 @@ impl Application for CosmicNetworkApplet {
|
||||||
.size(12),
|
.size(12),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
std::net::IpAddr::V6(a) => {}
|
std::net::IpAddr::V6(_) => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
column![button(Button::Secondary)
|
known_wifi = known_wifi.push(column![button(Button::Secondary)
|
||||||
.custom(vec![
|
.custom(vec![
|
||||||
icon("network-wireless-symbolic", 24)
|
icon("network-wireless-symbolic", 24)
|
||||||
.style(Svg::Custom(|theme| svg::Appearance {
|
.style(Svg::Custom(|theme| svg::Appearance {
|
||||||
|
|
@ -362,14 +367,46 @@ impl Application for CosmicNetworkApplet {
|
||||||
.into()
|
.into()
|
||||||
])
|
])
|
||||||
.padding([8, 24])
|
.padding([8, 24])
|
||||||
.style(button_style.clone())
|
.style(button_style.clone())]);
|
||||||
.on_press(Message::Ignore)]
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
list_col = list_col.push(el);
|
}
|
||||||
|
for known in &self.known_access_points {
|
||||||
|
let mut btn = button(Button::Secondary)
|
||||||
|
.custom(vec![
|
||||||
|
icon("network-wireless-symbolic", 24)
|
||||||
|
.style(Svg::Custom(|theme| svg::Appearance {
|
||||||
|
color: Some(theme.palette().text),
|
||||||
|
}))
|
||||||
|
.width(Length::Units(24))
|
||||||
|
.height(Length::Units(24))
|
||||||
|
.into(),
|
||||||
|
text(&known.ssid).size(14).into(),
|
||||||
|
])
|
||||||
|
.padding([8, 24])
|
||||||
|
.width(Length::Fill)
|
||||||
|
.style(button_style.clone());
|
||||||
|
let btn = match known.state {
|
||||||
|
// DeviceState::Prepare => todo!(),
|
||||||
|
// DeviceState::Config => todo!(),
|
||||||
|
// DeviceState::NeedAuth => todo!(),
|
||||||
|
// DeviceState::IpConfig => todo!(),
|
||||||
|
// DeviceState::IpCheck => todo!(),
|
||||||
|
// DeviceState::Secondaries => todo!(),
|
||||||
|
DeviceState::Failed
|
||||||
|
| DeviceState::Unknown
|
||||||
|
| DeviceState::Unmanaged
|
||||||
|
| DeviceState::Disconnected
|
||||||
|
| DeviceState::NeedAuth => {
|
||||||
|
btn.on_press(Message::ActivateKnownWifi(known.ssid.clone()))
|
||||||
|
}
|
||||||
|
_ => btn,
|
||||||
|
};
|
||||||
|
known_wifi = known_wifi.push(row![btn].align_items(Alignment::Center));
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut content = column![
|
let mut content = column![
|
||||||
|
vpn_ethernet_col,
|
||||||
container(
|
container(
|
||||||
toggler(fl!("airplane-mode"), self.airplane_mode, |m| {
|
toggler(fl!("airplane-mode"), self.airplane_mode, |m| {
|
||||||
Message::ToggleAirplaneMode(m)
|
Message::ToggleAirplaneMode(m)
|
||||||
|
|
@ -384,7 +421,7 @@ impl Application for CosmicNetworkApplet {
|
||||||
)
|
)
|
||||||
.padding([0, 12]),
|
.padding([0, 12]),
|
||||||
horizontal_rule(1),
|
horizontal_rule(1),
|
||||||
list_col,
|
known_wifi,
|
||||||
]
|
]
|
||||||
.align_items(Alignment::Center)
|
.align_items(Alignment::Center)
|
||||||
.spacing(8)
|
.spacing(8)
|
||||||
|
|
@ -456,11 +493,11 @@ impl Application for CosmicNetworkApplet {
|
||||||
.padding([0, 24])
|
.padding([0, 24])
|
||||||
.into()])
|
.into()])
|
||||||
.on_press(Message::CancelNewConnection),
|
.on_press(Message::CancelNewConnection),
|
||||||
button(Button::Secondary).custom(vec![container(text(
|
button(Button::Secondary)
|
||||||
fl!("connect")
|
.custom(vec![container(text(fl!("connect")))
|
||||||
))
|
.padding([0, 24])
|
||||||
.padding([0, 24])
|
.into()])
|
||||||
.into()])
|
.on_press(Message::SubmitPassword)
|
||||||
]
|
]
|
||||||
.spacing(24)
|
.spacing(24)
|
||||||
]
|
]
|
||||||
|
|
@ -470,19 +507,27 @@ impl Application for CosmicNetworkApplet {
|
||||||
content = content.push(col);
|
content = content.push(col);
|
||||||
}
|
}
|
||||||
NewConnectionState::Waiting(access_point) => {
|
NewConnectionState::Waiting(access_point) => {
|
||||||
let connecting = row![
|
let id = row![
|
||||||
icon("network-wireless-symbolic", 24)
|
icon("network-wireless-symbolic", 24)
|
||||||
.style(Svg::Custom(|theme| svg::Appearance {
|
.style(Svg::Custom(|theme| svg::Appearance {
|
||||||
color: Some(theme.palette().text),
|
color: Some(theme.palette().text),
|
||||||
}))
|
}))
|
||||||
.width(Length::Units(24))
|
.width(Length::Units(24))
|
||||||
.height(Length::Units(24)),
|
.height(Length::Units(24)),
|
||||||
text(format!("{}", fl!("connecting")))
|
text(&access_point.ssid).size(14),
|
||||||
.size(14)
|
]
|
||||||
.width(Length::Fill)
|
.align_items(Alignment::Center)
|
||||||
.height(Length::Units(24))
|
.width(Length::Fill)
|
||||||
.horizontal_alignment(Horizontal::Right)
|
.padding([0, 24])
|
||||||
.vertical_alignment(Vertical::Center)
|
.spacing(12);
|
||||||
|
let connecting = row![
|
||||||
|
id,
|
||||||
|
icon("process-working-symbolic", 24)
|
||||||
|
.style(Svg::Custom(|theme| svg::Appearance {
|
||||||
|
color: Some(theme.palette().text),
|
||||||
|
}))
|
||||||
|
.width(Length::Units(24))
|
||||||
|
.height(Length::Units(24)),
|
||||||
];
|
];
|
||||||
content = content.push(connecting);
|
content = content.push(connecting);
|
||||||
}
|
}
|
||||||
|
|
@ -499,7 +544,7 @@ impl Application for CosmicNetworkApplet {
|
||||||
.align_items(Alignment::Center)
|
.align_items(Alignment::Center)
|
||||||
.width(Length::Fill)
|
.width(Length::Fill)
|
||||||
.padding([0, 24])
|
.padding([0, 24])
|
||||||
.spacing(8);
|
.spacing(12);
|
||||||
content = content.push(id);
|
content = content.push(id);
|
||||||
let col = column![
|
let col = column![
|
||||||
text(fl!("unable-to-connect")),
|
text(fl!("unable-to-connect")),
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
use cosmic_dbus_networkmanager::device::wireless::WirelessDevice;
|
use cosmic_dbus_networkmanager::{device::wireless::WirelessDevice, interface::enums::DeviceState};
|
||||||
|
|
||||||
use futures_util::StreamExt;
|
use futures_util::StreamExt;
|
||||||
use itertools::Itertools;
|
use itertools::Itertools;
|
||||||
|
|
@ -16,17 +16,32 @@ pub async fn handle_wireless_device(device: WirelessDevice<'_>) -> zbus::Result<
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let access_points = device.get_access_points().await?;
|
let access_points = device.get_access_points().await?;
|
||||||
|
let state: DeviceState = device
|
||||||
|
.upcast()
|
||||||
|
.await
|
||||||
|
.and_then(|dev| dev.cached_state())
|
||||||
|
.unwrap_or_default()
|
||||||
|
.map(|s| s.into())
|
||||||
|
.unwrap_or_else(|| DeviceState::Unknown);
|
||||||
// Sort by strength and remove duplicates
|
// Sort by strength and remove duplicates
|
||||||
let mut aps = HashMap::<String, AccessPoint>::new();
|
let mut aps = HashMap::<String, AccessPoint>::new();
|
||||||
for ap in access_points {
|
for ap in access_points {
|
||||||
let ssid = String::from_utf8_lossy(&ap.ssid().await?.clone()).into_owned();
|
let ssid = String::from_utf8_lossy(&ap.ssid().await?.clone()).into_owned();
|
||||||
let strength = ap.strength().await?;
|
let strength = ap.strength().await?;
|
||||||
|
|
||||||
if let Some(access_point) = aps.get(&ssid) {
|
if let Some(access_point) = aps.get(&ssid) {
|
||||||
if access_point.strength > strength {
|
if access_point.strength > strength {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
aps.insert(ssid.clone(), AccessPoint { ssid, strength });
|
aps.insert(
|
||||||
|
ssid.clone(),
|
||||||
|
AccessPoint {
|
||||||
|
ssid,
|
||||||
|
strength,
|
||||||
|
state: state,
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
let aps = aps
|
let aps = aps
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
|
@ -40,4 +55,5 @@ pub async fn handle_wireless_device(device: WirelessDevice<'_>) -> zbus::Result<
|
||||||
pub struct AccessPoint {
|
pub struct AccessPoint {
|
||||||
pub ssid: String,
|
pub ssid: String,
|
||||||
pub strength: u8,
|
pub strength: u8,
|
||||||
|
pub state: DeviceState,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,17 @@ use std::{fmt::Debug, hash::Hash, time::Duration};
|
||||||
|
|
||||||
use cosmic::iced::{self, subscription};
|
use cosmic::iced::{self, subscription};
|
||||||
use cosmic_dbus_networkmanager::{
|
use cosmic_dbus_networkmanager::{
|
||||||
device::SpecificDevice, interface::enums::DeviceType, nm::NetworkManager,
|
device::SpecificDevice,
|
||||||
|
interface::{enums::DeviceType, settings::connection::ConnectionSettingsProxy},
|
||||||
|
nm::NetworkManager,
|
||||||
|
settings::{
|
||||||
|
connection::{ConnectionSettings, Secrets, Settings},
|
||||||
|
NetworkManagerSettings,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
use futures::{
|
use futures::{
|
||||||
channel::mpsc::{unbounded, UnboundedReceiver, UnboundedSender},
|
channel::mpsc::{unbounded, UnboundedReceiver, UnboundedSender},
|
||||||
|
future::ok,
|
||||||
FutureExt, StreamExt,
|
FutureExt, StreamExt,
|
||||||
};
|
};
|
||||||
use zbus::Connection;
|
use zbus::Connection;
|
||||||
|
|
@ -49,6 +56,12 @@ async fn start_listening<I: Copy>(
|
||||||
Ok(n) => n,
|
Ok(n) => n,
|
||||||
Err(_) => return (None, State::Finished),
|
Err(_) => return (None, State::Finished),
|
||||||
};
|
};
|
||||||
|
let s = match NetworkManagerSettings::new(&conn).await {
|
||||||
|
Ok(s) => s,
|
||||||
|
Err(_) => return (None, State::Finished),
|
||||||
|
};
|
||||||
|
let known_conns = s.list_connections().await.unwrap_or_default();
|
||||||
|
|
||||||
let (tx, rx) = unbounded();
|
let (tx, rx) = unbounded();
|
||||||
let mut active_conns = active_connections(
|
let mut active_conns = active_connections(
|
||||||
network_manager
|
network_manager
|
||||||
|
|
@ -85,8 +98,30 @@ async fn start_listening<I: Copy>(
|
||||||
let mut wireless_access_points =
|
let mut wireless_access_points =
|
||||||
Vec::with_capacity(wireless_access_point_futures.len());
|
Vec::with_capacity(wireless_access_point_futures.len());
|
||||||
for f in wireless_access_point_futures {
|
for f in wireless_access_point_futures {
|
||||||
wireless_access_points.append(&mut f.await);
|
let mut access_points = f.await;
|
||||||
|
wireless_access_points.append(&mut access_points);
|
||||||
}
|
}
|
||||||
|
let mut known_ssid = Vec::with_capacity(known_conns.len());
|
||||||
|
for c in known_conns {
|
||||||
|
let s = c.get_settings().await.unwrap();
|
||||||
|
let s = Settings::new(s);
|
||||||
|
if let Some(cur_ssid) = s
|
||||||
|
.wifi
|
||||||
|
.clone()
|
||||||
|
.and_then(|w| w.ssid)
|
||||||
|
.and_then(|ssid| String::from_utf8(ssid).ok())
|
||||||
|
{
|
||||||
|
known_ssid.push(cur_ssid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let known_access_points: Vec<_> = wireless_access_points
|
||||||
|
.iter()
|
||||||
|
.filter(|a| {
|
||||||
|
known_ssid.contains(&a.ssid)
|
||||||
|
&& !active_conns.iter().any(|ac| ac.name() == a.ssid)
|
||||||
|
})
|
||||||
|
.cloned()
|
||||||
|
.collect();
|
||||||
wireless_access_points.sort_by(|a, b| b.strength.cmp(&a.strength));
|
wireless_access_points.sort_by(|a, b| b.strength.cmp(&a.strength));
|
||||||
drop(network_manager);
|
drop(network_manager);
|
||||||
return (
|
return (
|
||||||
|
|
@ -97,6 +132,7 @@ async fn start_listening<I: Copy>(
|
||||||
wireless_access_points,
|
wireless_access_points,
|
||||||
wifi_enabled,
|
wifi_enabled,
|
||||||
airplane_mode: false,
|
airplane_mode: false,
|
||||||
|
known_access_points,
|
||||||
active_conns,
|
active_conns,
|
||||||
},
|
},
|
||||||
)),
|
)),
|
||||||
|
|
@ -108,6 +144,7 @@ async fn start_listening<I: Copy>(
|
||||||
Ok(n) => n,
|
Ok(n) => n,
|
||||||
Err(_) => return (None, State::Finished),
|
Err(_) => return (None, State::Finished),
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut active_conns_changed = tokio::time::sleep(Duration::from_secs(5))
|
let mut active_conns_changed = tokio::time::sleep(Duration::from_secs(5))
|
||||||
.then(|_| async { network_manager.receive_active_connections_changed().await })
|
.then(|_| async { network_manager.receive_active_connections_changed().await })
|
||||||
.await;
|
.await;
|
||||||
|
|
@ -153,7 +190,26 @@ async fn start_listening<I: Copy>(
|
||||||
Some(NetworkManagerRequest::SelectAccessPoint(ssid)) => {
|
Some(NetworkManagerRequest::SelectAccessPoint(ssid)) => {
|
||||||
'device_loop: for device in network_manager.devices().await.ok().unwrap_or_default() {
|
'device_loop: for device in network_manager.devices().await.ok().unwrap_or_default() {
|
||||||
if matches!(device.device_type().await.unwrap_or(DeviceType::Other), DeviceType::Wifi) {
|
if matches!(device.device_type().await.unwrap_or(DeviceType::Other), DeviceType::Wifi) {
|
||||||
|
let connection_settings = NetworkManagerSettings::new(&conn).await.unwrap();
|
||||||
|
for conn in connection_settings.list_connections().await.unwrap() {
|
||||||
|
let s = conn.get_settings().await.unwrap();
|
||||||
|
let s = Settings::new(s);
|
||||||
|
|
||||||
|
let cur_ssid = s
|
||||||
|
.wifi
|
||||||
|
.clone()
|
||||||
|
.and_then(|w| w.ssid)
|
||||||
|
.and_then(|ssid| String::from_utf8(ssid).ok());
|
||||||
|
if cur_ssid.as_ref() == Some(&ssid) {
|
||||||
|
// dbg!(s);
|
||||||
|
// dbg!(conn.get_secrets("connection").await);
|
||||||
|
// dbg!(Secrets::new(&conn).await);
|
||||||
|
// dbg!(psk);
|
||||||
|
// connection update can be used to set password
|
||||||
|
}
|
||||||
|
}
|
||||||
for conn in device.available_connections().await.unwrap_or_default() {
|
for conn in device.available_connections().await.unwrap_or_default() {
|
||||||
|
// network_manager.activate_connection(conn, device.clone());
|
||||||
// dbg!(&conn.path());
|
// dbg!(&conn.path());
|
||||||
// TODO activate connection
|
// TODO activate connection
|
||||||
}
|
}
|
||||||
|
|
@ -225,6 +281,7 @@ pub enum NetworkManagerEvent {
|
||||||
sender: UnboundedSender<NetworkManagerRequest>,
|
sender: UnboundedSender<NetworkManagerRequest>,
|
||||||
wireless_access_points: Vec<AccessPoint>,
|
wireless_access_points: Vec<AccessPoint>,
|
||||||
active_conns: Vec<ActiveConnectionInfo>,
|
active_conns: Vec<ActiveConnectionInfo>,
|
||||||
|
known_access_points: Vec<AccessPoint>,
|
||||||
wifi_enabled: bool,
|
wifi_enabled: bool,
|
||||||
airplane_mode: bool,
|
airplane_mode: bool,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue