aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/tasks-component.c8
-rw-r--r--calendar/gui/tasks-control.c8
-rw-r--r--calendar/gui/tasks-control.h8
3 files changed, 15 insertions, 9 deletions
diff --git a/calendar/gui/tasks-component.c b/calendar/gui/tasks-component.c
index bda28845e2..0fa40303ff 100644
--- a/calendar/gui/tasks-component.c
+++ b/calendar/gui/tasks-component.c
@@ -181,6 +181,8 @@ update_uri_for_primary_selection (TasksComponent *component)
TasksComponentPrivate *priv;
ESource *source;
char *uri;
+ ECalendarTable *cal_table;
+ ETable *etable;
priv = component->priv;
@@ -192,7 +194,11 @@ update_uri_for_primary_selection (TasksComponent *component)
uri = e_source_get_uri (source);
e_tasks_set_default_uri (priv->tasks, uri);
g_free (uri);
-
+
+ cal_table = e_tasks_get_calendar_table (priv->tasks);
+ etable = e_calendar_table_get_table (cal_table);
+ tasks_control_sensitize_commands (priv->view_control, priv->tasks, e_table_selected_count (etable));
+
/* Save the selection for next time we start up */
calendar_config_set_primary_tasks (e_source_peek_uid (source));
}
diff --git a/calendar/gui/tasks-control.c b/calendar/gui/tasks-control.c
index 0c0a3bd202..d2139a5bbb 100644
--- a/calendar/gui/tasks-control.c
+++ b/calendar/gui/tasks-control.c
@@ -230,8 +230,8 @@ tasks_control_activate_cb (BonoboControl *control,
/* Sensitizes the UI Component menu/toolbar commands based on the number of
* selected tasks.
*/
-static void
-sensitize_commands (ETasks *tasks, BonoboControl *control, int n_selected)
+void
+tasks_control_sensitize_commands (BonoboControl *control, ETasks *tasks, int n_selected)
{
BonoboUIComponent *uic;
gboolean read_only = TRUE;
@@ -271,7 +271,7 @@ selection_changed_cb (ETasks *tasks, int n_selected, gpointer data)
control = BONOBO_CONTROL (data);
- sensitize_commands (tasks, control, n_selected);
+ tasks_control_sensitize_commands (control, tasks, n_selected);
}
static BonoboUIVerb verbs [] = {
@@ -325,7 +325,7 @@ tasks_control_activate (BonoboControl *control, ETasks *tasks)
etable = e_calendar_table_get_table (cal_table);
n_selected = e_table_selected_count (etable);
- sensitize_commands (tasks, control, n_selected);
+ tasks_control_sensitize_commands (control, tasks, n_selected);
bonobo_ui_component_thaw (uic, NULL);
diff --git a/calendar/gui/tasks-control.h b/calendar/gui/tasks-control.h
index eca68c3f0a..97938ec613 100644
--- a/calendar/gui/tasks-control.h
+++ b/calendar/gui/tasks-control.h
@@ -26,9 +26,9 @@
#include "e-tasks.h"
-BonoboControl *tasks_control_new (void);
-void tasks_control_activate (BonoboControl *control, ETasks *tasks);
-void tasks_control_deactivate (BonoboControl *control, ETasks *tasks);
-
+BonoboControl *tasks_control_new (void);
+void tasks_control_activate (BonoboControl *control, ETasks *tasks);
+void tasks_control_deactivate (BonoboControl *control, ETasks *tasks);
+void tasks_control_sensitize_commands (BonoboControl *control, ETasks *tasks, int n_selected);
#endif /* _TASKS_CONTROL_H_ */