diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c index 8bdc8d1..adb937c 100644 --- a/src/gui-wizard-gtk/wizard.c +++ b/src/gui-wizard-gtk/wizard.c @@ -48,6 +48,7 @@ static GtkBox *g_box_analyzers; static GList *g_list_analyzers; static GtkLabel *g_lbl_analyze_log; static GtkTextView *g_tv_analyze_log; +static GtkProgressBar *g_pb_analyze; static GtkBox *g_box_collectors; /* List of event_gui_data's */ @@ -104,6 +105,9 @@ static GtkEntry *g_search_entry_bt; static GtkBuilder *builder; static PangoFontDescription *monospace_font; +static gboolean pb_pulse = false; +static gint pb_pulse_speed = 150; + /* THE PAGE FLOW * page_0: introduction/summary @@ -1405,6 +1409,8 @@ static gboolean consume_cmd_output(GIOChannel *source, GIOCondition condition, g { append_to_textview(evd->tv_log, msg); save_to_event_log(evd, msg); + /* cuts off \n from msg */ + gtk_label_set_text(g_lbl_analyze_log, strtrim(msg)); } strbuf_clear(line); @@ -1473,7 +1479,6 @@ static gboolean consume_cmd_output(GIOChannel *source, GIOCondition condition, g ) { VERB1 log("done running event on '%s': %d", g_dump_dir_name, retval); append_to_textview(evd->tv_log, "\n"); - for (;;) { if (!evd->more_events) @@ -1486,6 +1491,9 @@ static gboolean consume_cmd_output(GIOChannel *source, GIOCondition condition, g strbuf_free(line); line = NULL; + /* hide progress bar */ + pb_pulse = false; + /* Enable (un-gray out) navigation buttons */ gtk_widget_set_sensitive(GTK_WIDGET(g_assistant), true); @@ -1532,6 +1540,16 @@ static gboolean consume_cmd_output(GIOChannel *source, GIOCondition condition, g return TRUE; /* "please don't remove this event (yet)" */ } +/* pulse the progressbar */ +static gboolean pb_pulse_timeout(gpointer data) +{ + if (pb_pulse) + gtk_progress_bar_pulse(g_pb_analyze); + else + gtk_widget_hide(GTK_WIDGET(g_pb_analyze)); + return pb_pulse; +} + static void start_event_run(const char *event_name, GList *more_events, GtkWidget *page, @@ -1545,6 +1563,9 @@ static void start_event_run(const char *event_name, */ struct run_event_state *state = new_run_event_state(); + pb_pulse = true; + g_timeout_add(pb_pulse_speed, pb_pulse_timeout, NULL); + if (prepare_commands(state, g_dump_dir_name, event_name) == 0) { no_cmds: @@ -2340,6 +2361,7 @@ static void add_pages() g_box_analyzers = GTK_BOX( gtk_builder_get_object(builder, "vb_analyzers")); g_lbl_analyze_log = GTK_LABEL( gtk_builder_get_object(builder, "lbl_analyze_log")); g_tv_analyze_log = GTK_TEXT_VIEW( gtk_builder_get_object(builder, "tv_analyze_log")); + g_pb_analyze = GTK_PROGRESS_BAR( gtk_builder_get_object(builder, "pb_analyze")); g_box_collectors = GTK_BOX( gtk_builder_get_object(builder, "vb_collectors")); g_lbl_collect_log = GTK_LABEL( gtk_builder_get_object(builder, "lbl_collect_log")); g_tv_collect_log = GTK_TEXT_VIEW( gtk_builder_get_object(builder, "tv_collect_log")); diff --git a/src/gui-wizard-gtk/wizard.glade b/src/gui-wizard-gtk/wizard.glade index 593d1d7..74dd967 100644 --- a/src/gui-wizard-gtk/wizard.glade +++ b/src/gui-wizard-gtk/wizard.glade @@ -51,7 +51,7 @@ True True - GTK_SHADOW_OUT + out True @@ -108,7 +108,7 @@ True True - GTK_SHADOW_OUT + out True @@ -167,20 +167,22 @@ - + False - + True False 10 3 - + True False 0 - Select how you would like to analyze the problem: + Select additional files to attach to the report: + True + fill True @@ -190,7 +192,7 @@ - + True False @@ -204,11 +206,11 @@ - + True False - + gtk-preferences True True @@ -225,7 +227,7 @@ - + True False @@ -248,20 +250,20 @@ - + False - + True False 10 3 - + True False 0 - Analyzing did not start yet + Collecting did not start yet True True @@ -272,12 +274,12 @@ - + True True - GTK_SHADOW_OUT + out - + True True False @@ -294,22 +296,20 @@ - + False - + True False 10 3 - + True False 0 - Select additional files to attach to the report: - True - fill + Select how you would like to analyze the problem: True @@ -319,7 +319,7 @@ - + True False @@ -333,11 +333,11 @@ - + True False - + gtk-preferences True True @@ -354,7 +354,7 @@ - + True False @@ -377,22 +377,24 @@ - + False - + True False 10 3 - + True False 0 - Collecting did not start yet + Analyzing did not start yet True - True + fill + True + 64 False @@ -401,23 +403,47 @@ - + + True + False + + + False + True + 1 + + + + True True - GTK_SHADOW_OUT - + True True - False - False + out + + + True + True + False + False + + + + + + + True + False + Show log True True - 1 + 2 @@ -534,7 +560,7 @@ True True - GTK_SHADOW_OUT + out True @@ -788,7 +814,7 @@ True True - GTK_SHADOW_OUT + out @@ -875,7 +901,7 @@ True True - GTK_SHADOW_OUT + out True