Implement browsing project save location
This commit is contained in:
parent
d42fe2776c
commit
18e6800e0f
|
@ -113,7 +113,19 @@ pub(super) fn on_browse_open_project_clicked() -> impl FnMut(&mut FileTab, &Main
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(super) fn on_browse_save_project_clicked() -> impl FnMut(&mut FileTab, &MainWindow) -> Result<(), Error> + 'static {
|
pub(super) fn on_browse_save_project_clicked() -> impl FnMut(&mut FileTab, &MainWindow) -> Result<(), Error> + 'static {
|
||||||
move |_file_tab, _main_window| {
|
move |_file_tab, main_window| {
|
||||||
Err(Error::not_implemented("on_browse_save_project_clicked"))
|
let file_path = FileDialog::new()
|
||||||
|
.add_filter("TIM project file (.tim_project)", &["tim_project"])
|
||||||
|
.add_filter("JSON file (.json; .jsn)", &["json", "jsn"])
|
||||||
|
.add_filter("All", &["*"])
|
||||||
|
.set_title("Save location for TIM project file")
|
||||||
|
.save_file();
|
||||||
|
|
||||||
|
if let Some(file_path) = file_path {
|
||||||
|
if let Some(file_path) = file_path.to_str() {
|
||||||
|
main_window.set_project_widget_save_project_path(SharedString::from(file_path));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue