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



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();

you should not need to call the gnome_sound_init() nor _shutdown()
functions here. gnome_sound should already be initialised by evo-mail
starting up and you def don't want to shutdown() or the sound won't play
when the action occurs later.

> +}
> +
>   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",

spaces make the world go 'round... TOKEN COMMA SPACE TOKEN

> +                         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
-- 
Jeffrey Stedfast
Evolution Hacker - Novell, Inc.
fejj ximian com  - www.novell.com




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