From 3dc9688d944d117b71f349cf0f3e405cc28e5df0 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Thu, 26 Feb 2026 10:42:43 +0600 Subject: [PATCH] Fixed sensitivity --- source/ubl-settings-update.c | 46 +++++++++++++++++++++++++++++++----- ubl-settings-update.glade | 2 ++ 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/source/ubl-settings-update.c b/source/ubl-settings-update.c index c16fc2a..809de63 100644 --- a/source/ubl-settings-update.c +++ b/source/ubl-settings-update.c @@ -46,8 +46,10 @@ void on_toggle_button_toggled(GtkWidget *self, main_window *widgets){ if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->AutoUpdateCheck))){ yon_config_register(AUTOUPDATE,AUTOUPDATE_command,"enable"); + on_toggle_button_toggled(widgets->UpdateIntervalDefaultCheck,widgets); } else { yon_config_remove_by_key(AUTOUPDATE); + yon_config_remove_by_key(AUTOUPDATE_interval); } } else if (self == widgets->UpdateModeCombo){ @@ -202,25 +204,42 @@ void on_toggle_button_toggled(GtkWidget *self, main_window *widgets){ void yon_update_toggled(GtkWidget *self, main_window *widgets){ g_signal_handlers_block_by_func(G_OBJECT(self),G_CALLBACK(yon_update_toggled),widgets); - if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->AutoUpdateCheck))){ + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->AutoUpdateCheck))){ gtk_widget_set_sensitive(widgets->UpdateIntervalDefaultCheck,1); int status = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->UpdateIntervalDefaultCheck)); gtk_widget_set_sensitive(GTK_WIDGET(widgets->BootCheck),!status); - status = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->BootCheck)); gtk_widget_set_sensitive(GTK_WIDGET(widgets->UpdateIntervalSpin),!status); gtk_widget_set_sensitive(GTK_WIDGET(widgets->UpdateIntervalCombo),!status); + status = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->BootCheck)); + gtk_widget_set_sensitive(GTK_WIDGET(widgets->UpdateModeCombo),1); } else { gtk_widget_set_sensitive(GTK_WIDGET(widgets->UpdateIntervalDefaultCheck),0); gtk_widget_set_sensitive(GTK_WIDGET(widgets->BootCheck),0); gtk_widget_set_sensitive(GTK_WIDGET(widgets->UpdateIntervalSpin),0); gtk_widget_set_sensitive(GTK_WIDGET(widgets->UpdateIntervalCombo),0); + gtk_widget_set_sensitive(GTK_WIDGET(widgets->UpdateModeCombo),0); } g_signal_handlers_unblock_by_func(G_OBJECT(self),G_CALLBACK(yon_update_toggled),widgets); } void yon_interface_update(main_window *widgets){ + + g_signal_handlers_block_by_func(G_OBJECT(widgets->BootCheck),G_CALLBACK(on_toggle_button_toggled),widgets); + g_signal_handlers_block_by_func(G_OBJECT(widgets->PublicationCheck),G_CALLBACK(on_toggle_button_toggled),widgets); + g_signal_handlers_block_by_func(G_OBJECT(widgets->UpdateIntervalSpin),G_CALLBACK(on_toggle_button_toggled),widgets); + g_signal_handlers_block_by_func(G_OBJECT(widgets->UpdateIntervalCombo),G_CALLBACK(on_toggle_button_toggled),widgets); + g_signal_handlers_block_by_func(G_OBJECT(widgets->AutoUpdateCheck),G_CALLBACK(on_toggle_button_toggled),widgets); + + g_signal_handlers_block_by_func(G_OBJECT(widgets->UpdateModeCombo),G_CALLBACK(on_toggle_button_toggled),widgets); + g_signal_handlers_block_by_func(G_OBJECT(widgets->UpdateIntervalDefaultCheck),G_CALLBACK(on_toggle_button_toggled),widgets); + g_signal_handlers_block_by_func(G_OBJECT(widgets->UpdateRepoListCheck),G_CALLBACK(on_toggle_button_toggled),widgets); + g_signal_handlers_block_by_func(G_OBJECT(widgets->RepositoriesRepoListConfigurationCheck),G_CALLBACK(on_toggle_button_toggled),widgets); + g_signal_handlers_block_by_func(G_OBJECT(widgets->RepositoriesDisableSystemReposCheck),G_CALLBACK(on_toggle_button_toggled),widgets); + g_signal_handlers_block_by_func(G_OBJECT(widgets->PublicationConnectPublicCheck),G_CALLBACK(on_toggle_button_toggled),widgets); + g_signal_handlers_block_by_func(G_OBJECT(widgets->RecieveDBFromNetCheck),G_CALLBACK(on_toggle_button_toggled),widgets); + g_signal_handlers_block_by_func(G_OBJECT(widgets->MirrorPublicCheck),G_CALLBACK(on_toggle_button_toggled),widgets); gtk_list_store_clear(widgets->ReposList); gtk_list_store_clear(widgets->MirrorList); gtk_list_store_clear(widgets->UpdateRepoList); @@ -425,6 +444,7 @@ void yon_interface_update(main_window *widgets){ } autoupdate_config = config(AUTOUPDATE_interval); if (!yon_char_is_empty(autoupdate_config)){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->AutoUpdateCheck),1); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->UpdateIntervalDefaultCheck),0); int parsed_size; config_str parsed = yon_char_parse(autoupdate_config,&parsed_size,","); @@ -568,6 +588,20 @@ void yon_interface_update(main_window *widgets){ } yon_char_parsed_free(ftp_parameters,size); } + + g_signal_handlers_unblock_by_func(G_OBJECT(widgets->BootCheck),G_CALLBACK(on_toggle_button_toggled),widgets); + g_signal_handlers_unblock_by_func(G_OBJECT(widgets->PublicationCheck),G_CALLBACK(on_toggle_button_toggled),widgets); + g_signal_handlers_unblock_by_func(G_OBJECT(widgets->UpdateIntervalSpin),G_CALLBACK(on_toggle_button_toggled),widgets); + g_signal_handlers_unblock_by_func(G_OBJECT(widgets->UpdateIntervalCombo),G_CALLBACK(on_toggle_button_toggled),widgets); + g_signal_handlers_unblock_by_func(G_OBJECT(widgets->AutoUpdateCheck),G_CALLBACK(on_toggle_button_toggled),widgets); + g_signal_handlers_unblock_by_func(G_OBJECT(widgets->UpdateModeCombo),G_CALLBACK(on_toggle_button_toggled),widgets); + g_signal_handlers_unblock_by_func(G_OBJECT(widgets->UpdateIntervalDefaultCheck),G_CALLBACK(on_toggle_button_toggled),widgets); + g_signal_handlers_unblock_by_func(G_OBJECT(widgets->UpdateRepoListCheck),G_CALLBACK(on_toggle_button_toggled),widgets); + g_signal_handlers_unblock_by_func(G_OBJECT(widgets->RepositoriesRepoListConfigurationCheck),G_CALLBACK(on_toggle_button_toggled),widgets); + g_signal_handlers_unblock_by_func(G_OBJECT(widgets->RepositoriesDisableSystemReposCheck),G_CALLBACK(on_toggle_button_toggled),widgets); + g_signal_handlers_unblock_by_func(G_OBJECT(widgets->PublicationConnectPublicCheck),G_CALLBACK(on_toggle_button_toggled),widgets); + g_signal_handlers_unblock_by_func(G_OBJECT(widgets->RecieveDBFromNetCheck),G_CALLBACK(on_toggle_button_toggled),widgets); + g_signal_handlers_unblock_by_func(G_OBJECT(widgets->MirrorPublicCheck),G_CALLBACK(on_toggle_button_toggled),widgets); } // standard functions @@ -1487,7 +1521,6 @@ void yon_main_window_complete(main_window *widgets){ gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->UpdateModeCombo),0); } } - yon_interface_update(widgets); g_signal_connect(G_OBJECT(widgets->BootCheck),"toggled",G_CALLBACK(on_toggle_button_toggled),widgets); g_signal_connect(G_OBJECT(widgets->PublicationCheck),"toggled",G_CALLBACK(on_toggle_button_toggled),widgets); @@ -1495,9 +1528,9 @@ void yon_main_window_complete(main_window *widgets){ g_signal_connect(G_OBJECT(widgets->UpdateIntervalCombo),"changed",G_CALLBACK(on_toggle_button_toggled),widgets); g_signal_connect(G_OBJECT(widgets->AutoUpdateCheck),"toggled",G_CALLBACK(on_toggle_button_toggled),widgets); g_signal_connect(G_OBJECT(widgets->AutoUpdateCheck),"toggled",G_CALLBACK(yon_update_toggled),widgets); - g_signal_connect(G_OBJECT(widgets->AutoUpdateCheck),"toggled",G_CALLBACK(yon_update_toggled),widgets); - g_signal_connect(G_OBJECT(widgets->AutoUpdateCheck),"toggled",G_CALLBACK(yon_update_toggled),widgets); - g_signal_connect(G_OBJECT(widgets->AutoUpdateCheck),"toggled",G_CALLBACK(yon_update_toggled),widgets); + // g_signal_connect(G_OBJECT(widgets->AutoUpdateCheck),"toggled",G_CALLBACK(yon_update_toggled),widgets); + // g_signal_connect(G_OBJECT(widgets->AutoUpdateCheck),"toggled",G_CALLBACK(yon_update_toggled),widgets); + // g_signal_connect(G_OBJECT(widgets->AutoUpdateCheck),"toggled",G_CALLBACK(yon_update_toggled),widgets); g_signal_connect(G_OBJECT(widgets->UpdateModeCombo),"changed",G_CALLBACK(on_toggle_button_toggled),widgets); g_signal_connect(G_OBJECT(widgets->UpdateIntervalDefaultCheck),"toggled",G_CALLBACK(on_toggle_button_toggled),widgets); g_signal_connect(G_OBJECT(widgets->UpdateRepoListCheck),"toggled",G_CALLBACK(on_toggle_button_toggled),widgets); @@ -1506,6 +1539,7 @@ void yon_main_window_complete(main_window *widgets){ g_signal_connect(G_OBJECT(widgets->PublicationConnectPublicCheck),"toggled",G_CALLBACK(on_toggle_button_toggled),widgets); g_signal_connect(G_OBJECT(widgets->RecieveDBFromNetCheck),"toggled",G_CALLBACK(on_toggle_button_toggled),widgets); g_signal_connect(G_OBJECT(widgets->MirrorPublicCheck),"toggled",G_CALLBACK(on_toggle_button_toggled),widgets); + yon_interface_update(widgets); { yon_gtk_tree_view_minimal_fixed_size_set_full(GTK_TREE_VIEW(widgets->MirrorTree)); diff --git a/ubl-settings-update.glade b/ubl-settings-update.glade index a552f35..3043eb4 100644 --- a/ubl-settings-update.glade +++ b/ubl-settings-update.glade @@ -360,6 +360,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Default True + False True False Update interval @@ -376,6 +377,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Check system updates at system startup True + False True False start