Compare commits

..

No commits in common. "17098e6e889d45646bc36e29dc588c6689d66151" and "5cc92eb8aebb2011756a4e91e0355fd1c83605ee" have entirely different histories.

14 changed files with 145 additions and 264 deletions

216
Cargo.lock generated
View File

@ -15,9 +15,9 @@ dependencies = [
[[package]]
name = "addr2line"
version = "0.22.0"
version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678"
checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb"
dependencies = [
"gimli",
]
@ -30,15 +30,15 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
[[package]]
name = "autocfg"
version = "1.3.0"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80"
[[package]]
name = "backtrace"
version = "0.3.73"
version = "0.3.71"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a"
checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d"
dependencies = [
"addr2line",
"cc",
@ -69,14 +69,15 @@ dependencies = [
[[package]]
name = "cairo-rs"
version = "0.20.1"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8a0ea147c94108c9613235388f540e4d14c327f7081c9e471fc8ee8a2533e69"
checksum = "797fd5a634dcb0ad0d7d583df794deb0a236d88e759cd34b7da20198c6c9d145"
dependencies = [
"bitflags",
"cairo-sys-rs",
"glib",
"libc",
"thiserror",
]
[[package]]
@ -92,18 +93,15 @@ dependencies = [
[[package]]
name = "cc"
version = "1.1.13"
version = "1.0.94"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72db2f7947ecee9b03b510377e8bb9077afa27176fdbff55c51027e976fdcc48"
dependencies = [
"shlex",
]
checksum = "17f6e324229dc011159fcc089755d1e2e216a90d43a7dea6853ca740b84f35e7"
[[package]]
name = "cfg-expr"
version = "0.16.0"
version = "0.15.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "345c78335be0624ed29012dc10c49102196c6882c12dde65d9f35b02da2aada8"
checksum = "d067ad48b8650848b989a59a86c6c36a995d02d2bf778d45c3c5d57bc2718f02"
dependencies = [
"smallvec",
"target-lexicon",
@ -202,9 +200,9 @@ dependencies = [
[[package]]
name = "gdk-pixbuf"
version = "0.20.1"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8730751991b97419fc3f0c2dca2c9e45b48edf46e48e0f965964ecf33889812f"
checksum = "28bb53ecb56857c683c9ec859908e076dd3969c7d67598bd8b1ce095d211304a"
dependencies = [
"gdk-pixbuf-sys",
"gio",
@ -214,9 +212,9 @@ dependencies = [
[[package]]
name = "gdk-pixbuf-sys"
version = "0.20.1"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ffbf649fd5b1c8c0f0feeb015b7533c3ef92da2887fb95ddd338bc2b1644a7c"
checksum = "9f6681a0c1330d1d3968bec1529f7172d62819ef0bdbb0d18022320654158b03"
dependencies = [
"gio-sys",
"glib-sys",
@ -259,15 +257,15 @@ dependencies = [
[[package]]
name = "gimli"
version = "0.29.0"
version = "0.28.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd"
checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253"
[[package]]
name = "gio"
version = "0.20.1"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dcacaa37401cad0a95aadd266bc39c72a131d454fc012f6dfd217f891d76cc52"
checksum = "398e3da68749fdc32783cbf7521ec3f65c9cf946db8c7774f8460af49e52c6e2"
dependencies = [
"futures-channel",
"futures-core",
@ -278,13 +276,14 @@ dependencies = [
"libc",
"pin-project-lite",
"smallvec",
"thiserror",
]
[[package]]
name = "gio-sys"
version = "0.20.1"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5237611e97e9b86ab5768adc3eef853ae713ea797aa3835404acdfacffc9fb38"
checksum = "e4feb96b31c32730ea3e1e89aecd2e4e37ecb1c473ad8f685e3430a159419f63"
dependencies = [
"glib-sys",
"gobject-sys",
@ -295,9 +294,9 @@ dependencies = [
[[package]]
name = "glib"
version = "0.20.1"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b19429cb83fcbf1f00b31ae3a123fab5cd3761bdd15b0cc07905804742f0d0e4"
checksum = "fee90a615ce05be7a32932cfb8adf2c4bbb4700e80d37713c981fb24c0c56238"
dependencies = [
"bitflags",
"futures-channel",
@ -312,13 +311,14 @@ dependencies = [
"libc",
"memchr",
"smallvec",
"thiserror",
]
[[package]]
name = "glib-macros"
version = "0.20.1"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "960349f56469b75794157e93bf04f0bc8a622d0a6612d6a8f8d7eac41e0e1ee1"
checksum = "4da558d8177c0c8c54368818b508a4244e1286fce2858cef4e547023f0cfa5ef"
dependencies = [
"heck",
"proc-macro-crate",
@ -329,9 +329,9 @@ dependencies = [
[[package]]
name = "glib-sys"
version = "0.20.1"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "44edae63bea922f18f7e63977ee60a257ec27c4613aff1a6a9bb572ad0d88269"
checksum = "4958c26e5a01c9af00dea669a97369eccbec29a8e6d125c24ea2d85ee7467b60"
dependencies = [
"libc",
"system-deps",
@ -339,9 +339,9 @@ dependencies = [
[[package]]
name = "gobject-sys"
version = "0.20.1"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fa3d1dcd8a1eb2e7c22be3d5e792b14b186f3524f79b25631730f9a8c169d49a"
checksum = "c6908864f5ffff15b56df7e90346863904f49b949337ed0456b9287af61903b8"
dependencies = [
"glib-sys",
"libc",
@ -350,9 +350,9 @@ dependencies = [
[[package]]
name = "graphene-rs"
version = "0.20.1"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "80aac87f74e81c0e13433e892a047237abdc37945c86887f5eed905038356e69"
checksum = "630e940ad5824f90221d6579043a9cd1f8bec86b4a17faaf7827d58eb16e8c1f"
dependencies = [
"glib",
"graphene-sys",
@ -361,9 +361,9 @@ dependencies = [
[[package]]
name = "graphene-sys"
version = "0.20.1"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc2f91ecd32989efad60326cc20a8fb252bd2852239a08e4e70cde8c100de9ca"
checksum = "6fb8fade7b754982f47ebbed241fd2680816fdd4598321784da10b9e1168836a"
dependencies = [
"glib-sys",
"libc",
@ -456,9 +456,9 @@ dependencies = [
[[package]]
name = "hashbrown"
version = "0.14.5"
version = "0.14.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604"
[[package]]
name = "heck"
@ -468,9 +468,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "indexmap"
version = "2.4.0"
version = "2.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c"
checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26"
dependencies = [
"equivalent",
"hashbrown",
@ -509,9 +509,9 @@ dependencies = [
[[package]]
name = "libc"
version = "0.2.156"
version = "0.2.155"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a5f43f184355eefb8d17fc948dbecf6c13be3c141f20d834ae842193a448c72a"
checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c"
[[package]]
name = "memchr"
@ -530,27 +530,27 @@ dependencies = [
[[package]]
name = "miniz_oxide"
version = "0.7.4"
version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08"
checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7"
dependencies = [
"adler",
]
[[package]]
name = "object"
version = "0.36.3"
version = "0.32.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9"
checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441"
dependencies = [
"memchr",
]
[[package]]
name = "pango"
version = "0.20.1"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5764e5a174a5a0ec054fe5962ce6d4fc7052e2d0dcc23bbc77202b40a4a403d3"
checksum = "54768854025df6903061d0084fd9702a253ddfd60db7d9b751d43b76689a7f0a"
dependencies = [
"gio",
"glib",
@ -560,9 +560,9 @@ dependencies = [
[[package]]
name = "pango-sys"
version = "0.20.1"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd317e1de76b14b3d3efe05518c08b360327f1ab7fec150473a89ffcad4b072d"
checksum = "b07cc57d10cee4ec661f718a6902cee18c2f4cfae08e87e5a390525946913390"
dependencies = [
"glib-sys",
"gobject-sys",
@ -623,9 +623,9 @@ checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09"
[[package]]
name = "rustc-demangle"
version = "0.1.24"
version = "0.1.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f"
checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76"
[[package]]
name = "rustc_version"
@ -638,24 +638,24 @@ dependencies = [
[[package]]
name = "semver"
version = "1.0.23"
version = "1.0.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b"
checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca"
[[package]]
name = "serde"
version = "1.0.208"
version = "1.0.197"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2"
checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.208"
version = "1.0.197"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf"
checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b"
dependencies = [
"proc-macro2",
"quote",
@ -664,19 +664,13 @@ dependencies = [
[[package]]
name = "serde_spanned"
version = "0.6.7"
version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d"
checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1"
dependencies = [
"serde",
]
[[package]]
name = "shlex"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
[[package]]
name = "slab"
version = "0.4.9"
@ -694,9 +688,9 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
[[package]]
name = "syn"
version = "2.0.74"
version = "2.0.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fceb41e3d546d0bd83421d3409b1460cc7444cd389341a4c880fe7a042cb3d7"
checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af"
dependencies = [
"proc-macro2",
"quote",
@ -705,9 +699,9 @@ dependencies = [
[[package]]
name = "system-deps"
version = "7.0.2"
version = "7.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "070a0a5e7da2d24be457809c4b3baa57a835fd2829ad8b86f9a049052fe71031"
checksum = "6c81f13d9a334a6c242465140bd262fae382b752ff2011c4f7419919a9c97922"
dependencies = [
"cfg-expr",
"heck",
@ -724,9 +718,29 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"
[[package]]
name = "target-lexicon"
version = "0.12.16"
version = "0.12.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f"
[[package]]
name = "thiserror"
version = "1.0.58"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "1.0.58"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "tokio"
@ -752,21 +766,21 @@ dependencies = [
[[package]]
name = "toml"
version = "0.8.19"
version = "0.8.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e"
checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3"
dependencies = [
"serde",
"serde_spanned",
"toml_datetime",
"toml_edit 0.22.20",
"toml_edit 0.22.9",
]
[[package]]
name = "toml_datetime"
version = "0.6.8"
version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41"
checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1"
dependencies = [
"serde",
]
@ -784,15 +798,15 @@ dependencies = [
[[package]]
name = "toml_edit"
version = "0.22.20"
version = "0.22.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d"
checksum = "8e40bb779c5187258fd7aad0eb68cb8706a0a81fa712fbea808ab43c4b8374c4"
dependencies = [
"indexmap",
"serde",
"serde_spanned",
"toml_datetime",
"winnow 0.6.18",
"winnow 0.6.6",
]
[[package]]
@ -818,9 +832,9 @@ dependencies = [
[[package]]
name = "windows-targets"
version = "0.52.6"
version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973"
checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb"
dependencies = [
"windows_aarch64_gnullvm",
"windows_aarch64_msvc",
@ -834,51 +848,51 @@ dependencies = [
[[package]]
name = "windows_aarch64_gnullvm"
version = "0.52.6"
version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3"
checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263"
[[package]]
name = "windows_aarch64_msvc"
version = "0.52.6"
version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469"
checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6"
[[package]]
name = "windows_i686_gnu"
version = "0.52.6"
version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b"
checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670"
[[package]]
name = "windows_i686_gnullvm"
version = "0.52.6"
version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66"
checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9"
[[package]]
name = "windows_i686_msvc"
version = "0.52.6"
version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66"
checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf"
[[package]]
name = "windows_x86_64_gnu"
version = "0.52.6"
version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78"
checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9"
[[package]]
name = "windows_x86_64_gnullvm"
version = "0.52.6"
version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d"
checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596"
[[package]]
name = "windows_x86_64_msvc"
version = "0.52.6"
version = "0.52.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
[[package]]
name = "winnow"
@ -891,9 +905,9 @@ dependencies = [
[[package]]
name = "winnow"
version = "0.6.18"
version = "0.6.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f"
checksum = "f0c976aaaa0e1f90dbb21e9587cdaf1d9679a1cde8875c0d6bd83ab96a208352"
dependencies = [
"memchr",
]

View File

@ -11,3 +11,4 @@ bitvec = "1.0.1"
gio = { version = "0.20.0", features = ["v2_74"] }
gtk4 = { version = "0.9.0", features = ["v4_12"] }
tokio = { version = "1.39.2", features = ["rt", "time", "rt-multi-thread", "macros", "sync"] }

View File

@ -27,8 +27,7 @@ pub fn parse_fields(all_inputs: Vec<Input<Entry>>) -> Result<SignalReduce> {
for (i, input) in all_inputs.iter().enumerate() {
let input_text_buffer = input.get_input();
let extracted_value =
f64::from_str(input_text_buffer.text().replace(',', ".").as_str().trim())?;
let extracted_value = f64::from_str(input_text_buffer.text().as_str().trim())?;
values[i] = extracted_value;
}
@ -71,8 +70,6 @@ pub fn get_cell_data(list_item: &Object) -> (Frequency, Label) {
.and_downcast::<Label>()
.expect("The child has to be a `Label`.");
cell_label.set_selectable(true);
(cell_value, cell_label)
}

View File

@ -0,0 +1,19 @@
use gio::{glib::Variant, SimpleAction};
use gtk4 as gtk;
use gtk::{prelude::GtkWindowExt, AboutDialog, Image};
use std::path::Path;
pub fn open_about_dialogue(_action: &SimpleAction, _var: Option<&Variant>) {
let logo = Image::from_file(Path::new("./src/view/resources/logo.png"))
.paintable()
.unwrap();
AboutDialog::builder()
.authors(vec!["Сагиев А.Д.", "Ефимов И.П."])
.version("1.0-beta")
.logo(&logo)
.website("https://gitea.doryan04.ru/doryan/AIT")
.build()
.present();
}

View File

@ -1,65 +0,0 @@
use adw::HeaderBar;
use gio::{glib::Variant, SimpleAction};
use gtk4 as gtk;
use gtk::{
prelude::{BoxExt, GtkWindowExt},
AboutDialog, Box, Image, Label, Orientation, ScrolledWindow, Window,
};
use std::path::Path;
use crate::view::properties::Setters;
pub fn open_about_dialogue(_action: &SimpleAction, _var: Option<&Variant>) {
let logo = Image::from_file(Path::new("./src/view/resources/logo.png"))
.paintable()
.unwrap();
AboutDialog::builder()
.authors(vec!["Сагиев А.Д.", "Ефимов И.П."])
.version("1.0-beta")
.program_name("Прикладная теория информаций")
.license_type(gtk4::License::Apache20)
.logo(&logo)
.website("https://gitea.doryan04.ru/doryan/AIT")
.build()
.present();
}
pub fn open_help_dialogue(_action: &SimpleAction, _var: Option<&Variant>) {
let help = Box::builder()
.width_request(400)
.orientation(Orientation::Vertical)
.set_margin(crate::view::properties::MarginData::EqualsMargin(15))
.build();
let label = Label::builder()
.use_markup(true)
.wrap(true)
.width_request(400)
.max_width_chars(50)
.single_line_mode(false)
.natural_wrap_mode(gtk4::NaturalWrapMode::Word)
.label(crate::view::resources::HELP)
.build();
help.append(&label);
let scrollable = ScrolledWindow::builder()
.child(&help)
.hscrollbar_policy(gtk4::PolicyType::Never)
.build();
let custom_header = HeaderBar::new();
Window::builder()
.width_request(400)
.height_request(300)
.name("help")
.title("Помощь")
.titlebar(&custom_header)
.child(&scrollable)
.build()
.present();
}

View File

@ -15,7 +15,6 @@ macro_rules! build_for {
.halign(self.align.horizontal)
.valign(self.align.vertical)
.set_margin(self.margins)
.use_markup(self.markup)
.label(self.label)
.build();
@ -52,7 +51,6 @@ pub struct InputBuilder {
align: Alignment,
label: InputLabel,
margins: MarginData,
markup: bool,
}
impl<I> Product<InputBuilder, Box> for Input<I> {
@ -64,7 +62,6 @@ impl<I> Product<InputBuilder, Box> for Input<I> {
},
label: String::new(),
margins: MarginData::EqualsMargin(5),
markup: false,
}
}
@ -94,12 +91,6 @@ impl InputBuilder {
self
}
pub fn markup(mut self, toggle: bool) -> Self {
self.markup = toggle;
self
}
pub fn align(mut self, align: Alignment) -> Self {
self.align = align;

View File

@ -54,10 +54,10 @@ where
&self.actions_group.0
}
pub fn append_items<F, I>(&self, items: I)
pub fn append_items<Iterable, F>(&self, items: Iterable)
where
Iterable: IntoIterator<Item = (F, &'static str, &'static str)>,
F: Fn(&SimpleAction, Option<&Variant>) + 'static,
I: IntoIterator<Item = &'static (F, &'static str, &'static str)>,
{
for (callback, action_name, action_label) in items {
let action = ActionEntry::<SimpleActionGroup>::builder(action_name)

View File

@ -1,12 +1,8 @@
pub mod dialogues;
pub mod about;
pub mod info_bar;
pub mod input;
pub mod menu;
pub mod pages;
pub mod tabs;
pub type MenuActions<'a> = (fn(&SimpleAction, Option<&Variant>), &'a str, &'a str);
use gio::{glib::Variant, SimpleAction};
use crate::model::builder_traits;

View File

@ -1,6 +1,5 @@
pub mod components;
pub mod pages;
pub mod properties;
pub mod resources;
pub mod styles;
pub mod ui;

View File

@ -36,14 +36,7 @@ pub fn signal_reducing_page(wrapper: &Box) {
vertical: Align::Fill,
};
let input_labels: [&str; 6] = [
"l, м:",
"R<sub>м</sub>, Ом",
"C<sub>м</sub>, пФ:",
"R<sub>и</sub>, Ом:",
"V<sub>и</sub>, мВ",
"f, мГц:",
];
let input_labels: [&str; 6] = ["l, м:", "Rм, Ом", "Cм, пФ:", "Rи, Ом:", "Vи, мВ", "f, мГц:"];
let all_inputs: Vec<Input<Entry>> = input_labels
.iter()
@ -51,7 +44,6 @@ pub fn signal_reducing_page(wrapper: &Box) {
.map(|(index, label)| {
let elem = Input::<Entry>::builder()
.label(label)
.markup(true)
.margins(MarginData::EqualsMargin(6))
.align(input_label_alignment)
.build_entry(None);

View File

@ -1,51 +0,0 @@
<span size="x-large"><b> Код Хэмминга </b></span>
В данной лабораторной работе используется код Хэмминга 7-4, другими словами, код, который нужно закодировать, имеет длину в 4 бита, в то же время выходной код будет иметь 7 бит.
Программа умеет как закодировать ключевые слова, так и их проверять.
<b> Режим кодирования </b>
В этом режиме мы вводим код, в котором каждое "слово" имеет 4 бита. Это должно выглядеть следующим образом:
<tt>1010 1100 1110 0000</tt>
Мы получим следующее:
<tt>1100110 0111100 0101010 0000000</tt>
В противном случае вылезет информационный блок с предупреждением: "Проверьте корректность кода".
<b> Режим проверки </b>
Данный режим проверяет код на ошибки. Проверка в лучшем случае пишет: "Все коды корректны", в противном случае, построчно показывает, в каких кодах есть ошибка.
Пример ввода возьмём из предыдущего примера:
<tt>1100110 0111100 0101010 0000000</tt>
Результат:
<tt>Все коды корректны.</tt>
Если мы поменяем какой-либо бит в одном или в нескольких "словах":
<tt>1100110 0011100 0101110 0000010</tt>
Мы получим результат:
<tt>
Ошибка в коде 2 [0011100], позиция ошибки 2, корректный код: [0111100];
Ошибка в коде 3 [0101110], позиция ошибки 5, корректный код: [0101010];
Ошибка в коде 4 [0000010], позиция ошибки 6, корректный код: [0000000];
</tt>
<span size="x-large"><b> Затухание сигнала </b></span>
Лабораторная работа подразумевает рассчитать для 19 значений частоты реактивное сопротивление конденсатора X<sub>c</sub>, напряжения сигнала на стороне приёмника информации V<sub>п</sub> и коэффициент затухания сигнала ζ.
Значения вводятся согласно исходным данным для расчёта затухания сигнала. Значения можно вводить как с ",", так и ".".
При вводе одних и тех же данных без изменений будет вылезать предупреждение и операция расчёта не будет выполнена. Можно не менять данные в случае частоты, чтобы обновить данные расчёта в соответствии с новыми (К примеру, в случае длины провода, или сопротивления провода).

View File

@ -1 +0,0 @@
pub static HELP: &str = include_str!("help.html");

View File

@ -14,7 +14,7 @@
background-color: #00000020;
}
textview {
border-radius: 7px;
border-radius: 5px;
padding: 7px 8px;
background: #E6E6E6;
outline-offset: 2px;

View File

@ -6,17 +6,12 @@ use gtk4 as gtk;
use gtk::{prelude::*, StackTransitionType::SlideLeftRight, *};
use crate::view::{
components::{
dialogues::{open_about_dialogue, open_help_dialogue},
info_bar::InfoBar,
menu::HeaderMenu,
pages::Pages,
},
components::{about::open_about_dialogue, info_bar::InfoBar, menu::HeaderMenu, pages::Pages},
pages::*,
properties::*,
};
use super::{components::MenuActions, styles::load_css};
use super::styles::load_css;
pub fn ui(application: &adw::Application) {
load_css();
@ -61,13 +56,8 @@ pub fn ui(application: &adw::Application) {
let mut menu_button = HeaderMenu::<&str>::new();
let actions: &[MenuActions] = &[
(open_about_dialogue, "about_software", "О программе"),
(open_help_dialogue, "help", "Помощь"),
];
menu_button.set_action_group_name(Some("menu_group_action"));
menu_button.append_items(actions);
menu_button.append_items([(open_about_dialogue, "about_software", "О программе")]);
title_bar.append(
&Label::builder()
@ -75,8 +65,7 @@ pub fn ui(application: &adw::Application) {
.set_align(Alignment::new(Align::Center, Align::Center))
.hexpand(true)
.vexpand(true)
.use_markup(true)
.label("<b>Комплексная программа для лаб. работ</b>")
.label("Комплексная программа для лаб. работ")
.build(),
);
title_bar.append(menu_button.get_button());