mirror of
https://github.com/an-anime-team/sleepy-launcher.git
synced 2025-02-16 17:59:46 +03:00
feat: added commit hashes to core/sdk versions in about
SDK and core library were updated. Now "no free space available" error message will have prettified measurements for users simplicity
This commit is contained in:
parent
95548fc394
commit
5de6f0aa48
6 changed files with 16 additions and 30 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -31,7 +31,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "anime-game-core"
|
||||
version = "1.3.8"
|
||||
version = "1.3.9"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bzip2",
|
||||
|
@ -76,7 +76,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "anime-launcher-sdk"
|
||||
version = "0.3.0"
|
||||
version = "0.3.1"
|
||||
dependencies = [
|
||||
"anime-game-core",
|
||||
"anyhow",
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 42b738dc1ec5be8e6ced48501604622b8d0ab91e
|
||||
Subproject commit 35565d07c252a8655df23d6d99bb315e29eef318
|
|
@ -19,10 +19,6 @@ pub mod background;
|
|||
use ui::main::*;
|
||||
use ui::first_run::main::*;
|
||||
|
||||
mod prettify_bytes;
|
||||
|
||||
pub use prettify_bytes::prettify_bytes;
|
||||
|
||||
pub const APP_ID: &str = "moe.launcher.an-anime-game-launcher";
|
||||
pub const APP_VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||
pub const APP_DEBUG: bool = cfg!(debug_assertions);
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
#[inline]
|
||||
pub fn prettify_bytes(bytes: u64) -> String {
|
||||
if bytes > 1024 * 1024 * 1024 {
|
||||
format!("{:.2} GB", bytes as f64 / 1024.0 / 1024.0 / 1024.0)
|
||||
}
|
||||
|
||||
else if bytes > 1024 * 1024 {
|
||||
format!("{:.2} MB", bytes as f64 / 1024.0 / 1024.0)
|
||||
}
|
||||
|
||||
else if bytes > 1024 {
|
||||
format!("{:.2} KB", bytes as f64 / 1024.0)
|
||||
}
|
||||
|
||||
else {
|
||||
format!("{:.2} B", bytes)
|
||||
}
|
||||
}
|
|
@ -2,8 +2,16 @@ use relm4::prelude::*;
|
|||
|
||||
use gtk::prelude::*;
|
||||
|
||||
use anime_launcher_sdk::VERSION as SDK_VERSION;
|
||||
use anime_launcher_sdk::anime_game_core::{VERSION as CORE_VERSION, curl_sys};
|
||||
use anime_launcher_sdk::{
|
||||
VERSION as SDK_VERSION,
|
||||
COMMIT_HASH as SDK_COMMIT_HASH
|
||||
};
|
||||
|
||||
use anime_launcher_sdk::anime_game_core::{
|
||||
VERSION as CORE_VERSION,
|
||||
COMMIT_HASH as CORE_COMMIT_HASH,
|
||||
curl_sys
|
||||
};
|
||||
|
||||
use crate::*;
|
||||
|
||||
|
@ -70,8 +78,8 @@ impl SimpleComponent for AboutDialog {
|
|||
].join("\n"),
|
||||
|
||||
set_debug_info: &[
|
||||
format!("Anime Launcher SDK: {SDK_VERSION}"),
|
||||
format!("Anime Game Core: {CORE_VERSION}"),
|
||||
format!("Anime Launcher SDK: {SDK_VERSION}-{}", &SDK_COMMIT_HASH[..6]),
|
||||
format!("Anime Game Core: {CORE_VERSION}-{}", &CORE_COMMIT_HASH[..6]),
|
||||
String::new(),
|
||||
format!("curl: {}", CURL_INFO.version()),
|
||||
format!("SSL: {}", CURL_INFO.ssl_version().unwrap_or("?")),
|
||||
|
|
|
@ -4,8 +4,8 @@ use relm4::component::*;
|
|||
use adw::prelude::*;
|
||||
|
||||
use anime_launcher_sdk::anime_game_core::installer::installer::Update as InstallerUpdate;
|
||||
use anime_launcher_sdk::anime_game_core::prettify_bytes::prettify_bytes;
|
||||
|
||||
use crate::prettify_bytes;
|
||||
use crate::i18n::*;
|
||||
|
||||
pub struct ProgressBarInit {
|
||||
|
|
Loading…
Add table
Reference in a new issue