aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/tasks-control.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/tasks-control.c')
-rw-r--r--calendar/gui/tasks-control.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/calendar/gui/tasks-control.c b/calendar/gui/tasks-control.c
index 1c7bc82b69..0f0166833c 100644
--- a/calendar/gui/tasks-control.c
+++ b/calendar/gui/tasks-control.c
@@ -230,21 +230,30 @@ static void
sensitize_commands (ETasks *tasks, BonoboControl *control, int n_selected)
{
BonoboUIComponent *uic;
+ gboolean read_only;
uic = bonobo_control_get_ui_component (control);
g_assert (uic != NULL);
+ read_only = cal_client_is_read_only (e_tasks_get_cal_client (tasks));
+
bonobo_ui_component_set_prop (uic, "/commands/TasksCut", "sensitive",
- n_selected == 0 ? "0" : "1",
+ n_selected == 0 || read_only ? "0" : "1",
NULL);
bonobo_ui_component_set_prop (uic, "/commands/TasksCopy", "sensitive",
n_selected == 0 ? "0" : "1",
NULL);
+ bonobo_ui_component_set_prop (uic, "/commands/TasksPaste", "sensitive",
+ n_selected == 0 || read_only ? "0" : "1",
+ NULL);
bonobo_ui_component_set_prop (uic, "/commands/TasksDelete", "sensitive",
- n_selected == 0 ? "0" : "1",
+ n_selected == 0 || read_only ? "0" : "1",
NULL);
bonobo_ui_component_set_prop (uic, "/commands/TasksMarkComplete", "sensitive",
- n_selected == 0 ? "0" : "1",
+ n_selected == 0 || read_only ? "0" : "1",
+ NULL);
+ bonobo_ui_component_set_prop (uic, "/commands/TasksExpunge", "sensitive",
+ read_only ? "0" : "1",
NULL);
}