aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui_backend_local.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/gui_backend_local.c b/src/gui_backend_local.c
index 00ba2037..8692d8f8 100644
--- a/src/gui_backend_local.c
+++ b/src/gui_backend_local.c
@@ -69,7 +69,6 @@ static gboolean index_readable(GIOChannel *source, GIOCondition cond,
struct crystfelproject *proj = vp;
struct local_backend_priv *priv = proj->backend_private;
gchar *line;
- double frac = 0.1;
check_zombies(priv);
@@ -83,10 +82,17 @@ static gboolean index_readable(GIOChannel *source, GIOCondition cond,
return FALSE;
}
chomp(line);
- STATUS("Got line '%s'\n", line);
- gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(proj->progressbar),
- frac);
+ if ( strstr(line, " images processed, ") != NULL ) {
+ double frac;
+ int n_proc;
+ sscanf(line, "%i ", &n_proc);
+ frac = (double)n_proc/proj->n_frames;
+ gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(proj->progressbar),
+ frac);
+ } else {
+ STATUS("%s\n", line);
+ }
g_free(line);