[evolution-patches] patch for #41671



This patch makes sure we have sound support initialized before trying to
play. Also, if the sound file does not exist or is wrong, it just beeps
instead of playing the sound.

It fixed it for me, although Tim seems to have problems with sounds when
new mail arrives, which uses the same gnome_sound_init/gnome_sound_play
"technique", so I'm not sure this will fix it for him.

cheers
? gui/alarm-notify/alarm-notify.gladep
? gui/dialogs/alarm-options.gladep
? gui/dialogs/alarm-page.gladep
? gui/dialogs/cal-prefs-dialog.gladep
? gui/dialogs/e-delegate-dialog.gladep
? gui/dialogs/event-page.gladep
? gui/dialogs/meeting-page.gladep
? gui/dialogs/recurrence-page.gladep
? gui/dialogs/schedule-page.gladep
? gui/dialogs/task-details-page.gladep
? gui/dialogs/task-page.gladep
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.1743
diff -u -p -r1.1743 ChangeLog
--- ChangeLog	22 Apr 2003 21:15:38 -0000	1.1743
+++ ChangeLog	23 Apr 2003 16:21:25 -0000
@@ -1,3 +1,13 @@
+2003-04-23  Rodrigo Moya <rodrigo ximian com>
+
+	Fixes #41671
+
+	* gui/alarm-notify/notify-main.c (main): added calls to gnome_sound_init
+	and gnome_sound_shutdown.
+
+	* gui/alarm-notify/alarm-queue.c (audio_notification): check that the
+	sound file exists, and gdk_beep if not.
+
 2003-04-22  Rodrigo Moya <rodrigo ximian com>
 
 	Fixes part of #41148, #41216 and #41235
Index: gui/alarm-notify/notify-main.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/alarm-notify/notify-main.c,v
retrieving revision 1.24
diff -u -p -r1.24 notify-main.c
--- gui/alarm-notify/notify-main.c	27 Feb 2003 05:34:16 -0000	1.24
+++ gui/alarm-notify/notify-main.c	23 Apr 2003 16:21:26 -0000
@@ -26,6 +26,7 @@
 #include <glib.h>
 #include <libgnome/gnome-i18n.h>
 #include <libgnome/gnome-init.h>
+#include <libgnome/gnome-sound.h>
 #include <libgnomeui/gnome-client.h>
 #include <libgnomevfs/gnome-vfs-init.h>
 #include <glade/glade.h>
@@ -174,6 +175,8 @@ main (int argc, char **argv)
 
 	glade_init ();
 
+	gnome_sound_init ("localhost");
+
 	factory = bonobo_generic_factory_new ("OAFIID:GNOME_Evolution_Calendar_AlarmNotify_Factory",
 					      (BonoboFactoryCallback) alarm_notify_factory_fn, NULL);
 	if (!factory)
@@ -193,6 +196,7 @@ main (int argc, char **argv)
 	alarm_queue_done ();
 	alarm_done ();
 
+	gnome_sound_shutdown ();
 	gnome_vfs_shutdown ();
 
 	return 0;
Index: gui/alarm-notify/alarm-queue.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/alarm-notify/alarm-queue.c,v
retrieving revision 1.34
diff -u -p -r1.34 alarm-queue.c
--- gui/alarm-notify/alarm-queue.c	17 Apr 2003 15:39:48 -0000	1.34
+++ gui/alarm-notify/alarm-queue.c	23 Apr 2003 16:24:33 -0000
@@ -825,9 +825,11 @@ audio_notification (time_t trigger, Comp
 		const char *url;
 
 		url = icalattach_get_url (attach);
-		g_assert (url != NULL);
 
-		gnome_sound_play (url); /* this sucks */
+		if (url && *url && g_file_test (url, G_FILE_TEXT_EXISTS))
+			gnome_sound_play (url); /* this sucks */
+		else
+			gdk_beep ();
 	}
 
 	if (attach)


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