From dc0afe4e6bc4fea3f6d443e28dc3f8861e7e615c Mon Sep 17 00:00:00 2001 From: nullchinchilla Date: Wed, 24 Apr 2024 09:08:59 -0400 Subject: [PATCH] eh --- Cargo.lock | 600 +----------------- binaries/geph5-client-gui/Cargo.toml | 4 +- binaries/geph5-client-gui/src/l10n.csv | 3 +- binaries/geph5-client-gui/src/logs.rs | 4 +- binaries/geph5-client-gui/src/main.rs | 7 +- binaries/geph5-client-gui/src/store_cell.rs | 51 ++ binaries/geph5-client/src/bin/geph5-client.rs | 2 +- 7 files changed, 79 insertions(+), 592 deletions(-) create mode 100644 binaries/geph5-client-gui/src/store_cell.rs diff --git a/Cargo.lock b/Cargo.lock index 987d195..fe80d76 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,77 +18,6 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" -[[package]] -name = "accesskit" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74a4b14f3d99c1255dcba8f45621ab1a2e7540a0009652d33989005a4d0bfc6b" - -[[package]] -name = "accesskit_consumer" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c17cca53c09fbd7288667b22a201274b9becaa27f0b91bf52a526db95de45e6" -dependencies = [ - "accesskit", -] - -[[package]] -name = "accesskit_macos" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd3b6ae1eabbfbced10e840fd3fce8a93ae84f174b3e4ba892ab7bcb42e477a7" -dependencies = [ - "accesskit", - "accesskit_consumer", - "objc2 0.3.0-beta.3.patch-leaks.3", - "once_cell", -] - -[[package]] -name = "accesskit_unix" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09f46c18d99ba61ad7123dd13eeb0c104436ab6af1df6a1cd8c11054ed394a08" -dependencies = [ - "accesskit", - "accesskit_consumer", - "async-channel 2.2.1", - "async-once-cell", - "atspi", - "futures-lite 1.13.0", - "once_cell", - "serde", - "zbus", -] - -[[package]] -name = "accesskit_windows" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afcae27ec0974fc7c3b0b318783be89fd1b2e66dd702179fe600166a38ff4a0b" -dependencies = [ - "accesskit", - "accesskit_consumer", - "once_cell", - "paste", - "static_assertions", - "windows 0.48.0", -] - -[[package]] -name = "accesskit_winit" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5284218aca17d9e150164428a0ebc7b955f70e3a9a78b4c20894513aabf98a67" -dependencies = [ - "accesskit", - "accesskit_macos", - "accesskit_unix", - "accesskit_windows", - "winit", -] - [[package]] name = "addr2line" version = "0.21.0" @@ -292,16 +221,6 @@ dependencies = [ "libloading 0.7.4", ] -[[package]] -name = "async-broadcast" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c48ccdbf6ca6b121e0f586cbc0e73ae440e56c67c30fa0873b4e110d9c26d2b" -dependencies = [ - "event-listener 2.5.3", - "futures-core", -] - [[package]] name = "async-channel" version = "1.9.0" @@ -490,12 +409,6 @@ dependencies = [ "futures-lite 2.3.0", ] -[[package]] -name = "async-once-cell" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9338790e78aa95a416786ec8389546c4b6a1dfc3dc36071ed9518a9413a542eb" - [[package]] name = "async-process" version = "1.8.1" @@ -533,17 +446,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "async-recursion" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30c5ef0ede93efbf733c1a727f3b6b5a1060bbedd5600183e66f6e4be4af0ec5" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.59", -] - [[package]] name = "async-signal" version = "0.2.5" @@ -630,54 +532,6 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" -[[package]] -name = "atspi" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6059f350ab6f593ea00727b334265c4dfc7fd442ee32d264794bd9bdc68e87ca" -dependencies = [ - "atspi-common", - "atspi-connection", - "atspi-proxies", -] - -[[package]] -name = "atspi-common" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92af95f966d2431f962bc632c2e68eda7777330158bf640c4af4249349b2cdf5" -dependencies = [ - "enumflags2", - "serde", - "static_assertions", - "zbus", - "zbus_names", - "zvariant", -] - -[[package]] -name = "atspi-connection" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c65e7d70f86d4c0e3b2d585d9bf3f979f0b19d635a336725a88d279f76b939" -dependencies = [ - "atspi-common", - "atspi-proxies", - "futures-lite 1.13.0", - "zbus", -] - -[[package]] -name = "atspi-proxies" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6495661273703e7a229356dcbe8c8f38223d697aacfaf0e13590a9ac9977bb52" -dependencies = [ - "atspi-common", - "serde", - "zbus", -] - [[package]] name = "autocfg" version = "1.2.0" @@ -873,32 +727,13 @@ dependencies = [ "generic-array", ] -[[package]] -name = "block-sys" -version = "0.1.0-beta.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa55741ee90902547802152aaf3f8e5248aab7e21468089560d4c8840561146" -dependencies = [ - "objc-sys 0.2.0-beta.2", -] - [[package]] name = "block-sys" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae85a0696e7ea3b835a453750bf002770776609115e6d25c6d2ff28a8200f7e7" dependencies = [ - "objc-sys 0.3.2", -] - -[[package]] -name = "block2" -version = "0.2.0-alpha.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dd9e63c1744f755c2f60332b88de39d341e5e86239014ad839bd71c106dec42" -dependencies = [ - "block-sys 0.1.0-beta.1", - "objc2-encode 2.0.0-pre.2", + "objc-sys", ] [[package]] @@ -907,8 +742,8 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15b55663a85f33501257357e6421bb33e769d5c9ffb5ba0921c975a123e35e68" dependencies = [ - "block-sys 0.2.1", - "objc2 0.4.1", + "block-sys", + "objc2", ] [[package]] @@ -1034,15 +869,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" -[[package]] -name = "cgl" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ced0551234e87afee12411d535648dd89d2e7f34c78b753395567aff3d447ff" -dependencies = [ - "libc", -] - [[package]] name = "chacha20" version = "0.9.1" @@ -1578,17 +1404,6 @@ dependencies = [ "serde", ] -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "derive-new" version = "0.5.9" @@ -1760,16 +1575,13 @@ dependencies = [ "egui-wgpu", "egui-winit", "egui_glow", - "glow", - "glutin", - "glutin-winit", "image", "js-sys", "log", "objc", "parking_lot 0.12.1", "percent-encoding", - "raw-window-handle 0.5.2", + "pollster", "raw-window-handle 0.6.0", "static_assertions", "thiserror", @@ -1777,6 +1589,7 @@ dependencies = [ "wasm-bindgen-futures", "web-sys", "web-time", + "wgpu", "winapi", "winit", ] @@ -1787,7 +1600,6 @@ version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "584c5d1bf9a67b25778a3323af222dbe1a1feb532190e103901187f92c7fe29a" dependencies = [ - "accesskit", "ahash", "epaint", "log", @@ -1818,7 +1630,6 @@ version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e3da0cbe020f341450c599b35b92de4af7b00abde85624fd16f09c885573609" dependencies = [ - "accesskit_winit", "arboard", "egui", "log", @@ -1839,7 +1650,7 @@ dependencies = [ "egui", "glow", "log", - "memoffset 0.9.1", + "memoffset", "wasm-bindgen", "web-sys", "winit", @@ -1872,27 +1683,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "enumflags2" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3278c9d5fb675e0a51dabcf4c0d355f692b064171535ba72361be1528a9d8e8d" -dependencies = [ - "enumflags2_derive", - "serde", -] - -[[package]] -name = "enumflags2_derive" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.59", -] - [[package]] name = "epaint" version = "0.27.2" @@ -2439,6 +2229,7 @@ dependencies = [ "once_cell", "oneshot", "poll-promise", + "serde", "serde_json", "serde_yaml", "smol 2.0.0", @@ -2584,62 +2375,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "glutin" -version = "0.31.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fcd4ae4e86d991ad1300b8f57166e5be0c95ef1f63f3f5b827f8a164548746" -dependencies = [ - "bitflags 2.5.0", - "cfg_aliases", - "cgl", - "core-foundation", - "dispatch", - "glutin_egl_sys", - "glutin_glx_sys", - "glutin_wgl_sys", - "icrate", - "libloading 0.8.3", - "objc2 0.4.1", - "once_cell", - "raw-window-handle 0.5.2", - "wayland-sys", - "windows-sys 0.48.0", - "x11-dl", -] - -[[package]] -name = "glutin-winit" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ebcdfba24f73b8412c5181e56f092b5eff16671c514ce896b258a0a64bd7735" -dependencies = [ - "cfg_aliases", - "glutin", - "raw-window-handle 0.5.2", - "winit", -] - -[[package]] -name = "glutin_egl_sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77cc5623f5309ef433c3dd4ca1223195347fe62c413da8e2fdd0eb76db2d9bcd" -dependencies = [ - "gl_generator", - "windows-sys 0.48.0", -] - -[[package]] -name = "glutin_glx_sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a165fd686c10dcc2d45380b35796e577eacfd43d4660ee741ec8ebe2201b3b4f" -dependencies = [ - "gl_generator", - "x11-dl", -] - [[package]] name = "glutin_wgl_sys" version = "0.5.0" @@ -3022,9 +2757,9 @@ version = "0.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99d3aaff8a54577104bafdf686ff18565c3b6903ca5782a2026ef06e2c7aa319" dependencies = [ - "block2 0.3.0", + "block2", "dispatch", - "objc2 0.4.1", + "objc2", ] [[package]] @@ -3444,15 +3179,6 @@ dependencies = [ "libc", ] -[[package]] -name = "memoffset" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" -dependencies = [ - "autocfg", -] - [[package]] name = "memoffset" version = "0.9.1" @@ -3651,7 +3377,6 @@ dependencies = [ "log", "ndk-sys", "num_enum", - "raw-window-handle 0.5.2", "raw-window-handle 0.6.0", "thiserror", ] @@ -3671,18 +3396,6 @@ dependencies = [ "jni-sys", ] -[[package]] -name = "nix" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" -dependencies = [ - "bitflags 1.3.2", - "cfg-if", - "libc", - "memoffset 0.7.1", -] - [[package]] name = "no-std-compat" version = "0.4.1" @@ -3799,7 +3512,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" dependencies = [ - "proc-macro-crate 3.1.0", + "proc-macro-crate", "proc-macro2", "quote", "syn 2.0.59", @@ -3835,46 +3548,20 @@ dependencies = [ "objc_id", ] -[[package]] -name = "objc-sys" -version = "0.2.0-beta.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b9834c1e95694a05a828b59f55fa2afec6288359cda67146126b3f90a55d7" - [[package]] name = "objc-sys" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7c71324e4180d0899963fc83d9d241ac39e699609fc1025a850aadac8257459" -[[package]] -name = "objc2" -version = "0.3.0-beta.3.patch-leaks.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e01640f9f2cb1220bbe80325e179e532cb3379ebcd1bf2279d703c19fe3a468" -dependencies = [ - "block2 0.2.0-alpha.6", - "objc-sys 0.2.0-beta.2", - "objc2-encode 2.0.0-pre.2", -] - [[package]] name = "objc2" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "559c5a40fdd30eb5e344fbceacf7595a81e242529fb4e21cf5f43fb4f11ff98d" dependencies = [ - "objc-sys 0.3.2", - "objc2-encode 3.0.0", -] - -[[package]] -name = "objc2-encode" -version = "2.0.0-pre.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abfcac41015b00a120608fdaa6938c44cb983fee294351cc4bac7638b4e50512" -dependencies = [ - "objc-sys 0.2.0-beta.2", + "objc-sys", + "objc2-encode", ] [[package]] @@ -3977,16 +3664,6 @@ dependencies = [ "libredox 0.0.2", ] -[[package]] -name = "ordered-stream" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50" -dependencies = [ - "futures-core", - "pin-project-lite 0.2.14", -] - [[package]] name = "overload" version = "0.1.1" @@ -4337,23 +4014,13 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit 0.19.15", -] - [[package]] name = "proc-macro-crate" version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ - "toml_edit 0.21.1", + "toml_edit", ] [[package]] @@ -4818,19 +4485,6 @@ dependencies = [ "untrusted", ] -[[package]] -name = "sctk-adwaita" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82b2eaf3a5b264a521b988b2e73042e742df700c4f962cde845d1541adb46550" -dependencies = [ - "ab_glyph", - "log", - "memmap2", - "smithay-client-toolkit", - "tiny-skia", -] - [[package]] name = "semver" version = "1.0.22" @@ -4878,17 +4532,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_repr" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.59", -] - [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -5552,12 +5195,6 @@ dependencies = [ "serde_with 1.14.0", ] -[[package]] -name = "strict-num" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731" - [[package]] name = "stringprep" version = "0.1.4" @@ -5772,31 +5409,6 @@ dependencies = [ "time-core", ] -[[package]] -name = "tiny-skia" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83d13394d44dae3207b52a326c0c85a8bf87f1541f23b0d143811088497b09ab" -dependencies = [ - "arrayref", - "arrayvec", - "bytemuck", - "cfg-if", - "log", - "tiny-skia-path", -] - -[[package]] -name = "tiny-skia-path" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c9e7fc0c2e86a30b117d0462aa261b72b7a99b7ebd7deb3a14ceda95c5bdc93" -dependencies = [ - "arrayref", - "bytemuck", - "strict-num", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -5883,17 +5495,6 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap 2.2.6", - "toml_datetime", - "winnow", -] - [[package]] name = "toml_edit" version = "0.21.1" @@ -6061,17 +5662,6 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" -[[package]] -name = "uds_windows" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" -dependencies = [ - "memoffset 0.9.1", - "tempfile", - "winapi", -] - [[package]] name = "unicode-bidi" version = "0.3.15" @@ -6362,19 +5952,6 @@ dependencies = [ "wayland-scanner", ] -[[package]] -name = "wayland-protocols-plasma" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479" -dependencies = [ - "bitflags 2.5.0", - "wayland-backend", - "wayland-client", - "wayland-protocols", - "wayland-scanner", -] - [[package]] name = "wayland-protocols-wlr" version = "0.2.0" @@ -6475,6 +6052,7 @@ dependencies = [ "cfg_aliases", "js-sys", "log", + "naga", "parking_lot 0.11.2", "profiling", "raw-window-handle 0.6.0", @@ -6524,6 +6102,7 @@ dependencies = [ "arrayvec", "ash", "bitflags 2.5.0", + "block", "cfg_aliases", "core-graphics-types", "glow", @@ -6631,8 +6210,6 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-implement", - "windows-interface", "windows-targets 0.48.5", ] @@ -6655,28 +6232,6 @@ dependencies = [ "windows-targets 0.52.5", ] -[[package]] -name = "windows-implement" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e2ee588991b9e7e6c8338edf3333fbe4da35dc72092643958ebb43f0ab2c49c" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "windows-interface" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6fb8df20c9bcaa8ad6ab513f7b40104840c8867d5751126e4df3b08388d0cc7" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "windows-sys" version = "0.45.0" @@ -6888,7 +6443,6 @@ version = "0.29.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d59ad965a635657faf09c8f062badd885748428933dad8e8bdd64064d92e5ca" dependencies = [ - "ahash", "android-activity", "atomic-waker", "bitflags 2.5.0", @@ -6902,27 +6456,19 @@ dependencies = [ "js-sys", "libc", "log", - "memmap2", "ndk", "ndk-sys", - "objc2 0.4.1", + "objc2", "once_cell", "orbclient", "percent-encoding", - "raw-window-handle 0.5.2", "raw-window-handle 0.6.0", "redox_syscall 0.3.5", "rustix 0.38.32", - "sctk-adwaita", - "smithay-client-toolkit", "smol_str", "unicode-segmentation", "wasm-bindgen", "wasm-bindgen-futures", - "wayland-backend", - "wayland-client", - "wayland-protocols", - "wayland-protocols-plasma", "web-sys", "web-time", "windows-sys 0.48.0", @@ -7000,16 +6546,6 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a0ccd7b4a5345edfcd0c3535718a4e9ff7798ffc536bb5b5a0e26ff84732911" -[[package]] -name = "xdg-home" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e5a325c3cb8398ad6cf859c1135b25dd29e186679cf2da7581d9679f63b38e" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "xkbcommon-dl" version = "0.4.2" @@ -7035,72 +6571,6 @@ version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "791978798f0597cfc70478424c2b4fdc2b7a8024aaff78497ef00f24ef674193" -[[package]] -name = "zbus" -version = "3.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "675d170b632a6ad49804c8cf2105d7c31eddd3312555cffd4b740e08e97c25e6" -dependencies = [ - "async-broadcast", - "async-executor", - "async-fs 1.6.0", - "async-io 1.13.0", - "async-lock 2.8.0", - "async-process 1.8.1", - "async-recursion", - "async-task", - "async-trait", - "blocking", - "byteorder", - "derivative", - "enumflags2", - "event-listener 2.5.3", - "futures-core", - "futures-sink", - "futures-util", - "hex", - "nix", - "once_cell", - "ordered-stream", - "rand", - "serde", - "serde_repr", - "sha1", - "static_assertions", - "tracing", - "uds_windows", - "winapi", - "xdg-home", - "zbus_macros", - "zbus_names", - "zvariant", -] - -[[package]] -name = "zbus_macros" -version = "3.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7131497b0f887e8061b430c530240063d33bf9455fa34438f388a245da69e0a5" -dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", - "regex", - "syn 1.0.109", - "zvariant_utils", -] - -[[package]] -name = "zbus_names" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "437d738d3750bed6ca9b8d423ccc7a8eb284f6b1d6d4e225a0e4e6258d864c8d" -dependencies = [ - "serde", - "static_assertions", - "zvariant", -] - [[package]] name = "zerocopy" version = "0.7.32" @@ -7140,41 +6610,3 @@ dependencies = [ "quote", "syn 2.0.59", ] - -[[package]] -name = "zvariant" -version = "3.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eef2be88ba09b358d3b58aca6e41cd853631d44787f319a1383ca83424fb2db" -dependencies = [ - "byteorder", - "enumflags2", - "libc", - "serde", - "static_assertions", - "zvariant_derive", -] - -[[package]] -name = "zvariant_derive" -version = "3.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37c24dc0bed72f5f90d1f8bb5b07228cbf63b3c6e9f82d82559d4bae666e7ed9" -dependencies = [ - "proc-macro-crate 1.3.1", - "proc-macro2", - "quote", - "syn 1.0.109", - "zvariant_utils", -] - -[[package]] -name = "zvariant_utils" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7234f0d811589db492d16893e3f21e8e2fd282e6d01b0cddee310322062cc200" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] diff --git a/binaries/geph5-client-gui/Cargo.toml b/binaries/geph5-client-gui/Cargo.toml index e772a6e..42c1ab5 100644 --- a/binaries/geph5-client-gui/Cargo.toml +++ b/binaries/geph5-client-gui/Cargo.toml @@ -9,11 +9,11 @@ edition = "2021" anyhow = "1.0.81" csv = "1.3.0" dirs = "5.0.1" -eframe = {version="0.27.2"} +eframe = {version="0.27.2", default-features=false, features=[ "wgpu", "x11"]} egui = "0.27.2" moka = {version="0.12.5", features=["sync"]} native-dialog = "0.7.0" - +serde={version="1", features=["derive"]} once_cell = "1.19.0" smol_str = {version="0.2.1", features=["serde"]} tap = "1.0.1" diff --git a/binaries/geph5-client-gui/src/l10n.csv b/binaries/geph5-client-gui/src/l10n.csv index 0e2dea0..6ff19b6 100644 --- a/binaries/geph5-client-gui/src/l10n.csv +++ b/binaries/geph5-client-gui/src/l10n.csv @@ -1,6 +1,7 @@ label,en,zh,ru,fa about,About,关于,О программе,درباره account_info,Account Info,帐户信息,Информация об аккаунте,اطلاعات حساب +auto_configure_proxy,Auto-configure proxy,自动配置代理,Автонастройка прокси,پیکربندی خودکار پروکسی cancel,Cancel,取消,Отмена,لغو connect,Connect,连接,Подключиться,اتصال connected,Connected,已连接,Подключено,متصل @@ -22,4 +23,4 @@ selected_server,Selected Server,选定的服务器,Выбранный серве server,Server,服务器,Сервер,سرور settings,Settings,设置,Настройки,تنظیمات status,Status,状态,Статус,وضعیت -upload_speed,Upload Speed,上传速度,Скорость загрузки,سرعت آپلود +upload_speed,Upload Speed,上传速度,Скорость загрузки,سرعت آپلود \ No newline at end of file diff --git a/binaries/geph5-client-gui/src/logs.rs b/binaries/geph5-client-gui/src/logs.rs index 69ee37f..a03629f 100644 --- a/binaries/geph5-client-gui/src/logs.rs +++ b/binaries/geph5-client-gui/src/logs.rs @@ -6,7 +6,7 @@ use once_cell::sync::Lazy; use smol_str::{SmolStr, ToSmolStr}; use tracing::Level; -use tracing_subscriber::Layer; +use tracing_subscriber::{registry::LookupSpan, Layer}; #[derive(Clone, Debug)] pub struct LogLine { @@ -23,7 +23,7 @@ pub struct LogLayer; impl Layer for LogLayer where - S: tracing::Subscriber, + S: tracing::Subscriber + for<'a> LookupSpan<'a>, { fn on_event( &self, diff --git a/binaries/geph5-client-gui/src/main.rs b/binaries/geph5-client-gui/src/main.rs index fd99189..d6d6322 100644 --- a/binaries/geph5-client-gui/src/main.rs +++ b/binaries/geph5-client-gui/src/main.rs @@ -4,8 +4,11 @@ mod logs; mod prefs; mod refresh_cell; mod settings; +mod store_cell; mod tabs; +use std::time::Duration; + use egui::{FontData, FontDefinitions, FontFamily, Visuals}; use l10n::l10n; use logs::LogLayer; @@ -109,8 +112,8 @@ impl App { impl eframe::App for App { fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) { - // ctx.request_repaint_after(Duration::from_millis(100)); - ctx.request_repaint(); + ctx.request_repaint_after(Duration::from_millis(100)); + // ctx.request_repaint(); egui::TopBottomPanel::top("top").show(ctx, |ui| { ui.horizontal(|ui| { diff --git a/binaries/geph5-client-gui/src/store_cell.rs b/binaries/geph5-client-gui/src/store_cell.rs new file mode 100644 index 0000000..9de4f38 --- /dev/null +++ b/binaries/geph5-client-gui/src/store_cell.rs @@ -0,0 +1,51 @@ +use egui::mutex::RwLock; +use serde::{de::DeserializeOwned, Serialize}; +use smol_str::ToSmolStr; + +use crate::prefs::{pref_read, pref_write}; + +pub struct StoreCell { + inner: RwLock, + on_set: Box, +} + +impl StoreCell { + pub fn new(default_val: T) -> Self { + Self { + inner: RwLock::new(default_val), + on_set: Box::new(|_| {}), + } + } + + pub fn set(&self, val: T) -> T { + let mut inner = self.inner.write(); + (self.on_set)(&val); + std::mem::replace(&mut inner, val) + } + + pub fn get(&self) -> T { + self.inner.read().clone() + } + + pub fn modify(&self, clos: impl FnOnce(&mut T) -> U) -> U { + let mut inner = self.inner.write(); + let u = clos(&mut inner); + (self.on_set)(&inner); + u + } +} + +impl StoreCell { + pub fn new_persistent(key: &str, default_val: impl FnOnce() -> T) -> Self { + let val = pref_read(key) + .ok() + .and_then(|res| serde_json::from_str(&res).ok()); + let key = key.to_smolstr(); + Self { + inner: RwLock::new(val.unwrap_or_else(default_val)), + on_set: Box::new(move |val| { + let _ = pref_write(&key, &serde_json::to_string(val).unwrap()); + }), + } + } +} diff --git a/binaries/geph5-client/src/bin/geph5-client.rs b/binaries/geph5-client/src/bin/geph5-client.rs index 743acc6..d19eeba 100644 --- a/binaries/geph5-client/src/bin/geph5-client.rs +++ b/binaries/geph5-client/src/bin/geph5-client.rs @@ -29,7 +29,7 @@ fn main() -> anyhow::Result<()> { .from_env_lossy(), ) .init(); - smolscale::permanently_single_threaded(); + let args: CliArgs = argh::from_env(); let config: serde_json::Value = serde_yaml::from_slice(&std::fs::read(args.config)?)?; let mut config: Config = serde_json::from_value(config)?;