diff --git a/source/ubinstall-gtk-users.c b/source/ubinstall-gtk-users.c index d34a0f6..5efd748 100644 --- a/source/ubinstall-gtk-users.c +++ b/source/ubinstall-gtk-users.c @@ -12,12 +12,6 @@ int yon_users_save(main_window *widgets){ } else { yon_config_remove_by_key(root_password_parameter); } - int autologin = gtk_switch_get_active(GTK_SWITCH(widgets->UserAutologinSwitch)); - if (autologin){ - yon_config_register(autologin_parameter,autologin_parameter_command,"yes"); - } else { - yon_config_register(autologin_parameter,autologin_parameter_command,"no"); - } GList *users = gtk_container_get_children(GTK_CONTAINER(widgets->UserAddBox)); GList *iter; @@ -38,7 +32,7 @@ int yon_users_save(main_window *widgets){ } else { for (iter=users;iter;iter=iter->next){ yon_user_struct *user = g_object_get_data(G_OBJECT(iter->data),"yon_user_struct"); - if (user){ + if (user&&user->changed){ if (!yon_user_save(user)){ yon_ubl_status_box_spawn(GTK_CONTAINER(main_config.status_box),_EMPTY_IMPORTANT_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); @@ -57,6 +51,9 @@ int yon_users_save(main_window *widgets){ yon_char_parsed_add_or_create_if_exists(users,&users_size,DEFAULTUSER_parameter); yon_char_parsed_add_or_create_if_exists(users,&users_size,ADDADM_parameter); yon_debug_output("%s\n",yon_config_save_list_simple(users,users_size,main_config.config_load_path)); + for (int i=0;iAdminCheck),"clicked",G_CALLBACK(yon_user_admin_check),widgets); g_object_set_data(G_OBJECT(user->MainBox),"widgets",widgets); gtk_box_pack_start(GTK_BOX(widgets->UserAddBox),user->MainBox,0,0,0); + user->changed=1; } void on_user_remove_clicked(GtkWidget *,yon_user_struct *user){ @@ -131,6 +137,7 @@ void yon_password_new(GtkWidget *, yon_user_struct *user){ void yon_user_admin_check(GtkWidget *self, main_window *widgets){ yon_user_struct *user = g_object_get_data(G_OBJECT(self),"yon_user_struct"); GList *list = gtk_container_get_children(GTK_CONTAINER(widgets->UserAddBox)); + user->changed=1; GList *iter; for(iter=list;iter;iter=iter->next){ if (iter->data!=user->MainBox){ @@ -144,6 +151,7 @@ void yon_user_admin_check(GtkWidget *self, main_window *widgets){ yon_user_struct *yon_user_struct_new(){ yon_user_struct *user = new(yon_user_struct); + memset(user,0,sizeof(yon_user_struct)); GtkBuilder *builder = gtk_builder_new_from_resource(glade_path_user); user->MainBox = yon_gtk_builder_get_widget(builder,"MainBox"); diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index cbe2c8a..ade6016 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -761,6 +761,8 @@ void yon_main_window_create(main_window *widgets){ g_signal_connect(G_OBJECT(widgets->OSFormatEncryptionButton),"clicked",G_CALLBACK(yon_os_password_open),widgets); yon_gtk_revealer_set_from_switch(GTK_REVEALER(widgets->OSRevealer),GTK_SWITCH(widgets->OSFormatSwitch)); + g_signal_connect(G_OBJECT(widgets->UserAutologinSwitch),"state-set",G_CALLBACK(on_user_autoloin_switch),widgets); + g_signal_connect(G_OBJECT(widgets->UserdataFormatEncryptionCombo),"changed",G_CALLBACK(yon_gtk_widget_set_sensitive_from_combo_box),widgets->UserdataFormatEncryptionButton); g_signal_connect(G_OBJECT(widgets->UserdataFormatEncryptionButton),"clicked",G_CALLBACK(yon_userdata_password_open),widgets); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 0e1f77f..4904a72 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -972,6 +972,7 @@ typedef struct GtkWidget *PasswordEntry; GtkWidget *PasswordButton; GtkWidget *AdminCheck; + int changed; } yon_user_struct; typedef struct @@ -1617,4 +1618,5 @@ gboolean on_kernel_enabled_toggled(GtkWidget *self, GdkEventButton *, kernel_row void on_status_update(GtkWidget *,main_window *widgets); gboolean on_kernel_addon_menu_block(GObject *self, GdkEventButton *event); void on_os_components_uncheck_all(GtkWidget *,main_window *widgets); -gboolean yon_os_components_load(main_window *widgets); \ No newline at end of file +gboolean yon_os_components_load(main_window *widgets); +void on_user_autoloin_switch(GtkWidget *, int status, main_window *); \ No newline at end of file