From a06de88bf5fbd1bd168c1db57aea6aa2e5ba85c3 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 19 May 2025 10:59:22 +0600 Subject: [PATCH] Progress bar fixes --- source/ubl-settings-video.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/source/ubl-settings-video.c b/source/ubl-settings-video.c index 7a88efa..e081b67 100644 --- a/source/ubl-settings-video.c +++ b/source/ubl-settings-video.c @@ -2,8 +2,8 @@ config main_config; -void on_terminal_done(GtkWidget *terminal, int , main_window *){ - gtk_widget_destroy(terminal); +void on_terminal_done(GtkWidget *, int , main_window *widgets){ + gtk_widget_destroy(widgets->TerminalRevealer); } void on_terminal_more(GtkWidget *, main_window *widgets){ @@ -32,22 +32,22 @@ void on_terminal_destroy(GtkWidget *, main_window *widgets){ } } yon_proprietary_get_thread(NULL,widgets); - yon_ubl_status_box_render(PROPRIETARY_OPETAION_DONE_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE); + yon_ubl_status_box_render(yon_char_unite(PROPRIETARY_OPETAION_DONE_LABEL,". ",PROPRIETARY_LOADING_LABEL,NULL),BACKGROUND_IMAGE_SUCCESS_TYPE); } -gboolean on_command_execute_success(GtkWidget *self,gint status,main_window *){ +gboolean on_command_execute_success(GtkWidget *self,gint status,main_window *widgets){ g_mutex_lock(&main_config.progress_mutex); main_config.progress_active=0; g_mutex_unlock(&main_config.progress_mutex); if (!status){ - yon_ubl_status_box_render(yon_char_get_localised_from_lib(SUCCESS_LABEL),BACKGROUND_IMAGE_SUCCESS_TYPE); + yon_ubl_status_box_render(yon_char_unite(yon_char_get_localised_from_lib(SUCCESS_LABEL),". ",PROPRIETARY_LOADING_LABEL,NULL),BACKGROUND_IMAGE_SUCCESS_TYPE); } else { yon_ubl_status_box_render(yon_char_get_localised_from_lib(FAIL_LABEL),BACKGROUND_IMAGE_FAIL_TYPE); } - on_terminal_done(self,0,NULL); + on_terminal_done(self,0,widgets); return G_SOURCE_REMOVE; } @@ -71,17 +71,17 @@ gboolean on_terminal_check_progress(main_window *widgets){ if (last_match) { yon_char_remove_last_symbol(last_match,'%'); - percentage = atof(last_match); + percentage = g_ascii_strtod(last_match,NULL); yon_debug_output("%s\n", text); yon_debug_output("%s\n", last_match); - g_free(text); gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->TerminalInfoLabel), percentage / 100); g_free(last_match); } + g_free(text); g_match_info_unref(match); g_mutex_lock(&main_config.progress_mutex); - if (percentage==100||!main_config.progress_active){ + if (percentage>99||!main_config.progress_active){ gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->TerminalInfoLabel),0); g_mutex_unlock(&main_config.progress_mutex); return G_SOURCE_REMOVE; @@ -125,6 +125,7 @@ void yon_terminal_start(main_window *widgets, char *usr_command){ vte_terminal_set_scroll_on_output(VTE_TERMINAL(widgets->terminal), TRUE); vte_terminal_set_scroll_on_keystroke(VTE_TERMINAL(widgets->terminal), TRUE); gtk_widget_show_all(widgets->TerminalRevealer); + gtk_widget_realize(widgets->terminal); g_mutex_lock(&main_config.progress_mutex); main_config.progress_active=1; g_mutex_unlock(&main_config.progress_mutex);