Services sort fixed

pull/93/head
parent a1beb6aefe
commit a3c00d1eba

@ -82,15 +82,19 @@ dictionary *yon_systemd_get_list() {
}
}
if (!found) {
systemd_struct *u = calloc(1, sizeof(systemd_struct));
u->name = yon_char_new(name);
u->description = yon_char_new("");
u->load = 0;
u->active = 0;
u->state = yon_char_new("");
u->enable = 0;
yon_dictionary_add_or_create_if_exists_with_data(dict, (char*)name, u);
char *temp_name = yon_char_new(name);
if (!yon_dictionary_get(&dict,temp_name)){
systemd_struct *u = calloc(1, sizeof(systemd_struct));
free(yon_char_divide(temp_name,yon_char_find_last(temp_name,'/')));
u->name = temp_name;
u->description = yon_char_new("");
u->load = 0;
u->active = 0;
u->state = _("disabled");
u->enable = 0;
yon_dictionary_add_or_create_if_exists_with_data(dict, (char*)temp_name, u);
}
}
sd_bus_message_exit_container(reply);
}

@ -2077,9 +2077,12 @@ void yon_main_window_complete(main_window *widgets){
gtk_tree_model_filter_set_visible_func(widgets->SystemFilter,(GtkTreeModelFilterVisibleFunc)yon_filter,widgets,NULL);
for (int i=0;i<5;i++){
gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(widgets->SystemSort),i,(GtkTreeIterCompareFunc)sort_bool,GINT_TO_POINTER(i),NULL);
gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(widgets->UserSort),i,(GtkTreeIterCompareFunc)sort_bool,GINT_TO_POINTER(i),NULL);
}
gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(widgets->SystemSort),5,(GtkTreeIterCompareFunc)sort_string,GINT_TO_POINTER(13),NULL);
gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(widgets->SystemSort),6,(GtkTreeIterCompareFunc)sort_string,GINT_TO_POINTER(6),NULL);
gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(widgets->SystemSort),6,(GtkTreeIterCompareFunc)sort_string,GINT_TO_POINTER(5),NULL);
gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(widgets->UserSort),5,(GtkTreeIterCompareFunc)sort_string,GINT_TO_POINTER(13),NULL);
gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(widgets->UserSort),6,(GtkTreeIterCompareFunc)sort_string,GINT_TO_POINTER(5),NULL);
gtk_tree_view_set_search_column(GTK_TREE_VIEW(widgets->UserUnitsTree),5);
yon_load_proceed(YON_CONFIG_LOCAL);
yon_ubl_status_box_render(LIST_LOAD_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);

Loading…
Cancel
Save