aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog13
-rw-r--r--mail/em-folder-view.c4
-rw-r--r--mail/mail-component.c28
-rw-r--r--mail/mail-component.h3
-rw-r--r--mail/mail-folder-cache.c4
5 files changed, 50 insertions, 2 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index b7205a1efc..bf51ec4540 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,16 @@
+2007-10-11 Milan Crha <mcrha@redhat.com>
+
+ ** Fix for bug #329823
+
+ * 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.
+
2007-10-09 Matthew Barnes <mbarnes@redhat.com>
** Fixes part of bug #437579
diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c
index 3c2fdab81c..5c4cd27bc2 100644
--- a/mail/em-folder-view.c
+++ b/mail/em-folder-view.c
@@ -2322,7 +2322,9 @@ emfv_list_done_message_selected(CamelFolder *folder, const char *uid, CamelMimeM
}
e_profile_event_emit("goto.loaded", emfv->displayed_uid, 0);
-
+
+ mail_indicate_new_mail (FALSE);
+
/** @Event: message.reading
* @Title: Viewing a message
* @Target: EMEventTargetMessage
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)
diff --git a/mail/mail-component.h b/mail/mail-component.h
index 63147e38af..901e612a21 100644
--- a/mail/mail-component.h
+++ b/mail/mail-component.h
@@ -99,4 +99,7 @@ struct _CamelFolder *mail_component_get_folder(MailComponent *mc, enum _mail_com
const char *mail_component_get_folder_uri(MailComponent *mc, enum _mail_component_folder_t id);
int status_check (GNOME_Evolution_ShellState shell_state);
+
+void mail_indicate_new_mail (gboolean have_new_mail);
+
#endif /* _MAIL_COMPONENT_H_ */
diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c
index 58ddf04e4d..65daffc821 100644
--- a/mail/mail-folder-cache.c
+++ b/mail/mail-folder-cache.c
@@ -251,6 +251,10 @@ real_flush_updates(void *o, void *event_data, void *data)
EMEventTargetFolder *t = em_event_target_new_folder(e, up->uri, up->new);
t->is_inbox = em_folder_tree_model_is_type_inbox (model, up->store, up->full_name);
+
+ if (t->new > 0)
+ mail_indicate_new_mail (TRUE);
+
/** @Event: folder.changed
* @Title: Folder changed
* @Target: EMEventTargetFolder