Changed exit codes of dialogue to change the semantics of closing dialogue window with (x) button.

This commit is contained in:
2025-05-22 19:01:16 +02:00
parent 7dac50e4d9
commit 49f4612c6e
3 changed files with 14 additions and 11 deletions

View File

@@ -7,9 +7,10 @@
#include <stdio.h>
#include <stdlib.h>
#define YES 0
#define NO 1
#define YES 1
#define NO 0
#define PERM 2
#define TEMP 0
int exit_code = 0;
gboolean is_permanent = false;
@@ -20,7 +21,7 @@ static void positive_response(GtkWindow *window) {
fprintf(stdout, "%s", gtk_entry_buffer_get_text(entry_buffer));
exit_code = (gtk_check_button_get_active(GTK_CHECK_BUTTON(checkbox)))
? YES | PERM
: YES;
: YES | TEMP;
gtk_window_close(window);
}
@@ -28,7 +29,7 @@ static void negative_response(GtkWindow *window) {
fprintf(stdout, "%s", gtk_entry_buffer_get_text(entry_buffer));
exit_code = (gtk_check_button_get_active(GTK_CHECK_BUTTON(checkbox)))
? NO | PERM
: NO;
: NO | TEMP;
gtk_window_close(window);
}