Re: [evolution-patches] Fix for Bug #246431 [em-mailer-prefs]



Hi,

Sorry for the mix up.  Attached the patch for Bug 246431 – "Add the
possibility to preview the sound used for mail notification"

Thanks
Johnny

On 12/14/05, Srinivasa Ragavan <sragavan novell com> wrote:
> Wrong attachment. But the attachment was for a different bug.
>
> It is committed to head. Please resend the mail with the right
> attachment for the bug.
>
> -Srini.
> On Wed, 2005-12-14 at 14:01 +0530, Johnny Jacob wrote:
> > Hi,
> >
> > Worked on a small feature as specified in
> > http://bugzilla.gnome.org/show_bug.cgi?id=246431
> >
> > I added a Play button and a function to play the sound file when the
> > button is clicked
> >
> > I have attached the patch.Please review the patch.
> >
> > Thankyou,
> > Johnny
> >
> > Index: mail/ChangeLog
> > ===================================================================
> > RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
> > retrieving revision 1.3727
> > diff -u -p -r1.3727 ChangeLog
> > --- mail/ChangeLog      25 Nov 2005 15:13:31 -0000      1.3727
> > +++ mail/ChangeLog      25 Nov 2005 23:36:40 -0000
> > @@ -1,3 +1,10 @@
> > + 2005-11-25  Johnny Jacob  <johnnyjacob gmail com>
> > +
> > +       ** See Bug #246431
> > +       * mail-config.glade: Added a button to play sound preview
> > +       * em-mailer-prefs.c: (play_sound_preview): Added to preview
> > +       the selected sound file
> > +
> >   2005-11-25  Tor Lillqvist  <tml novell com>
> >
> >         * em-composer-prefs.c (sig_add_script_response): Use gstdio
> > Index: mail/mail-config.glade
> > ===================================================================
> > RCS file: /cvs/gnome/evolution/mail/mail-config.glade,v
> > retrieving revision 1.162
> > diff -u -p -r1.162 mail-config.glade
> > --- mail/mail-config.glade      18 Nov 2005 09:25:25 -0000      1.162
> > +++ mail/mail-config.glade      25 Nov 2005 23:38:22 -0000
> > @@ -5514,6 +5514,22 @@ For example: &quot;Work&quot; or &quot;P
> >                                   <property name="fill">True</property>
> >                                 </packing>
> >                               </child>
> > +                             <child>
> > +                                <widget class="GtkButton" id="cmdPlayPreview">
> > +                                  <property name="height_request">23</property>
> > +                                  <property name="visible">True</property>
> > +                                  <property name="can_focus">True</property>
> > +                                  <property
> > name="label">gtk-media-play</property>
> > +                                  <property name="use_stock">True</property>
> > +                                  <property
> > name="relief">GTK_RELIEF_NORMAL</property>
> > +                                  <property
> > name="focus_on_click">True</property>
> > +                                </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: mail/em-mailer-prefs.c
> > ===================================================================
> > RCS file: /cvs/gnome/evolution/mail/em-mailer-prefs.c,v
> > retrieving revision 1.33
> > diff -u -p -r1.33 em-mailer-prefs.c
> > --- mail/em-mailer-prefs.c      30 Sep 2005 08:24:06 -0000      1.33
> > +++ mail/em-mailer-prefs.c      25 Nov 2005 23:39:59 -0000
> > @@ -667,6 +667,20 @@ notify_sound_changed (GtkWidget *widget,
> >         gconf_client_set_string (prefs->gconf,
> > "/apps/evolution/mail/notify/sound", filename, NULL);
> >  }
> >
> > +static void
> > +play_sound_preview (GtkWidget *widget, EMMailerPrefs *prefs)
> > +{
> > +       const char *filename;
> > +       GtkWidget *entry;
> > +
> > +       entry = gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY
> > (prefs->notify_sound_file));
> > +       filename = gtk_entry_get_text (GTK_ENTRY (entry));
> > +
> > +       gnome_sound_init("localhost");
> > +       gnome_sound_play(filename);
> > +       gnome_sound_shutdown();
> > +}
> > +
> >   static GtkWidget *
> >   emmp_widget_glade(EConfig *ec, EConfigItem *item, struct _GtkWidget
> > *parent, struct _GtkWidget *old, void *data)
> >  {
> > @@ -803,6 +817,8 @@ em_mailer_prefs_construct (EMMailerPrefs
> >         gtk_entry_set_text (GTK_ENTRY (gnome_file_entry_gtk_entry
> > (prefs->notify_sound_file)), buf ? buf : "");
> >         g_signal_connect (gnome_file_entry_gtk_entry
> > (prefs->notify_sound_file), "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 (!gconf_client_key_is_writable (prefs->gconf,
> > "/apps/evolution/mail/notify/sound", NULL))
> >                 gtk_widget_set_sensitive ((GtkWidget *)
> > prefs->notify_sound_file, FALSE);
> >         g_free (buf);
> > _______________________________________________
> > Evolution-patches mailing list
> > Evolution-patches gnome org
> > http://mail.gnome.org/mailman/listinfo/evolution-patches
>
>


--
````````````````````````````````````````````````````````````````````````````````````````
I have no special talents. I am just passionately curious!!
- Albert Einstein
__________________________________________________
E-Mail    : johnnyjacob gmail com
Blog       : johnnyjacob.blogspot.com
Web       : www.protocolanalyser.bravehost.com
Index: mail/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3751
diff -u -p -r1.3751 ChangeLog
--- mail/ChangeLog	20 Dec 2005 10:06:39 -0000	1.3751
+++ mail/ChangeLog	21 Dec 2005 08:53:15 -0000
@@ -1,3 +1,10 @@
+2005-11-25  Johnny Jacob  <johnnyjacob gmail 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
+
 2005-12-20  Veerapuram Varadhan  <vvaradhan novell com>
 
 	Fixes #246256
Index: mail/em-mailer-prefs.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-mailer-prefs.c,v
retrieving revision 1.34
diff -u -p -r1.34 em-mailer-prefs.c
--- mail/em-mailer-prefs.c	18 Dec 2005 08:24:26 -0000	1.34
+++ mail/em-mailer-prefs.c	21 Dec 2005 08:53:49 -0000
@@ -669,6 +669,18 @@ notify_sound_changed (GtkWidget *widget,
 	gconf_client_set_string (prefs->gconf, "/apps/evolution/mail/notify/sound", filename, NULL);
 }
 
+static void
+play_sound_preview (GtkWidget *widget, EMMailerPrefs *prefs)
+{
+	const char *filename;
+	GtkWidget *entry;
+
+	entry = gnome_file_entry_gtk_entry (GNOME_FILE_ENTRY (prefs->notify_sound_file));
+	filename = gtk_entry_get_text (GTK_ENTRY (entry));
+	if (filename && *filename)
+		gnome_sound_play(filename);
+}
+
 static GtkWidget *
 emmp_widget_glade(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, struct _GtkWidget *old, void *data)
 {
@@ -811,6 +823,9 @@ em_mailer_prefs_construct (EMMailerPrefs
 	gtk_entry_set_text (GTK_ENTRY (gnome_file_entry_gtk_entry (prefs->notify_sound_file)), buf ? buf : "");
 	g_signal_connect (gnome_file_entry_gtk_entry (prefs->notify_sound_file), "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 (!gconf_client_key_is_writable (prefs->gconf, "/apps/evolution/mail/notify/sound", NULL))
 		gtk_widget_set_sensitive ((GtkWidget *) prefs->notify_sound_file, FALSE);
 	g_free (buf);
Index: mail/mail-config.glade
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-config.glade,v
retrieving revision 1.164
diff -u -p -r1.164 mail-config.glade
--- mail/mail-config.glade	20 Dec 2005 00:14:41 -0000	1.164
+++ mail/mail-config.glade	21 Dec 2005 08:58:38 -0000
@@ -5514,6 +5510,85 @@ For example: &quot;Work&quot; or &quot;P
 				  <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</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>



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