More work on Network stage.
This commit is contained in:
Generated
+180
-31
@@ -181,7 +181,7 @@ version = "0.7.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532"
|
checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"event-listener",
|
"event-listener 5.4.1",
|
||||||
"event-listener-strategy",
|
"event-listener-strategy",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
@@ -207,21 +207,33 @@ checksum = "c96bf972d85afc50bf5ab8fe2d54d1586b4e0b46c97c50a0c9e71e2f7bcd812a"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"async-task",
|
"async-task",
|
||||||
"concurrent-queue",
|
"concurrent-queue",
|
||||||
"fastrand",
|
"fastrand 2.4.1",
|
||||||
"futures-lite",
|
"futures-lite 2.6.1",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"slab",
|
"slab",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "async-fs"
|
||||||
|
version = "1.6.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "279cf904654eeebfa37ac9bb1598880884924aab82e290aa65c9e77a0e142e06"
|
||||||
|
dependencies = [
|
||||||
|
"async-lock 2.8.0",
|
||||||
|
"autocfg",
|
||||||
|
"blocking",
|
||||||
|
"futures-lite 1.13.0",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "async-fs"
|
name = "async-fs"
|
||||||
version = "2.2.0"
|
version = "2.2.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8034a681df4aed8b8edbd7fbe472401ecf009251c8b40556b304567052e294c5"
|
checksum = "8034a681df4aed8b8edbd7fbe472401ecf009251c8b40556b304567052e294c5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-lock",
|
"async-lock 3.4.2",
|
||||||
"blocking",
|
"blocking",
|
||||||
"futures-lite",
|
"futures-lite 2.6.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -234,7 +246,7 @@ dependencies = [
|
|||||||
"cfg-if",
|
"cfg-if",
|
||||||
"concurrent-queue",
|
"concurrent-queue",
|
||||||
"futures-io",
|
"futures-io",
|
||||||
"futures-lite",
|
"futures-lite 2.6.1",
|
||||||
"parking",
|
"parking",
|
||||||
"polling",
|
"polling",
|
||||||
"rustix 1.1.4",
|
"rustix 1.1.4",
|
||||||
@@ -242,13 +254,22 @@ dependencies = [
|
|||||||
"windows-sys 0.61.2",
|
"windows-sys 0.61.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "async-lock"
|
||||||
|
version = "2.8.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b"
|
||||||
|
dependencies = [
|
||||||
|
"event-listener 2.5.3",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "async-lock"
|
name = "async-lock"
|
||||||
version = "3.4.2"
|
version = "3.4.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311"
|
checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"event-listener",
|
"event-listener 5.4.1",
|
||||||
"event-listener-strategy",
|
"event-listener-strategy",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
]
|
]
|
||||||
@@ -261,7 +282,7 @@ checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"async-io",
|
"async-io",
|
||||||
"blocking",
|
"blocking",
|
||||||
"futures-lite",
|
"futures-lite 2.6.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -272,13 +293,13 @@ checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"async-channel",
|
"async-channel",
|
||||||
"async-io",
|
"async-io",
|
||||||
"async-lock",
|
"async-lock 3.4.2",
|
||||||
"async-signal",
|
"async-signal",
|
||||||
"async-task",
|
"async-task",
|
||||||
"blocking",
|
"blocking",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"event-listener",
|
"event-listener 5.4.1",
|
||||||
"futures-lite",
|
"futures-lite 2.6.1",
|
||||||
"rustix 1.1.4",
|
"rustix 1.1.4",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -300,7 +321,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "52b5aaafa020cf5053a01f2a60e8ff5dccf550f0f77ec54a4e47285ac2bab485"
|
checksum = "52b5aaafa020cf5053a01f2a60e8ff5dccf550f0f77ec54a4e47285ac2bab485"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-io",
|
"async-io",
|
||||||
"async-lock",
|
"async-lock 3.4.2",
|
||||||
"atomic-waker",
|
"atomic-waker",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
@@ -464,7 +485,7 @@ dependencies = [
|
|||||||
"async-channel",
|
"async-channel",
|
||||||
"async-task",
|
"async-task",
|
||||||
"futures-io",
|
"futures-io",
|
||||||
"futures-lite",
|
"futures-lite 2.6.1",
|
||||||
"piper",
|
"piper",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -510,6 +531,12 @@ dependencies = [
|
|||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "byteorder"
|
||||||
|
version = "1.5.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "byteorder-lite"
|
name = "byteorder-lite"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
@@ -986,6 +1013,12 @@ dependencies = [
|
|||||||
"num-traits",
|
"num-traits",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "event-listener"
|
||||||
|
version = "2.5.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "event-listener"
|
name = "event-listener"
|
||||||
version = "5.4.1"
|
version = "5.4.1"
|
||||||
@@ -1003,7 +1036,7 @@ version = "0.5.4"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93"
|
checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"event-listener",
|
"event-listener 5.4.1",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -1022,6 +1055,15 @@ dependencies = [
|
|||||||
"zune-inflate",
|
"zune-inflate",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "fastrand"
|
||||||
|
version = "1.9.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be"
|
||||||
|
dependencies = [
|
||||||
|
"instant",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "fastrand"
|
name = "fastrand"
|
||||||
version = "2.4.1"
|
version = "2.4.1"
|
||||||
@@ -1201,13 +1243,28 @@ version = "0.3.32"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718"
|
checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "futures-lite"
|
||||||
|
version = "1.13.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce"
|
||||||
|
dependencies = [
|
||||||
|
"fastrand 1.9.0",
|
||||||
|
"futures-core",
|
||||||
|
"futures-io",
|
||||||
|
"memchr",
|
||||||
|
"parking",
|
||||||
|
"pin-project-lite",
|
||||||
|
"waker-fn",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures-lite"
|
name = "futures-lite"
|
||||||
version = "2.6.1"
|
version = "2.6.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad"
|
checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"fastrand",
|
"fastrand 2.4.1",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"futures-io",
|
"futures-io",
|
||||||
"parking",
|
"parking",
|
||||||
@@ -1289,6 +1346,16 @@ dependencies = [
|
|||||||
"wasip3",
|
"wasip3",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "gif"
|
||||||
|
version = "0.13.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4ae047235e33e2829703574b54fdec96bfbad892062d97fed2f76022287de61b"
|
||||||
|
dependencies = [
|
||||||
|
"color_quant",
|
||||||
|
"weezl",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gif"
|
name = "gif"
|
||||||
version = "0.14.2"
|
version = "0.14.2"
|
||||||
@@ -1514,7 +1581,7 @@ dependencies = [
|
|||||||
"iced_runtime",
|
"iced_runtime",
|
||||||
"iced_widget",
|
"iced_widget",
|
||||||
"iced_winit",
|
"iced_winit",
|
||||||
"image",
|
"image 0.25.10",
|
||||||
"thiserror 2.0.18",
|
"thiserror 2.0.18",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -1574,7 +1641,7 @@ dependencies = [
|
|||||||
"half",
|
"half",
|
||||||
"iced_core",
|
"iced_core",
|
||||||
"iced_futures",
|
"iced_futures",
|
||||||
"image",
|
"image 0.25.10",
|
||||||
"kamadak-exif",
|
"kamadak-exif",
|
||||||
"log",
|
"log",
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
@@ -1583,6 +1650,20 @@ dependencies = [
|
|||||||
"unicode-segmentation",
|
"unicode-segmentation",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "iced_moving_picture"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5a058d0a3f6d4195fea964c68947e87ade42b1c3842f4a836c1fbecf5969a4fd"
|
||||||
|
dependencies = [
|
||||||
|
"async-fs 1.6.0",
|
||||||
|
"iced_futures",
|
||||||
|
"iced_runtime",
|
||||||
|
"iced_widget",
|
||||||
|
"image 0.24.9",
|
||||||
|
"thiserror 1.0.69",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "iced_program"
|
name = "iced_program"
|
||||||
version = "0.14.0"
|
version = "0.14.0"
|
||||||
@@ -1711,6 +1792,24 @@ dependencies = [
|
|||||||
"winapi-util",
|
"winapi-util",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "image"
|
||||||
|
version = "0.24.9"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d"
|
||||||
|
dependencies = [
|
||||||
|
"bytemuck",
|
||||||
|
"byteorder",
|
||||||
|
"color_quant",
|
||||||
|
"exr",
|
||||||
|
"gif 0.13.3",
|
||||||
|
"jpeg-decoder",
|
||||||
|
"num-traits",
|
||||||
|
"png 0.17.16",
|
||||||
|
"qoi",
|
||||||
|
"tiff 0.9.1",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "image"
|
name = "image"
|
||||||
version = "0.25.10"
|
version = "0.25.10"
|
||||||
@@ -1721,16 +1820,16 @@ dependencies = [
|
|||||||
"byteorder-lite",
|
"byteorder-lite",
|
||||||
"color_quant",
|
"color_quant",
|
||||||
"exr",
|
"exr",
|
||||||
"gif",
|
"gif 0.14.2",
|
||||||
"image-webp",
|
"image-webp",
|
||||||
"moxcms",
|
"moxcms",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"png",
|
"png 0.18.1",
|
||||||
"qoi",
|
"qoi",
|
||||||
"ravif",
|
"ravif",
|
||||||
"rayon",
|
"rayon",
|
||||||
"rgb",
|
"rgb",
|
||||||
"tiff",
|
"tiff 0.11.3",
|
||||||
"zune-core",
|
"zune-core",
|
||||||
"zune-jpeg",
|
"zune-jpeg",
|
||||||
]
|
]
|
||||||
@@ -1763,6 +1862,15 @@ dependencies = [
|
|||||||
"serde_core",
|
"serde_core",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "instant"
|
||||||
|
version = "0.1.13"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222"
|
||||||
|
dependencies = [
|
||||||
|
"cfg-if",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "interpolate_name"
|
name = "interpolate_name"
|
||||||
version = "0.2.4"
|
version = "0.2.4"
|
||||||
@@ -1882,6 +1990,15 @@ dependencies = [
|
|||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "jpeg-decoder"
|
||||||
|
version = "0.3.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "00810f1d8b74be64b13dbf3db89ac67740615d6c891f0e7b6179326533011a07"
|
||||||
|
dependencies = [
|
||||||
|
"rayon",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "js-sys"
|
name = "js-sys"
|
||||||
version = "0.3.95"
|
version = "0.3.95"
|
||||||
@@ -1924,9 +2041,11 @@ checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc"
|
|||||||
name = "kira-installer"
|
name = "kira-installer"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"blocking",
|
||||||
"iced",
|
"iced",
|
||||||
|
"iced_moving_picture",
|
||||||
"rust-i18n",
|
"rust-i18n",
|
||||||
"serde",
|
"smol",
|
||||||
"toml 1.1.2+spec-1.1.0",
|
"toml 1.1.2+spec-1.1.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -2154,7 +2273,7 @@ dependencies = [
|
|||||||
"cfg-if",
|
"cfg-if",
|
||||||
"dispatch",
|
"dispatch",
|
||||||
"futures-channel",
|
"futures-channel",
|
||||||
"futures-lite",
|
"futures-lite 2.6.1",
|
||||||
"jni 0.21.1",
|
"jni 0.21.1",
|
||||||
"ndk-context",
|
"ndk-context",
|
||||||
"objc2 0.6.4",
|
"objc2 0.6.4",
|
||||||
@@ -2831,7 +2950,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "c835479a4443ded371d6c535cbfd8d31ad92c5d23ae9770a61bc155e4992a3c1"
|
checksum = "c835479a4443ded371d6c535cbfd8d31ad92c5d23ae9770a61bc155e4992a3c1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"atomic-waker",
|
"atomic-waker",
|
||||||
"fastrand",
|
"fastrand 2.4.1",
|
||||||
"futures-io",
|
"futures-io",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -2847,6 +2966,19 @@ version = "0.2.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6"
|
checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "png"
|
||||||
|
version = "0.17.16"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 1.3.2",
|
||||||
|
"crc32fast",
|
||||||
|
"fdeflate",
|
||||||
|
"flate2",
|
||||||
|
"miniz_oxide",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "png"
|
name = "png"
|
||||||
version = "0.18.1"
|
version = "0.18.1"
|
||||||
@@ -3623,13 +3755,13 @@ checksum = "a33bd3e260892199c3ccfc487c88b2da2265080acb316cd920da72fdfd7c599f"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"async-channel",
|
"async-channel",
|
||||||
"async-executor",
|
"async-executor",
|
||||||
"async-fs",
|
"async-fs 2.2.0",
|
||||||
"async-io",
|
"async-io",
|
||||||
"async-lock",
|
"async-lock 3.4.2",
|
||||||
"async-net",
|
"async-net",
|
||||||
"async-process",
|
"async-process",
|
||||||
"blocking",
|
"blocking",
|
||||||
"futures-lite",
|
"futures-lite 2.6.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -3649,7 +3781,7 @@ checksum = "aac18da81ebbf05109ab275b157c22a653bb3c12cf884450179942f81bcbf6c3"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"as-raw-xcb-connection",
|
"as-raw-xcb-connection",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"fastrand",
|
"fastrand 2.4.1",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"memmap2",
|
"memmap2",
|
||||||
"ndk",
|
"ndk",
|
||||||
@@ -3742,7 +3874,7 @@ version = "3.27.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
|
checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"fastrand",
|
"fastrand 2.4.1",
|
||||||
"getrandom 0.4.2",
|
"getrandom 0.4.2",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"rustix 1.1.4",
|
"rustix 1.1.4",
|
||||||
@@ -3798,6 +3930,17 @@ dependencies = [
|
|||||||
"syn",
|
"syn",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tiff"
|
||||||
|
version = "0.9.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ba1310fcea54c6a9a4fd1aad794ecc02c31682f6bfbecdf460bf19533eed1e3e"
|
||||||
|
dependencies = [
|
||||||
|
"flate2",
|
||||||
|
"jpeg-decoder",
|
||||||
|
"weezl",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tiff"
|
name = "tiff"
|
||||||
version = "0.11.3"
|
version = "0.11.3"
|
||||||
@@ -4096,6 +4239,12 @@ version = "0.9.5"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
|
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "waker-fn"
|
||||||
|
version = "1.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "walkdir"
|
name = "walkdir"
|
||||||
version = "2.5.0"
|
version = "2.5.0"
|
||||||
@@ -5141,16 +5290,16 @@ dependencies = [
|
|||||||
"async-broadcast",
|
"async-broadcast",
|
||||||
"async-executor",
|
"async-executor",
|
||||||
"async-io",
|
"async-io",
|
||||||
"async-lock",
|
"async-lock 3.4.2",
|
||||||
"async-process",
|
"async-process",
|
||||||
"async-recursion",
|
"async-recursion",
|
||||||
"async-task",
|
"async-task",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"blocking",
|
"blocking",
|
||||||
"enumflags2",
|
"enumflags2",
|
||||||
"event-listener",
|
"event-listener 5.4.1",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"futures-lite",
|
"futures-lite 2.6.1",
|
||||||
"hex",
|
"hex",
|
||||||
"libc",
|
"libc",
|
||||||
"ordered-stream",
|
"ordered-stream",
|
||||||
|
|||||||
+3
-1
@@ -4,9 +4,11 @@ version = "0.1.0"
|
|||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
blocking = "1.6.2"
|
||||||
iced = { version = "0.14", features = ["smol", "image"] }
|
iced = { version = "0.14", features = ["smol", "image"] }
|
||||||
|
iced_moving_picture = "0"
|
||||||
rust-i18n = "3"
|
rust-i18n = "3"
|
||||||
serde = "1.0.228"
|
smol = "2.0.2"
|
||||||
toml = "1"
|
toml = "1"
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
|
|||||||
+3
-1
@@ -10,6 +10,8 @@
|
|||||||
"license.license": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.",
|
"license.license": "This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.",
|
||||||
"license.accept_text": "By pressing 'Accept' button you agreening to terms described above.",
|
"license.accept_text": "By pressing 'Accept' button you agreening to terms described above.",
|
||||||
"license.button.accept": "Accept",
|
"license.button.accept": "Accept",
|
||||||
|
"license.button.decline": "Decline",
|
||||||
"network.reuse_checkbox_caption": "Reuse settings?",
|
"network.reuse_checkbox_caption": "Reuse settings?",
|
||||||
"network.reuse_question": "Do you want to apply current network settings to installing system?"
|
"network.reuse_question": "Do you want to apply current network settings to installing system?",
|
||||||
|
"network.checking": "Checking network connectivity, please wait..."
|
||||||
}
|
}
|
||||||
+74
-79
@@ -1,64 +1,54 @@
|
|||||||
// <Kira Installer - universal Linux installer.>
|
// <Kira Installer - universal Linux installer.>
|
||||||
// Copyright (C) <2026> <Kira Foundation>
|
// Copyright (C) <2026> <Kira Foundation>
|
||||||
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
// the Free Software Foundation, either version 3 of the License, or
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
// (at your option) any later version.
|
// (at your option) any later version.
|
||||||
|
|
||||||
// This program is distributed in the hope that it will be useful,
|
// This program is distributed in the hope that it will be useful,
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
// You should have received a copy of the GNU General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
|
// You should have received a copy of the GNU General Public License
|
||||||
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
/*
|
/*
|
||||||
This file is the main application file.
|
This file is the main application file.
|
||||||
Main logic and stuff is located here. Including config loading.
|
Main logic and stuff is located here. Including config loading.
|
||||||
stages loading, switching between stages, and stuff.
|
stages loading, switching between stages, and stuff.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
use iced::widget;
|
use iced::widget;
|
||||||
use iced::Alignment;
|
|
||||||
use std::collections::{HashMap};
|
|
||||||
use std::path::{PathBuf,Path};
|
|
||||||
use std::str::FromStr;
|
|
||||||
use std::process::ExitCode;
|
use std::process::ExitCode;
|
||||||
|
|
||||||
use iced::{Element, Task};
|
use iced::{Element, Task};
|
||||||
|
|
||||||
use crate::stage::{StageAction, KiraConfig};
|
use crate::stage::{KiraConfig, StageAction};
|
||||||
use crate::stages::license;
|
use crate::stages::license;
|
||||||
use crate::stages::network;
|
use crate::stages::network;
|
||||||
use crate::stages::welcome;
|
use crate::stages::welcome;
|
||||||
use crate::stages::welcome::WelcomeStage;
|
use crate::stages::welcome::WelcomeStage;
|
||||||
|
|
||||||
|
|
||||||
rust_i18n::i18n!("src/locales", fallback = "en");
|
rust_i18n::i18n!("src/locales", fallback = "en");
|
||||||
mod stage;
|
mod stage;
|
||||||
mod stages;
|
mod stages;
|
||||||
mod theme;
|
mod theme;
|
||||||
|
|
||||||
|
|
||||||
enum Views {
|
enum Views {
|
||||||
Start,
|
Start,
|
||||||
Welcome(welcome::WelcomeStage),
|
Welcome(welcome::WelcomeStage),
|
||||||
License(license::LicenseStage),
|
License(license::LicenseStage),
|
||||||
Network(stages::network::NetworkStage),
|
Network(stages::network::NetworkStage),
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum Message {
|
enum Message {
|
||||||
Start,
|
Start,
|
||||||
Welcome(welcome::Message),
|
Welcome(welcome::Message),
|
||||||
License(license::Message),
|
License(license::Message),
|
||||||
Network(stages::network::Message)
|
Network(stages::network::Message),
|
||||||
}
|
}
|
||||||
|
|
||||||
struct KiraState {
|
struct KiraState {
|
||||||
@@ -84,11 +74,16 @@ fn load_kira_config(config_path: &str) -> Result<toml::Table, Box<dyn std::error
|
|||||||
|
|
||||||
impl KiraState {
|
impl KiraState {
|
||||||
fn boot() -> (Self, Task<Message>) {
|
fn boot() -> (Self, Task<Message>) {
|
||||||
(Self {
|
(
|
||||||
current_view: Views::Start,
|
Self {
|
||||||
toml_config: toml::Table::new(),
|
current_view: Views::Start,
|
||||||
config: KiraConfig { config_trail: Vec::new() }
|
toml_config: toml::Table::new(),
|
||||||
}, Task::done(Message::Start))
|
config: KiraConfig {
|
||||||
|
config_trail: Vec::new(),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Task::done(Message::Start),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -101,14 +96,12 @@ impl KiraState {
|
|||||||
// config: KiraConfig { config_trail: Vec::new() }
|
// config: KiraConfig { config_trail: Vec::new() }
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
fn view(k_state: &KiraState) -> Element<'_, Message> {
|
fn view(k_state: &KiraState) -> Element<'_, Message> {
|
||||||
match &k_state.current_view {
|
match &k_state.current_view {
|
||||||
Views::Start => Element::new(widget::space()) ,
|
Views::Start => Element::new(widget::space()),
|
||||||
Views::Welcome(wellcome_stage) => wellcome_stage.view().map(Message::Welcome),
|
Views::Welcome(wellcome_stage) => wellcome_stage.view().map(Message::Welcome),
|
||||||
Views::License(license_stage) => license_stage.view().map(Message::License),
|
Views::License(license_stage) => license_stage.view().map(Message::License),
|
||||||
Views::Network(network_stage) => network_stage.view().map(Message::Network),
|
Views::Network(network_stage) => network_stage.view().map(Message::Network),
|
||||||
@@ -117,18 +110,16 @@ fn view(k_state: &KiraState) -> Element<'_, Message> {
|
|||||||
|
|
||||||
fn update(k_state: &mut KiraState, message: Message) -> Task<Message> {
|
fn update(k_state: &mut KiraState, message: Message) -> Task<Message> {
|
||||||
match message {
|
match message {
|
||||||
Message::Start => {
|
Message::Start => match load_kira_config(CONFIG_PATH_STR) {
|
||||||
match load_kira_config(CONFIG_PATH_STR) {
|
Ok(conf) => {
|
||||||
Ok(conf) => {
|
println!("Config loaded!");
|
||||||
println!("Config loaded!");
|
k_state.toml_config = conf;
|
||||||
k_state.toml_config = conf;
|
k_state.current_view = Views::Welcome(WelcomeStage::new());
|
||||||
k_state.current_view = Views::Welcome(WelcomeStage::new());
|
Task::none()
|
||||||
Task::none()
|
}
|
||||||
},
|
Err(ex) => {
|
||||||
Err(ex) => {
|
println!("Error reading config {}: {}", CONFIG_PATH_STR, ex);
|
||||||
println!("Error reading config {}: {}", CONFIG_PATH_STR, ex);
|
iced::exit()
|
||||||
iced::exit()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Message::Welcome(wlc_msg) => {
|
Message::Welcome(wlc_msg) => {
|
||||||
@@ -136,48 +127,57 @@ fn update(k_state: &mut KiraState, message: Message) -> Task<Message> {
|
|||||||
let action = wlc_view.update(wlc_msg);
|
let action = wlc_view.update(wlc_msg);
|
||||||
if let StageAction::Next(welcome_res) = action {
|
if let StageAction::Next(welcome_res) = action {
|
||||||
k_state.config.config_trail.push(welcome_res);
|
k_state.config.config_trail.push(welcome_res);
|
||||||
k_state.current_view = Views::License(license::LicenseStage{});
|
k_state.current_view = Views::License(license::LicenseStage {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Task::none()
|
Task::none()
|
||||||
},
|
}
|
||||||
Message::License(license_message) => {
|
Message::License(license_message) => {
|
||||||
if let Views::License(license_view) = &mut k_state.current_view {
|
if let Views::License(license_view) = &mut k_state.current_view {
|
||||||
let action = license_view.update(license_message);
|
let action = license_view.update(license_message);
|
||||||
match action {
|
match action {
|
||||||
StageAction::Next(license_res) => {
|
StageAction::Next(license_res) => {
|
||||||
k_state.config.config_trail.push(license_res);
|
k_state.config.config_trail.push(license_res);
|
||||||
k_state.current_view = Views::Network(network::NetworkStage::new(&k_state.toml_config));
|
k_state.current_view =
|
||||||
Task::none()
|
Views::Network(network::NetworkStage::new(&k_state.toml_config));
|
||||||
},
|
Task::done(Message::Network(network::Message::CheckNetwork))
|
||||||
|
}
|
||||||
StageAction::Abort(_) => iced::exit(),
|
StageAction::Abort(_) => iced::exit(),
|
||||||
StageAction::Back => iced::exit(),
|
StageAction::Back => iced::exit(),
|
||||||
StageAction::None => Task::none()
|
StageAction::None => Task::none(),
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Task::none()
|
Task::none()
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
Message::Network(network_message) => {
|
Message::Network(network_message) => {
|
||||||
if let Views::Network(network_view) = &mut k_state.current_view {
|
if let Views::Network(network_view) = &mut k_state.current_view {
|
||||||
|
let update_result = network_view.update(network_message);
|
||||||
|
match update_result {
|
||||||
|
network::UpdateResult::Task(t) => t.map(Message::Network),
|
||||||
|
network::UpdateResult::StageAction(action) => match action {
|
||||||
|
StageAction::Next(network_res) => {
|
||||||
|
k_state.config.config_trail.push(network_res);
|
||||||
|
iced::exit()
|
||||||
|
}
|
||||||
|
StageAction::Back => {
|
||||||
|
k_state.current_view = Views::License(license::LicenseStage {});
|
||||||
|
Task::none()
|
||||||
|
}
|
||||||
|
_ => Task::none(),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
} else {
|
||||||
Task::none()
|
Task::none()
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
Task::none()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// pub fn main_interface() -> iced::Result {
|
// pub fn main_interface() -> iced::Result {
|
||||||
// iced::run(WellcomeStage::update, WellcomeStage::view)
|
// iced::run(WellcomeStage::update, WellcomeStage::view)
|
||||||
// }
|
// }
|
||||||
pub fn main() -> ExitCode {
|
pub fn main() -> ExitCode {
|
||||||
|
|
||||||
|
|
||||||
// let app_init = || {
|
// let app_init = || {
|
||||||
// let mut k_state = KiraState::default()
|
// let mut k_state = KiraState::default()
|
||||||
// k_state.current_view = Views::Welcome(WelcomeStage::new());
|
// k_state.current_view = Views::Welcome(WelcomeStage::new());
|
||||||
@@ -185,16 +185,13 @@ pub fn main() -> ExitCode {
|
|||||||
// };
|
// };
|
||||||
|
|
||||||
let iced_result = iced::application(KiraState::boot, update, view)
|
let iced_result = iced::application(KiraState::boot, update, view)
|
||||||
.window(iced::window::Settings {
|
.window(iced::window::Settings {
|
||||||
icon: Some(
|
icon: Some(
|
||||||
iced::window::icon::from_file_data(
|
iced::window::icon::from_file_data(include_bytes!("icon.png"), None)
|
||||||
include_bytes!("icon.png"),
|
.expect("icon should be a valid PNG"),
|
||||||
None,
|
),
|
||||||
)
|
..Default::default()
|
||||||
.expect("icon should be a valid PNG"),
|
})
|
||||||
),
|
|
||||||
..Default::default()
|
|
||||||
})
|
|
||||||
.centered()
|
.centered()
|
||||||
.theme(theme::main_theme())
|
.theme(theme::main_theme())
|
||||||
.run();
|
.run();
|
||||||
@@ -203,10 +200,8 @@ pub fn main() -> ExitCode {
|
|||||||
Ok(()) => ExitCode::SUCCESS,
|
Ok(()) => ExitCode::SUCCESS,
|
||||||
Err(_) => ExitCode::from(42), // Custom error code
|
Err(_) => ExitCode::from(42), // Custom error code
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// fn main() {
|
// fn main() {
|
||||||
// println!("Hello, world!");
|
// println!("Hello, world!");
|
||||||
// println!("{}", t!("wellcome.text"));
|
// println!("{}", t!("wellcome.text"));
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 146 KiB |
@@ -21,7 +21,6 @@
|
|||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub enum ConfigValue {
|
pub enum ConfigValue {
|
||||||
String(String),
|
String(String),
|
||||||
|
|||||||
+136
-63
@@ -19,24 +19,27 @@
|
|||||||
it needed for installation to process.
|
it needed for installation to process.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use toml::Table;
|
use iced::{Alignment, Task, widget};
|
||||||
use iced::{Alignment, widget};
|
use iced_moving_picture::widget::apng;
|
||||||
|
|
||||||
use rust_i18n::t;
|
use rust_i18n::t;
|
||||||
|
use smol;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
use toml::Table;
|
||||||
|
|
||||||
use crate::stage;
|
use crate::stage;
|
||||||
use crate::stage::StageResult;
|
use crate::stage::StageResult;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub enum State {
|
pub enum State {
|
||||||
Init,
|
|
||||||
Cheking,
|
Cheking,
|
||||||
ConnOK,
|
Normal,
|
||||||
ConnBad,
|
}
|
||||||
CheckFailed,
|
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
|
pub enum CheckResult {
|
||||||
|
Connected,
|
||||||
|
NoConnection,
|
||||||
|
CheckError,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
@@ -45,103 +48,173 @@ pub struct NetworkStage {
|
|||||||
state: State,
|
state: State,
|
||||||
use_net_settings: bool,
|
use_net_settings: bool,
|
||||||
reqire_network: bool,
|
reqire_network: bool,
|
||||||
|
spinner_frames: apng::Frames,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub enum Message {
|
pub enum Message {
|
||||||
Next,
|
Next,
|
||||||
Back,
|
Back,
|
||||||
StateChange(State),
|
UseSettingsTogle(bool),
|
||||||
UseSettingsTogle(bool)
|
CheckNetwork,
|
||||||
|
CheckCompleted(CheckResult),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub enum UpdateResult {
|
||||||
|
StageAction(stage::StageAction),
|
||||||
|
Task(Task<Message>),
|
||||||
|
}
|
||||||
|
|
||||||
|
fn check_connection_blocking() -> CheckResult {
|
||||||
|
use std::process::Command;
|
||||||
|
|
||||||
|
match Command::new("nm-online").arg("-q").status() {
|
||||||
|
Ok(status) => {
|
||||||
|
if status.success() {
|
||||||
|
CheckResult::Connected
|
||||||
|
} else {
|
||||||
|
CheckResult::NoConnection
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Err(ex) => {
|
||||||
|
println!("Exception while trying to chen net connectivity: {}", ex);
|
||||||
|
CheckResult::CheckError
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn check_connected() -> CheckResult {
|
||||||
|
use blocking;
|
||||||
|
let chek_result = blocking::unblock(|| check_connection_blocking()).await;
|
||||||
|
return chek_result;
|
||||||
|
}
|
||||||
|
|
||||||
impl NetworkStage {
|
impl NetworkStage {
|
||||||
pub fn new(toml_config: &Table) -> Self {
|
pub fn new(toml_config: &Table) -> Self {
|
||||||
|
|
||||||
let mut reqire_network = false;
|
let mut reqire_network = false;
|
||||||
|
|
||||||
if let Some(reqire_network_conf) = toml_config.get("network")
|
if let Some(reqire_network_conf) = toml_config
|
||||||
.and_then(|v|v.as_table())
|
.get("network")
|
||||||
.and_then(|v| v.get("reqire_network"))
|
.and_then(|v| v.as_table())
|
||||||
.and_then(|v| v.as_bool())
|
.and_then(|v| v.get("reqire_network"))
|
||||||
|
.and_then(|v| v.as_bool())
|
||||||
{
|
{
|
||||||
println!("Config value reqire_network read {}", reqire_network_conf);
|
println!("Config value reqire_network read {}", reqire_network_conf);
|
||||||
reqire_network = reqire_network_conf;
|
reqire_network = reqire_network_conf;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
println!("Error parsing network config. Using default values.");
|
println!("Error parsing network config. Using default values.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let spinner_frames =
|
||||||
|
apng::Frames::from_bytes(include_bytes!("spiner.apng").to_vec()).unwrap();
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
internet_active: false,
|
internet_active: false,
|
||||||
state: State::Init,
|
state: State::Cheking,
|
||||||
use_net_settings: false,
|
use_net_settings: false,
|
||||||
reqire_network: reqire_network
|
reqire_network: reqire_network,
|
||||||
|
spinner_frames: spinner_frames,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn check_connected(&mut self) -> Result<bool, std::io::Error> {
|
|
||||||
use std::process::Command;
|
|
||||||
let status = Command::new("nm-online").arg("-q").status()?;
|
|
||||||
|
|
||||||
if status.success() {
|
|
||||||
self.internet_active = true;
|
|
||||||
Ok(true)
|
|
||||||
} else {
|
|
||||||
self.internet_active = false;
|
|
||||||
Ok(false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fn gen_result(&self) -> StageResult {
|
fn gen_result(&self) -> StageResult {
|
||||||
StageResult {
|
StageResult {
|
||||||
name: "network".into(),
|
name: "network".into(),
|
||||||
config: Some(HashMap::from([(
|
config: Some(HashMap::from([
|
||||||
"accepted".to_string(),
|
(
|
||||||
stage::ConfigValue::Bool(true),
|
"internet_active".to_string(),
|
||||||
)])),
|
stage::ConfigValue::Bool(self.internet_active),
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"use_net_settings".to_string(),
|
||||||
|
stage::ConfigValue::Bool(self.use_net_settings),
|
||||||
|
),
|
||||||
|
])),
|
||||||
resuts: None,
|
resuts: None,
|
||||||
error: None,
|
error: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update(&mut self, message: Message) -> stage::StageAction {
|
pub fn update(&mut self, message: Message) -> UpdateResult {
|
||||||
match message {
|
match message {
|
||||||
Message::Next => stage::StageAction::Next(self.gen_result()),
|
Message::CheckNetwork => {
|
||||||
Message::Back => stage::StageAction::Back,
|
self.state = State::Cheking;
|
||||||
Message::StateChange(new_state) => {
|
UpdateResult::Task(Task::perform(check_connected(), Message::CheckCompleted))
|
||||||
self.state = new_state;
|
}
|
||||||
stage::StageAction::None
|
Message::CheckCompleted(check_status) => {
|
||||||
},
|
match check_status {
|
||||||
Message::UseSettingsTogle(toggle) => {
|
CheckResult::Connected => {
|
||||||
self.use_net_settings = toggle;
|
self.internet_active = true;
|
||||||
stage::StageAction::None
|
self.state = State::Normal;
|
||||||
|
}
|
||||||
|
CheckResult::NoConnection => {
|
||||||
|
self.internet_active = false;
|
||||||
|
self.state = State::Normal;
|
||||||
|
}
|
||||||
|
CheckResult::CheckError => {
|
||||||
|
self.internet_active = false;
|
||||||
|
self.state = State::Normal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
UpdateResult::StageAction(stage::StageAction::None)
|
||||||
|
}
|
||||||
|
Message::Next => UpdateResult::StageAction(stage::StageAction::Next(self.gen_result())),
|
||||||
|
Message::Back => UpdateResult::StageAction(stage::StageAction::Back),
|
||||||
|
Message::UseSettingsTogle(use_net_settings) => {
|
||||||
|
self.use_net_settings = use_net_settings;
|
||||||
|
UpdateResult::StageAction(stage::StageAction::None)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn view(&self) -> iced::Element<'_, Message> {
|
pub fn view(&self) -> iced::Element<'_, Message> {
|
||||||
let next_button =
|
let (next_button, back_button) = match self.state {
|
||||||
widget::button(widget::text(t!("button.next"))).on_press(Message::Next);
|
State::Cheking => (
|
||||||
let back_button = widget::button(widget::text(t!("button.back"))).on_press(Message::Back);
|
widget::button(widget::text(t!("button.next"))),
|
||||||
|
widget::button(widget::text(t!("button.back"))),
|
||||||
|
),
|
||||||
|
State::Normal => (
|
||||||
|
widget::button(widget::text(t!("button.next"))).on_press(Message::Next),
|
||||||
|
widget::button(widget::text(t!("button.back"))).on_press(Message::Back),
|
||||||
|
),
|
||||||
|
};
|
||||||
|
|
||||||
|
let mut info_column = match self.state {
|
||||||
|
State::Cheking => widget::Column::new()
|
||||||
|
.push(
|
||||||
|
widget::container(apng(&self.spinner_frames))
|
||||||
|
.center_x(iced::Length::Fill)
|
||||||
|
.center_y(iced::Length::Fill),
|
||||||
|
)
|
||||||
|
.push(widget::text(t!("network.checking"))),
|
||||||
|
State::Normal => widget::Column::new(),
|
||||||
|
};
|
||||||
|
|
||||||
|
info_column = info_column.push(widget::text(t!("network.reuse_question")));
|
||||||
|
|
||||||
|
info_column = match self.state {
|
||||||
|
State::Cheking => info_column.push(
|
||||||
|
widget::checkbox(self.use_net_settings).label(t!("network.reuse_checkbox_caption")),
|
||||||
|
),
|
||||||
|
State::Normal => info_column.push(
|
||||||
|
widget::checkbox(self.use_net_settings)
|
||||||
|
.label(t!("network.reuse_checkbox_caption"))
|
||||||
|
.on_toggle(Message::UseSettingsTogle),
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
info_column = info_column
|
||||||
|
.align_x(Alignment::Center)
|
||||||
|
.padding(20)
|
||||||
|
.spacing(5);
|
||||||
|
|
||||||
widget::column![
|
widget::column![
|
||||||
widget::container(
|
widget::container(info_column)
|
||||||
widget::column![
|
.height(iced::Length::Fill)
|
||||||
widget::text(t!("network.reuse_question")),
|
.width(iced::Length::Fill)
|
||||||
widget::checkbox(self.use_net_settings)
|
|
||||||
.label(t!("network.reuse_checkbox_caption"))
|
|
||||||
.on_toggle(Message::UseSettingsTogle)
|
|
||||||
]
|
|
||||||
.align_x(Alignment::Center)
|
.align_x(Alignment::Center)
|
||||||
.padding(20)
|
.align_y(Alignment::Center),
|
||||||
.spacing(5)
|
|
||||||
)
|
|
||||||
.height(iced::Length::Fill)
|
|
||||||
.width(iced::Length::Fill)
|
|
||||||
.align_x(Alignment::Center)
|
|
||||||
.align_y(Alignment::Center),
|
|
||||||
widget::row![
|
widget::row![
|
||||||
back_button,
|
back_button,
|
||||||
widget::space::horizontal(), // Pushes the right button to the far right
|
widget::space::horizontal(), // Pushes the right button to the far right
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 146 KiB |
Reference in New Issue
Block a user