From 31641a0c2b522d5ac1da0a0764eadfce92400412 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Wed, 17 Dec 2003 13:36:07 +0000 Subject: call calendar_control_sensitize_calendar_commands when the primary 2003-12-17 Rodrigo Moya * gui/calendar-component.c (update_uri_for_primary_selection): call calendar_control_sensitize_calendar_commands when the primary selection changes. (impl_createControls): keep the view_control in the private structure and use control_factory_new_control() to create the control. (control_activate_cb): removed unneeded function. * gui/tasks-component.c (impl_createControls): use tasks_control_new to create the tasks view control. (control_activate_cb): removed unneeded function. svn path=/trunk/; revision=23962 --- calendar/gui/tasks-component.c | 34 ++++++++-------------------------- 1 file changed, 8 insertions(+), 26 deletions(-) (limited to 'calendar/gui/tasks-component.c') diff --git a/calendar/gui/tasks-component.c b/calendar/gui/tasks-component.c index db7864bdd7..bda28845e2 100644 --- a/calendar/gui/tasks-component.c +++ b/calendar/gui/tasks-component.c @@ -66,8 +66,10 @@ struct _TasksComponentPrivate { ETasks *tasks; GtkWidget *source_selector; + BonoboControl *view_control; + ECal *create_ecal; - + GList *notifications; }; @@ -477,17 +479,6 @@ impl_finalize (GObject *object) /* Evolution::Component CORBA methods */ -static void -control_activate_cb (BonoboControl *control, gboolean activate, gpointer data) -{ - ETasks *tasks = data; - - if (activate) - tasks_control_activate (control, tasks); - else - tasks_control_deactivate (control, tasks); -} - static void impl_createControls (PortableServer_Servant servant, Bonobo_Control *corba_sidebar_control, @@ -498,7 +489,7 @@ impl_createControls (PortableServer_Servant servant, TasksComponent *component = TASKS_COMPONENT (bonobo_object_from_servant (servant)); TasksComponentPrivate *priv; GtkWidget *selector_scrolled_window; - BonoboControl *sidebar_control, *view_control; + BonoboControl *sidebar_control; guint not; priv = component->priv; @@ -518,23 +509,14 @@ impl_createControls (PortableServer_Servant servant, sidebar_control = bonobo_control_new (selector_scrolled_window); /* create the tasks view */ - priv->tasks = E_TASKS (e_tasks_new ()); - if (!priv->tasks) { - g_warning (G_STRLOC ": could not create the control!"); - bonobo_exception_set (ev, ex_GNOME_Evolution_Component_Failed); - return; - } - - gtk_widget_show (GTK_WIDGET (priv->tasks)); - - view_control = bonobo_control_new (GTK_WIDGET (priv->tasks)); - if (!view_control) { + priv->view_control = tasks_control_new (); + if (!priv->view_control) { g_warning (G_STRLOC ": could not create the control!"); bonobo_exception_set (ev, ex_GNOME_Evolution_Component_Failed); return; } - g_signal_connect (view_control, "activate", G_CALLBACK (control_activate_cb), priv->tasks); + priv->tasks = (ETasks *) bonobo_control_get_widget (priv->view_control); g_signal_connect_object (priv->source_selector, "selection_changed", G_CALLBACK (source_selection_changed_cb), @@ -561,7 +543,7 @@ impl_createControls (PortableServer_Servant servant, /* Return the controls */ *corba_sidebar_control = CORBA_Object_duplicate (BONOBO_OBJREF (sidebar_control), ev); - *corba_view_control = CORBA_Object_duplicate (BONOBO_OBJREF (view_control), ev); + *corba_view_control = CORBA_Object_duplicate (BONOBO_OBJREF (priv->view_control), ev); /* The tasks component doesn't use the status bar so just return an empty label. */ { -- cgit v1.2.3