[recipes] Split off a separate chef page



commit d2009fe572465d93ccca85b08b5a822a41808112
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Jan 16 10:29:16 2017 -0500

    Split off a separate chef page
    
    For now, this is just a second instance of the list page. Eventually,
    we may want to differentiate these further. This is just the minimal
    change needed to fix a problem with the back stack handling for
    list pages.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=777302

 src/gr-window.c  |   10 ++++++----
 src/gr-window.ui |    6 ++++++
 2 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/src/gr-window.c b/src/gr-window.c
index 3740d7b..0af6b44 100644
--- a/src/gr-window.c
+++ b/src/gr-window.c
@@ -53,6 +53,7 @@ struct _GrWindow
         GtkWidget *details_page;
         GtkWidget *edit_page;
         GtkWidget *list_page;
+        GtkWidget *chef_page;
         GtkWidget *shopping_page;
         GtkWidget *search_page;
         GtkWidget *cuisines_page;
@@ -440,6 +441,7 @@ gr_window_class_init (GrWindowClass *klass)
         gtk_widget_class_bind_template_child (widget_class, GrWindow, details_page);
         gtk_widget_class_bind_template_child (widget_class, GrWindow, edit_page);
         gtk_widget_class_bind_template_child (widget_class, GrWindow, list_page);
+        gtk_widget_class_bind_template_child (widget_class, GrWindow, chef_page);
         gtk_widget_class_bind_template_child (widget_class, GrWindow, shopping_page);
         gtk_widget_class_bind_template_child (widget_class, GrWindow, search_page);
         gtk_widget_class_bind_template_child (widget_class, GrWindow, cuisines_page);
@@ -604,7 +606,7 @@ gr_window_show_chef (GrWindow *window,
 
         save_back_entry (window);
 
-        gr_list_page_populate_from_chef (GR_LIST_PAGE (window->list_page), chef);
+        gr_list_page_populate_from_chef (GR_LIST_PAGE (window->chef_page), chef);
 
         title = g_strdup_printf (_("Chefs: %s"), gr_chef_get_fullname (chef));
         gtk_header_bar_set_title (GTK_HEADER_BAR (window->header), title);
@@ -613,7 +615,7 @@ gr_window_show_chef (GrWindow *window,
         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");
+        gtk_stack_set_visible_child_name (GTK_STACK (window->main_stack), "chef");
 }
 
 void
@@ -678,7 +680,7 @@ gr_window_show_myself (GrWindow *window)
 
         name = gr_recipe_store_get_user_key (store);
         chef = gr_recipe_store_get_chef (store, name);
-        gr_list_page_populate_from_chef (GR_LIST_PAGE (window->list_page), chef);
+        gr_list_page_populate_from_chef (GR_LIST_PAGE (window->chef_page), chef);
 
         gtk_header_bar_set_title (GTK_HEADER_BAR (window->header ), _("My own recipes"));
 
@@ -686,7 +688,7 @@ gr_window_show_myself (GrWindow *window)
         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");
+        gtk_stack_set_visible_child_name (GTK_STACK (window->main_stack), "chef");
 }
 
 void
diff --git a/src/gr-window.ui b/src/gr-window.ui
index d3bc755..c7744ee 100644
--- a/src/gr-window.ui
+++ b/src/gr-window.ui
@@ -237,6 +237,12 @@
                   </packing>
                 </child>
                 <child>
+                  <object class="GrListPage" id="chef_page"/>
+                  <packing>
+                    <property name="name">chef</property>
+                  </packing>
+                </child>
+                <child>
                   <object class="GrShoppingPage" id="shopping_page">
                     <signal name="notify::title" handler="shopping_title_changed" swapped="yes"/>
                   </object>


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