This repository has been archived on 2025-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
2024-08-15 22:17:00 +03:00
|
|
|
use gtk4 as gtk;
|
|
|
|
|
|
|
|
use std::str::FromStr;
|
|
|
|
|
|
|
|
use crate::{
|
|
|
|
model::{models::SignalReduce, Error, Frequency, Result},
|
|
|
|
model_utils::signal_reducer::*,
|
|
|
|
view::components::input::Input,
|
|
|
|
};
|
|
|
|
|
|
|
|
use gtk::{
|
|
|
|
prelude::{Cast, CastNone, EditableExt, ListItemExt, ObjectExt, WidgetExt},
|
|
|
|
ColumnView, Entry, Label, ListItem, SignalListItemFactory,
|
|
|
|
};
|
2024-08-15 22:18:55 +03:00
|
|
|
|
|
|
|
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,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|