From 1d23d27d80da756c1fbcb3dabe801a0eebfd72fa Mon Sep 17 00:00:00 2001 From: Lily Hopkins Date: Thu, 2 Nov 2023 19:15:26 +0000 Subject: [PATCH 1/3] fix: set source inhibits can add up --- testangel/src/ui/actions/outputs.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testangel/src/ui/actions/outputs.rs b/testangel/src/ui/actions/outputs.rs index f43703f..af925f6 100644 --- a/testangel/src/ui/actions/outputs.rs +++ b/testangel/src/ui/actions/outputs.rs @@ -321,7 +321,7 @@ impl FactoryComponent for OutputRow { self.possible_sources = new_sources; self.src_index = src_index; - self.inhibit_next_selection = 2; + self.inhibit_next_selection += 2; widgets.dropdown.set_model(Some(>k::StringList::new( self.possible_sources .iter() From 8c3f060b5223a03483b924fba0e5cbd56f5250eb Mon Sep 17 00:00:00 2001 From: Lily Hopkins Date: Thu, 2 Nov 2023 19:18:18 +0000 Subject: [PATCH 2/3] chore: bumped version --- Cargo.lock | 24 ++++++++++++------------ Cargo.toml | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eae51a8..558182a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3290,7 +3290,7 @@ dependencies = [ [[package]] name = "testangel" -version = "0.20.0-pre.2" +version = "0.20.0-pre.3" dependencies = [ "base64 0.21.5", "chrono", @@ -3322,7 +3322,7 @@ dependencies = [ [[package]] name = "testangel-arithmetic" -version = "0.20.0-pre.2" +version = "0.20.0-pre.3" dependencies = [ "lazy_static", "testangel-engine", @@ -3330,7 +3330,7 @@ dependencies = [ [[package]] name = "testangel-compare" -version = "0.20.0-pre.2" +version = "0.20.0-pre.3" dependencies = [ "lazy_static", "testangel-engine", @@ -3338,7 +3338,7 @@ dependencies = [ [[package]] name = "testangel-convert" -version = "0.20.0-pre.2" +version = "0.20.0-pre.3" dependencies = [ "lazy_static", "testangel-engine", @@ -3346,7 +3346,7 @@ dependencies = [ [[package]] name = "testangel-date" -version = "0.20.0-pre.2" +version = "0.20.0-pre.3" dependencies = [ "chrono", "lazy_static", @@ -3355,7 +3355,7 @@ dependencies = [ [[package]] name = "testangel-engine" -version = "0.20.0-pre.2" +version = "0.20.0-pre.3" dependencies = [ "testangel-engine-macros", "testangel-ipc", @@ -3363,11 +3363,11 @@ dependencies = [ [[package]] name = "testangel-engine-macros" -version = "0.20.0-pre.2" +version = "0.20.0-pre.3" [[package]] name = "testangel-evidence" -version = "0.20.0-pre.2" +version = "0.20.0-pre.3" dependencies = [ "lazy_static", "testangel-engine", @@ -3375,7 +3375,7 @@ dependencies = [ [[package]] name = "testangel-ipc" -version = "0.20.0-pre.2" +version = "0.20.0-pre.3" dependencies = [ "schemars", "serde", @@ -3384,7 +3384,7 @@ dependencies = [ [[package]] name = "testangel-rand" -version = "0.20.0-pre.2" +version = "0.20.0-pre.3" dependencies = [ "lazy_static", "rand", @@ -3395,7 +3395,7 @@ dependencies = [ [[package]] name = "testangel-regex" -version = "0.20.0-pre.2" +version = "0.20.0-pre.3" dependencies = [ "lazy_static", "regex", @@ -3405,7 +3405,7 @@ dependencies = [ [[package]] name = "testangel-user-interaction" -version = "0.20.0-pre.2" +version = "0.20.0-pre.3" dependencies = [ "lazy_static", "rfd", diff --git a/Cargo.toml b/Cargo.toml index abb096b..0ae9754 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace.package] -version = "0.20.0-pre.2" +version = "0.20.0-pre.3" edition = "2021" [workspace] From b3e6cc50f985102bfc8ba37ca5cca100d836777b Mon Sep 17 00:00:00 2001 From: Lily Hopkins Date: Thu, 2 Nov 2023 19:24:13 +0000 Subject: [PATCH 3/3] i18n: added translations for types --- testangel/locales/en/main.ftl | 5 +++++ testangel/locales/sv/main.ftl | 5 +++++ testangel/src/ui/actions/params.rs | 12 ++++++------ testangel/src/ui/components/variable_row.rs | 14 ++++++++++++-- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/testangel/locales/en/main.ftl b/testangel/locales/en/main.ftl index 201b459..d59e9f9 100644 --- a/testangel/locales/en/main.ftl +++ b/testangel/locales/en/main.ftl @@ -18,6 +18,11 @@ header-about = About { app-name } acknowledgements-testing-title = Software Testing acknowledgements-translations-title = Translations +kind-string = Text +kind-integer = Integer +kind-decimal = Decimal +kind-boolean = Boolean + tab-flows = Flows tab-actions = Actions diff --git a/testangel/locales/sv/main.ftl b/testangel/locales/sv/main.ftl index ee26a58..6382caa 100644 --- a/testangel/locales/sv/main.ftl +++ b/testangel/locales/sv/main.ftl @@ -18,6 +18,11 @@ header-about = Om { app-name } acknowledgements-testing-title = Programtestning acknowledgements-translations-title = Översättningar +kind-string = Text +kind-integer = Heltal +kind-decimal = Decimal +kind-boolean = Booleskt + tab-flows = Flöder tab-actions = Åtgärder diff --git a/testangel/src/ui/actions/params.rs b/testangel/src/ui/actions/params.rs index efe3344..05343fc 100644 --- a/testangel/src/ui/actions/params.rs +++ b/testangel/src/ui/actions/params.rs @@ -167,13 +167,13 @@ pub enum ParamRowOutput { Delete(DynamicIndex), } -static PARAM_KINDS: once_cell::sync::Lazy> = +static PARAM_KINDS: once_cell::sync::Lazy> = once_cell::sync::Lazy::new(|| { vec![ - ("String", ParameterKind::String), - ("Integer", ParameterKind::Integer), - ("Decimal", ParameterKind::Decimal), - ("Boolean", ParameterKind::Boolean), + (lang::lookup("kind-string"), ParameterKind::String), + (lang::lookup("kind-integer"), ParameterKind::Integer), + (lang::lookup("kind-decimal"), ParameterKind::Decimal), + (lang::lookup("kind-boolean"), ParameterKind::Boolean), ] }); @@ -204,7 +204,7 @@ impl FactoryComponent for ParamRow { // kind gtk::DropDown { - set_model: Some(>k::StringList::new(PARAM_KINDS.iter().map(|(label, _)| *label).collect::>().as_slice())), + set_model: Some(>k::StringList::new(PARAM_KINDS.iter().map(|(label, _)| label.as_str()).collect::>().as_slice())), set_selected: self.kind_index, connect_selected_notify[sender, index] => move |dropdown| { diff --git a/testangel/src/ui/components/variable_row.rs b/testangel/src/ui/components/variable_row.rs index 6d53c45..a0ab529 100644 --- a/testangel/src/ui/components/variable_row.rs +++ b/testangel/src/ui/components/variable_row.rs @@ -103,7 +103,12 @@ where "variable-row-subtitle-with-value", { let mut map = HashMap::new(); - map.insert("kind", self.kind.to_string().into()); + map.insert("kind", lang::lookup(match self.kind { + ParameterKind::String => "kind-string", + ParameterKind::Integer => "kind-integer", + ParameterKind::Decimal => "kind-decimal", + ParameterKind::Boolean => "kind-boolean", + }).into()); map.insert("source", self.source.to_string().into()); map.insert("value", self.value.to_string().into()); map @@ -114,7 +119,12 @@ where "variable-row-subtitle", { let mut map = HashMap::new(); - map.insert("kind", self.kind.to_string().into()); + map.insert("kind", lang::lookup(match self.kind { + ParameterKind::String => "kind-string", + ParameterKind::Integer => "kind-integer", + ParameterKind::Decimal => "kind-decimal", + ParameterKind::Boolean => "kind-boolean", + }).into()); map.insert("source", self.get_nice_name_for(&self.source).into()); map }