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



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);
Index: composer/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/composer/ChangeLog,v
retrieving revision 1.721
diff -u -p -r1.721 ChangeLog
--- composer/ChangeLog	22 Oct 2005 08:16:44 -0000	1.721
+++ composer/ChangeLog	23 Nov 2005 08:48:15 -0000
@@ -1,3 +1,9 @@
+2005-11-23  Johnny Jacob <johnnyjacob gmail com>
+	
+	** See Bug # 246245
+	* e-msg-composer-select-file.c (e_msg_composer_select_file_attachments):   
+	Changed the title caption from "Attach file(s)" to "Insert Attachment".
+
 2005-10-22  Parthasarathi Susarla <sparthasarathi novell com>
 	
 	* e-msg-composer.c: (get_file_content):
Index: composer/e-msg-composer-select-file.c
===================================================================
RCS file: /cvs/gnome/evolution/composer/e-msg-composer-select-file.c,v
retrieving revision 1.38
diff -u -p -r1.38 e-msg-composer-select-file.c
--- composer/e-msg-composer-select-file.c	19 Oct 2005 10:54:27 -0000	1.38
+++ composer/e-msg-composer-select-file.c	23 Nov 2005 08:51:33 -0000
@@ -236,7 +236,7 @@ void e_msg_composer_select_file_attachme
 		return;
 	}
 
-	*w = get_selector (composer, _("Attach file(s)"), SELECTOR_MODE_MULTI|SELECTOR_SHOW_INLINE);
+	*w = get_selector (composer, _("Insert Attachment"), SELECTOR_MODE_MULTI|SELECTOR_SHOW_INLINE);
 	g_signal_connect(*w, "response", G_CALLBACK(select_attach_response), composer);
 	g_signal_connect(*w, "destroy", G_CALLBACK(gtk_widget_destroyed), w);
 	g_object_set_data((GObject *)*w, "callback", func);



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