Fixed group editing

pull/316/head
parent 61aedd8ab9
commit d7f96635ab

@ -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 \

@ -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);

@ -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])){

Loading…
Cancel
Save