mirror of
https://github.com/13hannes11/focus_annotator.git
synced 2024-09-03 23:21:01 +02:00
added saving after marking
This commit is contained in:
10
src/main.rs
10
src/main.rs
@@ -106,13 +106,20 @@ fn build_ui(app: &Application) {
|
||||
let file = dialog.file().expect("Couldn't get file");
|
||||
eprintln!("Open");
|
||||
let filename = file.path().expect("Couldn't get file path");
|
||||
let contents = fs::read_to_string(filename).expect("Something went wrong reading the file");
|
||||
let contents = fs::read_to_string(filename.clone()).expect("Something went wrong reading the file");
|
||||
eprintln!("{}", contents);
|
||||
|
||||
let new_dataset : Vec<AnnotationZStack> = serde_json::from_str(&contents).unwrap();
|
||||
let mut state = state.borrow_mut();
|
||||
|
||||
state.replace_foucs_stacks(new_dataset);
|
||||
state.save_path = Some(
|
||||
filename.clone().as_path()
|
||||
.to_str()
|
||||
.expect("failed to convert filname to str")
|
||||
.to_string()
|
||||
);
|
||||
eprintln!("{}", state.save_path.clone().unwrap());
|
||||
image_ui.update(&state);
|
||||
}
|
||||
dialog.close();
|
||||
@@ -147,6 +154,7 @@ fn build_ui(app: &Application) {
|
||||
|
||||
let mut state = state.borrow_mut();
|
||||
state.mark_focus();
|
||||
state.save();
|
||||
state.skip();
|
||||
image_ui.update(&state);
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user