From 0f251d1f0c9f73bf3575096b503ce623f90e0c98 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Thu, 2 Oct 2025 16:21:15 +0600 Subject: [PATCH] Added password entry symbol blocking function --- source/libublsettings-gtk3-misc.c | 5 +++++ source/libublsettings-gtk3.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/source/libublsettings-gtk3-misc.c b/source/libublsettings-gtk3-misc.c index 206c6bc..6fa51b0 100644 --- a/source/libublsettings-gtk3-misc.c +++ b/source/libublsettings-gtk3-misc.c @@ -500,6 +500,11 @@ void yon_on_entry_set_allowed_symbols(GtkEntry *target, char *symbols){ g_signal_connect(G_OBJECT(target),"insert-text",G_CALLBACK(yon_on_insert_allowed_check),symbols); } +void yon_gtk_entry_allow_password_symbols(GtkEntry *target){ + g_return_if_fail(GTK_IS_ENTRY(target)); + g_signal_connect(G_OBJECT(target),"insert-text",G_CALLBACK(yon_on_insert_allowed_check),yon_char_new("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!\"#$%&\'()*+,-./;<=>?@[\\]^_`{|}~")); +} + int yon_ip_check(char *ip){ if (!strstr(ip,".")){ int pixmask = atoi(ip); diff --git a/source/libublsettings-gtk3.h b/source/libublsettings-gtk3.h index c25d819..344fa6f 100644 --- a/source/libublsettings-gtk3.h +++ b/source/libublsettings-gtk3.h @@ -531,6 +531,8 @@ void yon_on_text_insert_only_digits(GtkEditable *editable, const gchar *text, gi void yon_gtk_entry_block_restricted_symbols(GtkEntry *target); +void yon_gtk_entry_allow_password_symbols(GtkEntry *target); + void yon_gtk_entry_block_languages(GtkEntry *target); void yon_gtk_entry_block_symbols(GtkEntry *target, char *symbols);