|
|
|
|
@ -876,6 +876,39 @@ void on_groups_clicked(GtkWidget *self, GtkEntry *output_target){
|
|
|
|
|
}
|
|
|
|
|
gtk_tree_view_column_set_visible(gtk_tree_view_get_column(GTK_TREE_VIEW(window->GroupsTree),0),0);
|
|
|
|
|
gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(window->GroupsTree)),GTK_SELECTION_SINGLE);
|
|
|
|
|
const char *current_group=gtk_entry_get_text(output_target);
|
|
|
|
|
int digits=0;
|
|
|
|
|
for (int k=0;k<strlen(current_group);k++){
|
|
|
|
|
if (g_ascii_isdigit(current_group[k])){
|
|
|
|
|
digits++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
char *final_group_name=NULL;
|
|
|
|
|
|
|
|
|
|
if (digits==strlen(current_group)){
|
|
|
|
|
for (int i=0;i<main_config.groups_size;i++){
|
|
|
|
|
int group_size=0;
|
|
|
|
|
config_str groups_parsed = yon_char_parse(main_config.groups[i],&group_size,":");
|
|
|
|
|
if (group_size>2&&!strcmp(groups_parsed[2],current_group)){
|
|
|
|
|
final_group_name=yon_char_new(groups_parsed[0]);
|
|
|
|
|
if (group_size) yon_char_parsed_free(groups_parsed,group_size);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
if (group_size) yon_char_parsed_free(groups_parsed,group_size);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
final_group_name=yon_char_new(current_group);
|
|
|
|
|
}
|
|
|
|
|
for_iter(window->list,&iter){
|
|
|
|
|
char *group;
|
|
|
|
|
gtk_tree_model_get(GTK_TREE_MODEL(window->list),&iter,1,&group,-1);
|
|
|
|
|
if (!strcmp(group,final_group_name)){
|
|
|
|
|
gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(window->GroupsTree)),&iter);
|
|
|
|
|
gtk_tree_view_scroll_to_cell(GTK_TREE_VIEW(window->GroupsTree),gtk_tree_model_get_path(GTK_TREE_MODEL(window->list),&iter),gtk_tree_view_get_column(GTK_TREE_VIEW(window->GroupsTree),1),0,0,0);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
dictionary *dict = NULL;
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window);
|
|
|
|
|
yon_dictionary_add_or_create_if_exists_with_data(dict,"output",output_target);
|
|
|
|
|
@ -1924,6 +1957,8 @@ void on_user_save(GtkWidget *self, dictionary *dict){
|
|
|
|
|
} else {
|
|
|
|
|
uid_string = (char*)gtk_entry_get_text(GTK_ENTRY(window->userUIDEntry));
|
|
|
|
|
if (yon_char_is_empty(uid_string)){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_highlight_incorrect(window->userUIDEntry);
|
|
|
|
|
return;
|
|
|
|
|
@ -2531,6 +2566,7 @@ void on_main_edit(GtkWidget *self, main_window *widgets){
|
|
|
|
|
if (!strcmp(parameters[2],"x"))
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->userGroupsCheck),1);
|
|
|
|
|
else {
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->userGroupsCheck),0);
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(window->userGroupsEntry), parsed_size>2?parameters[2]:"");
|
|
|
|
|
if (!yon_char_is_empty(parameters[2]))
|
|
|
|
|
window->last_uid=yon_char_new(parameters[2]);
|
|
|
|
|
|