[recipes/shopping-list: 9/13] window: Add api to show the shopping list



commit 71501af0695832762ee6b9623f5645142f1bb4ec
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Jan 8 09:21:53 2017 -0500

    window: Add api to show the shopping list
    
    This is entirely parallel to the APIs for showing categories.

 src/gr-window.c |   16 ++++++++++++++++
 src/gr-window.h |    1 +
 2 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/gr-window.c b/src/gr-window.c
index aaceb8c..35b5f50 100644
--- a/src/gr-window.c
+++ b/src/gr-window.c
@@ -640,6 +640,22 @@ gr_window_show_list (GrWindow   *window,
 }
 
 void
+gr_window_show_shopping (GrWindow *window)
+{
+        save_back_entry (window);
+
+        gr_list_page_populate_from_shopping (GR_LIST_PAGE (window->list_page));
+
+        gtk_header_bar_set_title (GTK_HEADER_BAR (window->header), _("Shopping list"));
+
+        gtk_stack_set_visible_child_name (GTK_STACK (window->header_start_stack), "back");
+        gtk_stack_set_visible_child_name (GTK_STACK (window->header_title_stack), "title");
+        gtk_stack_set_visible_child_name (GTK_STACK (window->header_end_stack), "list");
+
+        gtk_stack_set_visible_child_name (GTK_STACK (window->main_stack), "list");
+}
+
+void
 gr_window_show_myself (GrWindow *window)
 {
         const char *name;
diff --git a/src/gr-window.h b/src/gr-window.h
index 990cbe2..a83f397 100644
--- a/src/gr-window.h
+++ b/src/gr-window.h
@@ -51,6 +51,7 @@ void            gr_window_show_favorites             (GrWindow   *window);
 void            gr_window_show_list                  (GrWindow   *window,
                                                       const char *title,
                                                       GList      *recipes);
+void            gr_window_show_shopping              (GrWindow   *window);
 void            gr_window_show_cuisine               (GrWindow   *window,
                                                       const char *cuisine,
                                                       const char *title);


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