Check if the file is dirty, if so, display a dialog to ask user to save the
file or not. If user choose to save, save the file and then close the tab.
If user choose not to save, close the tab directly.
Iterate all tabs, check if each tab is dirty, if so, display a dialog to ask
user to save the file or not. If user choose to save, save the file and then
close the tab. If user choose not to save, close the tab directly.
Create a new tab with the file in provided file path
event emit: front_file_open
payload: OpenFile { file_path: String, content: String }
event emit: front_file_save_as
payload: String
FIXME: the emit event maybe unused?
event emit: front_file_save
payload: String fn save_handler(event: &WindowMenuEvent) { let name =
get_current_tab_name(&event); let tab_map =
event.window().state::(); let mut lock =
tab_map.tabs.lock().unwrap();