[recipes/list-new: 13/14] Add API to switch the window to a new recipes list



commit de137ff7e42b446ec5a488cf706c2b110fd6fd74
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Feb 24 23:57:34 2017 -0500

    Add API to switch the window to a new 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 1fdd1b6..ebd1d8d 100644
--- a/src/gr-window.c
+++ b/src/gr-window.c
@@ -942,6 +942,22 @@ gr_window_show_all (GrWindow *window)
 }
 
 void
+gr_window_show_new (GrWindow *window)
+{
+        save_back_entry (window);
+
+        gr_list_page_populate_from_new (GR_LIST_PAGE (window->list_page));
+
+        gtk_header_bar_set_title (GTK_HEADER_BAR (window->header), _("New 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 64cea81..feaec31 100644
--- a/src/gr-window.h
+++ b/src/gr-window.h
@@ -55,6 +55,7 @@ void            gr_window_show_chef                  (GrWindow   *window,
 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_new                   (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]