Indentations of group-creation window has been fixed; group saving fixes

pull/14/head
parent b8372733eb
commit cc968b2a58

@ -369,7 +369,7 @@ void on_group_save(GtkWidget *self, dictionary *dict){
char *password = NULL;
int gid_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->userUIDAutoCheck));
if (gid_active){
gid=AUTOMATICALLY_LABEL;
gid="x";
} else {
gid = (char*)gtk_entry_get_text(GTK_ENTRY(window->userUIDEntry));
if (yon_char_is_empty(gid)){
@ -406,17 +406,17 @@ void on_group_save(GtkWidget *self, dictionary *dict){
yon_ubl_status_highlight_incorrect(window->PasswordEntry);
}
final_string = yon_char_unite(yon_char_return_if_exist(group_users,"x"),
":",yon_char_return_if_exist(gid,AUTOMATICALLY_LABEL),
":",yon_char_return_if_exist(gid,"x"),
":",yon_char_return_if_exist(non_unique,""),
yon_char_return_if_exist(gsystem,""),
":",yon_char_return_if_exist(password,DEFAULT_USER_LABEL),
":",yon_char_return_if_exist(password,"x"),
NULL);
yon_config_register(GROUPADD(group_name),"users",final_string);
GtkTreeIter iter;
GtkTreeModel *model = GTK_TREE_MODEL(widgets->GroupsList);
if (!gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->GroupsTree)),&model,&iter))
gtk_list_store_append(widgets->GroupsList,&iter);
gtk_list_store_set(widgets->GroupsList,&iter,0,gid,1,group_name,2,group_users,3,yon_char_append(non_unique,gsystem),4,gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->PasswordCombo)),-1);
gtk_list_store_set(widgets->GroupsList,&iter,0,strcmp(gid,"x")?gid:AUTOMATICALLY_LABEL,1,group_name,2,group_users,3,yon_char_append(non_unique,gsystem),4,gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(window->PasswordCombo)),-1);
on_subwindow_close(self);
}
@ -1237,7 +1237,8 @@ void on_main_edit(GtkWidget *self, main_window *widgets){
int size;
config_str parsed = yon_char_parse(config_string,&size,":");
gtk_entry_set_text(GTK_ENTRY(window->userLoginEntry),name);
gtk_entry_set_text(GTK_ENTRY(window->userGroupsEntry),size>1?parsed[0]:"");
if (size>1&&strcmp(parsed[0],"x"))
gtk_entry_set_text(GTK_ENTRY(window->userGroupsEntry),parsed[0]);
if (size>1){
if (!strcmp(parsed[1],"")||!strcmp(parsed[1],"x"))
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(window->userUIDAutoCheck),1);

@ -404,6 +404,8 @@
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="margin-start">5</property>
<property name="margin-end">5</property>
<property name="spacing">5</property>
<child>
<object class="GtkLabel">

Loading…
Cancel
Save