From 6c3ca55bcd799c2f3a1e827a625f4480740887ea Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 22 Nov 2024 14:50:09 +0600 Subject: [PATCH] Crash fix --- source/ubl-settings-kernel.c | 14 ++++++++++---- ubl-settings-kernel.glade | 1 - 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/source/ubl-settings-kernel.c b/source/ubl-settings-kernel.c index 857b686..a0827c8 100644 --- a/source/ubl-settings-kernel.c +++ b/source/ubl-settings-kernel.c @@ -391,6 +391,8 @@ void on_module_install_accept(GtkWidget *, dictionary *dict){ main_window *widgets = yon_dictionary_get_data(dict->first,main_window*); kernels_tab *tab = yon_dictionary_get_data(dict->first->next,kernels_tab*); dialog_window *window = yon_dictionary_get_data(dict->first->next->next,dialog_window*); + free(dict->first->next->next); + dict->first->next->next = NULL; char *module_formated = yon_package_string_set(tab->module); char *modules_to_install = module_formated; @@ -406,11 +408,10 @@ void on_module_install_accept(GtkWidget *, dictionary *dict){ } } char *command = install_command(modules_to_install); - // char *command_with_unload = yon_char_unite(unload_command(modules_to_install),"; ",command,NULL); + char *command_unload = unload_command(modules_to_install); + system(command_unload); yon_command_execute_async(command,widgets); tab->module_installed=1; - free(dict->first->next->next); - dict->first->next->next=NULL; on_subwindow_close(window->Window); } @@ -462,6 +463,7 @@ void on_module_install_clicked(GtkWidget *self,dictionary *dict){ char *action_text = MODULE_INSTALL_CONFIRMATION_LABEL(tab->name); if (!gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->MainNotebook))){ dialog_window *window = yon_dialog_window_new(); + yon_dictionary_add_or_create_if_exists_with_data(dict,"window",window); g_signal_connect(G_OBJECT(window->AcceptButton),"clicked",G_CALLBACK(on_module_install_accept),dict); gtk_label_set_text(GTK_LABEL(window->TopicLabel),action_text); @@ -615,6 +617,7 @@ kernels_tab *yon_tab_row_new(GtkListBox *target, char *target_string, main_windo gtk_image_set_from_icon_name(GTK_IMAGE(tab->module_icon),module_icon_path,GTK_ICON_SIZE_BUTTON); } else { gtk_widget_hide(tab->remove_module_button); + gtk_widget_hide(tab->update_module_button); gtk_widget_show(tab->install_module_button); } @@ -627,6 +630,7 @@ kernels_tab *yon_tab_row_new(GtkListBox *target, char *target_string, main_windo } else { gtk_widget_hide(tab->remove_package_button); + gtk_widget_hide(tab->update_package_button); gtk_widget_show(tab->install_package_button); } @@ -662,6 +666,8 @@ kernels_tab *yon_tab_row_new(GtkListBox *target, char *target_string, main_windo dictionary *dict = NULL; yon_dictionary_add_or_create_if_exists_with_data(dict,"widgets",widgets); yon_dictionary_add_or_create_if_exists_with_data(dict,"tab",tab); + g_signal_connect(G_OBJECT(tab->update_module_button),"clicked",G_CALLBACK(on_module_install_clicked),dict); + g_signal_connect(G_OBJECT(tab->update_package_button),"clicked",G_CALLBACK(on_package_install_clicked),dict); g_signal_connect(G_OBJECT(tab->install_module_button),"clicked",G_CALLBACK(on_module_install_clicked),dict); g_signal_connect(G_OBJECT(tab->install_package_button),"clicked",G_CALLBACK(on_package_install_clicked),dict); g_signal_connect(G_OBJECT(tab->remove_module_button),"clicked",G_CALLBACK(on_module_remove_clicked),dict); @@ -1077,7 +1083,7 @@ void yon_main_window_complete(main_window *widgets){ glong columns = vte_terminal_get_column_count(VTE_TERMINAL(widgets->InstallTerminal)); vte_terminal_set_size(VTE_TERMINAL(widgets->InstallTerminal),columns,20); - gtk_paned_add2(GTK_PANED(widgets->TerminalPaned),widgets->TerminalRevealer); + gtk_paned_pack2(GTK_PANED(widgets->TerminalPaned),widgets->TerminalRevealer,1,1); yon_interface_update(widgets); yon_save_window_set_postsave_function(on_save_done,widgets); diff --git a/ubl-settings-kernel.glade b/ubl-settings-kernel.glade index 2909662..af7e520 100644 --- a/ubl-settings-kernel.glade +++ b/ubl-settings-kernel.glade @@ -55,7 +55,6 @@ True False - end slide-up 0