Index: ChangeLog
===================================================================
--- ChangeLog	(revision 33983)
+++ ChangeLog	(working copy)
@@ -1,3 +1,10 @@
+2007-08-26 Johnny Jacob  <jjohnny@novell.com>
+
+	Fixes Bug #246431
+	* mail-config.glade: Added a button to play sound preview
+	* em-mailer-prefs.c: (play_sound_preview): Added. Preview
+	the selected sound file
+
 2007-08-08  Srinivasa Ragavan  <sragavan@novell.com>
 
 	* em-folder-browser.c: (emfb_set_folder): Use the gconf key to
Index: mail-config.glade
===================================================================
--- mail-config.glade	(revision 33983)
+++ mail-config.glade	(working copy)
@@ -5631,6 +5631,85 @@
 				  <property name="fill">True</property>
 				</packing>
 			      </child>
+
+			      <child>
+				<widget class="GtkButton" id="cmdPlayPreview">
+				  <property name="height_request">26</property>
+				  <property name="visible">True</property>
+				  <property name="can_focus">True</property>
+				  <property name="relief">GTK_RELIEF_NORMAL</property>
+				  <property name="focus_on_click">True</property>
+
+				  <child>
+				    <widget class="GtkAlignment" id="alignment36">
+				      <property name="visible">True</property>
+				      <property name="xalign">0.5</property>
+				      <property name="yalign">0.5</property>
+				      <property name="xscale">0</property>
+				      <property name="yscale">0</property>
+				      <property name="top_padding">0</property>
+				      <property name="bottom_padding">0</property>
+				      <property name="left_padding">0</property>
+				      <property name="right_padding">0</property>
+
+				      <child>
+					<widget class="GtkHBox" id="hbox233">
+					  <property name="visible">True</property>
+					  <property name="homogeneous">False</property>
+					  <property name="spacing">2</property>
+
+					  <child>
+					    <widget class="GtkImage" id="image11">
+					      <property name="visible">True</property>
+					      <property name="stock">gtk-media-play</property>
+					      <property name="icon_size">4</property>
+					      <property name="xalign">0.5</property>
+					      <property name="yalign">0.5</property>
+					      <property name="xpad">0</property>
+					      <property name="ypad">0</property>
+					    </widget>
+					    <packing>
+					      <property name="padding">0</property>
+					      <property name="expand">False</property>
+					      <property name="fill">False</property>
+					    </packing>
+					  </child>
+
+					  <child>
+					    <widget class="GtkLabel" id="label584">
+					      <property name="visible">True</property>
+					      <property name="label" translatable="yes">_Play this sound file</property>
+					      <property name="use_underline">True</property>
+					      <property name="use_markup">False</property>
+					      <property name="justify">GTK_JUSTIFY_LEFT</property>
+					      <property name="wrap">False</property>
+					      <property name="selectable">False</property>
+					      <property name="xalign">0.5</property>
+					      <property name="yalign">0.5</property>
+					      <property name="xpad">0</property>
+					      <property name="ypad">0</property>
+					      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+					      <property name="width_chars">-1</property>
+					      <property name="single_line_mode">False</property>
+					      <property name="angle">0</property>
+					    </widget>
+					    <packing>
+					      <property name="padding">0</property>
+					      <property name="expand">False</property>
+					      <property name="fill">False</property>
+					    </packing>
+					  </child>
+					</widget>
+				      </child>
+				    </widget>
+				  </child>
+				</widget>
+				<packing>
+				  <property name="padding">0</property>
+				  <property name="expand">False</property>
+				  <property name="fill">False</property>
+				</packing>
+			      </child>
 			    </widget>
 			    <packing>
 			      <property name="padding">0</property>
Index: em-mailer-prefs.c
===================================================================
--- em-mailer-prefs.c	(revision 33983)
+++ em-mailer-prefs.c	(working copy)
@@ -732,6 +732,16 @@
 	gconf_client_set_string (prefs->gconf, "/apps/evolution/mail/notify/sound", filename ? filename : "", NULL);
 }
 
+static void
+play_sound_preview (GtkWidget *widget, EMMailerPrefs *prefs)
+{
+	const char *filename;
+
+	filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (prefs->notify_sound_file));
+	if (filename && *filename)
+		gnome_sound_play(filename);
+}
+
 static GtkWidget *
 emmp_widget_glade(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, void *data)
 {
@@ -994,6 +1004,8 @@
 		gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (prefs->notify_sound_file), buf);
 	g_signal_connect (GTK_FILE_CHOOSER_BUTTON (prefs->notify_sound_file), "selection-changed",
 			  G_CALLBACK (notify_sound_changed), prefs);
+	g_signal_connect (GTK_BUTTON (glade_xml_get_widget (gui,"cmdPlayPreview")),"clicked",
+			  G_CALLBACK (play_sound_preview), prefs);
 	if (val != MAIL_CONFIG_NOTIFY_PLAY_SOUND)
 		gtk_widget_set_sensitive ((GtkWidget *) prefs->notify_sound_file, FALSE);
 	g_free (buf);
