From 8d46c74b075dd45538deff0c7679fa4037413f9b Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Wed, 1 Apr 2026 17:06:15 +0600 Subject: [PATCH] Fixed user autologin switching --- source/ubinstall-gtk-language.c | 10 ++++++++++ source/ubinstall-gtk-users.c | 2 +- source/ubinstall-gtk.c | 1 + source/ubinstall-gtk.h | 3 ++- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/source/ubinstall-gtk-language.c b/source/ubinstall-gtk-language.c index f759ff0..0a6b207 100644 --- a/source/ubinstall-gtk-language.c +++ b/source/ubinstall-gtk-language.c @@ -233,6 +233,16 @@ void on_language_default_toggled(GtkWidget *, int status, main_window *widgets){ } } +void on_locale_selected(GtkTreeView *,main_window *widgets){ + GtkTreeModel *model = NULL; + GtkTreeIter iter; + if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->LocaleTree)),&model,&iter)){ + gtk_widget_set_sensitive(widgets->LocaleRemoveButton,1); + } else { + gtk_widget_set_sensitive(widgets->LocaleRemoveButton,0); + } +} + void on_locale_toggled(GtkCellRenderer *, gchar *path, main_window *widgets){ GtkTreeIter fiter; GtkTreeIter iter; diff --git a/source/ubinstall-gtk-users.c b/source/ubinstall-gtk-users.c index 0f4d915..eadc513 100644 --- a/source/ubinstall-gtk-users.c +++ b/source/ubinstall-gtk-users.c @@ -107,7 +107,7 @@ gboolean on_user_autoloin_switch(GtkWidget *, int status, main_window *){ } else { yon_config_register(autologin_parameter,autologin_parameter_command,"no"); } - return status; + return 0; } void on_user_add(GtkWidget *,main_window *widgets){ diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 86dbda0..3b097cb 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -690,6 +690,7 @@ void yon_main_window_create(main_window *widgets){ g_signal_connect(G_OBJECT(widgets->LocaleRemoveButton),"clicked",G_CALLBACK(on_language_remove),widgets); g_signal_connect(G_OBJECT(widgets->LocaleDefaultSwitch),"state-set",G_CALLBACK(on_language_default_toggled),widgets); g_signal_connect(G_OBJECT(widgets->LocaleCell),"toggled",G_CALLBACK(on_locale_toggled),widgets); + g_signal_connect(G_OBJECT(widgets->LocaleTree),"cursor-changed",G_CALLBACK(on_locale_selected),widgets); g_signal_connect(G_OBJECT(widgets->CancelInstallButton),"clicked",G_CALLBACK(on_page_cancel_clicked),widgets); g_signal_connect(G_OBJECT(widgets->RegionCombo),"changed",G_CALLBACK(on_region_changed),widgets); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 53748f3..53974d1 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -1619,4 +1619,5 @@ 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); -gboolean on_user_autoloin_switch(GtkWidget *, int status, main_window *); \ No newline at end of file +gboolean on_user_autoloin_switch(GtkWidget *, int status, main_window *); +void on_locale_selected(GtkTreeView *self,main_window *widgets); \ No newline at end of file