aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-component.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2007-10-11 22:03:13 +0800
committerMilan Crha <mcrha@src.gnome.org>2007-10-11 22:03:13 +0800
commiteeb89358f6f3aa8f211b33c23842a8deb08171a8 (patch)
tree5874c18c42397a4a387d6c4aa87718044b31431d /mail/mail-component.c
parentaa70b15ea030e8c5a42ea9512c522140e6b8f5e7 (diff)
downloadgsoc2013-evolution-eeb89358f6f3aa8f211b33c23842a8deb08171a8.tar.gz
gsoc2013-evolution-eeb89358f6f3aa8f211b33c23842a8deb08171a8.tar.zst
gsoc2013-evolution-eeb89358f6f3aa8f211b33c23842a8deb08171a8.zip
** Fix for bug #329823
2007-10-11 Milan Crha <mcrha@redhat.com> ** Fix for bug #329823 * Evolution-Shell.idl: (setButtonIcon): * e-sidebar.h: (e_sidebar_change_button_icon): * e-sidebar.c: (struct Button), (button_new), (button_free), (e_sidebar_change_button_icon): * e-shell.h: (EMainShellFunc), (e_shell_foreach_shell_window): * e-shell.c: (EMainShellFunc), (e_shell_foreach_shell_window): * e-component-view.h: (e_component_view_set_button_icon): * e-component-view.c: (e_component_view_set_button_icon): * e-shell-window.h: (e_shell_window_change_component_button_icon): * e-shell-window.c: (e_shell_window_change_component_button_icon): * e-shell-view.c: (struct change_icon_struct), (change_button_icon_func), (impl_ShellView_setButtonIcon), (e_shell_view_class_init): Added support to change component's button icon. * mail-component.h: (mail_indicate_new_mail): * mail-component.c: (mail_indicate_new_mail), (struct _MailComponentPrivate), (impl_dispose), (impl_createView): New function to indicate new mails on sidebar's button and storing component_view in priv struct for later use. * em-folder-view.c: (emfv_list_done_message_selected): * mail-folder-cache.c: (real_flush_updates): Indicate changes like for plugins for new mails. svn path=/trunk/; revision=34374
Diffstat (limited to 'mail/mail-component.c')
-rw-r--r--mail/mail-component.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/mail/mail-component.c b/mail/mail-component.c
index 2aa9274b30..383e8d5c5c 100644
--- a/mail/mail-component.c
+++ b/mail/mail-component.c
@@ -139,6 +139,8 @@ struct _MailComponentPrivate {
char *context_path; /* current path for right-click menu */
CamelStore *local_store;
+
+ EComponentView *component_view;
};
/* indexed by _mail_component_folder_t */
@@ -455,7 +457,9 @@ impl_dispose (GObject *object)
camel_object_unref (priv->local_store);
priv->local_store = NULL;
}
-
+
+ priv->component_view = NULL;
+
(* G_OBJECT_CLASS (parent_class)->dispose) (object);
}
@@ -742,6 +746,8 @@ impl_createView (PortableServer_Servant servant,
g_object_set_data((GObject*)info, "folderview", view_widget);
g_object_set_data((GObject*)view_widget, "foldertree", tree_widget);
+ priv->component_view = component_view;
+
return BONOBO_OBJREF(component_view);
}
@@ -1463,4 +1469,24 @@ mail_component_get_folder_uri(MailComponent *mc, enum _mail_component_folder_t i
return mc_default_folders[id].uri;
}
+/**
+ * mail_indicate_new_mail
+ * Indicates new mail in a shell window.
+ * @param have_new_mail TRUE when have new mail, false otherwise.
+ **/
+void
+mail_indicate_new_mail (gboolean have_new_mail)
+{
+ const char *icon = NULL;
+ MailComponent *mc = mail_component_peek ();
+
+ g_return_if_fail (mc != NULL);
+
+ if (have_new_mail)
+ icon = "mail-unread";
+
+ if (mc->priv->component_view)
+ e_component_view_set_button_icon (mc->priv->component_view, icon);
+}
+
BONOBO_TYPE_FUNC_FULL (MailComponent, GNOME_Evolution_MailComponent, PARENT_TYPE, mail_component)