From 2905c6ab5c77f81738bcf8ef650e6752cbb814fe Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 6 Sep 2024 11:01:37 +0600 Subject: [PATCH] test fix for crash, test debug messages --- source/ubinstall-gtk.c | 19 +++++++++++++++++-- source/ubinstall-gtk.h | 4 +++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 3c1a4a5..3f1f3da 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -994,24 +994,32 @@ void *on_config_save(void *data){ fclose(file); char *command = save_config_command(yon_char_parsed_to_string(parameters,size," ")); yon_char_parsed_free(parameters,size); + yon_debug_output("$s\n","Entered installation"); if (system(yon_debug_output("%s\n",command))){ - gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALL_ERROR); + yon_debug_output("$s\n","Entered installation failed"); + + g_thread_new("success func",(GThreadFunc)on_install_error,widgets); free(command); main_config.config_save_thread=NULL; main_config.install_thread=0; main_config.install_complete=1; + yon_debug_output("$s\n","Exit installation"); pthread_exit(NULL); return 0; }; + yon_debug_output("$s\n","Entered installation success"); free(command); main_config.install_thread=0; main_config.install_complete=1; yon_debug_output("Install set to: %s\n",yon_char_from_int(main_config.install_complete)); yon_debug_output("Save state: %s\n",yon_char_from_int(main_config.save_done)); if (main_config.save_done){ - gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_COMPLETION); + yon_debug_output("$s\n","Entered installation page change"); + g_thread_new("success func",(GThreadFunc)on_install_success,widgets); } main_config.config_save_thread=NULL; + + yon_debug_output("$s\n","Exit installation"); pthread_exit(NULL); } @@ -1207,6 +1215,13 @@ void *on_install_success(main_window *widgets){ return NULL; } +void *on_install_error(main_window *widgets){ + gtk_label_set_text(GTK_LABEL(widgets->InstallationLabel),""); + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALL_ERROR); + + return NULL; +} + void *on_setup_system_configuration(void *data); void *on_setup_system_configuration(void * data){ yon_debug_output("$s\n","Entered thread"); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 7689db5..64f0799 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -467,4 +467,6 @@ void on_autohostname_sensitiveness_check(GtkWidget *, main_window *widgets); void on_autohostname_check(GtkWidget *, main_window *widgets); void on_hostname_entry_changed (GtkWidget *, main_window *widgets); -void *on_install_success(main_window *widgets); \ No newline at end of file +void *on_install_success(main_window *widgets); + +void *on_install_error(main_window *widgets); \ No newline at end of file