From aeaf4ada0b1e2ea7e4bcfb6f0ef7a930e40515e3 Mon Sep 17 00:00:00 2001 From: Jean Sirmai Date: Mon, 3 Jun 2024 23:28:48 +0200 Subject: [PATCH] =?UTF-8?q?Le=20bouton=20=20[exec=5Fxor=5Fedit]=20=20contr?= =?UTF-8?q?=C3=B4le=20le=20bouton=20=20[run=5Fstop=5Fmodel=5Fexec]=20(clea?= =?UTF-8?q?ning)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- callback.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/callback.c b/callback.c index 24f2996..66f3503 100644 --- a/callback.c +++ b/callback.c @@ -48,17 +48,18 @@ void ui_toggle_exec_edit (GtkWidget *btt_exec_xor_edit, GtkWidget *btt_run_stop_ { if (get_exec_edit_mode()) { gtk_button_set_icon_name (GTK_BUTTON (btt_exec_xor_edit), "system-run-symbolic"); + gtk_button_set_icon_name (GTK_BUTTON (btt_run_stop_model_exec), "media-playback-start-symbolic"); + gtk_widget_set_sensitive (GTK_WIDGET (btt_run_stop_model_exec), TRUE); set_exec_edit_mode (0); } else { gtk_button_set_icon_name (GTK_BUTTON (btt_exec_xor_edit), "document-edit-symbolic"); gtk_button_set_icon_name (GTK_BUTTON (btt_exec_xor_edit), "text-editor-symbolic"); // I hesitate set_exec_edit_mode (1); - - if (! get_run_xor_stop_exec()) { // il faudra une pop-up window, ici, TODO - // pour prévenir l'utilisateur du risque de perte des données de la simulation en cours - set_run_xor_stop_exec (0); - gtk_button_set_icon_name (GTK_BUTTON (btt_run_stop_model_exec), "media-playback-pause-symbolic"); - } + // Ici, il faudra prévenir l'utilisateur par une pop-up window : TODO (sauvegarde automatique sinon) + // S'il ne prend pas la main, les données de la simulation en cours risquent d'être perdues + gtk_button_set_icon_name (GTK_BUTTON (btt_run_stop_model_exec), "media-playback-pause-symbolic"); + gtk_widget_set_sensitive (GTK_WIDGET (btt_run_stop_model_exec), FALSE); + set_run_xor_stop_exec (0); } }