From 50e94be07e4680675002a868c3ac142da340f24d Mon Sep 17 00:00:00 2001 From: Brady Fomegne Date: Mon, 19 Aug 2024 03:36:37 +0100 Subject: [PATCH] fix: update the config template Now, the config template is in the respect of the current afrim data. --- data/blank_sample.toml | 0 data/full_sample.toml | 7 ++++--- data/sample.toml | 7 ++++--- src/config.rs | 16 +++++++++------- src/window/toolkit.rs | 16 ++++++++++------ 5 files changed, 27 insertions(+), 19 deletions(-) mode change 100644 => 100755 data/blank_sample.toml mode change 100644 => 100755 data/full_sample.toml mode change 100644 => 100755 data/sample.toml mode change 100644 => 100755 src/config.rs mode change 100644 => 100755 src/window/toolkit.rs diff --git a/data/blank_sample.toml b/data/blank_sample.toml old mode 100644 new mode 100755 diff --git a/data/full_sample.toml b/data/full_sample.toml old mode 100644 new mode 100755 index 9133f96..0068aef --- a/data/full_sample.toml +++ b/data/full_sample.toml @@ -1,8 +1,9 @@ [info] name = "Sample config" -maintainors = ["test"] -input_method = "test" -homepage = "example.com" +authors = ["test"] +description = "test" +website = "example.com" +version = "2024-08-19" [core] buffer_size = 20 diff --git a/data/sample.toml b/data/sample.toml old mode 100644 new mode 100755 index d4f7ea8..01e9eaa --- a/data/sample.toml +++ b/data/sample.toml @@ -1,5 +1,6 @@ [info] name = "Sample config" -maintainors = ["test"] -input_method = "test" -homepage = "example.com" +authors = ["test"] +description = "test" +website = "example.com" +version = "2024-08-19" diff --git a/src/config.rs b/src/config.rs old mode 100644 new mode 100755 index 69f7a2c..29178b2 --- a/src/config.rs +++ b/src/config.rs @@ -19,9 +19,10 @@ pub struct Core { #[derive(Clone, Deserialize, Debug)] pub struct Info { pub name: String, - pub maintainors: Vec, - pub input_method: String, - pub homepage: String, + pub description: String, + pub authors: Vec, + pub website: String, + pub version: String, } #[derive(Clone, Deserialize, Debug)] @@ -87,10 +88,11 @@ impl Default for Theme { impl Default for Info { fn default() -> Self { Self { - name: "Unknown".to_owned(), - input_method: "Unknow".to_owned(), - homepage: "Unknow".to_owned(), - maintainors: vec!["Unknow".to_owned()], + name: "Unknow".to_owned(), + description: "".to_owned(), + authors: vec!["Unknow".to_owned()], + website: "".to_owned(), + version: "Unknow".to_owned(), } } } diff --git a/src/window/toolkit.rs b/src/window/toolkit.rs old mode 100644 new mode 100755 index 2e1fb26..653aec1 --- a/src/window/toolkit.rs +++ b/src/window/toolkit.rs @@ -195,11 +195,13 @@ impl ToolKit { let core = self.config.core.to_owned().unwrap_or_default(); make_page!( "Details", - "IME:" => &info.input_method => { + "IME:" => &info.name => { let window = window.clone(); let config_name = info.name.to_owned(); - let config_maintainors = info.maintainors.join(", "); - let config_homepage = info.homepage.clone(); + let config_authors = info.authors.join(", "); + let config_description = info.description.clone(); + let config_website = info.website.clone(); + let config_version = info.version.clone(); move || { rstk::message_box() @@ -208,9 +210,11 @@ impl ToolKit { .title("Configuration file") .message(&config_name) .detail(&format!( - "{}\n\nby {}", - &config_homepage, - &config_maintainors, + "{}\n{}\n{}\n{}", + &config_version, + &config_description, + &config_website, + &config_authors, )) .show(); }