diff --git a/source/ubinstall-gtk-bootloader.c b/source/ubinstall-gtk-bootloader.c index c780787..0c664e5 100644 --- a/source/ubinstall-gtk-bootloader.c +++ b/source/ubinstall-gtk-bootloader.c @@ -495,4 +495,16 @@ void yon_bootloader_init(main_window *widgets){ } yon_char_parsed_free(admins_parsed,admins_size); } +} + +void on_bootloader_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->BootloadUserTree)),&model,&iter)){ + gtk_widget_set_sensitive(widgets->BootloadUserRemoveButton,1); + gtk_widget_set_sensitive(widgets->BootloadUserEditButton,1); + } else { + gtk_widget_set_sensitive(widgets->BootloadUserRemoveButton,0); + gtk_widget_set_sensitive(widgets->BootloadUserEditButton,0); + } } \ No newline at end of file diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index b143b22..c76d43e 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -815,6 +815,7 @@ void yon_main_window_create(main_window *widgets){ g_signal_connect(G_OBJECT(widgets->BootloadUserEditButton),"clicked",G_CALLBACK(on_bootloader_user_edit),widgets); g_signal_connect(G_OBJECT(widgets->BootloadAdminCheckCell),"toggled",G_CALLBACK(on_bootloader_admin_toggled),widgets); g_signal_connect(G_OBJECT(widgets->BootloadUserRemoveButton),"clicked",G_CALLBACK(on_bootloader_user_remove),widgets); + g_signal_connect(G_OBJECT(widgets->BootloadUserTree),"cursor-changed",G_CALLBACK(on_bootloader_selected),widgets); g_signal_connect(G_OBJECT(widgets->BootloadTimerSwitch),"state-set",G_CALLBACK(yon_gtk_widget_set_sensitive_from_switch),widgets->BootloadTimerSpin); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 681e5ce..6f7b099 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -1625,4 +1625,5 @@ void on_kernel_info(GtkWidget *, char *link, kernel_row *row); gboolean on_os_components_info(GtkWidget *, GdkEventButton *, os_row *row); void on_software_info(GtkWidget*, main_window *widgets); void yon_packages_remove_empty_groups(main_window *widgets); -void yon_config_mode_start(main_window *widgets); \ No newline at end of file +void yon_config_mode_start(main_window *widgets); +void on_bootloader_selected(GtkTreeView *,main_window *widgets); \ No newline at end of file diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index b949dcc..fe4b481 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -6680,6 +6680,7 @@ Select a different installation sources. True + False True True Edit user @@ -6697,6 +6698,7 @@ Select a different installation sources. True + False True True image18