[recipes] Slight improvement for step titles



commit 3dc32c986a598b57d4aaa4e280ee26f4e0fd12a4
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Feb 7 23:24:49 2017 -0500

    Slight improvement for step titles
    
    Step x/n is not great, but better than nothing.

 src/gr-cooking-view.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/gr-cooking-view.c b/src/gr-cooking-view.c
index 75c2034..84d3023 100644
--- a/src/gr-cooking-view.c
+++ b/src/gr-cooking-view.c
@@ -275,6 +275,7 @@ setup_steps (GrCookingView *view)
                 int image = -1;
                 guint64 timer = 0;
                 g_autofree char *step = NULL;
+                g_autofree char *title = NULL;
 
                 p = strstr (steps[i], "[image:");
                 if (p) {
@@ -316,7 +317,8 @@ setup_steps (GrCookingView *view)
                 if (step == NULL)
                         step = g_strdup (steps[i]);
 
-                g_ptr_array_add (view->steps, step_data_new ("Step", step, timer, image, view));
+                title = g_strdup_printf (_("Step %d/%d"), i + 1, g_strv_length (steps));
+                g_ptr_array_add (view->steps, step_data_new (title, step, timer, image, view));
         }
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]