Skip to content
Snippets Groups Projects
Commit bf4fe763 authored by erwan's avatar erwan
Browse files

Update: make it possible to use rbgui with rdbg daemons

parent f3f31512
No related branches found
Tags 4.5.1 v4.5.1
No related merge requests found
Pipeline #71278 passed
(* 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 #thread
#require "lablgtk3" #require "lablgtk3"
...@@ -115,22 +115,23 @@ let display_event b = ...@@ -115,22 +115,23 @@ let display_event b =
blue_add b#buffer (str_of_sasa_event false !e) blue_add b#buffer (str_of_sasa_event false !e)
(**********************************************************************************) (**********************************************************************************)
let custom_mode_ref = ref custom_mode
(* *) (* *)
let goto_hook_call e = 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) next_cond e (fun e -> e.name = "mv_hook" && e.kind = Call)
else else
e e
let goto_hook_exit 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) next_cond e (fun e -> e.name = "mv_hook" && e.kind = Exit)
else else
e e
let goto_top e = let goto_top e =
if custom_mode then if !custom_mode_ref then
next_cond e (fun e -> e.kind = Ltop) next_cond e (fun e -> e.kind = Ltop)
else else
e e
...@@ -179,8 +180,10 @@ let init_rdbg_hook () = ...@@ -179,8 +180,10 @@ let init_rdbg_hook () =
in in
Some res Some res
in 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 let set_tooltip b = b#misc#set_tooltip_text
...@@ -571,7 +574,7 @@ let main () = ...@@ -571,7 +574,7 @@ let main () =
legitimate_button#set_image image#coerce; legitimate_button#set_image image#coerce;
let set_daemongui_tbl = 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 custom_daemon p text_out w step_button back_step_button round_button legitimate_button
else else
(fun _ -> ()) (fun _ -> ())
...@@ -579,7 +582,7 @@ let main () = ...@@ -579,7 +582,7 @@ let main () =
let a_gui_step e = let a_gui_step e =
(* set the daemongui_tbl and step to the next event where the user (* set the daemongui_tbl and step to the next event where the user
is asked to choose whom to activate *) is asked to choose whom to activate *)
if custom_mode then ( if !custom_mode_ref then (
set_daemongui_tbl e; set_daemongui_tbl e;
let e = goto_hook_exit e in let e = goto_hook_exit e in
let e = goto_hook_call e in let e = goto_hook_call e in
...@@ -623,10 +626,10 @@ let main () = ...@@ -623,10 +626,10 @@ let main () =
(* change_label legitimate_button "Silen_t"; *) (* change_label legitimate_button "Silen_t"; *)
ignore (legitimate_button#connect#clicked ~callback: ignore (legitimate_button#connect#clicked ~callback:
(button_cb true true (fun () -> (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 *) (* indeed, in the defaut mode (manual central), it should be hided *)
let rec next_round_gui rn = let rec next_round_gui rn =
if is_silent !e then () else e:=a_gui_step !e; if is_silent !e then () else e:=a_gui_step !e;
...@@ -641,9 +644,9 @@ let main () = ...@@ -641,9 +644,9 @@ let main () =
ignore (round_button#connect#clicked ignore (round_button#connect#clicked
~callback:( ~callback:(
button_cb true true (fun () -> button_cb true true (fun () ->
if custom_mode then ( if !custom_mode_ref then (
next_round_gui !roundnb; 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) && not (is_silent !e)
then then
e:= goto_hook_call !e e:= goto_hook_call !e
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment