From bf4fe7634dd820ef43cd497965772c04d0a47d20 Mon Sep 17 00:00:00 2001 From: Erwan Jahier <erwan.jahier@univ-grenoble-alpes.fr> Date: Thu, 3 Jun 2021 14:56:38 +0200 Subject: [PATCH] Update: make it possible to use rbgui with rdbg daemons --- tools/rdbg4sasa/gtkgui.ml | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/tools/rdbg4sasa/gtkgui.ml b/tools/rdbg4sasa/gtkgui.ml index 90fe497d..eb21ff64 100644 --- a/tools/rdbg4sasa/gtkgui.ml +++ b/tools/rdbg4sasa/gtkgui.ml @@ -1,4 +1,4 @@ -(* Time-stamp: <modified the 03/06/2021 (at 12:02) by Erwan Jahier> *) +(* Time-stamp: <modified the 03/06/2021 (at 14:35) by Erwan Jahier> *) #thread #require "lablgtk3" @@ -115,22 +115,23 @@ let display_event b = blue_add b#buffer (str_of_sasa_event false !e) (**********************************************************************************) - +let custom_mode_ref = ref custom_mode + (* *) let goto_hook_call e = - if custom_mode then + if !custom_mode_ref then next_cond e (fun e -> e.name = "mv_hook" && e.kind = Call) else e let goto_hook_exit e = - if custom_mode then + if !custom_mode_ref then next_cond e (fun e -> e.name = "mv_hook" && e.kind = Exit) else e let goto_top e = - if custom_mode then + if !custom_mode_ref then next_cond e (fun e -> e.kind = Ltop) else e @@ -179,8 +180,10 @@ let init_rdbg_hook () = in Some res in - rdbg_mv_hook := Some guidaemon - + match !rdbg_mv_hook with + | None -> rdbg_mv_hook := Some guidaemon + | _ -> () (* custom_mode_ref := false *) + let set_tooltip b = b#misc#set_tooltip_text @@ -571,7 +574,7 @@ let main () = legitimate_button#set_image image#coerce; let set_daemongui_tbl = - if custom_mode then + if !custom_mode_ref then custom_daemon p text_out w step_button back_step_button round_button legitimate_button else (fun _ -> ()) @@ -579,7 +582,7 @@ let main () = let a_gui_step e = (* set the daemongui_tbl and step to the next event where the user is asked to choose whom to activate *) - if custom_mode then ( + if !custom_mode_ref then ( set_daemongui_tbl e; let e = goto_hook_exit e in let e = goto_hook_call e in @@ -623,10 +626,10 @@ let main () = (* change_label legitimate_button "Silen_t"; *) ignore (legitimate_button#connect#clicked ~callback: (button_cb true true (fun () -> - if custom_mode then legitimate_gui() else legitimate ()) + if !custom_mode_ref then legitimate_gui() else legitimate ()) ) ); - if custom_mode then legitimate_button#misc#hide(); + if !custom_mode_ref then legitimate_button#misc#hide(); (* indeed, in the defaut mode (manual central), it should be hided *) let rec next_round_gui rn = if is_silent !e then () else e:=a_gui_step !e; @@ -641,9 +644,9 @@ let main () = ignore (round_button#connect#clicked ~callback:( button_cb true true (fun () -> - if custom_mode then ( + if !custom_mode_ref then ( next_round_gui !roundnb; - if custom_mode && !e.name <> "mv_hook" && !e.kind <> Call + if !custom_mode_ref && !e.name <> "mv_hook" && !e.kind <> Call && not (is_silent !e) then e:= goto_hook_call !e -- GitLab