Commit bf4fe763 authored by erwan's avatar erwan
Browse files

Update: make it possible to use rbgui with rdbg daemons

parent f3f31512
Pipeline #71278 passed with stages
in 3 minutes and 49 seconds
(* 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,7 +180,9 @@ 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
......
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