[recipes] Don't bing in preview



commit 85fe41f7d481228c5f4c977903d752f6eeb44413
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Feb 19 09:34:23 2017 -0500

    Don't bing in preview
    
    We should only do this in cooking mode.

 src/gr-cooking-view.c |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)
---
diff --git a/src/gr-cooking-view.c b/src/gr-cooking-view.c
index 586916e..c93f3f2 100644
--- a/src/gr-cooking-view.c
+++ b/src/gr-cooking-view.c
@@ -220,16 +220,20 @@ static void
 play_complete_sound (StepData *step)
 {
 #ifdef ENABLE_CANBERRA
-        GrCookingView *self = step->view;
-        g_autofree char *path;
-
-        path = g_build_filename (get_pkg_data_dir (), "sounds", "complete.oga", NULL);
-        ca_context_play (self->c, 0,
-                         CA_PROP_MEDIA_ROLE, "alert",
-                         CA_PROP_MEDIA_FILENAME, path,
-                         CA_PROP_MEDIA_NAME, _("A cooking timer has expired"),
-                         CA_PROP_CANBERRA_CACHE_CONTROL, "permanent",
-                         NULL);
+        GrCookingView *view = step->view;
+        GtkWidget *page;
+
+        page = gtk_widget_get_ancestor (GTK_WIDGET (view), GR_TYPE_COOKING_PAGE);
+        if (page) {
+                g_autofree char *path;
+                path = g_build_filename (get_pkg_data_dir (), "sounds", "complete.oga", NULL);
+                ca_context_play (view->c, 0,
+                                 CA_PROP_MEDIA_ROLE, "alert",
+                                 CA_PROP_MEDIA_FILENAME, path,
+                                 CA_PROP_MEDIA_NAME, _("A cooking timer has expired"),
+                                 CA_PROP_CANBERRA_CACHE_CONTROL, "permanent",
+                                 NULL);
+        }
 #endif
 }
 


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