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); } }