[recipes] Don't reshuffle chefs when one changes
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [recipes] Don't reshuffle chefs when one changes
- Date: Sun, 19 Feb 2017 13:37:59 +0000 (UTC)
commit 905c98221ff0e1f2d054269ae77d60ad12e5777c
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Feb 19 08:36:20 2017 -0500
Don't reshuffle chefs when one changes
Just refresh the tiles - this really only makes a difference
in the rare case that you are among the chefs who have contributed
recipes and are featured on the front page.
https://bugzilla.gnome.org/show_bug.cgi?id=778902
src/gr-recipes-page.c | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/src/gr-recipes-page.c b/src/gr-recipes-page.c
index 476b596..a09cd7f 100644
--- a/src/gr-recipes-page.c
+++ b/src/gr-recipes-page.c
@@ -442,6 +442,20 @@ populate_chefs_from_store (GrRecipesPage *self)
}
static void
+refresh_chefs (GrRecipesPage *self)
+{
+ GList *children, *l;
+
+ children = gtk_container_get_children (GTK_CONTAINER (self->chefs_box));
+ for (l = children; l; l = l->next) {
+ GtkWidget *child = l->data;
+ GtkWidget *tile = gtk_bin_get_child (GTK_BIN (child));
+ gr_chef_tile_set_chef (GR_CHEF_TILE (tile), gr_chef_tile_get_chef (GR_CHEF_TILE (tile)));
+ }
+ g_list_free (children);
+}
+
+static void
connect_store_signals (GrRecipesPage *page)
{
GrRecipeStore *store;
@@ -451,5 +465,5 @@ connect_store_signals (GrRecipesPage *page)
g_signal_connect_swapped (store, "recipe-added", G_CALLBACK (repopulate_recipes), page);
g_signal_connect_swapped (store, "recipe-removed", G_CALLBACK (repopulate_recipes), page);
g_signal_connect_swapped (store, "recipe-changed", G_CALLBACK (repopulate_recipes), page);
- g_signal_connect_swapped (store, "chefs-changed", G_CALLBACK (populate_chefs_from_store), page);
+ g_signal_connect_swapped (store, "chefs-changed", G_CALLBACK (refresh_chefs), page);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]