merge stable version #2

Merged
doryan merged 97 commits from experimental into main 2024-08-28 18:54:00 +03:00
2 changed files with 9 additions and 21 deletions
Showing only changes of commit e9764cf0e8 - Show all commits

View File

@ -1,24 +1,3 @@
use gtk4 as gtk;
use std::str::FromStr;
use gtk::{
prelude::{TextBufferExt, TextViewExt},
TextBuffer,
};
use crate::{
model::{models::SignalReduce, Error, Result},
view::components::input::Input,
};
pub fn get_error_message(error: Error) -> Option<&'static str> {
match error.to_string().as_str() {
"cannot parse float from empty string" => Some("Вы не ввели данные в поле/-я"),
"invalid float literal" => Some("Вы ввели не корректные данные в поле/-я"),
_ => None,
}
}
pub fn parse_fields(all_inputs: Vec<Input>) -> Result<SignalReduce> {
let mut values: [f64; 6] = [0.0; 6];

View File

@ -12,3 +12,12 @@ use gtk::{
prelude::{Cast, CastNone, EditableExt, ListItemExt, ObjectExt, WidgetExt},
ColumnView, Entry, Label, ListItem, SignalListItemFactory,
};
pub fn get_error_message(error: Error) -> Option<&'static str> {
match error.to_string().as_str() {
"cannot parse float from empty string" => Some("Вы не ввели данные в поле/-я"),
"invalid float literal" => Some("Вы ввели не корректные данные в поле/-я"),
_ => None,
}
}