From 0796e449f6cac4023f926265317f4dab81a433db Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 20 Jan 2025 11:46:38 +0600 Subject: [PATCH] Changed password window status messages --- source/ubl-settings-usergroups.c | 18 ++---------------- source/ubl-settings-usergroups.h | 1 - 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index 99d1f0b..5f8b104 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -1515,22 +1515,11 @@ void on_password_show_hide(GtkEntry *self, GtkEntryIconPosition icon_pos, GdkEv } } -void on_password_changed(GtkEntry *, ubl_settings_usergroups_password_window *window){ - char *self_text = (char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry)); - char *pair_text = (char*)gtk_entry_get_text(GTK_ENTRY(window->RepeatPasswordEntry)); - if ((!yon_char_is_empty(self_text)&&!yon_char_is_empty(pair_text))&&strcmp(self_text,pair_text)){ - yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(window->StatusBox),"password_mismatch",PASSWORD_MISMATCH_LABEL,BACKGROUND_IMAGE_FAIL_TYPE); - } else if (strlen(self_text)StatusBox),"password_short",PASSWORD_SHORT_LABEL(yon_char_from_int(main_config.password_min_length)),BACKGROUND_IMAGE_FAIL_TYPE); - } else { - yon_ubl_status_box_despawn_infinite(GTK_CONTAINER(window->StatusBox)); - } -} - void on_password_accept(GtkWidget *self, dictionary *dict){ ubl_settings_usergroups_password_window *window = yon_dictionary_get_data(dict->first,ubl_settings_usergroups_password_window*); GtkEntry *entry = yon_dictionary_get_data(dict->first->next,GtkEntry*); char *password = (char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordEntry)); + char *password_check = (char*)gtk_entry_get_text(GTK_ENTRY(window->RepeatPasswordEntry)); if (yon_char_is_empty(password)){ char *pasted_hash = (char*)gtk_entry_get_text(GTK_ENTRY(window->PasswordHashEntry)); if (!yon_char_is_empty(pasted_hash)){ @@ -1553,7 +1542,6 @@ void on_password_accept(GtkWidget *self, dictionary *dict){ yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),PASSWORD_SHORT_LABEL(yon_char_from_int(main_config.password_min_length)),5,BACKGROUND_IMAGE_FAIL_TYPE); return; } - char *password_check = (char*)gtk_entry_get_text(GTK_ENTRY(window->RepeatPasswordEntry)); if (!strcmp(password,password_check)){ if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->NoEncriptionCheck))){ char *pasw=yon_char_append("%%",password); @@ -1561,7 +1549,7 @@ void on_password_accept(GtkWidget *self, dictionary *dict){ } gtk_entry_set_text(GTK_ENTRY(entry),password); } else { - yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(window->StatusBox),"password_mismatch",PASSWORD_MISMATCH_LABEL,BACKGROUND_IMAGE_FAIL_TYPE); + yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),PASSWORD_MISMATCH_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); return; } } @@ -1588,8 +1576,6 @@ ubl_settings_usergroups_password_window *yon_ubl_settings_usergroups_password_ne g_signal_connect(G_OBJECT(window->PasswordEntry),"icon-press",G_CALLBACK(on_password_show_hide),NULL); g_signal_connect(G_OBJECT(window->RepeatPasswordEntry),"icon-press",G_CALLBACK(on_password_show_hide),NULL); g_signal_connect(G_OBJECT(window->PasswordHashEntry),"icon-press",G_CALLBACK(on_password_show_hide),NULL); - g_signal_connect(G_OBJECT(window->PasswordEntry),"changed",G_CALLBACK(on_password_changed),window); - g_signal_connect(G_OBJECT(window->RepeatPasswordEntry),"changed",G_CALLBACK(on_password_changed),window); gtk_window_set_title(GTK_WINDOW(window->CreateGroupWindow),PASSWORD_TITLE_LABEL); return window; diff --git a/source/ubl-settings-usergroups.h b/source/ubl-settings-usergroups.h index a8bf6f3..7f9098e 100644 --- a/source/ubl-settings-usergroups.h +++ b/source/ubl-settings-usergroups.h @@ -501,7 +501,6 @@ ubl_settings_usergroups_group_window *yon_ubl_settings_usergroups_group_new(int void on_standard_groups_accept(GtkWidget *self, ubl_settings_usergroups_group_window *window); void on_standard_groups_open(GtkWidget *self, main_window *widgets); void on_password_show_hide(GtkEntry *self, GtkEntryIconPosition icon_pos, GdkEvent* event); -void on_password_changed(GtkEntry *self, ubl_settings_usergroups_password_window *window); void on_password_accept(GtkWidget *self, dictionary *dict); ubl_settings_usergroups_password_window *yon_ubl_settings_usergroups_password_new(); void yon_system_load(main_window *window);