Fixed default saving

pull/235/head
parent 116edf202b
commit 6060f1a2ad

@ -154,6 +154,10 @@ ubl_settings_usergroups_user_window *yon_ubl_settings_usergroups_user_new(){
window->old_password=NULL;
window->old_username=NULL;
dictionary *entry_dict = NULL;
struct target_struct *target = malloc(sizeof(struct target_struct));
target->target=GTK_ENTRY(window->userGroupsEntry);
target->defaut_toggle=GTK_TOGGLE_BUTTON(window->userGroupsCheck);
yon_window_config_custom_window_setup(GTK_WINDOW(window->CreateUserWindow),"UserWindow");
yon_dictionary_add_or_create_if_exists_with_data(entry_dict,"combo",window->userPasswordCombo);
yon_dictionary_add_or_create_if_exists_with_data(entry_dict,"entry",window->userPasswordEntry);
@ -161,7 +165,7 @@ ubl_settings_usergroups_user_window *yon_ubl_settings_usergroups_user_new(){
g_signal_connect(G_OBJECT(window->UserCancelButton),"clicked",G_CALLBACK(on_subwindow_close),NULL);
g_signal_connect(G_OBJECT(window->userUIDAutoCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),window->userUIDEntry);
g_signal_connect(G_OBJECT(window->userHomeButton),"clicked",G_CALLBACK(on_filechooser_open),window->userHomeEntry);
g_signal_connect(G_OBJECT(window->UserGroupsButton),"clicked",G_CALLBACK(on_groups_clicked),window->userGroupsEntry);
g_signal_connect(G_OBJECT(window->UserGroupsButton),"clicked",G_CALLBACK(on_groups_clicked),target);
g_signal_connect(G_OBJECT(window->userPasswordButton),"clicked",G_CALLBACK(on_password_change),entry_dict);
g_signal_connect(G_OBJECT(window->userAdditionalGroupsButton),"clicked",G_CALLBACK(on_groups_multiple_clicked),window->userAdditionalGroupsEntry);
g_signal_connect(G_OBJECT(window->userPasswordExpirationButton),"clicked",G_CALLBACK(on_expiration_clicked),window);

@ -799,19 +799,24 @@ void on_filechooser_open(GtkWidget *, GtkEntry *output_target){
void on_groups_save(GtkWidget *self, dictionary *dict){
ubl_settings_usergroups_group_window *window = yon_dictionary_get_data(dict->first,ubl_settings_usergroups_group_window*);
GtkEntry *output = yon_dictionary_get_data(dict->first->next,GtkEntry*);
struct target_struct *output = yon_dictionary_get_data(dict->first->next,struct target_struct *);
if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->DefaultCheck))){
GtkTreeIter iter;
GtkTreeModel *model = GTK_TREE_MODEL(window->list);
if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(window->GroupsTree)),&model,&iter)){
char *name;
gtk_tree_model_get(model,&iter,1,&name,-1);
gtk_entry_set_text(output,name);
gtk_entry_set_text(output->target,name);
free(name);
}
} else {
gtk_entry_set_text(output->target,"");
gtk_toggle_button_set_active(output->defaut_toggle,1);
}
on_subwindow_close(self);
}
void on_groups_clicked(GtkWidget *, GtkEntry *output_target){
void on_groups_clicked(GtkWidget *, struct target_struct *output_target){
ubl_settings_usergroups_group_window *window = yon_ubl_settings_usergroups_group_new(0);
gtk_window_set_title(GTK_WINDOW(window->GroupsWindow),MAIN_GROUP_TITLE_LABEL);
gtk_label_set_text(GTK_LABEL(window->HeaderLabel),MAIN_GROUP_TITLE_LABEL);
@ -837,7 +842,7 @@ void on_groups_clicked(GtkWidget *, GtkEntry *output_target){
gtk_tree_view_column_set_title(gtk_tree_view_get_column(GTK_TREE_VIEW(window->GroupsTree),1),GID_LABEL);
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);
const char *current_group=gtk_entry_get_text(output_target->target);
size_t digits=0;
for (guint k=0;k<strlen(current_group);k++){
if (g_ascii_isdigit(current_group[k])){

@ -429,6 +429,11 @@ typedef struct{
} system_remove_confirmation_window;
struct target_struct{
GtkEntry *target;
GtkToggleButton *defaut_toggle;
};
ubl_settings_usergroups_additional_settings_window *yon_ubl_settings_usergroups_additional_settings_new();
void on_ubl_settings_usergroups_additional_settings_open(GtkWidget *self, main_window *widgets);
@ -489,7 +494,7 @@ void on_saving_settings_open(GtkWidget *self, main_window *widgets);
void on_password_combo_changed(GtkComboBox *self, GtkWidget *target);
void on_filechooser_open(GtkWidget *self, GtkEntry *output_target);
void on_groups_save(GtkWidget *self, dictionary *dict);
void on_groups_clicked(GtkWidget *self, GtkEntry *output_target);
void on_groups_clicked(GtkWidget *self, struct target_struct *output_target);
void on_groups_multiple_save(GtkWidget *self, dictionary *dict);
void on_groups_multiple_clicked(GtkWidget *self, GtkEntry *output_target);
void on_passwords_encrypt();

Loading…
Cancel
Save