From a0913dbc396645d888be56ea9390de94f73c2ccb Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 6 Aug 2024 16:04:26 +0600 Subject: [PATCH] Test fix for saving crash --- source/ubl-settings-usergroups.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/source/ubl-settings-usergroups.c b/source/ubl-settings-usergroups.c index c09b947..68105cf 100644 --- a/source/ubl-settings-usergroups.c +++ b/source/ubl-settings-usergroups.c @@ -1036,6 +1036,20 @@ void on_expiration_clicked(GtkWidget *self, ubl_settings_usergroups_user_window }else { yon_config_remove_by_key(HASHPASSWD_parameter); } + char *sync = ""; + int boot_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->UsersBootCheck)); + int shutdown_active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(window->UsersShutdownCheck)); + if (!boot_active&&!shutdown_active){ + yon_config_remove_by_key(USERADD_SYNC_parameter); + } else { + if (boot_active){ + sync = "boot"; + } + if (shutdown_active){ + sync = yon_char_unite(sync,yon_char_is_empty(sync)?"":",","shutdown"); + } + yon_config_register(USERADD_SYNC_parameter,USERADD_SYNC_parameter_command,sync); + } } void on_hash_changed(GtkWidget *self, ubl_settings_usergroups_additional_settings_window *window){ @@ -1192,8 +1206,8 @@ ubl_settings_usergroups_additional_settings_window *yon_ubl_settings_usergroups_ g_signal_connect(G_OBJECT(window->PasswordHashCombo),"changed",G_CALLBACK(on_hash_changed),window); - g_signal_connect(G_OBJECT(window->UsersBootCheck),"toggled",G_CALLBACK(on_users_boot_toggled),NULL); - g_signal_connect(G_OBJECT(window->UsersShutdownCheck),"toggled",G_CALLBACK(on_users_shutdown_toggled),NULL); + // g_signal_connect(G_OBJECT(window->UsersBootCheck),"toggled",G_CALLBACK(on_users_boot_toggled),NULL); + // g_signal_connect(G_OBJECT(window->UsersShutdownCheck),"toggled",G_CALLBACK(on_users_shutdown_toggled),NULL); return window; }