[recipes/recipe-link: 8/8] Track recipe for details page in back stack
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [recipes/recipe-link: 8/8] Track recipe for details page in back stack
- Date: Thu, 29 Dec 2016 16:21:48 +0000 (UTC)
commit dcc4907b1864401bda1e7c8a418ea67b4c2fc2ba
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Dec 29 11:13:09 2016 -0500
Track recipe for details page in back stack
We need this now, since with cross-references, we can now go
from details page to details page.
src/gr-window.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/gr-window.c b/src/gr-window.c
index 06cd780..a225f9f 100644
--- a/src/gr-window.c
+++ b/src/gr-window.c
@@ -73,6 +73,7 @@ typedef struct
gchar *header_end_child;
gchar *header_title;
gchar *search;
+ GrRecipe *recipe;
} BackEntry;
static void
@@ -84,6 +85,7 @@ back_entry_free (BackEntry *entry)
g_free (entry->header_end_child);
g_free (entry->header_title);
g_free (entry->search);
+ g_clear_object (&entry->recipe);
g_free (entry);
}
@@ -104,6 +106,11 @@ save_back_entry (GrWindow *window)
else
entry->search = NULL;
+ if (strcmp (entry->page, "details") == 0)
+ entry->recipe = g_object_ref (gr_details_page_get_recipe (GR_DETAILS_PAGE
(window->details_page)));
+ else
+ entry->recipe = NULL;
+
g_queue_push_head (window->back_entry_stack, entry);
}
@@ -132,6 +139,10 @@ go_back (GrWindow *window)
gtk_search_bar_set_search_mode (GTK_SEARCH_BAR (window->search_bar), FALSE);
}
+ if (strcmp (entry->page, "details") == 0) {
+ gr_details_page_set_recipe (GR_DETAILS_PAGE (window->details_page), entry->recipe);
+ }
+
back_entry_free (entry);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]