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

Refactoring

parent 749a8ea6
No related branches found
No related tags found
1 merge request!14A new rdbgui4sasa with automatic daemons
Pipeline #66594 failed
(* Time-stamp: <modified the 07/05/2021 (at 17:08) by Erwan Jahier> *)
(* Time-stamp: <modified the 07/05/2021 (at 17:21) by Erwan Jahier> *)
#thread
#require "lablgtk3"
......@@ -100,9 +100,6 @@ let custom_daemon p gtext vbox step_button round_button =
let dk_sd = make_but (!daemon_kind=Synchronous) "Synchronous" in
let dk_manual = make_but (!daemon_kind=Manual) "Manual" in
let dk_manual_central = make_but (!daemon_kind=ManualCentral) "Manual Central" in
(* let _scrolled = GBin.scrolled_window ~border_width:10 *)
(* ~shadow_type:`OUT ~height:150 ~packing:vbox#add () *)
(* in *)
dk_dd#misc#set_tooltip_text (Printf.sprintf "Set the automatic distributed mode");
dk_sd#misc#set_tooltip_text (Printf.sprintf "Set the automatic synchronous mode");
dk_cd#misc#set_tooltip_text (Printf.sprintf "Set the automatic central mode");
......@@ -244,43 +241,30 @@ let custom_daemon p gtext vbox step_button round_button =
)
nodes_enabled;
let hide b = b#misc#hide() in
let show b = b#misc#show() in
let update_checkbox node enabled =
match !daemon_kind with
| Manual ->
step_button#misc#show();
round_button#misc#hide();
checkbox_grid#misc#show();
pushbox_grid#misc#hide();
counter_grid#misc#hide();
show step_button; show checkbox_grid;
hide round_button; hide pushbox_grid; hide counter_grid;
let checkbox = Hashtbl.find checkbox_map node in
if enabled then
checkbox#misc#show ()
show checkbox
else (
checkbox#set_active false; (* on decoche *)
checkbox#misc#hide ()
hide checkbox
);
checkbox#set_sensitive enabled
| ManualCentral ->
step_button#misc#hide();
round_button#misc#hide();
checkbox_grid#misc#hide();
pushbox_grid#misc#show();
counter_grid#misc#hide();
hide step_button; hide round_button; hide checkbox_grid; hide counter_grid;
show pushbox_grid;
let pushbox = Hashtbl.find pushbox_map node in
if enabled then
pushbox#misc#show ()
else
pushbox#misc#hide ();
if enabled then show pushbox else hide pushbox;
pushbox#set_sensitive enabled
| Distributed | Synchronous | Central | LocCentral ->
step_button#misc#show();
round_button#misc#show();
checkbox_grid#misc#hide();
pushbox_grid#misc#hide();
counter_grid#misc#show()
show step_button; show round_button; show counter_grid;
hide checkbox_grid; hide pushbox_grid;
in
let update_all_checkboxes () =
let nodes_enabled = rdbg_nodes_enabled !e in
......@@ -612,9 +596,6 @@ let main () =
Main.quit () (* terminate gtk *)
));
(* Affichage d'informations *)
(* let gtext_content = ref "" in *)
refresh ()
let gui = main
......
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