Le bouton [exec_xor_edit] contrôle le bouton [run_stop_model_exec] (cleaning)

This commit is contained in:
Jean Sirmai 2024-06-03 23:28:48 +02:00
parent a4a5c24c1b
commit aeaf4ada0b
Signed by: jean
GPG Key ID: FB3115C340E057E3
1 changed files with 7 additions and 6 deletions

View File

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