From d7f96635abf3bce88be6dec077223837b3cd0d71 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Wed, 18 Feb 2026 17:36:00 +0600 Subject: [PATCH] Fixed group editing --- source/CMakeLists.txt | 2 +- source/ubl-settings-usergroups-group.c | 6 +++++- source/ubl-settings-usergroups.c | 8 ++++++-- ubl-settings-usergroups.desktop | 0 4 files changed, 12 insertions(+), 4 deletions(-) mode change 100644 => 100755 ubl-settings-usergroups.desktop diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index b9894e3..bec35b4 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -12,6 +12,7 @@ pkg_check_modules(VTE291 REQUIRED vte-2.91) include_directories(${VTE291_INCLUDE_DIRS}) link_directories(${VTE291_LIBRARY_DIRS}) add_definitions(${VTE291_CFLAGS_OTHER}) +add_definitions(-DVTE_INCLUDE) pkg_check_modules(PWQ REQUIRED pwquality) include_directories(${PWQ_INCLUDE_DIRS}) @@ -72,7 +73,6 @@ add_custom_target( ) -add_definitions(-DVTE_INCLUDE) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always \ -O2 -pipe -fno-plt -fexceptions \ diff --git a/source/ubl-settings-usergroups-group.c b/source/ubl-settings-usergroups-group.c index 94a39ea..feb5058 100644 --- a/source/ubl-settings-usergroups-group.c +++ b/source/ubl-settings-usergroups-group.c @@ -156,11 +156,15 @@ void on_group_save(GtkWidget *self, dictionary *dict){ { GtkTreeIter iter; GtkTreeModel *model = GTK_TREE_MODEL(widgets->GroupsList); + // char *edit_status = g_object_get_data(G_OBJECT(window->CreateGroupWindow),"edit state"); for_iter(model,&iter){ char *cur; gtk_tree_model_get(model,&iter,1, &cur,-1); if (!yon_char_is_empty(cur)&&!strcmp(cur,group_name)){ - if (!gtk_tree_selection_iter_is_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->GroupsTree)),&iter)){ + GtkTreeIter child,sort; + gtk_tree_model_filter_convert_child_iter_to_iter(GTK_TREE_MODEL_FILTER(widgets->ConfigGroupsFilter),&child,&iter); + gtk_tree_model_sort_convert_child_iter_to_iter(GTK_TREE_MODEL_SORT(widgets->ConfigGroupsSort),&sort,&child); + if (!gtk_tree_selection_iter_is_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->GroupsTree)),&sort)){ yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),GROUP_EXIST_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); yon_ubl_status_highlight_incorrect(window->userLoginEntry); diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index f24217e..864dea0 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -1595,8 +1595,10 @@ void on_main_edit(GtkWidget *, main_window *widgets){ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->userUIDAutoCheck),0); gtk_entry_set_text(GTK_ENTRY(window->userUIDEntry), parsed_size>1?parameters[1]:""); } - if (!yon_char_is_empty(parameters[1])) + if (!yon_char_is_empty(parameters[1])){ window->last_uid=yon_char_new(parameters[1]); + g_object_set_data(G_OBJECT(window->CreateUserWindow),"edit state",yon_char_new(name)); + } } if (parsed_size>2){ if (!strcmp(parameters[2],"x")||!strcmp(parameters[2],"")) @@ -1741,6 +1743,7 @@ void on_main_edit(GtkWidget *, main_window *widgets){ model = GTK_TREE_MODEL(widgets->ConfigGroupsSort); if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->GroupsTree)),&model,&iter)){ ubl_settings_usergroups_group_creation_window *window = yon_ubl_settings_usergroups_group_creation_new(); + gtk_widget_set_sensitive(window->userLoginEntry,0); gtk_window_set_title(GTK_WINDOW(window->CreateGroupWindow),CONFIGURE_GROUP_TITLE_LABEL); gtk_label_set_text(GTK_LABEL(window->userTitleNameLabel),CONFIGURE_GROUP_TITLE_LABEL); dictionary *dict = NULL; @@ -1766,7 +1769,8 @@ void on_main_edit(GtkWidget *, main_window *widgets){ g_signal_handlers_block_by_func(G_OBJECT(window->userUIDAutoCheck),G_CALLBACK(on_GID_update),window); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->userUIDAutoCheck),0); g_signal_handlers_unblock_by_func(G_OBJECT(window->userUIDAutoCheck),G_CALLBACK(on_GID_update),window); - window->last_gid=yon_char_new(parsed[1]); + window->last_gid=yon_char_new(name); + g_object_set_data(G_OBJECT(window->CreateGroupWindow),"edit state",yon_char_new(name)); } } if (size>2&&!yon_char_is_empty(parsed[2])){ diff --git a/ubl-settings-usergroups.desktop b/ubl-settings-usergroups.desktop old mode 100644 new mode 100755