Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fn main() {
let model = Rc::new(RefCell::new(DM::DecisionModel::new()));

let mw = main_window.as_weak();
let mdl = model.clone();
let mdl = Rc::clone(&model);
main_window.on_dialog_play(move || {
mdl.borrow_mut().reset_score_and_indices();

Expand All @@ -28,14 +28,14 @@ fn main() {
});

let mw = main_window.as_weak();
let mdl = model.clone();
let mdl = Rc::clone(&model);
main_window.on_dialog_return_edit(move || {
mdl.borrow_mut().reset_score_and_indices();
View::Edit.set_visible(&mw.unwrap())
});

let mw = main_window.as_weak();
let mdl = model.clone();
let mdl = Rc::clone(&model);
main_window.on_dialog_results(move || {
let params = mdl.borrow_mut().sorted_by_score();
let vm = Rc::new(VecModel::<Parameter>::default());
Expand All @@ -51,7 +51,7 @@ fn main() {
});

let mw = main_window.as_weak();
let mdl = model.clone();
let mdl = Rc::clone(&model);
main_window.on_next_pair(move |winner| {
let winner_side: DM::Side = match winner {
Winner::Lhs => DM::Side::Lhs,
Expand Down Expand Up @@ -80,14 +80,14 @@ fn main() {
});

let mw = main_window.as_weak();
let mdl = model.clone();
let mdl = Rc::clone(&model);
main_window.on_show(move || {
mw.unwrap()
.set_parameters(mdl.borrow_mut().get_parameters().into());
});

let mw = main_window.as_weak();
let mdl = model.clone();
let mdl = Rc::clone(&model);
main_window.on_discard(move || {
mw.unwrap().set_parameters(SharedString::new());
mw.unwrap().set_play_enabled(false);
Expand All @@ -96,7 +96,7 @@ fn main() {
});

let mw = main_window.as_weak();
let mdl = model.clone();
let mdl = Rc::clone(&model);
main_window.on_append(move || {
let parameters_ui = mw.unwrap().get_parameters();
println!("add params clicked:\n{}", parameters_ui);
Expand Down