[anjal] Initial status bar/ error handling support.
- From: Srinivasa Ragavan <sragavan src gnome org>
- To: svn-commits-list gnome org
- Subject: [anjal] Initial status bar/ error handling support.
- Date: Mon, 20 Jul 2009 06:00:59 +0000 (UTC)
commit 8037d3f8eadfdb72499aae51b84f6ad68dcc6781
Author: Srinivasa Ragavan <sragavan novell com>
Date: Mon Jul 20 11:30:14 2009 +0530
Initial status bar/ error handling support.
src/mail-component.c | 27 +++++++++++++++++++++++++++
src/mail-component.h | 2 ++
src/mail-shell.c | 1 +
3 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/src/mail-component.c b/src/mail-component.c
index 5751ea4..2acefe4 100644
--- a/src/mail-component.c
+++ b/src/mail-component.c
@@ -129,6 +129,8 @@ struct _MailComponentPrivate {
guint mail_sync_id; /* timeout id for sync call on the stores */
guint mail_sync_in_progress; /* is greater than 0 if still waiting to finish sync on some store */
+ guint status_hide; /* Idle handler to hide status bar */
+
};
/* indexed by _mail_component_folder_t */
@@ -515,6 +517,14 @@ enable_folder_tree (GtkWidget *emfb, GtkWidget *emft)
#endif
/* Evolution::Component CORBA methods. */
+static gboolean
+mc_hide_status (gpointer data)
+{
+ mail_component_show_status_bar (FALSE);
+
+ return TRUE;
+}
+
MailComponent *
mail_component_create (GtkWidget * parent, gboolean select_item)
{
@@ -578,6 +588,9 @@ mail_component_create (GtkWidget * parent, gboolean select_item)
mail_component->folder_tree = tree_widget;
mail_component->mail_view = view_widget;
+ mail_component->status_bar = statusbar_widget;
+
+ mail_component->priv->status_hide = g_timeout_add_seconds (5, mc_hide_status, NULL);
return mail_component;
}
@@ -643,6 +656,8 @@ mail_component_quit(MailComponent *mc)
if (mc->priv->quit_state == -1)
mc->priv->quit_state = MC_QUIT_START;
+ g_source_remove (mc->priv->status_hide);
+
mail_config_prune_proxies ();
switch (mc->priv->quit_state) {
case MC_QUIT_START: {
@@ -1506,4 +1521,16 @@ mail_component_show_logger (gpointer top)
gtk_widget_show_all (window);
}
+void
+mail_component_show_status_bar (gboolean show)
+{
+ MailComponent *mc = mail_component_peek();
+ if (show)
+ gtk_widget_show (mc->status_bar);
+ else {
+ if (e_task_bar_get_num_children((ETaskBar *) mc->status_bar) == 0)
+ gtk_widget_hide (mc->status_bar);
+ }
+}
+
G_DEFINE_TYPE (MailComponent, mail_component, G_TYPE_OBJECT)
diff --git a/src/mail-component.h b/src/mail-component.h
index 40c6486..32a5bb8 100644
--- a/src/mail-component.h
+++ b/src/mail-component.h
@@ -55,6 +55,7 @@ struct _MailComponent {
GtkWidget *folder_tree;
GtkWidget *people_view;
GtkWidget *mail_view;
+ GtkWidget *status_bar;
MailComponentPrivate *priv;
};
@@ -111,4 +112,5 @@ void mail_component_show_logger (gpointer);
MailComponent * mail_component_create (GtkWidget * parent, gboolean select_item);
gboolean mail_component_can_quit(MailComponent *mc);
gboolean mail_component_quit(MailComponent *mc);
+void mail_component_show_status_bar (gboolean show);
#endif /* _MAIL_COMPONENT_H_ */
diff --git a/src/mail-shell.c b/src/mail-shell.c
index d704998..e99fdbe 100644
--- a/src/mail-shell.c
+++ b/src/mail-shell.c
@@ -502,6 +502,7 @@ mail_shell_construct (MailShell *shell)
mail_view_set_sort_by ((MailView *)shell->mail_component->mail_view, priv->sort);
mail_view_set_check_email ((MailView *)shell->mail_component->mail_view, priv->check_mail);
+ gtk_box_pack_end ((GtkBox *)priv->box, shell->mail_component->status_bar, FALSE, FALSE, 2);
if (ms_check_new()) {
MailViewChild *mc;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]