fix(on click): ColumnView data update is complete
This commit is contained in:
parent
0d2987a968
commit
2a88eeaf01
|
@ -178,20 +178,40 @@ pub fn signal_reducing_page(wrapper: &Box) {
|
|||
.vexpand(true)
|
||||
.build();
|
||||
|
||||
calculate_button.connect_clicked(move |_| match parse_fields(all_inputs.clone()) {
|
||||
Ok(results) => {
|
||||
values.set(results);
|
||||
calculate_button.connect_clicked(clone!(
|
||||
#[strong]
|
||||
model_for_events,
|
||||
move |_| match parse_fields(all_inputs.clone()) {
|
||||
Ok(results) => {
|
||||
values.set(results);
|
||||
|
||||
model_for_events.items_changed(0, 0, 18);
|
||||
model_for_events.items_changed(18, 18, 0);
|
||||
}
|
||||
Err(error) => {
|
||||
let error_kind: Option<&str> = get_error_message(error);
|
||||
let new_elem = &Frequency::new(values.get().frequency);
|
||||
|
||||
info_bar.set_text_label(error_kind);
|
||||
info_bar.show_infobar(5u64);
|
||||
let exist_elem_pos = model_for_events.find_with_equal_func(|elem| {
|
||||
elem.downcast_ref::<Frequency>().unwrap().frequency() == new_elem.frequency()
|
||||
});
|
||||
|
||||
match exist_elem_pos {
|
||||
Some(_) => {
|
||||
info_bar.set_text_label(Some("Данная частота уже была задана."));
|
||||
info_bar.show_infobar(5u64);
|
||||
}
|
||||
None => {
|
||||
model_for_events.append(&Frequency::new(values.get().frequency));
|
||||
|
||||
model_for_events.items_changed(0, 0, 1);
|
||||
model_for_events.items_changed(1, 1, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
Err(error) => {
|
||||
let error_kind: Option<&str> = get_error_message(error);
|
||||
|
||||
info_bar.set_text_label(error_kind);
|
||||
info_bar.show_infobar(5u64);
|
||||
}
|
||||
}
|
||||
});
|
||||
));
|
||||
|
||||
wrapper.append(&input_block);
|
||||
wrapper.append(&calculate_button);
|
||||
|
|
Loading…
Reference in New Issue