Commit c4d20452 authored by Guillaume Melquiond's avatar Guillaume Melquiond

Properly mark dialog boxes as transient.

parent 4846913e
......@@ -529,9 +529,10 @@ let init () =
resize_images 20;
Debug.dprintf debug " done.@."
let show_legend_window () =
let show_legend_window ~parent () =
let dialog =
GWindow.dialog
~modal:true ~parent
~title:"Why3: legend of icons" ~icon:!why_icon
()
in
......@@ -597,9 +598,10 @@ let show_legend_window () =
dialog#destroy ()
let show_about_window () =
let show_about_window ~parent () =
let about_dialog =
GWindow.about_dialog
~parent
~name:"The Why3 Verification Platform"
~authors:["François Bobot";
"Jean-Christophe Filliâtre";
......@@ -1130,9 +1132,9 @@ let editors_page c (notebook:GPack.notebook) =
Mprover.iter add_prover (Whyconf.get_provers c.config)
let preferences (c : t) =
let preferences ~parent (c : t) =
let dialog = GWindow.dialog
~modal:true ~icon:(!why_icon)
~modal:true ~parent ~icon:(!why_icon)
~title:"Why3: preferences" ()
in
let vbox = dialog#vbox in
......@@ -1190,19 +1192,20 @@ let run_auto_detection gconfig =
(*let () = Debug.dprintf debug "[config] end of configuration initialization@."*)
let uninstalled_prover_dialog ~height ~callback c unknown =
let uninstalled_prover_dialog ~parent ~callback c unknown =
let others,names,versions =
Whyconf.unknown_to_known_provers
(Whyconf.get_provers c.config) unknown
in
let dialog = GWindow.dialog
~icon:(!why_icon) ~modal:true
~icon:(!why_icon) ~modal:true ~parent
~title:"Why3: Uninstalled prover" ()
in
let vbox = dialog#vbox in
let vbox_pack = vbox#pack ~fill:true ~expand:true ?from:None ?padding:None in
let hbox = GPack.hbox ~packing:vbox_pack () in
let hbox_pack = hbox#pack ~fill:true ~expand:true ?from:None ?padding:None in
let height = parent#misc#allocation.Gtk.height * 3 / 4 in
let scrollview =
GBin.scrolled_window ~hpolicy:`NEVER ~vpolicy:`AUTOMATIC ~height
~packing:hbox_pack ()
......
......@@ -112,12 +112,12 @@ val image_failure_obs : GdkPixbuf.pixbuf ref
(* miscellaneous dialogs *)
(*************************)
val show_legend_window : unit -> unit
val show_about_window : unit -> unit
val preferences : t -> unit
val show_legend_window : parent:#GWindow.window_skel -> unit -> unit
val show_about_window : parent:#GWindow.window_skel -> unit -> unit
val preferences : parent:#GWindow.window_skel -> t -> unit
val uninstalled_prover_dialog :
height:int ->
parent:#GWindow.window_skel ->
callback: (Whyconf.prover -> Whyconf.prover_upgrade_policy -> unit) ->
t -> Whyconf.prover -> unit
......
......@@ -1787,7 +1787,7 @@ let (_: GMenu.menu_item) =
let (_: GMenu.menu_item) =
let callback () =
Gconfig.preferences gconfig;
Gconfig.preferences ~parent:main_window gconfig;
make_sources_editable gconfig.allow_source_editing;
send_session_config_to_server ()
in
......@@ -1900,12 +1900,12 @@ let help_factory = new menu_factory help_menu ~accel_path:"<Why3-Main>/Help/" ~a
let (_ : GMenu.menu_item) =
help_factory#add_item
"Legend"
~callback:show_legend_window
~callback:(show_legend_window ~parent:main_window)
let (_ : GMenu.menu_item) =
help_factory#add_item
"About"
~callback:show_about_window
~callback:(show_about_window ~parent:main_window)
(*****************************************************************)
(* "Tools" submenus for strategies, provers, and transformations *)
......@@ -2240,11 +2240,7 @@ let check_uninstalled_prover =
let callback p u =
send_request (Set_prover_policy(p,u))
in
(* The gconfig.window_height is always the height of the window thanks to
the callback to size_allocate. By default, this dialog has 3/4 the
height of the main window. *)
let height = 3 * gconfig.window_height / 4 in
uninstalled_prover_dialog ~height ~callback gconfig p
uninstalled_prover_dialog ~parent:main_window ~callback gconfig p
end
let treat_notification n =
......
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