From e950ee0dd086aff89e19e27082b7a7cfdf5a040d Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Wed, 5 Feb 2025 17:21:08 +0600 Subject: [PATCH] Entries emptiness checks --- source/ubl-settings-logging.c | 12 +++++++++++- ubl-settings-logging-journald.glade | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/source/ubl-settings-logging.c b/source/ubl-settings-logging.c index f650f96..3fad7b6 100644 --- a/source/ubl-settings-logging.c +++ b/source/ubl-settings-logging.c @@ -1117,6 +1117,11 @@ void on_logrotate_save(GtkWidget *, dictionary *dict){ rotate_count = yon_char_append("rotate ",yon_char_from_long(fileamount)); if (active==2){ const char *text = gtk_entry_get_text(GTK_ENTRY(window->FileAmountEntry)); + if (yon_char_is_empty(text)){ + yon_ubl_status_box_spawn(window->StatusBox,EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + yon_ubl_status_highlight_incorrect(window->FileAmountEntry); + return; + } olddir=yon_char_unite("olddir ",text,NULL); } } @@ -1189,7 +1194,12 @@ void on_logrotate_save(GtkWidget *, dictionary *dict){ int original_active = gtk_combo_box_get_active(GTK_COMBO_BOX(window->SaveOriginalCombo)); if (original_active==1){ - char *ext_file = (char*)gtk_entry_get_text(GTK_ENTRY(window->SaveOriginalEntry)); + char *ext_file = (char*)gtk_entry_get_text(GTK_ENTRY(window->SaveOriginalEntry)); + if (yon_char_is_empty(ext_file)){ + yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + yon_ubl_status_highlight_incorrect(window->SaveOriginalEntry); + return; + } extension = yon_char_append("extension ",ext_file); } diff --git a/ubl-settings-logging-journald.glade b/ubl-settings-logging-journald.glade index 101fb03..af38e32 100644 --- a/ubl-settings-logging-journald.glade +++ b/ubl-settings-logging-journald.glade @@ -666,6 +666,7 @@ True False True + 0 False