From 983b7d37b0e0e1cb6a707efbaf68c2be76bf5e95 Mon Sep 17 00:00:00 2001 From: Nazar Mokrynskyi Date: Thu, 14 Mar 2024 10:49:27 +0200 Subject: [PATCH] Update `relm4` and `gtk4` to newer versions --- Cargo.lock | 449 +++++++++++++++++++++-------- Cargo.toml | 11 +- build.rs | 23 ++ src/frontend.rs | 14 +- src/frontend/configuration.rs | 10 +- src/frontend/configuration/farm.rs | 10 +- src/frontend/running.rs | 6 +- src/frontend/running/farm.rs | 16 +- src/frontend/running/node.rs | 4 +- src/main.rs | 8 +- 10 files changed, 386 insertions(+), 165 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2b2bc462..837fd97a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -904,7 +904,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4af014b17dd80e8af9fa689b2d4a211ddba6eb583c1622f35d0cb543f6b17e4" dependencies = [ "atk-sys", - "glib", + "glib 0.18.5", "libc", ] @@ -914,10 +914,10 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "251e0b7d90e33e0ba930891a505a9a35ece37b2dd37a14f3ffc306c13b980009" dependencies = [ - "glib-sys", - "gobject-sys", + "glib-sys 0.18.1", + "gobject-sys 0.18.0", "libc", - "system-deps", + "system-deps 6.2.2", ] [[package]] @@ -1390,22 +1390,45 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ca26ef0159422fb77631dc9d17b102f253b876fe1586b03b803e63a309b4ee2" dependencies = [ "bitflags 2.6.0", - "cairo-sys-rs", - "glib", + "cairo-sys-rs 0.18.2", + "glib 0.18.5", "libc", "once_cell", "thiserror", ] +[[package]] +name = "cairo-rs" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a0ea147c94108c9613235388f540e4d14c327f7081c9e471fc8ee8a2533e69" +dependencies = [ + "bitflags 2.6.0", + "cairo-sys-rs 0.20.0", + "glib 0.20.4", + "libc", +] + [[package]] name = "cairo-sys-rs" version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "685c9fa8e590b8b3d678873528d83411db17242a73fccaed827770ea0fedda51" dependencies = [ - "glib-sys", + "glib-sys 0.18.1", "libc", - "system-deps", + "system-deps 6.2.2", +] + +[[package]] +name = "cairo-sys-rs" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "428290f914b9b86089f60f5d8a9f6e440508e1bcff23b25afd51502b0a2da88f" +dependencies = [ + "glib-sys 0.20.4", + "libc", + "system-deps 7.0.3", ] [[package]] @@ -1435,6 +1458,16 @@ dependencies = [ "target-lexicon", ] +[[package]] +name = "cfg-expr" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0890061c4d3223e7267f3bad2ec40b997d64faac1c2815a4a9d95018e2b9e9c" +dependencies = [ + "smallvec", + "target-lexicon", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -3356,7 +3389,7 @@ version = "30.0.3" source = "git+https://github.com/subspace/polkadot-sdk?rev=5871818e1d736f1843eb9078f886290695165c42#5871818e1d736f1843eb9078f886290695165c42" dependencies = [ "Inflector", - "cfg-expr", + "cfg-expr 0.15.8", "derive-syn-parse", "docify", "expander", @@ -3662,13 +3695,13 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f5ba081bdef3b75ebcdbfc953699ed2d7417d6bd853347a42a37d76406a33646" dependencies = [ - "cairo-rs", - "gdk-pixbuf", + "cairo-rs 0.18.5", + "gdk-pixbuf 0.18.5", "gdk-sys", - "gio", - "glib", + "gio 0.18.4", + "glib 0.18.5", "libc", - "pango", + "pango 0.18.3", ] [[package]] @@ -3677,24 +3710,49 @@ version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50e1f5f1b0bfb830d6ccc8066d18db35c487b1b2b1e8589b5dfe9f07e8defaec" dependencies = [ - "gdk-pixbuf-sys", - "gio", - "glib", + "gdk-pixbuf-sys 0.18.0", + "gio 0.18.4", + "glib 0.18.5", "libc", "once_cell", ] +[[package]] +name = "gdk-pixbuf" +version = "0.20.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4c29071a9e92337d8270a85cb0510cda4ac478be26d09ad027cc1d081911b19" +dependencies = [ + "gdk-pixbuf-sys 0.20.4", + "gio 0.20.4", + "glib 0.20.4", + "libc", +] + [[package]] name = "gdk-pixbuf-sys" version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9839ea644ed9c97a34d129ad56d38a25e6756f99f3a88e15cd39c20629caf7" dependencies = [ - "gio-sys", - "glib-sys", - "gobject-sys", + "gio-sys 0.18.1", + "glib-sys 0.18.1", + "gobject-sys 0.18.0", "libc", - "system-deps", + "system-deps 6.2.2", +] + +[[package]] +name = "gdk-pixbuf-sys" +version = "0.20.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "687343b059b91df5f3fbd87b4307038fa9e647fcc0461d0d3f93e94fee20bf3d" +dependencies = [ + "gio-sys 0.20.4", + "glib-sys 0.20.4", + "gobject-sys 0.20.4", + "libc", + "system-deps 7.0.3", ] [[package]] @@ -3703,47 +3761,47 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31ff856cb3386dae1703a920f803abafcc580e9b5f711ca62ed1620c25b51ff2" dependencies = [ - "cairo-sys-rs", - "gdk-pixbuf-sys", - "gio-sys", - "glib-sys", - "gobject-sys", + "cairo-sys-rs 0.18.2", + "gdk-pixbuf-sys 0.18.0", + "gio-sys 0.18.1", + "glib-sys 0.18.1", + "gobject-sys 0.18.0", "libc", - "pango-sys", + "pango-sys 0.18.0", "pkg-config", - "system-deps", + "system-deps 6.2.2", ] [[package]] name = "gdk4" -version = "0.7.3" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7edb019ad581f8ecf8ea8e4baa6df7c483a95b5a59be3140be6a9c3b0c632af6" +checksum = "c121aeeb0cf7545877ae615dac6bfd088b739d8abee4d55e7143b06927d16a31" dependencies = [ - "cairo-rs", - "gdk-pixbuf", + "cairo-rs 0.20.1", + "gdk-pixbuf 0.20.4", "gdk4-sys", - "gio", - "glib", + "gio 0.20.4", + "glib 0.20.4", "libc", - "pango", + "pango 0.20.4", ] [[package]] name = "gdk4-sys" -version = "0.7.2" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbab43f332a3cf1df9974da690b5bb0e26720ed09a228178ce52175372dcfef0" +checksum = "7d3c03d1ea9d5199f14f060890fde68a3b5ec5699144773d1fa6abf337bfbc9c" dependencies = [ - "cairo-sys-rs", - "gdk-pixbuf-sys", - "gio-sys", - "glib-sys", - "gobject-sys", + "cairo-sys-rs 0.20.0", + "gdk-pixbuf-sys 0.20.4", + "gio-sys 0.20.4", + "glib-sys 0.20.4", + "gobject-sys 0.20.4", "libc", - "pango-sys", + "pango-sys 0.20.4", "pkg-config", - "system-deps", + "system-deps 7.0.3", ] [[package]] @@ -3836,8 +3894,8 @@ dependencies = [ "futures-core", "futures-io", "futures-util", - "gio-sys", - "glib", + "gio-sys 0.18.1", + "glib 0.18.5", "libc", "once_cell", "pin-project-lite", @@ -3845,19 +3903,49 @@ dependencies = [ "thiserror", ] +[[package]] +name = "gio" +version = "0.20.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8d999e8fb09583e96080867e364bc1e701284ad206c76a5af480d63833ad43c" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "gio-sys 0.20.4", + "glib 0.20.4", + "libc", + "pin-project-lite", + "smallvec", +] + [[package]] name = "gio-sys" version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37566df850baf5e4cb0dfb78af2e4b9898d817ed9263d1090a2df958c64737d2" dependencies = [ - "glib-sys", - "gobject-sys", + "glib-sys 0.18.1", + "gobject-sys 0.18.0", "libc", - "system-deps", + "system-deps 6.2.2", "winapi", ] +[[package]] +name = "gio-sys" +version = "0.20.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f7efc368de04755344f0084104835b6bb71df2c1d41e37d863947392a894779" +dependencies = [ + "glib-sys 0.20.4", + "gobject-sys 0.20.4", + "libc", + "system-deps 7.0.3", + "windows-sys 0.52.0", +] + [[package]] name = "glib" version = "0.18.5" @@ -3870,10 +3958,10 @@ dependencies = [ "futures-executor", "futures-task", "futures-util", - "gio-sys", - "glib-macros", - "glib-sys", - "gobject-sys", + "gio-sys 0.18.1", + "glib-macros 0.18.5", + "glib-sys 0.18.1", + "gobject-sys 0.18.0", "libc", "memchr", "once_cell", @@ -3881,6 +3969,27 @@ dependencies = [ "thiserror", ] +[[package]] +name = "glib" +version = "0.20.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adcf1ec6d3650bf9fdbc6cee242d4fcebc6f6bfd9bea5b929b6a8b7344eb85ff" +dependencies = [ + "bitflags 2.6.0", + "futures-channel", + "futures-core", + "futures-executor", + "futures-task", + "futures-util", + "gio-sys 0.20.4", + "glib-macros 0.20.4", + "glib-sys 0.20.4", + "gobject-sys 0.20.4", + "libc", + "memchr", + "smallvec", +] + [[package]] name = "glib-macros" version = "0.18.5" @@ -3895,6 +4004,19 @@ dependencies = [ "syn 2.0.82", ] +[[package]] +name = "glib-macros" +version = "0.20.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6bf88f70cd5720a6197639dcabcb378dd528d0cb68cb1f45e3b358bcb841cd7" +dependencies = [ + "heck 0.5.0", + "proc-macro-crate 3.2.0", + "proc-macro2", + "quote", + "syn 2.0.82", +] + [[package]] name = "glib-sys" version = "0.18.1" @@ -3902,7 +4024,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "063ce2eb6a8d0ea93d2bf8ba1957e78dbab6be1c2220dd3daca57d5a9d869898" dependencies = [ "libc", - "system-deps", + "system-deps 6.2.2", +] + +[[package]] +name = "glib-sys" +version = "0.20.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f9eca5d88cfa6a453b00d203287c34a2b7cac3a7831779aa2bb0b3c7233752b" +dependencies = [ + "libc", + "system-deps 7.0.3", ] [[package]] @@ -3917,9 +4049,20 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0850127b514d1c4a4654ead6dedadb18198999985908e6ffe4436f53c785ce44" dependencies = [ - "glib-sys", + "glib-sys 0.18.1", + "libc", + "system-deps 6.2.2", +] + +[[package]] +name = "gobject-sys" +version = "0.20.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4c674d2ff8478cf0ec29d2be730ed779fef54415a2fb4b565c52def62696462" +dependencies = [ + "glib-sys 0.20.4", "libc", - "system-deps", + "system-deps 7.0.3", ] [[package]] @@ -3944,25 +4087,25 @@ dependencies = [ [[package]] name = "graphene-rs" -version = "0.18.1" +version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2228cda1505613a7a956cca69076892cfbda84fc2b7a62b94a41a272c0c401" +checksum = "1f53144c7fe78292705ff23935f1477d511366fb2f73c43d63b37be89076d2fe" dependencies = [ - "glib", + "glib 0.20.4", "graphene-sys", "libc", ] [[package]] name = "graphene-sys" -version = "0.18.1" +version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc4144cee8fc8788f2a9b73dc5f1d4e1189d1f95305c4cb7bd9c1af1cfa31f59" +checksum = "e741797dc5081e59877a4d72c442c72d61efdd99161a0b1c1b29b6b988934b99" dependencies = [ - "glib-sys", + "glib-sys 0.20.4", "libc", "pkg-config", - "system-deps", + "system-deps 7.0.3", ] [[package]] @@ -3978,33 +4121,33 @@ dependencies = [ [[package]] name = "gsk4" -version = "0.7.3" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d958e351d2f210309b32d081c832d7de0aca0b077aa10d88336c6379bd01f7e" +checksum = "aa21a2f7c51ee1c6cc1242c2faf3aae2b7566138f182696759987bde8219e922" dependencies = [ - "cairo-rs", + "cairo-rs 0.20.1", "gdk4", - "glib", + "glib 0.20.4", "graphene-rs", "gsk4-sys", "libc", - "pango", + "pango 0.20.4", ] [[package]] name = "gsk4-sys" -version = "0.7.3" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12bd9e3effea989f020e8f1ff3fa3b8c63ba93d43b899c11a118868853a56d55" +checksum = "0f9fb607554f9f4e8829eb7ea301b0fde051e1dbfd5d16b143a8a9c2fac6c01b" dependencies = [ - "cairo-sys-rs", + "cairo-sys-rs 0.20.0", "gdk4-sys", - "glib-sys", - "gobject-sys", + "glib-sys 0.20.4", + "gobject-sys 0.20.4", "graphene-sys", "libc", - "pango-sys", - "system-deps", + "pango-sys 0.20.4", + "system-deps 7.0.3", ] [[package]] @@ -4014,17 +4157,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93c4f5e0e20b60e10631a5f06da7fe3dda744b05ad0ea71fee2f47adf865890c" dependencies = [ "atk", - "cairo-rs", + "cairo-rs 0.18.5", "field-offset", "futures-channel", "gdk", - "gdk-pixbuf", - "gio", - "glib", + "gdk-pixbuf 0.18.5", + "gio 0.18.4", + "glib 0.18.5", "gtk-sys", "gtk3-macros", "libc", - "pango", + "pango 0.18.3", "pkg-config", ] @@ -4035,15 +4178,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "771437bf1de2c1c0b496c11505bdf748e26066bbe942dfc8f614c9460f6d7722" dependencies = [ "atk-sys", - "cairo-sys-rs", - "gdk-pixbuf-sys", + "cairo-sys-rs 0.18.2", + "gdk-pixbuf-sys 0.18.0", "gdk-sys", - "gio-sys", - "glib-sys", - "gobject-sys", + "gio-sys 0.18.1", + "glib-sys 0.18.1", + "gobject-sys 0.18.0", "libc", - "pango-sys", - "system-deps", + "pango-sys 0.18.0", + "system-deps 6.2.2", ] [[package]] @@ -4061,56 +4204,54 @@ dependencies = [ [[package]] name = "gtk4" -version = "0.7.3" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aeb51aa3e9728575a053e1f43543cd9992ac2477e1b186ad824fd4adfb70842" +checksum = "31e2d105ce672f5cdcb5af2602e91c2901e91c72da15ab76f613ad57ecf04c6d" dependencies = [ - "cairo-rs", + "cairo-rs 0.20.1", "field-offset", "futures-channel", - "gdk-pixbuf", + "gdk-pixbuf 0.20.4", "gdk4", - "gio", - "glib", + "gio 0.20.4", + "glib 0.20.4", "graphene-rs", "gsk4", "gtk4-macros", "gtk4-sys", "libc", - "pango", + "pango 0.20.4", ] [[package]] name = "gtk4-macros" -version = "0.7.2" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d57ec49cf9b657f69a05bca8027cff0a8dfd0c49e812be026fc7311f2163832f" +checksum = "e9e7b362c8fccd2712297903717d65d30defdab2b509bc9d209cbe5ffb9fabaf" dependencies = [ - "anyhow", - "proc-macro-crate 1.1.3", - "proc-macro-error", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.82", ] [[package]] name = "gtk4-sys" -version = "0.7.3" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54d8c4aa23638ce9faa2caf7e2a27d4a1295af2155c8e8d28c4d4eeca7a65eb8" +checksum = "cbe4325908b1c1642dbb48e9f49c07a73185babf43e8b2065b0f881a589f55b8" dependencies = [ - "cairo-sys-rs", - "gdk-pixbuf-sys", + "cairo-sys-rs 0.20.0", + "gdk-pixbuf-sys 0.20.4", "gdk4-sys", - "gio-sys", - "glib-sys", - "gobject-sys", + "gio-sys 0.20.4", + "glib-sys 0.20.4", + "gobject-sys 0.20.4", "graphene-sys", "gsk4-sys", "libc", - "pango-sys", - "system-deps", + "pango-sys 0.20.4", + "system-deps 7.0.3", ] [[package]] @@ -5313,7 +5454,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03589b9607c868cc7ae54c0b2a22c8dc03dd41692d48f2d7df73615c6a95dc0a" dependencies = [ - "glib", + "glib 0.18.5", "gtk", "gtk-sys", "libappindicator-sys", @@ -7763,11 +7904,23 @@ version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ca27ec1eb0457ab26f3036ea52229edbdb74dee1edd29063f5b9b010e7ebee4" dependencies = [ - "gio", - "glib", + "gio 0.18.4", + "glib 0.18.5", "libc", "once_cell", - "pango-sys", + "pango-sys 0.18.0", +] + +[[package]] +name = "pango" +version = "0.20.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa26aa54b11094d72141a754901cd71d9356432bb8147f9cace8d9c7ba95f356" +dependencies = [ + "gio 0.20.4", + "glib 0.20.4", + "libc", + "pango-sys 0.20.4", ] [[package]] @@ -7776,10 +7929,22 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "436737e391a843e5933d6d9aa102cb126d501e815b83601365a948a518555dc5" dependencies = [ - "glib-sys", - "gobject-sys", + "glib-sys 0.18.1", + "gobject-sys 0.18.0", + "libc", + "system-deps 6.2.2", +] + +[[package]] +name = "pango-sys" +version = "0.20.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84fd65917bf12f06544ae2bbc200abf9fc0a513a5a88a0fa81013893aef2b838" +dependencies = [ + "glib-sys 0.20.4", + "gobject-sys 0.20.4", "libc", - "system-deps", + "system-deps 7.0.3", ] [[package]] @@ -8864,7 +9029,7 @@ dependencies = [ "rand", "rand_chacha", "simd_helpers", - "system-deps", + "system-deps 6.2.2", "thiserror", "v_frame", "wasm-bindgen", @@ -9062,16 +9227,16 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "relm4" -version = "0.7.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f8f08cd89e93688c76f1ceae98f1331131b211b898d529bcf41f4ccfcbe698e" +checksum = "30837553c1a8cfea1a404c83ec387c5c8ff9358e1060b057c274c5daa5035ad1" dependencies = [ - "async-trait", "flume", "fragile", "futures", "gtk4", "once_cell", + "relm4-css", "relm4-macros", "tokio", "tracing", @@ -9079,9 +9244,9 @@ dependencies = [ [[package]] name = "relm4-components" -version = "0.7.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6891c5cdb090a76e5eb3ec525dafe0171a751cb54156b6d62e1e43e6d2188db" +checksum = "fb3d67f2982131c5e6047af4278d8fe750266767e57b58bc15f2e11e190eef36" dependencies = [ "once_cell", "relm4", @@ -9089,20 +9254,34 @@ dependencies = [ ] [[package]] -name = "relm4-icons" -version = "0.7.0-alpha.2" +name = "relm4-css" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d2413577ec528e0a4de8d05e7b1f6840e60f2cf14a70b16dfd8d862654c06c" +checksum = "1d3b924557df1cddc687b60b313c4b76620fdbf0e463afa4b29f67193ccf37f9" + +[[package]] +name = "relm4-icons" +version = "0.9.0" +source = "git+https://github.com/Relm4/icons?rev=74dc5af44e0dc6bb397cbb6c32d6d57661a26601#74dc5af44e0dc6bb397cbb6c32d6d57661a26601" dependencies = [ "gtk4", +] + +[[package]] +name = "relm4-icons-build" +version = "0.1.0" +source = "git+https://github.com/Relm4/icons?rev=74dc5af44e0dc6bb397cbb6c32d6d57661a26601#74dc5af44e0dc6bb397cbb6c32d6d57661a26601" +dependencies = [ "gvdb", + "serde", + "toml 0.8.19", ] [[package]] name = "relm4-macros" -version = "0.7.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a0249463bd27f93f10c883aaa31e7ca254cc2f0c6c8cd60a68e6d052d9dba85" +checksum = "5a895a7455441a857d100ca679bd24a92f91d28b5e3df63296792ac1af2eddde" dependencies = [ "proc-macro2", "quote", @@ -11971,6 +12150,7 @@ dependencies = [ "relm4", "relm4-components", "relm4-icons", + "relm4-icons-build", "reqwest", "sc-client-api", "sc-client-db", @@ -12749,7 +12929,20 @@ version = "6.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" dependencies = [ - "cfg-expr", + "cfg-expr 0.15.8", + "heck 0.5.0", + "pkg-config", + "toml 0.8.19", + "version-compare", +] + +[[package]] +name = "system-deps" +version = "7.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66d23aaf9f331227789a99e8de4c91bf46703add012bdfd45fdecdfb2975a005" +dependencies = [ + "cfg-expr 0.17.0", "heck 0.5.0", "pkg-config", "toml 0.8.19", diff --git a/Cargo.toml b/Cargo.toml index 63f936ca..bb7ed5ef 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,7 +51,7 @@ frame-system = { git = "https://github.com/subspace/polkadot-sdk", rev = "587181 fs4 = "0.10.0" futures = "0.3.31" futures-timer = "3.0.3" -gtk = { version = "0.7.3", package = "gtk4", features = ["v4_14"] } +gtk = { version = "0.9.2", package = "gtk4", features = ["v4_14"] } hex = "0.4.3" image = { version = "0.25.4", default-features = false, features = ["png"] } mimalloc = "0.1.43" @@ -61,9 +61,10 @@ open = "5.3.0" pallet-balances = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42", default-features = false } parity-scale-codec = "3.6.12" parking_lot = "0.12.3" -relm4 = "0.7.0-rc.1" -relm4-components = { version = "0.7.0-rc.1", default-features = false } -relm4-icons = { version = "0.7.0-alpha.2", features = ["checkmark", "cross", "grid-filled", "menu-large", "pause", "processor", "puzzle-piece", "size-horizontally", "speedometer2", "speedometer3", "speedometer4", "ssd", "wallet2", "warning"] } +relm4 = "0.9.1" +relm4-components = { version = "0.9.1", default-features = false } +# TODO: Switch to upstream release 0.10.0+ that includes https://github.com/Relm4/icons/pull/19 +relm4-icons = { version = "0.9.0", git = "https://github.com/Relm4/icons", rev = "74dc5af44e0dc6bb397cbb6c32d6d57661a26601" } reqwest = { version = "0.12.8", default-features = false, features = ["json", "rustls-tls"] } sc-client-api = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42", default-features = false } sc-client-db = { git = "https://github.com/subspace/polkadot-sdk", rev = "5871818e1d736f1843eb9078f886290695165c42", default-features = false } @@ -125,6 +126,8 @@ ksni = "0.2.2" [build-dependencies] fluent-static-codegen = "0.5.0" +# TODO: Switch to upstream release, right now it is unreleased +relm4-icons-build = { version = "0.1.0", git = "https://github.com/Relm4/icons", rev = "74dc5af44e0dc6bb397cbb6c32d6d57661a26601" } [target.'cfg(windows)'.build-dependencies] winres = "0.1.12" diff --git a/build.rs b/build.rs index da58113c..ef64349f 100644 --- a/build.rs +++ b/build.rs @@ -28,4 +28,27 @@ fn main() { res.set_icon("res\\windows\\space-acres.ico"); res.compile().unwrap(); } + + relm4_icons_build::bundle_icons( + "icon_names.rs", + None, + None, + None::<&str>, + [ + "ssd", + "size-horizontally", + "cross", + "checkmark", + "wallet2", + "warning", + "puzzle-piece", + "pause", + "menu-large", + "processor", + "speedometer2", + "speedometer3", + "speedometer4", + "grid-filled", + ], + ); } diff --git a/src/frontend.rs b/src/frontend.rs index e08c477b..bb4748be 100644 --- a/src/frontend.rs +++ b/src/frontend.rs @@ -14,7 +14,7 @@ use crate::frontend::loading::{LoadingInput, LoadingView}; use crate::frontend::new_version::NewVersion; use crate::frontend::running::{RunningInit, RunningInput, RunningOutput, RunningView}; use crate::frontend::translations::{AsDefaultStr, T}; -use crate::AppStatusCode; +use crate::{icon_names, AppStatusCode}; use futures::channel::mpsc; use futures::{SinkExt, StreamExt}; use gtk::glib; @@ -23,7 +23,6 @@ use notify_rust::Notification; use relm4::actions::{RelmAction, RelmActionGroup}; use relm4::prelude::*; use relm4::{Sender, ShutdownReceiver}; -use relm4_icons::icon_name; use std::any::Any; use std::cell::{Cell, LazyCell}; use std::future::Future; @@ -300,7 +299,7 @@ impl AsyncComponent for App { // cases, would be nice to just hide corresponding menu item instead gtk::MenuButton { set_direction: gtk::ArrowType::None, - set_icon_name: icon_name::MENU_LARGE, + set_icon_name: icon_names::MENU_LARGE, set_popover: Some(>k::PopoverMenu::from_model(Some(&main_menu_without_change_configuration))), #[track = "model.changed_current_raw_config()"] set_visible: model.current_raw_config.is_none(), @@ -308,7 +307,7 @@ impl AsyncComponent for App { gtk::MenuButton { set_direction: gtk::ArrowType::None, - set_icon_name: icon_name::MENU_LARGE, + set_icon_name: icon_names::MENU_LARGE, set_popover: Some(>k::PopoverMenu::from_model(Some(&main_menu))), #[track = "model.changed_current_raw_config()"] set_visible: model.current_raw_config.is_some(), @@ -330,7 +329,7 @@ impl AsyncComponent for App { gtk::Image { set_height_request: 256, - set_from_paintable: Some(&*PIXBUF_ABOUT_IMG), + set_paintable: Some(&*PIXBUF_ABOUT_IMG), }, gtk::Label { @@ -360,7 +359,7 @@ impl AsyncComponent for App { gtk::Image { set_height_request: 256, - set_from_paintable: Some(&*PIXBUF_ABOUT_IMG), + set_paintable: Some(&*PIXBUF_ABOUT_IMG), }, gtk::Label { @@ -563,8 +562,7 @@ impl AsyncComponent for App { .program_name("Space Acres") .version(env!("CARGO_PKG_VERSION")) .authors(env!("CARGO_PKG_AUTHORS").split(':').collect::>()) - // TODO: Use https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/6643 once available - .license("Zero-Clause BSD: https://opensource.org/license/0bsd/") + .license_type(gtk::License::_0bsd) .website(env!("CARGO_PKG_REPOSITORY")) .website_label("GitHub") .comments(env!("CARGO_PKG_DESCRIPTION")) diff --git a/src/frontend/configuration.rs b/src/frontend/configuration.rs index d6662240..b7894157 100644 --- a/src/frontend/configuration.rs +++ b/src/frontend/configuration.rs @@ -7,6 +7,7 @@ use crate::frontend::configuration::farm::{ }; use crate::frontend::configuration::utils::is_directory_writable; use crate::frontend::translations::{AsDefaultStr, T}; +use crate::icon_names; use gtk::glib; use gtk::prelude::*; use relm4::factory::AsyncFactoryVecDeque; @@ -14,7 +15,6 @@ use relm4::prelude::*; use relm4_components::open_dialog::{ OpenDialog, OpenDialogMsg, OpenDialogResponse, OpenDialogSettings, }; -use relm4_icons::icon_name; use std::ops::Deref; use std::path::PathBuf; use subspace_farmer::utils::ss58::parse_ss58_reward_address; @@ -104,9 +104,9 @@ where fn icon(&self) -> Option<&'static str> { if self.is_valid { - Some(icon_name::CHECKMARK) + Some(icon_names::CHECKMARK) } else { - Some(icon_name::CROSS) + Some(icon_names::CROSS) } } } @@ -217,7 +217,7 @@ impl AsyncComponent for ConfigurationView { ) .as_str(), ), - set_primary_icon_name: Some(icon_name::SSD), + set_primary_icon_name: Some(icon_names::SSD), set_primary_icon_activatable: false, set_primary_icon_sensitive: false, #[track = "model.node_path.changed_is_valid()"] @@ -290,7 +290,7 @@ impl AsyncComponent for ConfigurationView { ) .as_str(), ), - set_primary_icon_name: Some(icon_name::WALLET2), + set_primary_icon_name: Some(icon_names::WALLET2), set_primary_icon_activatable: false, set_primary_icon_sensitive: false, #[track = "model.reward_address.changed_is_valid()"] diff --git a/src/frontend/configuration/farm.rs b/src/frontend/configuration/farm.rs index aebabd0e..eeea99d6 100644 --- a/src/frontend/configuration/farm.rs +++ b/src/frontend/configuration/farm.rs @@ -1,5 +1,6 @@ use crate::backend::config::{Farm, MIN_FARM_SIZE}; use crate::frontend::configuration::MaybeValid; +use crate::icon_names; use bytesize::ByteSize; use gtk::prelude::*; use std::fmt; @@ -11,7 +12,6 @@ use crate::frontend::configuration::utils::is_directory_writable; use crate::frontend::translations::{AsDefaultStr, T}; use relm4::AsyncFactorySender; use relm4_components::simple_combo_box::SimpleComboBox; -use relm4_icons::icon_name; use std::path::PathBuf; use std::str::FromStr; use tracing::warn; @@ -154,7 +154,7 @@ impl AsyncFactoryComponent for FarmWidget { ) .as_str(), ), - set_primary_icon_name: Some(icon_name::SSD), + set_primary_icon_name: Some(icon_names::SSD), set_primary_icon_activatable: false, set_primary_icon_sensitive: false, #[track = "self.path.changed_is_valid()"] @@ -199,7 +199,7 @@ impl AsyncFactoryComponent for FarmWidget { set_placeholder_text: Some( &T.configuration_farm_fixed_size_placeholder(), ), - set_primary_icon_name: Some(icon_name::SIZE_HORIZONTALLY), + set_primary_icon_name: Some(icon_names::SIZE_HORIZONTALLY), set_primary_icon_activatable: false, set_primary_icon_sensitive: false, #[track = "self.fixed_size.changed_is_valid()"] @@ -231,7 +231,7 @@ impl AsyncFactoryComponent for FarmWidget { set_placeholder_text: Some( &T.configuration_farm_free_percentage_size_placeholder(), ), - set_primary_icon_name: Some(icon_name::SIZE_HORIZONTALLY), + set_primary_icon_name: Some(icon_names::SIZE_HORIZONTALLY), set_primary_icon_activatable: false, set_primary_icon_sensitive: false, #[track = "self.free_percentage_size.changed_is_valid()"] @@ -254,7 +254,7 @@ impl AsyncFactoryComponent for FarmWidget { warn!("Can't send delete output"); } }, - set_icon_name: icon_name::CROSS, + set_icon_name: icon_names::CROSS, set_tooltip: &T.configuration_farm_delete(), }, }, diff --git a/src/frontend/running.rs b/src/frontend/running.rs index 48b7b154..f144a2f7 100644 --- a/src/frontend/running.rs +++ b/src/frontend/running.rs @@ -12,11 +12,11 @@ use crate::frontend::widgets::progress_circle::{ ProgressCircle, ProgressCircleInit, ProgressCircleInput, }; use crate::frontend::NotificationExt; +use crate::icon_names; use gtk::prelude::*; use notify_rust::Notification; use relm4::factory::FactoryHashMap; use relm4::prelude::*; -use relm4_icons::icon_name; use sp_consensus_subspace::ChainConstants; use std::num::NonZeroU8; use std::time::{Duration, Instant}; @@ -129,7 +129,7 @@ impl Component for RunningView { connect_clicked => RunningInput::ToggleFarmDetails, set_cursor_from_name: Some("pointer"), set_has_frame: false, - set_icon_name: icon_name::GRID_FILLED, + set_icon_name: icon_names::GRID_FILLED, set_tooltip: &T.running_farmer_button_expand_details(), }, gtk::ToggleButton { @@ -137,7 +137,7 @@ impl Component for RunningView { set_active: model.plotting_paused, set_cursor_from_name: Some("pointer"), set_has_frame: false, - set_icon_name: icon_name::PAUSE, + set_icon_name: icon_names::PAUSE, set_tooltip: &T.running_farmer_button_pause_plotting(), }, }, diff --git a/src/frontend/running/farm.rs b/src/frontend/running/farm.rs index 45489dff..78b7cf84 100644 --- a/src/frontend/running/farm.rs +++ b/src/frontend/running/farm.rs @@ -1,11 +1,11 @@ use crate::backend::farmer::DiskFarm; use crate::frontend::translations::{AsDefaultStr, T}; use crate::frontend::NotificationExt; +use crate::icon_names; use bytesize::ByteSize; use gtk::prelude::*; use notify_rust::Notification; use relm4::prelude::*; -use relm4_icons::icon_name; use simple_moving_average::{SingleSumSMA, SMA}; use std::collections::HashMap; use std::path::PathBuf; @@ -177,7 +177,7 @@ impl FactoryComponent for FarmWidget { set_hexpand: true, gtk::Image { - set_icon_name: Some(icon_name::WARNING), + set_icon_name: Some(icon_names::WARNING), } }, None => { @@ -215,9 +215,9 @@ impl FactoryComponent for FarmWidget { gtk::Image { #[track = "self.changed_proving_result() || self.changed_auditing_time_score() || self.changed_proving_time_score()"] set_icon_name: Some(match self.farm_score() { - ..=0.4 => icon_name::SPEEDOMETER4, - ..=0.8 => icon_name::SPEEDOMETER3, - _ => icon_name::SPEEDOMETER2, + ..=0.4 => icon_names::SPEEDOMETER4, + ..=0.8 => icon_names::SPEEDOMETER3, + _ => icon_names::SPEEDOMETER2, }), }, }, @@ -235,7 +235,7 @@ impl FactoryComponent for FarmWidget { set_visible: self.farm_details && self.auditing_time.get_num_samples() > 0, gtk::Image { - set_icon_name: Some(icon_name::PUZZLE_PIECE), + set_icon_name: Some(icon_names::PUZZLE_PIECE), }, gtk::LevelBar { @@ -259,7 +259,7 @@ impl FactoryComponent for FarmWidget { set_visible: self.farm_details && self.proving_time.get_num_samples() > 0, gtk::Image { - set_icon_name: Some(icon_name::PROCESSOR), + set_icon_name: Some(icon_names::PROCESSOR), }, gtk::LevelBar { @@ -271,7 +271,7 @@ impl FactoryComponent for FarmWidget { }, gtk::Image { - set_icon_name: Some(icon_name::WARNING), + set_icon_name: Some(icon_names::WARNING), #[track = "self.changed_non_fatal_farming_error()"] set_tooltip: { let last_error = self.non_fatal_farming_error diff --git a/src/frontend/running/node.rs b/src/frontend/running/node.rs index 8618678e..e2502aef 100644 --- a/src/frontend/running/node.rs +++ b/src/frontend/running/node.rs @@ -1,12 +1,12 @@ use crate::backend::node::{ChainInfo, SyncState}; use crate::backend::NodeNotification; use crate::frontend::translations::{AsDefaultStr, T}; +use crate::icon_names; use bytesize::ByteSize; use gtk::prelude::*; use parking_lot::Mutex; use relm4::prelude::*; use relm4::{Sender, ShutdownReceiver}; -use relm4_icons::icon_name; use simple_moving_average::{SingleSumSMA, SMA}; use std::path::PathBuf; use std::sync::Arc; @@ -103,7 +103,7 @@ impl Component for NodeView { .unwrap_or_default(), gtk::Image { - set_icon_name: Some(icon_name::SSD), + set_icon_name: Some(icon_names::SSD), }, gtk::LevelBar { diff --git a/src/main.rs b/src/main.rs index 0122554d..f251d673 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,6 +10,9 @@ mod backend; mod frontend; +mod icon_names { + include!(concat!(env!("OUT_DIR"), "/icon_names.rs")); +} use crate::frontend::{App, AppInit, RunBackendResult, GLOBAL_CSS}; use bytesize::ByteSize; @@ -271,8 +274,9 @@ impl Cli { args }); - app.set_global_css(GLOBAL_CSS); - relm4_icons::initialize_icons(); + relm4::set_global_css(GLOBAL_CSS); + + relm4_icons::initialize_icons(icon_names::GRESOURCE_BYTES, icon_names::RESOURCE_PREFIX); // Prefer dark theme in cross-platform way if environment is configured that way if let Some(settings) = gtk::Settings::default() {