SHA256
Refactor of stages results handling
This commit is contained in:
Generated
+374
-14
@@ -69,6 +69,15 @@ 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 = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04"
|
checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "android_system_properties"
|
||||||
|
version = "0.1.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ae221649c9976a6f6c56ae1facf410f3ddb33cc661c4b7b61020a912d4237fbc"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anyhow"
|
name = "anyhow"
|
||||||
version = "1.0.104"
|
version = "1.0.104"
|
||||||
@@ -128,6 +137,15 @@ dependencies = [
|
|||||||
"stable_deref_trait",
|
"stable_deref_trait",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ash"
|
||||||
|
version = "0.38.0+1.3.281"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0bb44936d800fea8f016d7f2311c6a4f97aebd5dc86f09906139ec848cf3a46f"
|
||||||
|
dependencies = [
|
||||||
|
"libloading",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "async-broadcast"
|
name = "async-broadcast"
|
||||||
version = "0.7.2"
|
version = "0.7.2"
|
||||||
@@ -405,6 +423,12 @@ dependencies = [
|
|||||||
"no_std_io2",
|
"no_std_io2",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "block"
|
||||||
|
version = "0.1.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "block2"
|
name = "block2"
|
||||||
version = "0.5.1"
|
version = "0.5.1"
|
||||||
@@ -581,6 +605,8 @@ version = "0.12.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "fe6d2e5af09e8c8ad56c969f2157a3d4238cebc7c55f0a517728c38f7b200f81"
|
checksum = "fe6d2e5af09e8c8ad56c969f2157a3d4238cebc7c55f0a517728c38f7b200f81"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
"termcolor",
|
||||||
"unicode-width",
|
"unicode-width",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -619,6 +645,16 @@ dependencies = [
|
|||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "core-foundation"
|
||||||
|
version = "0.10.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6"
|
||||||
|
dependencies = [
|
||||||
|
"core-foundation-sys",
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "core-foundation-sys"
|
name = "core-foundation-sys"
|
||||||
version = "0.8.7"
|
version = "0.8.7"
|
||||||
@@ -632,8 +668,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081"
|
checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 1.3.2",
|
"bitflags 1.3.2",
|
||||||
"core-foundation",
|
"core-foundation 0.9.4",
|
||||||
"core-graphics-types",
|
"core-graphics-types 0.1.3",
|
||||||
"foreign-types",
|
"foreign-types",
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
@@ -645,7 +681,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf"
|
checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 1.3.2",
|
"bitflags 1.3.2",
|
||||||
"core-foundation",
|
"core-foundation 0.9.4",
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "core-graphics-types"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 2.13.2",
|
||||||
|
"core-foundation 0.10.1",
|
||||||
"libc",
|
"libc",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -989,6 +1036,12 @@ dependencies = [
|
|||||||
"zlib-rs",
|
"zlib-rs",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "foldhash"
|
||||||
|
version = "0.1.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "foldhash"
|
name = "foldhash"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
@@ -1233,6 +1286,17 @@ dependencies = [
|
|||||||
"weezl",
|
"weezl",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "gl_generator"
|
||||||
|
version = "0.14.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d"
|
||||||
|
dependencies = [
|
||||||
|
"khronos_api",
|
||||||
|
"log",
|
||||||
|
"xml-rs",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "glam"
|
name = "glam"
|
||||||
version = "0.25.0"
|
version = "0.25.0"
|
||||||
@@ -1269,6 +1333,78 @@ dependencies = [
|
|||||||
"walkdir",
|
"walkdir",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "glow"
|
||||||
|
version = "0.16.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c5e5ea60d70410161c8bf5da3fdfeaa1c72ed2c15f8bbb9d19fe3a4fad085f08"
|
||||||
|
dependencies = [
|
||||||
|
"js-sys",
|
||||||
|
"slotmap",
|
||||||
|
"wasm-bindgen",
|
||||||
|
"web-sys",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "glutin_wgl_sys"
|
||||||
|
version = "0.6.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2c4ee00b289aba7a9e5306d57c2d05499b2e5dc427f84ac708bd2c090212cf3e"
|
||||||
|
dependencies = [
|
||||||
|
"gl_generator",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "gpu-alloc"
|
||||||
|
version = "0.6.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "45cf04b2726f02df5508c6de726acdc90cdf97ac771a9a0ffd8ba10a6e696bf9"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 2.13.2",
|
||||||
|
"gpu-alloc-types",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "gpu-alloc-types"
|
||||||
|
version = "0.3.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b2bbed164dd10ed526c2e4fe3e721ca4a71c61730e5aafac6844b417b3227058"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 2.13.2",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "gpu-allocator"
|
||||||
|
version = "0.27.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c151a2a5ef800297b4e79efa4f4bec035c5f51d5ae587287c9b952bdf734cacd"
|
||||||
|
dependencies = [
|
||||||
|
"log",
|
||||||
|
"presser",
|
||||||
|
"thiserror 1.0.69",
|
||||||
|
"windows 0.58.0",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "gpu-descriptor"
|
||||||
|
version = "0.3.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b89c83349105e3732062a895becfc71a8f921bb71ecbbdd8ff99263e3b53a0ca"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 2.13.2",
|
||||||
|
"gpu-descriptor-types",
|
||||||
|
"hashbrown 0.15.5",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "gpu-descriptor-types"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 2.13.2",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "guillotiere"
|
name = "guillotiere"
|
||||||
version = "0.6.2"
|
version = "0.6.2"
|
||||||
@@ -1304,13 +1440,22 @@ dependencies = [
|
|||||||
"smallvec",
|
"smallvec",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hashbrown"
|
||||||
|
version = "0.15.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
|
||||||
|
dependencies = [
|
||||||
|
"foldhash 0.1.5",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hashbrown"
|
name = "hashbrown"
|
||||||
version = "0.16.1"
|
version = "0.16.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
|
checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"foldhash",
|
"foldhash 0.2.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -1764,6 +1909,23 @@ dependencies = [
|
|||||||
"mutate_once",
|
"mutate_once",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "khronos-egl"
|
||||||
|
version = "6.0.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
"libloading",
|
||||||
|
"pkg-config",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "khronos_api"
|
||||||
|
version = "3.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "kira-installer"
|
name = "kira-installer"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
@@ -1909,6 +2071,15 @@ version = "0.16.4"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7f66e8d5d03f609abc3a39e6f08e4164ebf1447a732906d39eb9b99b7919ef39"
|
checksum = "7f66e8d5d03f609abc3a39e6f08e4164ebf1447a732906d39eb9b99b7919ef39"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "malloc_buf"
|
||||||
|
version = "0.0.6"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb"
|
||||||
|
dependencies = [
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "maybe-rayon"
|
name = "maybe-rayon"
|
||||||
version = "0.1.1"
|
version = "0.1.1"
|
||||||
@@ -1943,6 +2114,21 @@ dependencies = [
|
|||||||
"autocfg",
|
"autocfg",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "metal"
|
||||||
|
version = "0.32.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "00c15a6f673ff72ddcc22394663290f870fb224c1bfce55734a75c414150e605"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 2.13.2",
|
||||||
|
"block",
|
||||||
|
"core-graphics-types 0.2.0",
|
||||||
|
"foreign-types",
|
||||||
|
"log",
|
||||||
|
"objc",
|
||||||
|
"paste",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "miniz_oxide"
|
name = "miniz_oxide"
|
||||||
version = "0.8.9"
|
version = "0.8.9"
|
||||||
@@ -1994,7 +2180,7 @@ dependencies = [
|
|||||||
"wasm-bindgen",
|
"wasm-bindgen",
|
||||||
"wasm-bindgen-futures",
|
"wasm-bindgen-futures",
|
||||||
"web-sys",
|
"web-sys",
|
||||||
"windows",
|
"windows 0.62.2",
|
||||||
"zbus",
|
"zbus",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -2025,6 +2211,7 @@ dependencies = [
|
|||||||
"num-traits",
|
"num-traits",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"rustc-hash 1.1.0",
|
"rustc-hash 1.1.0",
|
||||||
|
"spirv",
|
||||||
"thiserror 2.0.20",
|
"thiserror 2.0.20",
|
||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
@@ -2181,6 +2368,15 @@ dependencies = [
|
|||||||
"syn 2.0.119",
|
"syn 2.0.119",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "objc"
|
||||||
|
version = "0.2.7"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1"
|
||||||
|
dependencies = [
|
||||||
|
"malloc_buf",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "objc-sys"
|
name = "objc-sys"
|
||||||
version = "0.3.5"
|
version = "0.3.5"
|
||||||
@@ -2547,6 +2743,15 @@ dependencies = [
|
|||||||
"libredox",
|
"libredox",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "ordered-float"
|
||||||
|
version = "5.5.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8c7c9e0d9b23589f26070720bac724174bfec1083e82f7854cdd0267518343c0"
|
||||||
|
dependencies = [
|
||||||
|
"num-traits",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ordered-stream"
|
name = "ordered-stream"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
@@ -2723,6 +2928,12 @@ dependencies = [
|
|||||||
"zerocopy",
|
"zerocopy",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "presser"
|
||||||
|
version = "0.3.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro-crate"
|
name = "proc-macro-crate"
|
||||||
version = "3.5.0"
|
version = "3.5.0"
|
||||||
@@ -2871,6 +3082,12 @@ version = "0.10.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69"
|
checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "range-alloc"
|
||||||
|
version = "0.1.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ca45419789ae5a7899559e9512e58ca889e41f04f1f2445e9f4b290ceccd1d08"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rangemap"
|
name = "rangemap"
|
||||||
version = "1.8.0"
|
version = "1.8.0"
|
||||||
@@ -3436,6 +3653,15 @@ dependencies = [
|
|||||||
"x11rb",
|
"x11rb",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "spirv"
|
||||||
|
version = "0.3.0+sdk-1.3.268.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844"
|
||||||
|
dependencies = [
|
||||||
|
"bitflags 2.13.2",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "stable_deref_trait"
|
name = "stable_deref_trait"
|
||||||
version = "1.2.1"
|
version = "1.2.1"
|
||||||
@@ -3515,6 +3741,15 @@ dependencies = [
|
|||||||
"windows-sys 0.61.2",
|
"windows-sys 0.61.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "termcolor"
|
||||||
|
version = "1.4.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755"
|
||||||
|
dependencies = [
|
||||||
|
"winapi-util",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "thiserror"
|
name = "thiserror"
|
||||||
version = "1.0.69"
|
version = "1.0.69"
|
||||||
@@ -3995,12 +4230,18 @@ dependencies = [
|
|||||||
"cfg_aliases",
|
"cfg_aliases",
|
||||||
"document-features",
|
"document-features",
|
||||||
"hashbrown 0.16.1",
|
"hashbrown 0.16.1",
|
||||||
|
"js-sys",
|
||||||
"log",
|
"log",
|
||||||
|
"naga",
|
||||||
|
"parking_lot",
|
||||||
"portable-atomic",
|
"portable-atomic",
|
||||||
"profiling",
|
"profiling",
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"static_assertions",
|
"static_assertions",
|
||||||
|
"wasm-bindgen",
|
||||||
|
"wasm-bindgen-futures",
|
||||||
|
"web-sys",
|
||||||
"wgpu-core",
|
"wgpu-core",
|
||||||
"wgpu-hal",
|
"wgpu-hal",
|
||||||
"wgpu-types",
|
"wgpu-types",
|
||||||
@@ -4031,11 +4272,31 @@ dependencies = [
|
|||||||
"rustc-hash 1.1.0",
|
"rustc-hash 1.1.0",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"thiserror 2.0.20",
|
"thiserror 2.0.20",
|
||||||
|
"wgpu-core-deps-apple",
|
||||||
|
"wgpu-core-deps-emscripten",
|
||||||
"wgpu-core-deps-windows-linux-android",
|
"wgpu-core-deps-windows-linux-android",
|
||||||
"wgpu-hal",
|
"wgpu-hal",
|
||||||
"wgpu-types",
|
"wgpu-types",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wgpu-core-deps-apple"
|
||||||
|
version = "27.0.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0772ae958e9be0c729561d5e3fd9a19679bcdfb945b8b1a1969d9bfe8056d233"
|
||||||
|
dependencies = [
|
||||||
|
"wgpu-hal",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "wgpu-core-deps-emscripten"
|
||||||
|
version = "27.0.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b06ac3444a95b0813ecfd81ddb2774b66220b264b3e2031152a4a29fda4da6b5"
|
||||||
|
dependencies = [
|
||||||
|
"wgpu-hal",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "wgpu-core-deps-windows-linux-android"
|
name = "wgpu-core-deps-windows-linux-android"
|
||||||
version = "27.0.0"
|
version = "27.0.0"
|
||||||
@@ -4051,18 +4312,47 @@ version = "27.0.4"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "5b21cb61c57ee198bc4aff71aeadff4cbb80b927beb912506af9c780d64313ce"
|
checksum = "5b21cb61c57ee198bc4aff71aeadff4cbb80b927beb912506af9c780d64313ce"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"android_system_properties",
|
||||||
|
"arrayvec",
|
||||||
|
"ash",
|
||||||
|
"bit-set",
|
||||||
"bitflags 2.13.2",
|
"bitflags 2.13.2",
|
||||||
|
"block",
|
||||||
|
"bytemuck",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"cfg_aliases",
|
"cfg_aliases",
|
||||||
|
"core-graphics-types 0.2.0",
|
||||||
|
"glow",
|
||||||
|
"glutin_wgl_sys",
|
||||||
|
"gpu-alloc",
|
||||||
|
"gpu-allocator",
|
||||||
|
"gpu-descriptor",
|
||||||
|
"hashbrown 0.16.1",
|
||||||
|
"js-sys",
|
||||||
|
"khronos-egl",
|
||||||
|
"libc",
|
||||||
"libloading",
|
"libloading",
|
||||||
"log",
|
"log",
|
||||||
|
"metal",
|
||||||
"naga",
|
"naga",
|
||||||
|
"ndk-sys",
|
||||||
|
"objc",
|
||||||
|
"once_cell",
|
||||||
|
"ordered-float",
|
||||||
|
"parking_lot",
|
||||||
"portable-atomic",
|
"portable-atomic",
|
||||||
"portable-atomic-util",
|
"portable-atomic-util",
|
||||||
|
"profiling",
|
||||||
|
"range-alloc",
|
||||||
"raw-window-handle",
|
"raw-window-handle",
|
||||||
"renderdoc-sys",
|
"renderdoc-sys",
|
||||||
|
"smallvec",
|
||||||
"thiserror 2.0.20",
|
"thiserror 2.0.20",
|
||||||
|
"wasm-bindgen",
|
||||||
|
"web-sys",
|
||||||
"wgpu-types",
|
"wgpu-types",
|
||||||
|
"windows 0.58.0",
|
||||||
|
"windows-core 0.58.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -4101,6 +4391,16 @@ dependencies = [
|
|||||||
"thiserror 2.0.20",
|
"thiserror 2.0.20",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows"
|
||||||
|
version = "0.58.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6"
|
||||||
|
dependencies = [
|
||||||
|
"windows-core 0.58.0",
|
||||||
|
"windows-targets",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows"
|
name = "windows"
|
||||||
version = "0.62.2"
|
version = "0.62.2"
|
||||||
@@ -4108,7 +4408,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580"
|
checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-collections",
|
"windows-collections",
|
||||||
"windows-core",
|
"windows-core 0.62.2",
|
||||||
"windows-future",
|
"windows-future",
|
||||||
"windows-numerics",
|
"windows-numerics",
|
||||||
]
|
]
|
||||||
@@ -4119,7 +4419,20 @@ version = "0.3.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610"
|
checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-core",
|
"windows-core 0.62.2",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-core"
|
||||||
|
version = "0.58.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99"
|
||||||
|
dependencies = [
|
||||||
|
"windows-implement 0.58.0",
|
||||||
|
"windows-interface 0.58.0",
|
||||||
|
"windows-result 0.2.0",
|
||||||
|
"windows-strings 0.1.0",
|
||||||
|
"windows-targets",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -4128,11 +4441,11 @@ version = "0.62.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb"
|
checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-implement",
|
"windows-implement 0.60.2",
|
||||||
"windows-interface",
|
"windows-interface 0.59.3",
|
||||||
"windows-link",
|
"windows-link",
|
||||||
"windows-result",
|
"windows-result 0.4.1",
|
||||||
"windows-strings",
|
"windows-strings 0.5.1",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -4141,11 +4454,22 @@ version = "0.3.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb"
|
checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-core",
|
"windows-core 0.62.2",
|
||||||
"windows-link",
|
"windows-link",
|
||||||
"windows-threading",
|
"windows-threading",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-implement"
|
||||||
|
version = "0.58.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn 2.0.119",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows-implement"
|
name = "windows-implement"
|
||||||
version = "0.60.2"
|
version = "0.60.2"
|
||||||
@@ -4157,6 +4481,17 @@ dependencies = [
|
|||||||
"syn 2.0.119",
|
"syn 2.0.119",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-interface"
|
||||||
|
version = "0.58.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515"
|
||||||
|
dependencies = [
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn 2.0.119",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows-interface"
|
name = "windows-interface"
|
||||||
version = "0.59.3"
|
version = "0.59.3"
|
||||||
@@ -4180,10 +4515,19 @@ version = "0.3.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26"
|
checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"windows-core",
|
"windows-core 0.62.2",
|
||||||
"windows-link",
|
"windows-link",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-result"
|
||||||
|
version = "0.2.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e"
|
||||||
|
dependencies = [
|
||||||
|
"windows-targets",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows-result"
|
name = "windows-result"
|
||||||
version = "0.4.1"
|
version = "0.4.1"
|
||||||
@@ -4193,6 +4537,16 @@ dependencies = [
|
|||||||
"windows-link",
|
"windows-link",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "windows-strings"
|
||||||
|
version = "0.1.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10"
|
||||||
|
dependencies = [
|
||||||
|
"windows-result 0.2.0",
|
||||||
|
"windows-targets",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "windows-strings"
|
name = "windows-strings"
|
||||||
version = "0.5.1"
|
version = "0.5.1"
|
||||||
@@ -4316,7 +4670,7 @@ dependencies = [
|
|||||||
"calloop",
|
"calloop",
|
||||||
"cfg_aliases",
|
"cfg_aliases",
|
||||||
"concurrent-queue",
|
"concurrent-queue",
|
||||||
"core-foundation",
|
"core-foundation 0.9.4",
|
||||||
"core-graphics",
|
"core-graphics",
|
||||||
"cursor-icon",
|
"cursor-icon",
|
||||||
"dpi",
|
"dpi",
|
||||||
@@ -4421,6 +4775,12 @@ version = "0.2.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56"
|
checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "xml-rs"
|
||||||
|
version = "0.8.29"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e450f9b2ed1dff33c94c12589a87338689467b9c4f5d8a5710bd09a847d2c8a7"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "y4m"
|
name = "y4m"
|
||||||
version = "0.8.0"
|
version = "0.8.0"
|
||||||
|
|||||||
+3
-1
@@ -8,7 +8,8 @@ edition = "2024"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
blocking = "1.6"
|
blocking = "1.6"
|
||||||
iced = { version = "0.14", default-features = false, features = ["crisp", "linux-theme-detection", "tiny-skia", "x11", "smol", "image"] }
|
iced = { version = "0.14", default-features = false, features = ["crisp", "linux-theme-detection", "tiny-skia", "wgpu", "x11", "smol", "image"] }
|
||||||
|
#iced = { git = "https://github.com/iced-rs/iced", branch = "vello_cpu", default-features = false, features = ["crisp", "linux-theme-detection", "vello-cpu", "x11", "smol", "image"]}
|
||||||
iced_moving_picture = "0"
|
iced_moving_picture = "0"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
rust-i18n = "3"
|
rust-i18n = "3"
|
||||||
@@ -29,6 +30,7 @@ lto = true
|
|||||||
debug = false
|
debug = false
|
||||||
incremental = false
|
incremental = false
|
||||||
codegen-units = 1
|
codegen-units = 1
|
||||||
|
# We need level 3 for tiny-skia otherwise render is lagging
|
||||||
opt-level = "s"
|
opt-level = "s"
|
||||||
strip = true
|
strip = true
|
||||||
|
|
||||||
|
|||||||
+24
-10
@@ -116,6 +116,23 @@ impl BlkDev {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
|
pub struct BcachefsProp {
|
||||||
|
pub password: Option<String>,
|
||||||
|
pub comp_alg: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl BcachefsProp {
|
||||||
|
pub fn new(password: Option<String>, comp_alg: Option<String>) -> Self {
|
||||||
|
Self { password:password, comp_alg: comp_alg }
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn default() -> Self {
|
||||||
|
Self { password: None, comp_alg: None }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
pub enum FSType {
|
pub enum FSType {
|
||||||
VFAT,
|
VFAT,
|
||||||
@@ -124,7 +141,7 @@ pub enum FSType {
|
|||||||
SWAP,
|
SWAP,
|
||||||
EXT4,
|
EXT4,
|
||||||
BTRFS,
|
BTRFS,
|
||||||
BCACHEFS,
|
BCACHEFS(BcachefsProp),
|
||||||
UNKNOWN,
|
UNKNOWN,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,7 +154,7 @@ impl std::fmt::Display for FSType {
|
|||||||
Self::SWAP => write!(f, "swap"),
|
Self::SWAP => write!(f, "swap"),
|
||||||
Self::EXT4 => write!(f, "ext4"),
|
Self::EXT4 => write!(f, "ext4"),
|
||||||
Self::BTRFS => write!(f, "btrfs"),
|
Self::BTRFS => write!(f, "btrfs"),
|
||||||
Self::BCACHEFS => write!(f, "bcachefs"),
|
Self::BCACHEFS(_) => write!(f, "bcachefs"),
|
||||||
Self::UNKNOWN => write!(f, "unknown"),
|
Self::UNKNOWN => write!(f, "unknown"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -153,7 +170,7 @@ impl FSType {
|
|||||||
"swap" => Self::SWAP,
|
"swap" => Self::SWAP,
|
||||||
"ext4" => Self::EXT4,
|
"ext4" => Self::EXT4,
|
||||||
"btrfs" => Self::BTRFS,
|
"btrfs" => Self::BTRFS,
|
||||||
"bcachefs" => Self::BCACHEFS,
|
"bcachefs" => Self::BCACHEFS(BcachefsProp::default()),
|
||||||
_ => Self::UNKNOWN,
|
_ => Self::UNKNOWN,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -168,7 +185,7 @@ impl FSType {
|
|||||||
Self::EXT4 => "ext4",
|
Self::EXT4 => "ext4",
|
||||||
Self::BTRFS => "btrfs",
|
Self::BTRFS => "btrfs",
|
||||||
// workaroud as parted do not support bcachefs partition type
|
// workaroud as parted do not support bcachefs partition type
|
||||||
Self::BCACHEFS => "bcachefs",
|
Self::BCACHEFS(_) => "xfs",
|
||||||
// lets do something generic here instead of panic
|
// lets do something generic here instead of panic
|
||||||
Self::UNKNOWN => "linux-swap",
|
Self::UNKNOWN => "linux-swap",
|
||||||
}
|
}
|
||||||
@@ -191,10 +208,7 @@ impl FSType {
|
|||||||
pub enum PartRole {
|
pub enum PartRole {
|
||||||
EFI,
|
EFI,
|
||||||
ROOT,
|
ROOT,
|
||||||
HOME,
|
SWAP
|
||||||
SWAP,
|
|
||||||
LuksRoot,
|
|
||||||
LuksHome,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
@@ -413,7 +427,7 @@ impl PartLayout {
|
|||||||
self.add_part(p_size, fs_type, gpt_label, fs_label, mount_point, role)
|
self.add_part(p_size, fs_type, gpt_label, fs_label, mount_point, role)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn gen_kira_layout(dev: BlkDev, efi_size: KiraSize, swap_size: KiraSize) -> Self {
|
pub fn gen_kira_layout(dev: BlkDev, efi_size: KiraSize, swap_size: KiraSize, maybe_password: Option<String>, maybe_compr: Option<String>) -> Self {
|
||||||
let mut res: PartLayout = PartLayout::new(dev);
|
let mut res: PartLayout = PartLayout::new(dev);
|
||||||
|
|
||||||
// UEFI partition
|
// UEFI partition
|
||||||
@@ -428,7 +442,7 @@ impl PartLayout {
|
|||||||
)
|
)
|
||||||
.add_part_reserve(
|
.add_part_reserve(
|
||||||
swap_size,
|
swap_size,
|
||||||
FSType::BTRFS,
|
FSType::BCACHEFS(BcachefsProp::new(maybe_password, maybe_compr)),
|
||||||
Some("bee-root".into()),
|
Some("bee-root".into()),
|
||||||
None,
|
None,
|
||||||
Some("/".into()),
|
Some("/".into()),
|
||||||
|
|||||||
+10
-7
@@ -150,13 +150,14 @@ fn parted_get_last_part_num(dev: &BlkDev) -> Result<u32, ExecCommandError> {
|
|||||||
/// parted --script $install_device mklabel gpt
|
/// parted --script $install_device mklabel gpt
|
||||||
/// Its blocking function
|
/// Its blocking function
|
||||||
pub fn parted_init_gpt_part_table(dev: &BlkDev) -> Result<(), ExecCommandError> {
|
pub fn parted_init_gpt_part_table(dev: &BlkDev) -> Result<(), ExecCommandError> {
|
||||||
exec_parted(&vec![
|
let dev_full_name = dev.full_name();
|
||||||
|
let args = vec![
|
||||||
"--script",
|
"--script",
|
||||||
dev.full_name().as_str(),
|
&dev_full_name,
|
||||||
"mklabel",
|
"mklabel",
|
||||||
"gpt",
|
"gpt",
|
||||||
])
|
];
|
||||||
.map(|_| ())
|
exec_command("parted", &args)
|
||||||
}
|
}
|
||||||
|
|
||||||
const LINUX_ROOT_X86_64_TYPE: &str = "4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709";
|
const LINUX_ROOT_X86_64_TYPE: &str = "4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709";
|
||||||
@@ -217,6 +218,7 @@ pub fn parted_mkpart(dev: &BlkDev, part: &PartInfo) -> Result<(), ExecCommandErr
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// creating single drive bcachefs volume
|
/// creating single drive bcachefs volume
|
||||||
|
/// compression: lz4, zstd
|
||||||
pub fn bcachefs_format(
|
pub fn bcachefs_format(
|
||||||
dev_name: &str,
|
dev_name: &str,
|
||||||
compression: Option<String>,
|
compression: Option<String>,
|
||||||
@@ -226,10 +228,11 @@ pub fn bcachefs_format(
|
|||||||
// --data_checksum=none - do not make sense on single dev volumes
|
// --data_checksum=none - do not make sense on single dev volumes
|
||||||
// sudo bcachefs format --force --compression=lz4 --background_compression=lz4 --encrypted --passphrase_file=./test.pass /dev/loop0
|
// sudo bcachefs format --force --compression=lz4 --background_compression=lz4 --encrypted --passphrase_file=./test.pass /dev/loop0
|
||||||
|
|
||||||
let mut arg = vec!["format", "--force", "--data_checksum=none"];
|
let mut arg = vec!["format", "--force"];
|
||||||
// if compression algorythm specified
|
// if compression algorythm specified
|
||||||
if let Some(compresss_alg) = &compression {
|
let maybe_comp_cmd = compression.and_then(|alg| Some(format!("--compression={}", alg)));
|
||||||
arg.push(compresss_alg.as_str());
|
if let Some(comp_cmd) = &maybe_comp_cmd {
|
||||||
|
arg.push(comp_cmd);
|
||||||
}
|
}
|
||||||
// if we want encrypted volume
|
// if we want encrypted volume
|
||||||
if let Some(passw) = password {
|
if let Some(passw) = password {
|
||||||
|
|||||||
+32
-51
@@ -72,35 +72,31 @@ enum Message {
|
|||||||
|
|
||||||
struct KiraState {
|
struct KiraState {
|
||||||
current_view: Views,
|
current_view: Views,
|
||||||
toml_config: toml::Table,
|
k_config: KiraConfig,
|
||||||
config: KiraConfig,
|
|
||||||
stages_save: Vec<Views>,
|
stages_save: Vec<Views>,
|
||||||
}
|
}
|
||||||
|
|
||||||
const CONFIG_PATH_STR: &str = "kira_config.toml";
|
// const CONFIG_PATH_STR: &str = "kira_config.toml";
|
||||||
|
|
||||||
fn load_kira_config(config_path: &str) -> Result<toml::Table, Box<dyn std::error::Error>> {
|
// fn load_kira_config(config_path: &str) -> Result<toml::Table, Box<dyn std::error::Error>> {
|
||||||
use std::fs;
|
// use std::fs;
|
||||||
use toml::Table;
|
// use toml::Table;
|
||||||
// 1. Read the file content into a String
|
// // 1. Read the file content into a String
|
||||||
let content = fs::read_to_string(config_path)?;
|
// let content = fs::read_to_string(config_path)?;
|
||||||
|
|
||||||
// 2. Parse the string into a Table
|
// // 2. Parse the string into a Table
|
||||||
let table: Table = content.parse()?;
|
// let table: Table = content.parse()?;
|
||||||
|
|
||||||
log::info!("{:?}", table);
|
// log::info!("{:?}", table);
|
||||||
Ok(table)
|
// Ok(table)
|
||||||
}
|
// }
|
||||||
|
|
||||||
impl KiraState {
|
impl KiraState {
|
||||||
fn boot() -> (Self, Task<Message>) {
|
fn boot() -> (Self, Task<Message>) {
|
||||||
(
|
(
|
||||||
Self {
|
Self {
|
||||||
current_view: Views::Start,
|
current_view: Views::Start,
|
||||||
toml_config: toml::Table::new(),
|
k_config: KiraConfig ::default(),
|
||||||
config: KiraConfig {
|
|
||||||
config_trail: Vec::new(),
|
|
||||||
},
|
|
||||||
stages_save: Vec::new(),
|
stages_save: Vec::new(),
|
||||||
},
|
},
|
||||||
Task::done(Message::Start),
|
Task::done(Message::Start),
|
||||||
@@ -125,26 +121,19 @@ 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 => match load_kira_config(CONFIG_PATH_STR) {
|
Message::Start => {
|
||||||
Ok(conf) => {
|
log::info!("Starting!");
|
||||||
log::info!("Config loaded!");
|
k_state.current_view = Views::Welcome(WelcomeStage::new(k_state.k_config.clone()));
|
||||||
k_state.toml_config = conf;
|
|
||||||
k_state.current_view = Views::Welcome(WelcomeStage::new());
|
|
||||||
Task::none()
|
Task::none()
|
||||||
}
|
|
||||||
Err(ex) => {
|
|
||||||
log::error!("Error reading config {}: {}", CONFIG_PATH_STR, ex);
|
|
||||||
iced::exit()
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
Message::Welcome(wlc_msg) => {
|
Message::Welcome(wlc_msg) => {
|
||||||
if let Views::Welcome(wlc_view) = &mut k_state.current_view {
|
if let Views::Welcome(wlc_view) = &mut k_state.current_view {
|
||||||
match wlc_view.update(wlc_msg) {
|
match wlc_view.update(wlc_msg) {
|
||||||
StageAction::Next(welcome_res) => {
|
StageAction::Next(welcome_res) => {
|
||||||
k_state.config.config_trail.push(welcome_res);
|
k_state.k_config = welcome_res;
|
||||||
let s_state = std::mem::replace(
|
let s_state = std::mem::replace(
|
||||||
&mut k_state.current_view,
|
&mut k_state.current_view,
|
||||||
Views::License(license::LicenseStage {}),
|
Views::License(license::LicenseStage::new(k_state.k_config.clone())),
|
||||||
);
|
);
|
||||||
k_state.stages_save.push(s_state);
|
k_state.stages_save.push(s_state);
|
||||||
Task::none()
|
Task::none()
|
||||||
@@ -161,10 +150,10 @@ fn update(k_state: &mut KiraState, message: Message) -> Task<Message> {
|
|||||||
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.k_config = license_res;
|
||||||
let s_state = std::mem::replace(
|
let s_state = std::mem::replace(
|
||||||
&mut k_state.current_view,
|
&mut k_state.current_view,
|
||||||
Views::Network(network::NetworkStage::new(&k_state.toml_config)),
|
Views::Network(network::NetworkStage::new(k_state.k_config.clone())),
|
||||||
);
|
);
|
||||||
k_state.stages_save.push(s_state);
|
k_state.stages_save.push(s_state);
|
||||||
Task::done(Message::Network(network::Message::CheckNetwork))
|
Task::done(Message::Network(network::Message::CheckNetwork))
|
||||||
@@ -172,7 +161,6 @@ fn update(k_state: &mut KiraState, message: Message) -> Task<Message> {
|
|||||||
StageAction::Abort => iced::exit(),
|
StageAction::Abort => iced::exit(),
|
||||||
StageAction::Back => {
|
StageAction::Back => {
|
||||||
k_state.current_view = k_state.stages_save.pop().unwrap();
|
k_state.current_view = k_state.stages_save.pop().unwrap();
|
||||||
k_state.config.config_trail.pop();
|
|
||||||
Task::none()
|
Task::none()
|
||||||
}
|
}
|
||||||
StageAction::None => Task::none(),
|
StageAction::None => Task::none(),
|
||||||
@@ -188,17 +176,16 @@ fn update(k_state: &mut KiraState, message: Message) -> Task<Message> {
|
|||||||
network::UpdateResult::Task(t) => t.map(Message::Network),
|
network::UpdateResult::Task(t) => t.map(Message::Network),
|
||||||
network::UpdateResult::StageAction(action) => match action {
|
network::UpdateResult::StageAction(action) => match action {
|
||||||
StageAction::Next(network_res) => {
|
StageAction::Next(network_res) => {
|
||||||
k_state.config.config_trail.push(network_res);
|
k_state.k_config = network_res;
|
||||||
let s_state = std::mem::replace(
|
let s_state = std::mem::replace(
|
||||||
&mut k_state.current_view,
|
&mut k_state.current_view,
|
||||||
Views::TimeZone(stages::timezone::TimeZoneStage::new()),
|
Views::TimeZone(stages::timezone::TimeZoneStage::new(k_state.k_config.clone())),
|
||||||
);
|
);
|
||||||
k_state.stages_save.push(s_state);
|
k_state.stages_save.push(s_state);
|
||||||
Task::none()
|
Task::none()
|
||||||
}
|
}
|
||||||
StageAction::Back => {
|
StageAction::Back => {
|
||||||
k_state.current_view = k_state.stages_save.pop().unwrap();
|
k_state.current_view = k_state.stages_save.pop().unwrap();
|
||||||
k_state.config.config_trail.pop();
|
|
||||||
Task::none()
|
Task::none()
|
||||||
}
|
}
|
||||||
_ => Task::none(),
|
_ => Task::none(),
|
||||||
@@ -213,17 +200,16 @@ fn update(k_state: &mut KiraState, message: Message) -> Task<Message> {
|
|||||||
let action = timezone_view.update(timezone_message);
|
let action = timezone_view.update(timezone_message);
|
||||||
match action {
|
match action {
|
||||||
StageAction::Next(tz_res) => {
|
StageAction::Next(tz_res) => {
|
||||||
k_state.config.config_trail.push(tz_res);
|
k_state.k_config = tz_res;
|
||||||
let s_state = std::mem::replace(
|
let s_state = std::mem::replace(
|
||||||
&mut k_state.current_view,
|
&mut k_state.current_view,
|
||||||
Views::Locale(stages::locale::LocaleStage::new(&k_state.config)),
|
Views::Locale(stages::locale::LocaleStage::new(k_state.k_config.clone())),
|
||||||
);
|
);
|
||||||
k_state.stages_save.push(s_state);
|
k_state.stages_save.push(s_state);
|
||||||
Task::none()
|
Task::none()
|
||||||
}
|
}
|
||||||
StageAction::Abort => iced::exit(),
|
StageAction::Abort => iced::exit(),
|
||||||
StageAction::Back => {
|
StageAction::Back => {
|
||||||
k_state.config.config_trail.pop();
|
|
||||||
k_state.current_view = k_state.stages_save.pop().unwrap();
|
k_state.current_view = k_state.stages_save.pop().unwrap();
|
||||||
Task::none()
|
Task::none()
|
||||||
}
|
}
|
||||||
@@ -237,16 +223,15 @@ fn update(k_state: &mut KiraState, message: Message) -> Task<Message> {
|
|||||||
if let Views::Locale(locale_view) = &mut k_state.current_view {
|
if let Views::Locale(locale_view) = &mut k_state.current_view {
|
||||||
match locale_view.update(locale_msg) {
|
match locale_view.update(locale_msg) {
|
||||||
StageAction::Next(locale_res) => {
|
StageAction::Next(locale_res) => {
|
||||||
k_state.config.config_trail.push(locale_res);
|
k_state.k_config = locale_res;
|
||||||
let s_state = std::mem::replace(
|
let s_state = std::mem::replace(
|
||||||
&mut k_state.current_view,
|
&mut k_state.current_view,
|
||||||
Views::Keyboard(stages::keyboard::KeyboardStage::new()),
|
Views::Keyboard(stages::keyboard::KeyboardStage::new(k_state.k_config.clone())),
|
||||||
);
|
);
|
||||||
k_state.stages_save.push(s_state);
|
k_state.stages_save.push(s_state);
|
||||||
Task::none()
|
Task::none()
|
||||||
}
|
}
|
||||||
StageAction::Back => {
|
StageAction::Back => {
|
||||||
k_state.config.config_trail.pop();
|
|
||||||
k_state.current_view = k_state.stages_save.pop().unwrap();
|
k_state.current_view = k_state.stages_save.pop().unwrap();
|
||||||
Task::none()
|
Task::none()
|
||||||
}
|
}
|
||||||
@@ -260,9 +245,9 @@ fn update(k_state: &mut KiraState, message: Message) -> Task<Message> {
|
|||||||
if let Views::Keyboard(keyboard_view) = &mut k_state.current_view {
|
if let Views::Keyboard(keyboard_view) = &mut k_state.current_view {
|
||||||
match keyboard_view.update(keyboard_msg) {
|
match keyboard_view.update(keyboard_msg) {
|
||||||
StageAction::Next(keyboard_res) => {
|
StageAction::Next(keyboard_res) => {
|
||||||
match stages::partition::PartitionStage::new(&k_state.toml_config) {
|
match stages::partition::PartitionStage::new(k_state.k_config.clone()) {
|
||||||
Ok(part_stage) => {
|
Ok(part_stage) => {
|
||||||
k_state.config.config_trail.push(keyboard_res);
|
k_state.k_config = keyboard_res;
|
||||||
let s_state = std::mem::replace(
|
let s_state = std::mem::replace(
|
||||||
&mut k_state.current_view,
|
&mut k_state.current_view,
|
||||||
Views::Partition(part_stage),
|
Views::Partition(part_stage),
|
||||||
@@ -276,7 +261,6 @@ fn update(k_state: &mut KiraState, message: Message) -> Task<Message> {
|
|||||||
Task::none()
|
Task::none()
|
||||||
}
|
}
|
||||||
StageAction::Back => {
|
StageAction::Back => {
|
||||||
k_state.config.config_trail.pop();
|
|
||||||
k_state.current_view = k_state.stages_save.pop().unwrap();
|
k_state.current_view = k_state.stages_save.pop().unwrap();
|
||||||
Task::none()
|
Task::none()
|
||||||
}
|
}
|
||||||
@@ -290,16 +274,15 @@ fn update(k_state: &mut KiraState, message: Message) -> Task<Message> {
|
|||||||
if let Views::Partition(partition_view) = &mut k_state.current_view {
|
if let Views::Partition(partition_view) = &mut k_state.current_view {
|
||||||
match partition_view.update(partition_msg) {
|
match partition_view.update(partition_msg) {
|
||||||
StageAction::Next(partition_res) => {
|
StageAction::Next(partition_res) => {
|
||||||
k_state.config.config_trail.push(partition_res);
|
k_state.k_config = partition_res;
|
||||||
let s_state = std::mem::replace(
|
let s_state = std::mem::replace(
|
||||||
&mut k_state.current_view,
|
&mut k_state.current_view,
|
||||||
Views::Security(stages::security::SecurityStage::new()),
|
Views::Security(stages::security::SecurityStage::new(k_state.k_config.clone())),
|
||||||
);
|
);
|
||||||
k_state.stages_save.push(s_state);
|
k_state.stages_save.push(s_state);
|
||||||
Task::none()
|
Task::none()
|
||||||
}
|
}
|
||||||
StageAction::Back => {
|
StageAction::Back => {
|
||||||
k_state.config.config_trail.pop();
|
|
||||||
k_state.current_view = k_state.stages_save.pop().unwrap();
|
k_state.current_view = k_state.stages_save.pop().unwrap();
|
||||||
Task::none()
|
Task::none()
|
||||||
}
|
}
|
||||||
@@ -313,16 +296,15 @@ fn update(k_state: &mut KiraState, message: Message) -> Task<Message> {
|
|||||||
if let Views::Security(security_view) = &mut k_state.current_view {
|
if let Views::Security(security_view) = &mut k_state.current_view {
|
||||||
match security_view.update(security_msg) {
|
match security_view.update(security_msg) {
|
||||||
StageAction::Next(security_res) => {
|
StageAction::Next(security_res) => {
|
||||||
k_state.config.config_trail.push(security_res);
|
k_state.k_config = security_res;
|
||||||
let s_state = std::mem::replace(
|
let s_state = std::mem::replace(
|
||||||
&mut k_state.current_view,
|
&mut k_state.current_view,
|
||||||
Views::Install(stages::install::InstallStage::new(&k_state.config)),
|
Views::Install(stages::install::InstallStage::new(k_state.k_config.clone())),
|
||||||
);
|
);
|
||||||
k_state.stages_save.push(s_state);
|
k_state.stages_save.push(s_state);
|
||||||
Task::none()
|
Task::none()
|
||||||
}
|
}
|
||||||
StageAction::Back => {
|
StageAction::Back => {
|
||||||
k_state.config.config_trail.pop();
|
|
||||||
k_state.current_view = k_state.stages_save.pop().unwrap();
|
k_state.current_view = k_state.stages_save.pop().unwrap();
|
||||||
Task::none()
|
Task::none()
|
||||||
}
|
}
|
||||||
@@ -339,7 +321,6 @@ fn update(k_state: &mut KiraState, message: Message) -> Task<Message> {
|
|||||||
stages::install::Update::Task(t) => t.map(Message::Install),
|
stages::install::Update::Task(t) => t.map(Message::Install),
|
||||||
stages::install::Update::StgAct(stage_action) => match stage_action {
|
stages::install::Update::StgAct(stage_action) => match stage_action {
|
||||||
StageAction::Back => {
|
StageAction::Back => {
|
||||||
k_state.config.config_trail.pop();
|
|
||||||
k_state.current_view = k_state.stages_save.pop().unwrap();
|
k_state.current_view = k_state.stages_save.pop().unwrap();
|
||||||
Task::none()
|
Task::none()
|
||||||
}
|
}
|
||||||
|
|||||||
+59
-52
@@ -18,47 +18,38 @@
|
|||||||
This file contains basic enums and structs to be used with stages.
|
This file contains basic enums and structs to be used with stages.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use iced::wgpu::naga::compact::KeepUnused::No;
|
||||||
|
|
||||||
use crate::stages;
|
use crate::stages;
|
||||||
|
|
||||||
|
|
||||||
// #[derive(Debug, Clone)]
|
// #[derive(Debug, Clone)]
|
||||||
// pub enum ConfigValue {
|
// pub enum StageResult {
|
||||||
// String(String),
|
// WelcomeStageResult(stages::welcome::WelcomeStageResult),
|
||||||
// I64(i64),
|
// NetworkStageResult(stages::network::NetworkStageResult),
|
||||||
// U64(u64),
|
// LocaleStageResult(stages::locale::LocaleStageResult),
|
||||||
// F64(f64),
|
// TimeZoneStageResult(stages::timezone::TimeZoneStageResult),
|
||||||
// Bool(bool),
|
// KeyboardStageResult(stages::keyboard::KeyboardStageResult),
|
||||||
// PartLayout(PartLayout),
|
// SecurityStageResult(stages::security::SecurityStageResult),
|
||||||
// KiraSize(KiraSize),
|
// PartitionStageResult(stages::partition::PartitionStageResult),
|
||||||
// Vector(Vec<ConfigValue>),
|
// None,
|
||||||
// Dictionary(HashMap<String, ConfigValue>),
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
// impl StageResult {
|
||||||
pub enum StageResult {
|
// pub fn name(&self) -> String {
|
||||||
WelcomeStageResult(stages::welcome::WelcomeStageResult),
|
// match self {
|
||||||
NetworkStageResult(stages::network::NetworkStageResult),
|
// Self::LocaleStageResult(_) => "locale".into(),
|
||||||
LocaleStageResult(stages::locale::LocaleStageResult),
|
// Self::WelcomeStageResult(_) => "welcome".into(),
|
||||||
TimeZoneStageResult(stages::timezone::TimeZoneStageResult),
|
// Self::NetworkStageResult(_) => "network".into(),
|
||||||
KeyboardStageResult(stages::keyboard::KeyboardStageResult),
|
// Self::TimeZoneStageResult(_) => "timezone".into(),
|
||||||
SecurityStageResult(stages::security::SecurityStageResult),
|
// Self::KeyboardStageResult(_) => "keyboard".into(),
|
||||||
PartitionStageResult(stages::partition::PartitionStageResult),
|
// Self::PartitionStageResult(_) => "partition".into(),
|
||||||
None,
|
// Self::SecurityStageResult(_) => "security".into(),
|
||||||
}
|
// Self::None => "none".into(),
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
impl StageResult {
|
|
||||||
pub fn name(&self) -> String {
|
|
||||||
match self {
|
|
||||||
Self::LocaleStageResult(_) => "locale".into(),
|
|
||||||
Self::WelcomeStageResult(_) => "welcome".into(),
|
|
||||||
Self::NetworkStageResult(_) => "network".into(),
|
|
||||||
Self::TimeZoneStageResult(_) => "timezone".into(),
|
|
||||||
Self::KeyboardStageResult(_) => "keyboard".into(),
|
|
||||||
Self::PartitionStageResult(_) => "partition".into(),
|
|
||||||
Self::SecurityStageResult(_) => "security".into(),
|
|
||||||
Self::None => "none".into(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// impl StageResult {
|
// impl StageResult {
|
||||||
// pub fn new(name: &str) -> Self {
|
// pub fn new(name: &str) -> Self {
|
||||||
// Self {
|
// Self {
|
||||||
@@ -129,36 +120,52 @@ impl StageResult {
|
|||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct KiraConfig {
|
pub struct KiraConfig {
|
||||||
pub config_trail: Vec<StageResult>,
|
pub res_welcome: Option<stages::welcome::WelcomeStageResult>,
|
||||||
|
pub res_license: bool,
|
||||||
|
pub res_network: Option<stages::network::NetworkStageResult>,
|
||||||
|
pub res_timezone: Option<stages::timezone::TimeZoneStageResult>,
|
||||||
|
pub res_locale: Option<stages::locale::LocaleStageResult>,
|
||||||
|
pub res_keyboard: Option<stages::keyboard::KeyboardStageResult>,
|
||||||
|
pub res_partition: Option<stages::partition::PartitionStageResult>,
|
||||||
|
pub res_security: Option<stages::security::SecurityStageResult>,
|
||||||
|
pub res_install: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for KiraConfig {
|
impl Default for KiraConfig {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
config_trail: Vec::new(),
|
res_welcome: None,
|
||||||
|
res_license: false,
|
||||||
|
res_network: None,
|
||||||
|
res_timezone: None,
|
||||||
|
res_locale: None,
|
||||||
|
res_keyboard: None,
|
||||||
|
res_partition: None,
|
||||||
|
res_security: None,
|
||||||
|
res_install: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl KiraConfig {
|
// impl KiraConfig {
|
||||||
pub fn get_stage(&self, name: &str) -> Option<StageResult> {
|
// pub fn get_stage(&self, name: &str) -> Option<StageResult> {
|
||||||
self.config_trail
|
// self.config_trail
|
||||||
.iter()
|
// .iter()
|
||||||
.find(|v| v.name() == name)
|
// .find(|v| v.name() == name)
|
||||||
.and_then(|v| Some(v.clone()))
|
// .and_then(|v| Some(v.clone()))
|
||||||
}
|
// }
|
||||||
pub fn pop_last(&mut self) -> Option<StageResult> {
|
// pub fn pop_last(&mut self) -> Option<StageResult> {
|
||||||
self.config_trail.pop()
|
// self.config_trail.pop()
|
||||||
}
|
// }
|
||||||
pub fn push(&mut self, stage_result: StageResult) {
|
// pub fn push(&mut self, stage_result: StageResult) {
|
||||||
self.config_trail.push(stage_result);
|
// self.config_trail.push(stage_result);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub enum StageAction {
|
pub enum StageAction {
|
||||||
Back,
|
Back,
|
||||||
None,
|
None,
|
||||||
Next(StageResult),
|
Next(KiraConfig),
|
||||||
Abort,
|
Abort,
|
||||||
}
|
}
|
||||||
|
|||||||
+68
-56
@@ -19,30 +19,32 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
kira_disk_layout::{self, BlkDev, PartLayout, PartRole},
|
kira_disk_layout::{self, BlkDev, FSType, PartLayout, PartRole},
|
||||||
kira_system::{self, ExecCommandError},
|
|
||||||
kira_size::KiraSize,
|
kira_size::KiraSize,
|
||||||
|
kira_system::{self, ExecCommandError},
|
||||||
kira_theming,
|
kira_theming,
|
||||||
stage::{KiraConfig, StageAction, StageResult},
|
stage::{KiraConfig, StageAction},
|
||||||
stages::partition::PartitionStageResult,
|
stages::partition::PartitionStageResult,
|
||||||
};
|
};
|
||||||
use iced::{
|
use iced::{
|
||||||
Alignment, Task, futures::{self, SinkExt, StreamExt, TryStreamExt, channel::mpsc::SendError}, widget,
|
Alignment, Task,
|
||||||
|
futures::{self, SinkExt, StreamExt, TryStreamExt, channel::mpsc::SendError},
|
||||||
|
widget,
|
||||||
};
|
};
|
||||||
use iced::{Color, Length, futures::channel::mpsc::Sender, widget::container};
|
use iced::{Color, Length, futures::channel::mpsc::Sender, widget::container};
|
||||||
///
|
|
||||||
/// So. I am goind to make dir structure lile this
|
|
||||||
/// /bzz/root
|
|
||||||
/// /bzz/home
|
|
||||||
/// Mount root from it and binmount home
|
|
||||||
///
|
|
||||||
use log;
|
use log;
|
||||||
use rust_i18n::t;
|
use rust_i18n::t;
|
||||||
|
|
||||||
|
const EFI_BOOT_MOUNT_POINT: &str = "/beefi";
|
||||||
|
|
||||||
/// Creates new GPT table and partitions from PartLayout
|
/// Creates new GPT table and partitions from PartLayout
|
||||||
pub fn create_partitions(part_layout: &PartLayout) -> Result<(), ExecCommandError> {
|
pub fn create_partitions(part_layout: &PartLayout) -> Result<(), ExecCommandError> {
|
||||||
|
log::info!("Creating GPT part table...");
|
||||||
kira_system::parted_init_gpt_part_table(&part_layout.dev)?;
|
kira_system::parted_init_gpt_part_table(&part_layout.dev)?;
|
||||||
|
log::info!("Start to create partitions...");
|
||||||
for part in &part_layout.part_list {
|
for part in &part_layout.part_list {
|
||||||
|
log::info!("Creating partition: {}", part);
|
||||||
kira_system::parted_mkpart(&part_layout.dev, part)?;
|
kira_system::parted_mkpart(&part_layout.dev, part)?;
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
@@ -55,13 +57,12 @@ pub fn create_partitions(part_layout: &PartLayout) -> Result<(), ExecCommandErro
|
|||||||
/// creates subvolumes bzz/root bzz/home
|
/// creates subvolumes bzz/root bzz/home
|
||||||
pub fn bcachefs_init(
|
pub fn bcachefs_init(
|
||||||
dev_name: &str,
|
dev_name: &str,
|
||||||
compression: Option<String>,
|
|
||||||
password: Option<String>,
|
|
||||||
mnt_dir: &str,
|
mnt_dir: &str,
|
||||||
|
password: Option<String>,
|
||||||
|
comp_alg: Option<String>,
|
||||||
) -> Result<(), ExecCommandError> {
|
) -> Result<(), ExecCommandError> {
|
||||||
|
|
||||||
// format device
|
// format device
|
||||||
kira_system::bcachefs_format(dev_name, compression, password.clone())?;
|
kira_system::bcachefs_format(dev_name, comp_alg, password.clone())?;
|
||||||
|
|
||||||
// if encryption used - unlock drive
|
// if encryption used - unlock drive
|
||||||
if let Some(pass) = password {
|
if let Some(pass) = password {
|
||||||
@@ -71,17 +72,14 @@ pub fn bcachefs_init(
|
|||||||
//mount drive
|
//mount drive
|
||||||
kira_system::bcachefs_mount(dev_name, mnt_dir)?;
|
kira_system::bcachefs_mount(dev_name, mnt_dir)?;
|
||||||
|
|
||||||
// Creating bzz_snaps directory for root snapshoots
|
// Creating bzz-snaps directory for root snapshoots
|
||||||
std::fs::create_dir(format!("{}{}", mnt_dir, "/bzz_snaps"))?;
|
std::fs::create_dir(format!("{}{}", mnt_dir, "/bzz-snaps"))?;
|
||||||
|
|
||||||
// We want /var to bee simple dir so snapshoting root capture it
|
|
||||||
std::fs::create_dir(format!("{}{}", mnt_dir, "/var"))?;
|
|
||||||
|
|
||||||
// Creating boot directory for efi mounting
|
// Creating boot directory for efi mounting
|
||||||
std::fs::create_dir_all(format!("{}{}", mnt_dir, "/bzz-boot/uefi"))?;
|
std::fs::create_dir_all(format!("{}{}", mnt_dir, EFI_BOOT_MOUNT_POINT))?;
|
||||||
|
|
||||||
// create subvolumes
|
// create subvolumes
|
||||||
for vol_name in ["/home", "/tmp", "/var/tmp"] {
|
for vol_name in ["/home", "/usr", "/var", "/var/tmp"] {
|
||||||
let vol_path = format!("{}{}", mnt_dir, vol_name);
|
let vol_path = format!("{}{}", mnt_dir, vol_name);
|
||||||
kira_system::bcachefs_create_subvolume(vol_path.as_str())?;
|
kira_system::bcachefs_create_subvolume(vol_path.as_str())?;
|
||||||
}
|
}
|
||||||
@@ -89,10 +87,11 @@ pub fn bcachefs_init(
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn init_disk(part_layout: &PartLayout) -> Result<(), ExecCommandError> {
|
pub fn init_disk(part_layout: &PartLayout, mnt_dir: &str) -> Result<(), ExecCommandError> {
|
||||||
// use parted to create partition gpt layout
|
// use parted to create partition gpt layout
|
||||||
create_partitions(part_layout)?;
|
create_partitions(part_layout)?;
|
||||||
|
|
||||||
|
// format partitions
|
||||||
for part in &part_layout.part_list {
|
for part in &part_layout.part_list {
|
||||||
match part.role {
|
match part.role {
|
||||||
Some(PartRole::EFI) => {
|
Some(PartRole::EFI) => {
|
||||||
@@ -100,6 +99,22 @@ pub fn init_disk(part_layout: &PartLayout) -> Result<(), ExecCommandError> {
|
|||||||
kira_system::mkfs_esp(&part_l)?;
|
kira_system::mkfs_esp(&part_l)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Some(PartRole::ROOT) => {
|
||||||
|
if let Some(part_l) = part.partlabel_dev() {
|
||||||
|
if let FSType::BCACHEFS(bc_par) = &part.fs_type {
|
||||||
|
bcachefs_init(
|
||||||
|
&part_l,
|
||||||
|
mnt_dir,
|
||||||
|
bc_par.password.clone(),
|
||||||
|
bc_par.comp_alg.clone(),
|
||||||
|
)?;
|
||||||
|
} else {
|
||||||
|
return Err(ExecCommandError::Other(
|
||||||
|
"ROOT partition is not BCACHEFS type!".into(),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Some(PartRole::SWAP) => {
|
Some(PartRole::SWAP) => {
|
||||||
if let Some(part_l) = part.partlabel_dev() {
|
if let Some(part_l) = part.partlabel_dev() {
|
||||||
kira_system::mkswap(&part_l)?;
|
kira_system::mkswap(&part_l)?;
|
||||||
@@ -127,6 +142,7 @@ pub struct InstallStage {
|
|||||||
progress_message: String,
|
progress_message: String,
|
||||||
part_config: PartitionStageResult,
|
part_config: PartitionStageResult,
|
||||||
modal_backgroud: Color,
|
modal_backgroud: Color,
|
||||||
|
k_config: KiraConfig,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
@@ -146,27 +162,16 @@ pub enum Update {
|
|||||||
Task(Task<Message>),
|
Task(Task<Message>),
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn init_disk_async(part_layout: PartLayout) -> Result<(f32, String), ExecCommandError> {
|
async fn init_disk_async(part_layout: PartLayout, mnt_dir: String) -> Result<(), ExecCommandError> {
|
||||||
use blocking;
|
use blocking;
|
||||||
blocking::unblock(move || init_disk(&part_layout)).await?;
|
blocking::unblock(move || init_disk(&part_layout, &mnt_dir)).await
|
||||||
Ok((1.1f32, "Preparing bcachefs filesystem...".into()))
|
|
||||||
}
|
|
||||||
|
|
||||||
async fn bcachefs_init_async(
|
|
||||||
dev_name: String,
|
|
||||||
compression: Option<String>,
|
|
||||||
password: Option<String>,
|
|
||||||
mnt_dir: String,
|
|
||||||
) -> Result<(f32, String), ExecCommandError> {
|
|
||||||
use blocking;
|
|
||||||
blocking::unblock(move || bcachefs_init(&dev_name, compression, password, &mnt_dir)).await?;
|
|
||||||
Ok((2.2f32, "Something next...".into()))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn partition_disk(
|
fn partition_disk(
|
||||||
disk_layout: PartLayout,
|
disk_layout: PartLayout,
|
||||||
password: Option<String>,
|
password: Option<String>,
|
||||||
compression: Option<String>,
|
compression: Option<String>,
|
||||||
|
mnt_dir: String,
|
||||||
) -> impl futures::Stream<Item = Result<(f32, String), ExecCommandError>> {
|
) -> impl futures::Stream<Item = Result<(f32, String), ExecCommandError>> {
|
||||||
use blocking;
|
use blocking;
|
||||||
|
|
||||||
@@ -175,14 +180,25 @@ fn partition_disk(
|
|||||||
|mut output: Sender<Result<(f32, String), ExecCommandError>>| async move {
|
|mut output: Sender<Result<(f32, String), ExecCommandError>>| async move {
|
||||||
//sleep(Duration::from_millis(10)).await;
|
//sleep(Duration::from_millis(10)).await;
|
||||||
let disk_layout_cloned = disk_layout.clone();
|
let disk_layout_cloned = disk_layout.clone();
|
||||||
|
|
||||||
// creating gpt partition table
|
// creating gpt partition table
|
||||||
match output.send(init_disk_async(disk_layout_cloned).await).await {
|
let res = init_disk_async(disk_layout_cloned, mnt_dir).await;
|
||||||
Err(ex) => {
|
output
|
||||||
log::error!("Error creating GPT partition table: {}", ex.to_string());
|
.send(res.map(|_| (1.1f32, "Formatting bcachefs".into())))
|
||||||
return;
|
.await
|
||||||
}
|
.unwrap();
|
||||||
_ => (),
|
if res.is_err() {
|
||||||
};
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let res = init_disk_async(disk_layout_cloned).await;
|
||||||
|
output
|
||||||
|
.send(res.map(|_| (1.1f32, "Formatting bcachefs".into())))
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
if res.is_err() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// creating partitions
|
// creating partitions
|
||||||
let dev = disk_layout.dev.clone();
|
let dev = disk_layout.dev.clone();
|
||||||
@@ -252,7 +268,7 @@ fn partition_disk(
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl InstallStage {
|
impl InstallStage {
|
||||||
pub fn new(config: &KiraConfig) -> Self {
|
pub fn new(k_config: KiraConfig) -> Self {
|
||||||
let mut modal_backgroud = kira_theming::main_theme().palette().background;
|
let mut modal_backgroud = kira_theming::main_theme().palette().background;
|
||||||
modal_backgroud.a = 0.5;
|
modal_backgroud.a = 0.5;
|
||||||
Self {
|
Self {
|
||||||
@@ -260,19 +276,14 @@ impl InstallStage {
|
|||||||
state: InstallationState::UserConfirmDialog,
|
state: InstallationState::UserConfirmDialog,
|
||||||
progress: 0.0,
|
progress: 0.0,
|
||||||
progress_message: String::new(),
|
progress_message: String::new(),
|
||||||
part_config: config
|
part_config: k_config.res_partition.clone().expect("Partition stage result should be present in KiraConfig!"),
|
||||||
.config_trail
|
k_config: k_config,
|
||||||
.iter()
|
|
||||||
.find_map(|v| match v {
|
|
||||||
StageResult::PartitionStageResult(res) => Some(res.clone()),
|
|
||||||
_ => None,
|
|
||||||
})
|
|
||||||
.expect("Partition stage result should be present in KiraConfig!"),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn gen_result(&self) -> StageResult {
|
fn gen_result(&mut self) -> KiraConfig {
|
||||||
StageResult::None
|
self.k_config.res_install = true;
|
||||||
|
self.k_config.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update(&mut self, message: Message) -> Update {
|
pub fn update(&mut self, message: Message) -> Update {
|
||||||
@@ -287,7 +298,8 @@ impl InstallStage {
|
|||||||
let disk_password = self.part_config.password.clone();
|
let disk_password = self.part_config.password.clone();
|
||||||
let disk_compression = Some("lz4".to_string());
|
let disk_compression = Some("lz4".to_string());
|
||||||
Update::Task(Task::run(
|
Update::Task(Task::run(
|
||||||
partition_disk(disk_layout, disk_password, disk_compression).map_err(|ex|ex.to_string()),
|
partition_disk(disk_layout, disk_password, disk_compression)
|
||||||
|
.map_err(|ex| ex.to_string()),
|
||||||
Message::UpdateProgress,
|
Message::UpdateProgress,
|
||||||
))
|
))
|
||||||
//Update::Task(Task::perform(, Message::PartitioningFinish))
|
//Update::Task(Task::perform(, Message::PartitioningFinish))
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
use crate::kira_scroll_list::{self, ListViewMessage};
|
use crate::kira_scroll_list::{self, ListViewMessage};
|
||||||
use crate::stage::{StageAction, StageResult};
|
use crate::stage::{KiraConfig, StageAction};
|
||||||
use iced::{Alignment, Length, widget};
|
use iced::{Alignment, Length, widget};
|
||||||
use log;
|
use log;
|
||||||
use rust_i18n::t;
|
use rust_i18n::t;
|
||||||
@@ -119,9 +119,9 @@ pub struct KeyboardStage {
|
|||||||
variants_map: HashMap<String, Vec<Variant>>,
|
variants_map: HashMap<String, Vec<Variant>>,
|
||||||
variants: Vec<Variant>,
|
variants: Vec<Variant>,
|
||||||
variant: Option<usize>,
|
variant: Option<usize>,
|
||||||
|
|
||||||
keyboard_layout: Option<KeyboarLayout>,
|
keyboard_layout: Option<KeyboarLayout>,
|
||||||
// selected_kbd_layout_id: Option<usize>,
|
// selected_kbd_layout_id: Option<usize>,
|
||||||
|
k_config: KiraConfig,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
@@ -230,7 +230,7 @@ fn get_layouts_blocking() -> std::io::Result<(
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl KeyboardStage {
|
impl KeyboardStage {
|
||||||
pub fn new() -> Self {
|
pub fn new(k_config: KiraConfig) -> Self {
|
||||||
match get_layouts_blocking() {
|
match get_layouts_blocking() {
|
||||||
Ok((models, layouts, variants_map)) => {
|
Ok((models, layouts, variants_map)) => {
|
||||||
let def_layout = layouts
|
let def_layout = layouts
|
||||||
@@ -258,6 +258,7 @@ impl KeyboardStage {
|
|||||||
layout: def_layout,
|
layout: def_layout,
|
||||||
variant: Some(0),
|
variant: Some(0),
|
||||||
keyboard_layout: keyboard_layout,
|
keyboard_layout: keyboard_layout,
|
||||||
|
k_config: k_config,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(ex) => {
|
Err(ex) => {
|
||||||
@@ -274,19 +275,21 @@ impl KeyboardStage {
|
|||||||
layout: None,
|
layout: None,
|
||||||
variant: None,
|
variant: None,
|
||||||
keyboard_layout: None,
|
keyboard_layout: None,
|
||||||
|
k_config: k_config,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn gen_result(&self) -> StageResult {
|
fn gen_result(&mut self) -> KiraConfig {
|
||||||
StageResult::KeyboardStageResult(KeyboardStageResult {
|
self.k_config.res_keyboard = Some(KeyboardStageResult {
|
||||||
keyboard_model: self.model.clone().expect("Keyboard model must be choosed!"),
|
keyboard_model: self.model.clone().expect("Keyboard model must be choosed!"),
|
||||||
keyboard_layout: self
|
keyboard_layout: self
|
||||||
.keyboard_layout
|
.keyboard_layout
|
||||||
.clone()
|
.clone()
|
||||||
.expect("Keyboard layout must be choosed!"),
|
.expect("Keyboard layout must be choosed!"),
|
||||||
})
|
});
|
||||||
|
self.k_config.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update(&mut self, message: Message) -> StageAction {
|
pub fn update(&mut self, message: Message) -> StageAction {
|
||||||
|
|||||||
@@ -23,10 +23,12 @@ use iced::{Alignment, widget};
|
|||||||
use rust_i18n::t;
|
use rust_i18n::t;
|
||||||
|
|
||||||
use crate::stage;
|
use crate::stage;
|
||||||
use crate::stage::StageResult;
|
use crate::stage::KiraConfig;
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct LicenseStage {}
|
pub struct LicenseStage {
|
||||||
|
k_config: KiraConfig,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub enum Message {
|
pub enum Message {
|
||||||
@@ -42,13 +44,18 @@ pub enum Message {
|
|||||||
//const LICENSE_TEXT: &str = include_str!("gpl-3.0.txt");
|
//const LICENSE_TEXT: &str = include_str!("gpl-3.0.txt");
|
||||||
|
|
||||||
impl LicenseStage {
|
impl LicenseStage {
|
||||||
fn accepted() -> StageResult {
|
pub fn new(k_config: KiraConfig) -> Self {
|
||||||
StageResult::None
|
Self { k_config: k_config }
|
||||||
|
}
|
||||||
|
|
||||||
|
fn accepted(&mut self) -> KiraConfig {
|
||||||
|
self.k_config.res_license = true;
|
||||||
|
self.k_config.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update(&mut self, message: Message) -> stage::StageAction {
|
pub fn update(&mut self, message: Message) -> stage::StageAction {
|
||||||
match message {
|
match message {
|
||||||
Message::Accept => stage::StageAction::Next(Self::accepted()),
|
Message::Accept => stage::StageAction::Next(self.accepted()),
|
||||||
Message::Back => stage::StageAction::Back,
|
Message::Back => stage::StageAction::Back,
|
||||||
Message::Decline => stage::StageAction::Abort,
|
Message::Decline => stage::StageAction::Abort,
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-11
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
kira_theming,
|
kira_theming,
|
||||||
stage::{KiraConfig, StageAction, StageResult},
|
stage::{KiraConfig, StageAction},
|
||||||
};
|
};
|
||||||
use iced::{Alignment, widget};
|
use iced::{Alignment, widget};
|
||||||
use rust_i18n::t;
|
use rust_i18n::t;
|
||||||
@@ -136,6 +136,7 @@ pub struct LocaleStage {
|
|||||||
locales: Vec<LocaleData>,
|
locales: Vec<LocaleData>,
|
||||||
lang_locale_text: String,
|
lang_locale_text: String,
|
||||||
all_locale_text: String,
|
all_locale_text: String,
|
||||||
|
k_config: KiraConfig,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
@@ -153,12 +154,12 @@ pub enum Message {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl LocaleStage {
|
impl LocaleStage {
|
||||||
pub fn new(kira_config: &KiraConfig) -> Self {
|
pub fn new(k_config: KiraConfig) -> Self {
|
||||||
// get seelctet language code from welcome stage
|
// get seelctet language code from welcome stage
|
||||||
let maybe_lang = kira_config.config_trail.iter().find_map(|v| match v {
|
let maybe_lang = k_config
|
||||||
StageResult::WelcomeStageResult(res) => Some(res.loc_code.clone()),
|
.res_welcome
|
||||||
_ => None,
|
.as_ref()
|
||||||
});
|
.and_then(|rw| Some(rw.loc_code.clone()));
|
||||||
|
|
||||||
let raw_loc_codes = get_locales_codes_list_blocking().unwrap();
|
let raw_loc_codes = get_locales_codes_list_blocking().unwrap();
|
||||||
let raw_loc_descr = get_locales_description_blocking().unwrap();
|
let raw_loc_descr = get_locales_description_blocking().unwrap();
|
||||||
@@ -210,24 +211,26 @@ impl LocaleStage {
|
|||||||
locales: locales,
|
locales: locales,
|
||||||
lang_locale_text: lang_locale_text,
|
lang_locale_text: lang_locale_text,
|
||||||
all_locale_text: all_locale_text,
|
all_locale_text: all_locale_text,
|
||||||
|
k_config: k_config,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn gen_result(&self) -> StageResult {
|
fn gen_result(&mut self) -> KiraConfig {
|
||||||
if let Some(lang_locale) = &self.lang_locale
|
self.k_config.res_locale = if let Some(lang_locale) = &self.lang_locale
|
||||||
&& let Some(formats_locale) = &self.formats_locale
|
&& let Some(formats_locale) = &self.formats_locale
|
||||||
{
|
{
|
||||||
StageResult::LocaleStageResult(LocaleStageResult {
|
Some(LocaleStageResult {
|
||||||
lang_locale: lang_locale.clone(),
|
lang_locale: lang_locale.clone(),
|
||||||
formats_locale: formats_locale.clone(),
|
formats_locale: formats_locale.clone(),
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
let loc = LocaleData::default();
|
let loc = LocaleData::default();
|
||||||
StageResult::LocaleStageResult(LocaleStageResult {
|
Some(LocaleStageResult {
|
||||||
lang_locale: loc.clone(),
|
lang_locale: loc.clone(),
|
||||||
formats_locale: loc,
|
formats_locale: loc,
|
||||||
})
|
})
|
||||||
}
|
};
|
||||||
|
self.k_config.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update(&mut self, message: Message) -> StageAction {
|
pub fn update(&mut self, message: Message) -> StageAction {
|
||||||
|
|||||||
+18
-30
@@ -23,10 +23,10 @@ use iced::{Alignment, Task, widget};
|
|||||||
use iced_moving_picture::widget::apng;
|
use iced_moving_picture::widget::apng;
|
||||||
use log;
|
use log;
|
||||||
use rust_i18n::t;
|
use rust_i18n::t;
|
||||||
use toml::Table;
|
|
||||||
|
|
||||||
use crate::stage;
|
use crate::stage::{self, KiraConfig};
|
||||||
use crate::stage::StageResult;
|
|
||||||
|
const REQIRE_NETWORK: bool = false;
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
pub enum State {
|
pub enum State {
|
||||||
@@ -41,21 +41,21 @@ pub enum CheckResult {
|
|||||||
CheckError,
|
CheckError,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
|
pub struct NetworkStageResult {
|
||||||
|
pub internet_active: bool,
|
||||||
|
pub use_net_settings: bool,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct NetworkStage {
|
pub struct NetworkStage {
|
||||||
internet_active: bool,
|
internet_active: bool,
|
||||||
state: State,
|
state: State,
|
||||||
use_net_settings: bool,
|
use_net_settings: bool,
|
||||||
reqire_network: bool,
|
|
||||||
spinner_frames: apng::Frames,
|
spinner_frames: apng::Frames,
|
||||||
logo_handle: widget::image::Handle,
|
logo_handle: widget::image::Handle,
|
||||||
status_message: String,
|
status_message: String,
|
||||||
}
|
k_config: KiraConfig,
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
|
||||||
pub struct NetworkStageResult {
|
|
||||||
pub internet_active: bool,
|
|
||||||
pub use_net_settings: bool,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
@@ -100,21 +100,7 @@ async fn check_connected() -> CheckResult {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl NetworkStage {
|
impl NetworkStage {
|
||||||
pub fn new(toml_config: &Table) -> Self {
|
pub fn new(k_config: KiraConfig) -> Self {
|
||||||
let mut reqire_network = false;
|
|
||||||
|
|
||||||
if let Some(reqire_network_conf) = toml_config
|
|
||||||
.get("network")
|
|
||||||
.and_then(|v| v.as_table())
|
|
||||||
.and_then(|v| v.get("reqire_network"))
|
|
||||||
.and_then(|v| v.as_bool())
|
|
||||||
{
|
|
||||||
log::debug!("Config value reqire_network read {}", reqire_network_conf);
|
|
||||||
reqire_network = reqire_network_conf;
|
|
||||||
} else {
|
|
||||||
log::error!("Error parsing network config. Using default values.");
|
|
||||||
}
|
|
||||||
|
|
||||||
let spinner_frames =
|
let spinner_frames =
|
||||||
apng::Frames::from_bytes(crate::kira_theming::get_spiner_bytes()).unwrap();
|
apng::Frames::from_bytes(crate::kira_theming::get_spiner_bytes()).unwrap();
|
||||||
|
|
||||||
@@ -125,17 +111,19 @@ impl NetworkStage {
|
|||||||
internet_active: false,
|
internet_active: false,
|
||||||
state: State::Cheking,
|
state: State::Cheking,
|
||||||
use_net_settings: true,
|
use_net_settings: true,
|
||||||
reqire_network: reqire_network,
|
|
||||||
spinner_frames: spinner_frames,
|
spinner_frames: spinner_frames,
|
||||||
status_message: t!("network.checking").into(),
|
status_message: t!("network.checking").into(),
|
||||||
|
k_config: k_config,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn gen_result(&self) -> StageResult {
|
fn gen_result(&self) -> KiraConfig {
|
||||||
StageResult::NetworkStageResult(NetworkStageResult {
|
let mut k_config = self.k_config.clone();
|
||||||
|
k_config.res_network = Some(NetworkStageResult {
|
||||||
internet_active: self.internet_active,
|
internet_active: self.internet_active,
|
||||||
use_net_settings: self.use_net_settings,
|
use_net_settings: self.use_net_settings,
|
||||||
})
|
});
|
||||||
|
k_config
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update(&mut self, message: Message) -> UpdateResult {
|
pub fn update(&mut self, message: Message) -> UpdateResult {
|
||||||
@@ -176,7 +164,7 @@ impl NetworkStage {
|
|||||||
|
|
||||||
pub fn view(&self) -> iced::Element<'_, Message> {
|
pub fn view(&self) -> iced::Element<'_, Message> {
|
||||||
let next_button =
|
let next_button =
|
||||||
if (self.state == State::Cheking) || (!self.internet_active && self.reqire_network) {
|
if (self.state == State::Cheking) || (!self.internet_active && REQIRE_NETWORK) {
|
||||||
widget::button(widget::text(t!("button.next")))
|
widget::button(widget::text(t!("button.next")))
|
||||||
} else {
|
} else {
|
||||||
widget::button(widget::text(t!("button.next"))).on_press(Message::Next)
|
widget::button(widget::text(t!("button.next"))).on_press(Message::Next)
|
||||||
|
|||||||
+51
-48
@@ -24,11 +24,13 @@ use crate::kira_color_bar;
|
|||||||
use crate::kira_disk_layout::{BlkDev, FSType, PartInfo, PartLayout};
|
use crate::kira_disk_layout::{BlkDev, FSType, PartInfo, PartLayout};
|
||||||
use crate::kira_size::KiraSize;
|
use crate::kira_size::KiraSize;
|
||||||
use crate::kira_sysinfo;
|
use crate::kira_sysinfo;
|
||||||
use crate::stage::{StageAction, StageResult};
|
use crate::stage::{KiraConfig, StageAction};
|
||||||
use iced::{Alignment, Color, Element, Length, widget};
|
use iced::{Alignment, Color, Element, Length, widget};
|
||||||
use log;
|
use log;
|
||||||
use rust_i18n::t;
|
use rust_i18n::t;
|
||||||
use toml::Table;
|
|
||||||
|
const MIN_DISK_SIZE_MB: u64 = 8192;
|
||||||
|
const EFI_SIZE_MB: u64 = 128;
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||||
pub enum SwapMode {
|
pub enum SwapMode {
|
||||||
@@ -69,7 +71,7 @@ fn part_type_to_color(t: &FSType) -> Color {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Converts PartInfo into data for ColorBar widget
|
/// Converts PartInfo into data for ColorBar widget
|
||||||
///
|
///
|
||||||
fn part_to_ct_params(part: &PartInfo, dev_size: KiraSize) -> (String, u16, Color) {
|
fn part_to_ct_params(part: &PartInfo, dev_size: KiraSize) -> (String, u16, Color) {
|
||||||
let fill_ratio: u16 = ((part.size.b() as f32 / dev_size.b() as f32) * 11.0) as u16;
|
let fill_ratio: u16 = ((part.size.b() as f32 / dev_size.b() as f32) * 11.0) as u16;
|
||||||
let fill_ratio = fill_ratio.max(1);
|
let fill_ratio = fill_ratio.max(1);
|
||||||
@@ -77,8 +79,6 @@ fn part_to_ct_params(part: &PartInfo, dev_size: KiraSize) -> (String, u16, Color
|
|||||||
(part.to_string(), fill_ratio, part_color)
|
(part.to_string(), fill_ratio, part_color)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
pub struct PartitionStageResult {
|
pub struct PartitionStageResult {
|
||||||
pub swap_mode: SwapMode,
|
pub swap_mode: SwapMode,
|
||||||
@@ -91,8 +91,6 @@ pub struct PartitionStageResult {
|
|||||||
pub part_layout: PartLayout,
|
pub part_layout: PartLayout,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct PartitionStage {
|
pub struct PartitionStage {
|
||||||
device: Option<BlkDev>,
|
device: Option<BlkDev>,
|
||||||
@@ -110,10 +108,9 @@ pub struct PartitionStage {
|
|||||||
generated_part_layout: Option<PartLayout>,
|
generated_part_layout: Option<PartLayout>,
|
||||||
system_ram_size: KiraSize,
|
system_ram_size: KiraSize,
|
||||||
vram_of_all_gpus_size: KiraSize,
|
vram_of_all_gpus_size: KiraSize,
|
||||||
|
k_config: KiraConfig,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub enum Message {
|
pub enum Message {
|
||||||
SelectDevice(BlkDev),
|
SelectDevice(BlkDev),
|
||||||
@@ -129,27 +126,12 @@ pub enum Message {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl PartitionStage {
|
impl PartitionStage {
|
||||||
pub fn new(toml_config: &Table) -> Result<Self, String> {
|
pub fn new(k_config: KiraConfig) -> Result<Self, String> {
|
||||||
let maybe_dev_list = BlkDev::list_sys_blk_dev();
|
let maybe_dev_list = BlkDev::list_sys_blk_dev();
|
||||||
log::info!("hiii from partition");
|
log::info!("hiii from partition");
|
||||||
let mut min_disk_size_mb = 8192;
|
|
||||||
let mut efi_size_mb = 128;
|
|
||||||
if let Some(part_table) = toml_config
|
|
||||||
.get("partition")
|
|
||||||
.and_then(|v| v.as_table()) {
|
|
||||||
|
|
||||||
min_disk_size_mb = part_table.get("min_disk_size_mb")
|
let min_disk_size: KiraSize = KiraSize::new_mb(MIN_DISK_SIZE_MB);
|
||||||
.and_then(|v| v.as_integer())
|
let efi_size: KiraSize = KiraSize::new_mb(EFI_SIZE_MB);
|
||||||
.unwrap_or(8192);
|
|
||||||
|
|
||||||
efi_size_mb = part_table.get("efi_size_mb")
|
|
||||||
.and_then(|v| v.as_integer())
|
|
||||||
.unwrap_or(128);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
let min_disk_size: KiraSize = KiraSize::new_mb(min_disk_size_mb.try_into().unwrap_or(8192));
|
|
||||||
let efi_size: KiraSize = KiraSize::new_mb(efi_size_mb.try_into().unwrap_or(128));
|
|
||||||
|
|
||||||
let sec_boot_setup = match kira_sysinfo::get_secure_boot_status() {
|
let sec_boot_setup = match kira_sysinfo::get_secure_boot_status() {
|
||||||
Ok(sb_status) => sb_status.setup_mode,
|
Ok(sb_status) => sb_status.setup_mode,
|
||||||
@@ -192,9 +174,10 @@ impl PartitionStage {
|
|||||||
efi_size: efi_size,
|
efi_size: efi_size,
|
||||||
selected_disk_parts: None,
|
selected_disk_parts: None,
|
||||||
generated_disk_parts: None,
|
generated_disk_parts: None,
|
||||||
generated_part_layout:None,
|
generated_part_layout: None,
|
||||||
system_ram_size: system_ram_size,
|
system_ram_size: system_ram_size,
|
||||||
vram_of_all_gpus_size: vram_of_all_gpus_size,
|
vram_of_all_gpus_size: vram_of_all_gpus_size,
|
||||||
|
k_config: k_config,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
Err(ex) => Err(ex),
|
Err(ex) => Err(ex),
|
||||||
@@ -240,8 +223,16 @@ impl PartitionStage {
|
|||||||
fn gen_layout(&mut self) {
|
fn gen_layout(&mut self) {
|
||||||
if let Some(dev) = self.device.clone() {
|
if let Some(dev) = self.device.clone() {
|
||||||
let swap_size: KiraSize = self.get_swap_size();
|
let swap_size: KiraSize = self.get_swap_size();
|
||||||
let patr_layout = PartLayout::gen_kira_layout(dev.clone(), self.efi_size, swap_size);
|
let patr_layout = PartLayout::gen_kira_layout(
|
||||||
self.generated_disk_parts = Some(patr_layout.part_list
|
dev.clone(),
|
||||||
|
self.efi_size,
|
||||||
|
swap_size,
|
||||||
|
None,
|
||||||
|
Some("lz4".into()),
|
||||||
|
);
|
||||||
|
self.generated_disk_parts = Some(
|
||||||
|
patr_layout
|
||||||
|
.part_list
|
||||||
.iter()
|
.iter()
|
||||||
.map(|part_info| part_to_ct_params(part_info, dev.size))
|
.map(|part_info| part_to_ct_params(part_info, dev.size))
|
||||||
.collect(),
|
.collect(),
|
||||||
@@ -250,14 +241,24 @@ impl PartitionStage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn gen_result(&self) -> StageResult {
|
fn gen_result(&mut self) -> KiraConfig {
|
||||||
let disk_layout = self.generated_part_layout.clone().expect("Layout must be generated!");
|
let disk_layout = self
|
||||||
|
.generated_part_layout
|
||||||
|
.clone()
|
||||||
|
.expect("Layout must be generated!");
|
||||||
|
|
||||||
StageResult::PartitionStageResult(PartitionStageResult { swap_mode: self.swap_mode.clone().unwrap(),
|
self.k_config.res_partition = Some(PartitionStageResult {
|
||||||
swap_size: self.get_swap_size(), efi_size: self.efi_size,
|
swap_mode: self.swap_mode.clone().unwrap(),
|
||||||
use_zram: self.use_zram, secure_boot: self.secure_boot, encrypt_drive: true,
|
swap_size: self.get_swap_size(),
|
||||||
password: Some("123456".to_string()), part_layout: disk_layout })
|
efi_size: self.efi_size,
|
||||||
|
use_zram: self.use_zram,
|
||||||
|
secure_boot: self.secure_boot,
|
||||||
|
encrypt_drive: true,
|
||||||
|
password: Some("123456".to_string()),
|
||||||
|
part_layout: disk_layout,
|
||||||
|
});
|
||||||
|
|
||||||
|
self.k_config.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update(&mut self, message: Message) -> StageAction {
|
pub fn update(&mut self, message: Message) -> StageAction {
|
||||||
@@ -290,25 +291,25 @@ impl PartitionStage {
|
|||||||
self.device = Some(dev);
|
self.device = Some(dev);
|
||||||
self.gen_layout();
|
self.gen_layout();
|
||||||
StageAction::None
|
StageAction::None
|
||||||
},
|
}
|
||||||
Message::SelectSwapMode(sm) => {
|
Message::SelectSwapMode(sm) => {
|
||||||
self.swap_mode = Some(sm);
|
self.swap_mode = Some(sm);
|
||||||
self.gen_layout();
|
self.gen_layout();
|
||||||
StageAction::None
|
StageAction::None
|
||||||
},
|
}
|
||||||
Message::ToggleSecureBoot(t) => {
|
Message::ToggleSecureBoot(t) => {
|
||||||
self.secure_boot = t;
|
self.secure_boot = t;
|
||||||
StageAction::None
|
StageAction::None
|
||||||
},
|
}
|
||||||
Message::ToggleEncrypDrive(t) => {
|
Message::ToggleEncrypDrive(t) => {
|
||||||
self.encrypt_drive = t;
|
self.encrypt_drive = t;
|
||||||
StageAction::None
|
StageAction::None
|
||||||
},
|
}
|
||||||
Message::ToggleZram(t) => {
|
Message::ToggleZram(t) => {
|
||||||
self.use_zram = t;
|
self.use_zram = t;
|
||||||
self.gen_layout();
|
self.gen_layout();
|
||||||
StageAction::None
|
StageAction::None
|
||||||
},
|
}
|
||||||
Message::SwapSizeIncrement => {
|
Message::SwapSizeIncrement => {
|
||||||
self.custom_swap_size_mb = (self.custom_swap_size_mb / 1024u32)
|
self.custom_swap_size_mb = (self.custom_swap_size_mb / 1024u32)
|
||||||
.strict_mul(1024u32)
|
.strict_mul(1024u32)
|
||||||
@@ -316,7 +317,7 @@ impl PartitionStage {
|
|||||||
self.custom_swap_size_str = format!("{}MB", self.custom_swap_size_mb);
|
self.custom_swap_size_str = format!("{}MB", self.custom_swap_size_mb);
|
||||||
self.gen_layout();
|
self.gen_layout();
|
||||||
StageAction::None
|
StageAction::None
|
||||||
},
|
}
|
||||||
Message::SwapSizeDecrement => {
|
Message::SwapSizeDecrement => {
|
||||||
self.custom_swap_size_mb = (self.custom_swap_size_mb / 1024u32)
|
self.custom_swap_size_mb = (self.custom_swap_size_mb / 1024u32)
|
||||||
.strict_mul(1024u32)
|
.strict_mul(1024u32)
|
||||||
@@ -324,7 +325,7 @@ impl PartitionStage {
|
|||||||
self.custom_swap_size_str = format!("{}MB", self.custom_swap_size_mb);
|
self.custom_swap_size_str = format!("{}MB", self.custom_swap_size_mb);
|
||||||
self.gen_layout();
|
self.gen_layout();
|
||||||
StageAction::None
|
StageAction::None
|
||||||
},
|
}
|
||||||
Message::SwapSizeFieldChange(f_v) => {
|
Message::SwapSizeFieldChange(f_v) => {
|
||||||
let mut only_num = f_v.trim().to_string();
|
let mut only_num = f_v.trim().to_string();
|
||||||
only_num.retain(char::is_numeric);
|
only_num.retain(char::is_numeric);
|
||||||
@@ -332,7 +333,7 @@ impl PartitionStage {
|
|||||||
self.custom_swap_size_str = format!("{}MB", self.custom_swap_size_mb);
|
self.custom_swap_size_str = format!("{}MB", self.custom_swap_size_mb);
|
||||||
self.gen_layout();
|
self.gen_layout();
|
||||||
StageAction::None
|
StageAction::None
|
||||||
},
|
}
|
||||||
Message::Back => StageAction::Back,
|
Message::Back => StageAction::Back,
|
||||||
Message::Next => StageAction::Next(self.gen_result()),
|
Message::Next => StageAction::Next(self.gen_result()),
|
||||||
}
|
}
|
||||||
@@ -374,10 +375,12 @@ impl PartitionStage {
|
|||||||
let selected_dev_content = widget::column![selected_dev_text, selected_dev_content];
|
let selected_dev_content = widget::column![selected_dev_text, selected_dev_content];
|
||||||
|
|
||||||
let use_sec_boot_checkbox = if self.secure_boot_in_setup_mode {
|
let use_sec_boot_checkbox = if self.secure_boot_in_setup_mode {
|
||||||
|
widget::checkbox(self.secure_boot)
|
||||||
|
.label(t!("partition.use_secure_boot"))
|
||||||
|
.on_toggle(Message::ToggleSecureBoot)
|
||||||
|
} else {
|
||||||
widget::checkbox(self.secure_boot).label(t!("partition.use_secure_boot"))
|
widget::checkbox(self.secure_boot).label(t!("partition.use_secure_boot"))
|
||||||
.on_toggle(Message::ToggleSecureBoot)
|
};
|
||||||
}
|
|
||||||
else {widget::checkbox(self.secure_boot).label(t!("partition.use_secure_boot"))};
|
|
||||||
|
|
||||||
widget::column![
|
widget::column![
|
||||||
widget::container(
|
widget::container(
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
This is Security stage, setup users logins and such
|
This is Security stage, setup users logins and such
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use crate::stage::{StageAction, StageResult};
|
use crate::stage::{StageAction, KiraConfig};
|
||||||
use iced::{Alignment, Color, widget};
|
use iced::{Alignment, Color, widget};
|
||||||
use rust_i18n::t;
|
use rust_i18n::t;
|
||||||
|
|
||||||
@@ -69,6 +69,7 @@ pub struct SecurityStage {
|
|||||||
root_pass_is_secure: bool,
|
root_pass_is_secure: bool,
|
||||||
user_password_strenght: PasswordStrenght,
|
user_password_strenght: PasswordStrenght,
|
||||||
root_password_strenght: PasswordStrenght,
|
root_password_strenght: PasswordStrenght,
|
||||||
|
k_config: KiraConfig,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
@@ -101,7 +102,7 @@ fn retain_first_n(s: &str, n: usize) -> &str {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl SecurityStage {
|
impl SecurityStage {
|
||||||
pub fn new() -> Self {
|
pub fn new(k_config: KiraConfig) -> Self {
|
||||||
Self {
|
Self {
|
||||||
user_name: "".into(),
|
user_name: "".into(),
|
||||||
user_full_name: "".into(),
|
user_full_name: "".into(),
|
||||||
@@ -112,16 +113,18 @@ impl SecurityStage {
|
|||||||
root_pass_is_secure: true,
|
root_pass_is_secure: true,
|
||||||
user_password_strenght: PasswordStrenght::Low,
|
user_password_strenght: PasswordStrenght::Low,
|
||||||
root_password_strenght: PasswordStrenght::Low,
|
root_password_strenght: PasswordStrenght::Low,
|
||||||
|
k_config: k_config,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn gen_result(&self) -> StageResult {
|
fn gen_result(&mut self) -> KiraConfig {
|
||||||
StageResult::SecurityStageResult(SecurityStageResult {
|
self.k_config.res_security = Some(SecurityStageResult {
|
||||||
user_name: self.user_name.clone(),
|
user_name: self.user_name.clone(),
|
||||||
user_full_name: self.user_full_name.clone(),
|
user_full_name: self.user_full_name.clone(),
|
||||||
user_password: self.user_password.clone(),
|
user_password: self.user_password.clone(),
|
||||||
root_password: self.root_password.clone(),
|
root_password: self.root_password.clone(),
|
||||||
})
|
});
|
||||||
|
self.k_config.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update(&mut self, message: Message) -> StageAction {
|
pub fn update(&mut self, message: Message) -> StageAction {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
This is TimeZone stage, used to select timezone
|
This is TimeZone stage, used to select timezone
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use crate::stage::{StageAction, StageResult};
|
use crate::stage::{KiraConfig, StageAction};
|
||||||
use iced::{Alignment, Length, widget};
|
use iced::{Alignment, Length, widget};
|
||||||
use log;
|
use log;
|
||||||
use rust_i18n::t;
|
use rust_i18n::t;
|
||||||
@@ -58,6 +58,7 @@ pub struct TimeZoneStage {
|
|||||||
zone_id: Option<usize>,
|
zone_id: Option<usize>,
|
||||||
selected_zone: Option<TimeZoneData>,
|
selected_zone: Option<TimeZoneData>,
|
||||||
selected_zone_text: String,
|
selected_zone_text: String,
|
||||||
|
k_config: KiraConfig,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
@@ -105,7 +106,7 @@ fn get_timezones_blocking() -> Result<Vec<TimeZoneData>, String> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl TimeZoneStage {
|
impl TimeZoneStage {
|
||||||
pub fn new() -> Self {
|
pub fn new(k_config: KiraConfig) -> Self {
|
||||||
match get_timezones_blocking() {
|
match get_timezones_blocking() {
|
||||||
Ok(time_zones_data_list) => {
|
Ok(time_zones_data_list) => {
|
||||||
let mut time_zones_map: HashMap<String, Vec<String>> = HashMap::new();
|
let mut time_zones_map: HashMap<String, Vec<String>> = HashMap::new();
|
||||||
@@ -130,6 +131,7 @@ impl TimeZoneStage {
|
|||||||
zone_id: None,
|
zone_id: None,
|
||||||
selected_zone: None,
|
selected_zone: None,
|
||||||
selected_zone_text: String::new(),
|
selected_zone_text: String::new(),
|
||||||
|
k_config: k_config,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(ex) => {
|
Err(ex) => {
|
||||||
@@ -145,18 +147,20 @@ impl TimeZoneStage {
|
|||||||
zone_id: None,
|
zone_id: None,
|
||||||
selected_zone: None,
|
selected_zone: None,
|
||||||
selected_zone_text: String::new(),
|
selected_zone_text: String::new(),
|
||||||
|
k_config: k_config,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn gen_result(&self) -> StageResult {
|
fn gen_result(&mut self) -> KiraConfig {
|
||||||
StageResult::TimeZoneStageResult(TimeZoneStageResult {
|
self.k_config.res_timezone = Some(TimeZoneStageResult {
|
||||||
time_zone: self
|
time_zone: self
|
||||||
.selected_zone
|
.selected_zone
|
||||||
.clone()
|
.clone()
|
||||||
.expect("Timezone must be selected!"),
|
.expect("Timezone must be selected!"),
|
||||||
})
|
});
|
||||||
|
self.k_config.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update(&mut self, message: Message) -> StageAction {
|
pub fn update(&mut self, message: Message) -> StageAction {
|
||||||
|
|||||||
+18
-15
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
kira_theming,
|
kira_theming,
|
||||||
stage::{StageAction, StageResult},
|
stage::{KiraConfig, StageAction},
|
||||||
};
|
};
|
||||||
use iced::{Alignment, widget};
|
use iced::{Alignment, widget};
|
||||||
use rust_i18n::t;
|
use rust_i18n::t;
|
||||||
@@ -37,18 +37,19 @@ impl std::fmt::Display for LocData {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
|
||||||
pub struct WelcomeStage {
|
|
||||||
locale: Option<LocData>,
|
|
||||||
locales: Vec<LocData>,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
pub struct WelcomeStageResult {
|
pub struct WelcomeStageResult {
|
||||||
pub loc_code: String,
|
pub loc_code: String,
|
||||||
pub loc_name: String,
|
pub loc_name: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
|
pub struct WelcomeStage {
|
||||||
|
locale: Option<LocData>,
|
||||||
|
locales: Vec<LocData>,
|
||||||
|
k_config: KiraConfig,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub enum Message {
|
pub enum Message {
|
||||||
SelectLocale(LocData),
|
SelectLocale(LocData),
|
||||||
@@ -57,7 +58,7 @@ pub enum Message {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl WelcomeStage {
|
impl WelcomeStage {
|
||||||
pub fn new() -> Self {
|
pub fn new(k_config: KiraConfig) -> Self {
|
||||||
Self {
|
Self {
|
||||||
locale: Some(LocData {
|
locale: Some(LocData {
|
||||||
name: "English".into(),
|
name: "English".into(),
|
||||||
@@ -70,21 +71,23 @@ impl WelcomeStage {
|
|||||||
code: s.to_string(),
|
code: s.to_string(),
|
||||||
})
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
|
k_config: k_config,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn gen_result(&self) -> StageResult {
|
fn gen_result(&mut self) -> KiraConfig {
|
||||||
if let Some(loc) = &self.locale {
|
self.k_config.res_welcome = Some(if let Some(loc) = &self.locale {
|
||||||
StageResult::WelcomeStageResult(WelcomeStageResult {
|
WelcomeStageResult {
|
||||||
loc_code: loc.code.clone(),
|
loc_code: loc.code.clone(),
|
||||||
loc_name: loc.name.clone(),
|
loc_name: loc.name.clone(),
|
||||||
})
|
}
|
||||||
} else {
|
} else {
|
||||||
StageResult::WelcomeStageResult(WelcomeStageResult {
|
WelcomeStageResult {
|
||||||
loc_code: "en".to_string(),
|
loc_code: "en".to_string(),
|
||||||
loc_name: "English".to_string(),
|
loc_name: "English".to_string(),
|
||||||
})
|
}
|
||||||
}
|
});
|
||||||
|
self.k_config.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn update(&mut self, message: Message) -> StageAction {
|
pub fn update(&mut self, message: Message) -> StageAction {
|
||||||
|
|||||||
Reference in New Issue
Block a user