diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2003-12-02 11:41:35 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2003-12-02 11:41:35 +0800 |
commit | 492cdaf6f9db2f622ad4a4b292bddaf55631d0b6 (patch) | |
tree | 847eae4fea9d93692e162eec11673c2577691068 | |
parent | ac0442e31c68ce073e4156bbe47d63da8f7d2523 (diff) | |
download | gsoc2013-evolution-492cdaf6f9db2f622ad4a4b292bddaf55631d0b6.tar.gz gsoc2013-evolution-492cdaf6f9db2f622ad4a4b292bddaf55631d0b6.tar.zst gsoc2013-evolution-492cdaf6f9db2f622ad4a4b292bddaf55631d0b6.zip |
New member activity_handler. (mail_component_init): Initialize.
* mail-component.c (struct _MailComponentPrivate): New member
activity_handler.
(mail_component_init): Initialize.
(impl_dispose): Unref.
(mail_component_peek_activity_handler): New.
(impl_createControls): Create an ETaskBar, attach it to the
ActivityHandler, and return it to the caller as the statusbar
control.
* e-activity-handler.c (e_activity_handler_operation_finished):
Argh, renamed from e_activity_client_operation_finished().
(e_activity_handler_operation_started): Don't unref the pixbuf.
* e-shell-window.c (setup_widgets): Hide the menu hint label.
* e-activity-handler.c (init): Init to next_activity_id to 1 so
callers can rely on it being nonzero.
svn path=/trunk/; revision=23556
-rw-r--r-- | mail/ChangeLog | 14 | ||||
-rw-r--r-- | mail/mail-component.c | 37 | ||||
-rw-r--r-- | shell/ChangeLog | 11 | ||||
-rw-r--r-- | shell/e-activity-handler.c | 14 | ||||
-rw-r--r-- | shell/e-activity-handler.h | 4 | ||||
-rw-r--r-- | shell/e-shell-window.c | 5 |
6 files changed, 65 insertions, 20 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index da58519f1b..fe425c4cb9 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,19 @@ 2003-12-01 Ettore Perazzoli <ettore@ximian.com> + * mail-mt.c (struct _mail_msg_priv): Remove member "activity". + (mail_operation_status): Un-#if 0 the code. + + * mail-component.c (struct _MailComponentPrivate): New member + activity_handler. + (mail_component_init): Initialize. + (impl_dispose): Unref. + (mail_component_peek_activity_handler): New. + (impl_createControls): Create an ETaskBar, attach it to the + ActivityHandler, and return it to the caller as the statusbar + control. + +2003-12-01 Ettore Perazzoli <ettore@ximian.com> + * mail-component.c (impl_createControls): Pass a label for the status bar control for now. diff --git a/mail/mail-component.c b/mail/mail-component.c index e43f0610d3..fd22ad4524 100644 --- a/mail/mail-component.c +++ b/mail/mail-component.c @@ -40,6 +40,7 @@ #include "em-folder-browser.h" #include "em-folder-selector.h" #include "em-folder-selection.h" +#include "em-migrate.h" #include "mail-config.h" #include "mail-component.h" @@ -51,7 +52,7 @@ #include "mail-send-recv.h" #include "mail-session.h" -#include "em-migrate.h" +#include "e-task-bar.h" #include <gtk/gtklabel.h> @@ -78,6 +79,8 @@ struct _MailComponentPrivate { char *base_directory; EMFolderTreeModel *model; + + EActivityHandler *activity_handler; MailAsyncEvent *async_event; GHashTable *store_hash; /* display_name by store */ @@ -264,7 +267,12 @@ static void impl_dispose (GObject *object) { MailComponentPrivate *priv = MAIL_COMPONENT (object)->priv; - + + if (priv->activity_handler != NULL) { + g_object_unref (priv->activity_handler); + priv->activity_handler = NULL; + } + if (priv->search_context != NULL) { g_object_unref (priv->search_context); priv->search_context = NULL; @@ -325,35 +333,33 @@ impl_createControls (PortableServer_Servant servant, MailComponentPrivate *priv = mail_component->priv; BonoboControl *tree_control; BonoboControl *view_control; + BonoboControl *statusbar_control; GtkWidget *tree_widget; GtkWidget *view_widget; + GtkWidget *statusbar_widget; view_widget = em_folder_browser_new (); tree_widget = (GtkWidget *) em_folder_tree_new_with_model (priv->model); em_format_set_session ((EMFormat *) ((EMFolderView *) view_widget)->preview, session); + statusbar_widget = e_task_bar_new (); + e_activity_handler_attach_task_bar (priv->activity_handler, E_TASK_BAR (statusbar_widget)); + gtk_widget_show (tree_widget); gtk_widget_show (view_widget); + gtk_widget_show (statusbar_widget); tree_control = bonobo_control_new (tree_widget); view_control = bonobo_control_new (view_widget); + statusbar_control = bonobo_control_new (statusbar_widget); *corba_tree_control = CORBA_Object_duplicate (BONOBO_OBJREF (tree_control), ev); *corba_view_control = CORBA_Object_duplicate (BONOBO_OBJREF (view_control), ev); + *corba_statusbar_control = CORBA_Object_duplicate (BONOBO_OBJREF (statusbar_control), ev); g_signal_connect (view_control, "activate", G_CALLBACK (view_control_activate_cb), view_widget); g_signal_connect (tree_widget, "folder-selected", G_CALLBACK (folder_selected_cb), view_widget); - - /* FIXME temporary for testing. */ - { - GtkWidget *label = gtk_label_new ("Hey hey this is the mailer"); - BonoboControl *control; - - gtk_widget_show (label); - control = bonobo_control_new (label); - *corba_statusbar_control = CORBA_Object_duplicate (BONOBO_OBJREF (control), ev); - } } @@ -443,6 +449,8 @@ mail_component_init (MailComponent *component) abort (); priv->model = em_folder_tree_model_new (); + + priv->activity_handler = e_activity_handler_new (); /* EPFIXME: Turn into an object? */ mail_session_init (priv->base_directory); @@ -516,6 +524,11 @@ mail_component_peek_search_context (MailComponent *component) return component->priv->search_context; } +EActivityHandler * +mail_component_peek_activity_handler (MailComponent *component) +{ + return component->priv->activity_handler; +} void mail_component_add_store (MailComponent *component, CamelStore *store, const char *name) diff --git a/shell/ChangeLog b/shell/ChangeLog index eb3ed5cd68..0b4da8cd75 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,5 +1,16 @@ 2003-12-01 Ettore Perazzoli <ettore@ximian.com> + * e-activity-handler.c (e_activity_handler_operation_finished): + Argh, renamed from e_activity_client_operation_finished(). + (e_activity_handler_operation_started): Don't unref the pixbuf. + + * e-shell-window.c (setup_widgets): Hide the menu hint label. + + * e-activity-handler.c (init): Init to next_activity_id to 1 so + callers can rely on it being nonzero. + +2003-12-01 Ettore Perazzoli <ettore@ximian.com> + * e-shell.c (struct _EShellPrivate): Remove member activity_handler. (setup_activity_interface): Remove. diff --git a/shell/e-activity-handler.c b/shell/e-activity-handler.c index 695b7f6606..cdc41d8025 100644 --- a/shell/e-activity-handler.c +++ b/shell/e-activity-handler.c @@ -145,6 +145,8 @@ activity_info_new (const char *component_id, static void activity_info_free (ActivityInfo *info) { + g_print ("activity_info_free %d ref count %d\n", info->id, G_OBJECT (info->icon_pixbuf)->ref_count); + g_free (info->component_id); g_object_unref (info->icon_pixbuf); @@ -267,7 +269,7 @@ init (EActivityHandler *activity_handler) EActivityHandlerPrivate *priv; priv = g_new (EActivityHandlerPrivate, 1); - priv->next_activity_id = 0; + priv->next_activity_id = 1; priv->activity_infos = NULL; priv->task_bars = NULL; @@ -327,8 +329,6 @@ e_activity_handler_operation_started (EActivityHandler *activity_handler, task_widget_new_from_activity_info (activity_info)); } - g_object_unref (icon_pixbuf); - priv->activity_infos = g_list_prepend (priv->activity_infos, activity_info); return activity_id; @@ -371,8 +371,8 @@ e_activity_handler_operation_progressing (EActivityHandler *activity_handler, } void -e_activity_client_operation_finished (EActivityHandler *activity_handler, - guint activity_id) +e_activity_handler_operation_finished (EActivityHandler *activity_handler, + guint activity_id) { EActivityHandlerPrivate *priv = activity_handler->priv; GList *p; @@ -380,6 +380,10 @@ e_activity_client_operation_finished (EActivityHandler *activity_handler, int order_number; p = lookup_activity (priv->activity_infos, activity_id, &order_number); + if (p == NULL) { + g_warning ("e_activity_handler_operation_finished: Unknown activity %d\n", activity_id); + return; + } activity_info_free ((ActivityInfo *) p->data); priv->activity_infos = g_list_remove_link (priv->activity_infos, p); diff --git a/shell/e-activity-handler.h b/shell/e-activity-handler.h index 6a315fae21..46826c8eb3 100644 --- a/shell/e-activity-handler.h +++ b/shell/e-activity-handler.h @@ -74,8 +74,8 @@ void e_activity_handler_operation_progressing (EActivityHandler *activity_hand const char *information, double progress); -void e_activity_client_operation_finished (EActivityHandler *activity_handler, - guint activity_id); +void e_activity_handler_operation_finished (EActivityHandler *activity_handler, + guint activity_id); #ifdef __cplusplus diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c index e11908902f..fb123561a7 100644 --- a/shell/e-shell-window.c +++ b/shell/e-shell-window.c @@ -534,7 +534,7 @@ setup_status_bar (EShellWindow *window) setup_statusbar_notebook (window); ui_engine = bonobo_window_get_ui_engine (BONOBO_WINDOW (window)); - + g_signal_connect (ui_engine, "add_hint", G_CALLBACK (ui_engine_add_hint_callback), window); g_signal_connect (ui_engine, "remove_hint", G_CALLBACK (ui_engine_remove_hint_callback), window); } @@ -586,6 +586,9 @@ setup_widgets (EShellWindow *window) gtk_box_pack_start (GTK_BOX (contents_vbox), priv->status_bar, FALSE, TRUE, 0); gtk_widget_show_all (contents_vbox); + /* We only display this when a menu item is actually selected. */ + gtk_widget_hide (priv->menu_hint_label); + bonobo_window_set_contents (BONOBO_WINDOW (window), contents_vbox); } |