Progress bar fixes

pull/106/head
parent 3f73aa6437
commit a06de88bf5

@ -2,8 +2,8 @@
config main_config; config main_config;
void on_terminal_done(GtkWidget *terminal, int , main_window *){ void on_terminal_done(GtkWidget *, int , main_window *widgets){
gtk_widget_destroy(terminal); gtk_widget_destroy(widgets->TerminalRevealer);
} }
void on_terminal_more(GtkWidget *, main_window *widgets){ 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_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); g_mutex_lock(&main_config.progress_mutex);
main_config.progress_active=0; main_config.progress_active=0;
g_mutex_unlock(&main_config.progress_mutex); g_mutex_unlock(&main_config.progress_mutex);
if (!status){ 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 { } else {
yon_ubl_status_box_render(yon_char_get_localised_from_lib(FAIL_LABEL),BACKGROUND_IMAGE_FAIL_TYPE); 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; return G_SOURCE_REMOVE;
} }
@ -71,17 +71,17 @@ gboolean on_terminal_check_progress(main_window *widgets){
if (last_match) { if (last_match) {
yon_char_remove_last_symbol(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", text);
yon_debug_output("%s\n", last_match); yon_debug_output("%s\n", last_match);
g_free(text);
gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->TerminalInfoLabel), percentage / 100); gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->TerminalInfoLabel), percentage / 100);
g_free(last_match); g_free(last_match);
} }
g_free(text);
g_match_info_unref(match); g_match_info_unref(match);
g_mutex_lock(&main_config.progress_mutex); 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); gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->TerminalInfoLabel),0);
g_mutex_unlock(&main_config.progress_mutex); g_mutex_unlock(&main_config.progress_mutex);
return G_SOURCE_REMOVE; 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_output(VTE_TERMINAL(widgets->terminal), TRUE);
vte_terminal_set_scroll_on_keystroke(VTE_TERMINAL(widgets->terminal), TRUE); vte_terminal_set_scroll_on_keystroke(VTE_TERMINAL(widgets->terminal), TRUE);
gtk_widget_show_all(widgets->TerminalRevealer); gtk_widget_show_all(widgets->TerminalRevealer);
gtk_widget_realize(widgets->terminal);
g_mutex_lock(&main_config.progress_mutex); g_mutex_lock(&main_config.progress_mutex);
main_config.progress_active=1; main_config.progress_active=1;
g_mutex_unlock(&main_config.progress_mutex); g_mutex_unlock(&main_config.progress_mutex);

Loading…
Cancel
Save