[recipes/list-new: 4/14] Add API to switch the window to an all-recipes list



commit 2c7660a2f432234cf502a59d16e4f0158334bf0d
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Feb 20 21:28:14 2017 -0500

    Add API to switch the window to an all-recipes list
    
    This uses the just-introduced list page API.

 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 d8cac3d..1fdd1b6 100644
--- a/src/gr-window.c
+++ b/src/gr-window.c
@@ -926,6 +926,22 @@ gr_window_show_favorites (GrWindow *window)
 }
 
 void
+gr_window_show_all (GrWindow *window)
+{
+        save_back_entry (window);
+
+        gr_list_page_populate_from_all (GR_LIST_PAGE (window->list_page));
+
+        gtk_header_bar_set_title (GTK_HEADER_BAR (window->header), _("All recipes"));
+
+        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_list (GrWindow   *window,
                      const char *title,
                      GList      *recipes)
diff --git a/src/gr-window.h b/src/gr-window.h
index 1552e8a..64cea81 100644
--- a/src/gr-window.h
+++ b/src/gr-window.h
@@ -54,6 +54,7 @@ void            gr_window_show_chef                  (GrWindow   *window,
                                                       GrChef     *chef);
 void            gr_window_show_myself                (GrWindow   *window);
 void            gr_window_show_favorites             (GrWindow   *window);
+void            gr_window_show_all                   (GrWindow   *window);
 void            gr_window_show_list                  (GrWindow   *window,
                                                       const char *title,
                                                       GList      *recipes);


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