[gnome-games] Only use the gtk-enable-event-sounds setting when available
- From: Christian Persch <chpe src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-games] Only use the gtk-enable-event-sounds setting when available
- Date: Tue, 2 Jun 2009 18:16:20 -0400 (EDT)
commit 0bba3a1ce370beab014fb2392ffe71db7ae75f9b
Author: Christian Persch <chpe gnome org>
Date: Tue Jun 2 23:51:19 2009 +0200
Only use the gtk-enable-event-sounds setting when available
It only exists since gtk 2.14, so #ifdef the code accordingly.
---
aisleriot/window.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/aisleriot/window.c b/aisleriot/window.c
index af12c79..c152b7e 100644
--- a/aisleriot/window.c
+++ b/aisleriot/window.c
@@ -1997,7 +1997,7 @@ game_exception_cb (AisleriotGame *game,
gtk_widget_show (dialog);
}
-#if defined(HAVE_CLUTTER) || defined(HAVE_CANBERRA_GTK)
+#if defined(HAVE_CLUTTER) || (defined(HAVE_CANBERRA_GTK) && GTK_CHECK_VERSION (2, 14, 0))
static void
settings_changed_cb (GtkSettings *settings,
@@ -2023,14 +2023,14 @@ settings_changed_cb (GtkSettings *settings,
}
#endif /* HAVE_CLUTTER */
-#ifdef HAVE_CANBERRA_GTK
+#if defined(HAVE_CANBERRA_GTK) && GTK_CHECK_VERSION (2, 14, 0)
if (name == NULL || strcmp (name, "gtk-enable-event-sounds") == 0) {
g_object_get (settings, "gtk-enable-event-sounds", &enabled, NULL);
action = gtk_action_group_get_action (priv->action_group, "Sound");
gtk_action_set_visible (action, enabled);
}
-#endif /* HAVE_CANBERRA_GTK */
+#endif /* HAVE_CANBERRA_GTK && GTK >= 2.14 */
}
static void
@@ -2062,7 +2062,7 @@ screen_changed_cb (GtkWidget *widget,
g_signal_connect (settings, "notify::gtk-enable-animations",
G_CALLBACK (settings_changed_cb), window);
#endif
-#ifdef HAVE_CANBERRA_GTK
+#if defined (HAVE_CANBERRA_GTK) && GTK_CHECK_VERSION (2, 14, 0)
g_signal_connect (settings, "notify::gtk-enable-event-sounds",
G_CALLBACK (settings_changed_cb), window);
#endif
@@ -2677,7 +2677,7 @@ aisleriot_window_init (AisleriotWindow *window)
#endif /* HAVE_CLUTTER */
-#if defined(HAVE_CLUTTER) || defined(HAVE_CANBERRA_GTK)
+#if defined(HAVE_CLUTTER) || (defined(HAVE_CANBERRA_GTK) && GTK_CHECK_VERSION (2, 14, 0))
/* Set the action visibility and listen for animation and sound mode changes */
screen_changed_cb (GTK_WIDGET (window), NULL, window);
g_signal_connect (window, "screen-changed",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]