Commit e294f64d authored by MARCHE Claude's avatar MARCHE Claude

ide: dialog to ask whether to save or not before quitting

parent 129b79b8
......@@ -538,6 +538,7 @@ let info_window ?(callback=(fun () -> ())) mt s =
~message_type:mt
~buttons
~title:"Why3 info or error"
~modal:true
~show:true ()
in
let (_ : GtkSignal.id) =
......@@ -718,8 +719,22 @@ let exit_function () =
let ret = Sys.command "xmllint --noout --dtdvalid share/why3session.dtd essai.xml" in
if ret = 0 then eprintf "DTD validation succeeded, good!@.";
*)
M.save_session ();
GMain.quit ()
let d = GWindow.message_dialog
~message:"Do you want to save the session?"
~message_type:`QUESTION
~buttons:GWindow.Buttons.yes_no
~title:"Why3 save"
~modal:true
~show:true ()
in
let (_ : GtkSignal.id) =
d#connect#response
~callback:(function x -> d#destroy ();
if x = `YES then M.save_session ();
GMain.quit ()
)
in
()
let (_ : GtkSignal.id) = w#connect#destroy ~callback:exit_function
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment