[recipes] printer: Replace serves with yield



commit 0b8ba538c2f2df3af4162c0caee09a14bc33ed6b
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Jun 25 20:15:32 2017 -0400

    printer: Replace serves with yield
    
    Use the recipe api to get the yield, instead of serves.

 src/gr-recipe-printer.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/gr-recipe-printer.c b/src/gr-recipe-printer.c
index d3ed1fc..f554dd2 100644
--- a/src/gr-recipe-printer.c
+++ b/src/gr-recipe-printer.c
@@ -126,6 +126,7 @@ begin_print (GtkPrintOperation *operation,
         PangoLayout *layout;
         int amount_width;
         const char *value;
+        g_autofree char *amount = NULL;
 
         store = gr_recipe_store_get ();
         chef = gr_recipe_store_get_chef (store, gr_recipe_get_author (printer->recipe));
@@ -162,7 +163,8 @@ begin_print (GtkPrintOperation *operation,
         g_string_append_printf (s, "%s %s\n", _("Author:"), gr_chef_get_fullname (chef));
         g_string_append_printf (s, "%s %s\n", _("Preparation:"), gr_recipe_get_prep_time (printer->recipe));
         g_string_append_printf (s, "%s %s\n", _("Cooking:"), gr_recipe_get_cook_time (printer->recipe));
-        g_string_append_printf (s, "%s %d\n", _("Serves:"), gr_recipe_get_serves (printer->recipe));
+        amount = gr_number_format (gr_recipe_get_yield (printer->recipe));
+        g_string_append_printf (s, "%s %s %s\n", _("Yield:"), amount, gr_recipe_get_yield_unit 
(printer->recipe));
         value = gr_recipe_get_cuisine (printer->recipe);
         if (value && *value) {
                 const char *title;


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