Patch to make disabling of the status icon in new mail notification possible
Gary Ekker <[email protected]> Mon, 16 Jul 2007 15:26:07 -0600
| Newsgroups | gmane.comp.gnome.evolution.patches |
|---|---|
| Message-ID | <[email protected]> |
Hi, I'm not subscribed to this list, so please include me in any replies. The attached patch makes it so that you have a gconf key as an option to not show new mail notifications in the notification area. If this is acceptable to the evolution maintainers, let me know and I'll be happy to commit. Cheers. -Gary _______________________________________________ Evolution-patches mailing list [email protected] http://mail.gnome.org/mailman/listinfo/evolution-patches
disable-status-icon-in-mail-notification.patch
(text/x-patch, 2.3 KB)
Index: apps-evolution-mail-notification.schemas.in
===================================================================
--- apps-evolution-mail-notification.schemas.in (revision 33808)
+++ apps-evolution-mail-notification.schemas.in (working copy)
@@ -22,6 +22,16 @@
<long>When the new-mail status icon is visible, make it blink.</long>
</locale>
</schema>
+ <schema>
+ <key>/schemas/apps/evolution/mail/notification/status-icon</key>
+ <applyto>/apps/evolution/mail/notification/status-icon</applyto>
+ <owner>evolution-mail</owner>
+ <type>bool</type>
+ <default>true</default>
+ <locale name="C">
+ <short>Show the status icon</short>
+ <long>Make new-mail status icon visible.</long>
+ </locale>
+ </schema>
</schemalist>
</gconfschemafile>
-
Index: mail-notification.c
===================================================================
--- mail-notification.c (revision 33808)
+++ mail-notification.c (working copy)
@@ -42,6 +42,7 @@
#define GCONF_KEY_NOTIFICATION "/apps/evolution/mail/notification/notification"
#define GCONF_KEY_BLINK "/apps/evolution/mail/notification/blink-status-icon"
+#define GCONF_KEY_STATUS_ICON "/apps/evolution/mail/notification/status-icon"
int e_plugin_lib_enable (EPluginLib *ep, int enable);
void org_gnome_mail_new_notify (EPlugin *ep, EMEventTargetFolder *t);
@@ -119,9 +120,16 @@
is_key = gconf_client_get (client, GCONF_KEY_BLINK, NULL);
if (!is_key)
gconf_client_set_bool (client, GCONF_KEY_BLINK, TRUE, NULL);
- else
+ else
gconf_value_free (is_key);
+ is_key = gconf_client_get (client, GCONF_KEY_STATUS_ICON, NULL);
+ if (!is_key)
+ gconf_client_set_bool (client, GCONF_KEY_STATUS_ICON,
+ TRUE, NULL);
+ else
+ gconf_value_free (is_key);
+
if (!status_icon) {
printf("creating\n");
status_icon = gtk_status_icon_new ();
@@ -132,7 +140,8 @@
msg = g_strdup_printf (ngettext(_("You have received %d new message in %s."), _("You have received %d new messages in %s."), t->new), t->new, folder);
gtk_status_icon_set_tooltip (status_icon, msg);
- gtk_status_icon_set_visible (status_icon, TRUE);
+ gtk_status_icon_set_visible (status_icon,
+ gconf_client_get_bool (client, GCONF_KEY_STATUS_ICON, NULL));
gtk_status_icon_set_blinking (status_icon,
gconf_client_get_bool (client, GCONF_KEY_BLINK, NULL));