From 5a20dc84bb40f9ab827290eb67b4a41c81df1817 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Thu, 3 Oct 2002 10:57:22 +0000 Subject: Fixes #30057 2002-10-02 Rodrigo Moya Fixes #30057 * cal-client/cal-client.c (cal_client_is_read_only): added check of the status of the client before trying to make CORBA calls. * gui/calendar-commands.c (sensitize_calendar_commands, sensitize_taskpad_commands): * gui/tasks-control.c (sensitize_commands): * gui/dialogs/event-editor.c (set_menu_sens): * gui/dialogs/task-editor.c (set_menu_sens): * gui/e-calendar-table.c (e_calendar_table_on_right_click): * gui/e-day-view.c (e_day_view_on_event_right_click): * gui/e-week-view.c (e_week_view_show_popup_menu): take into account the read-onlyness of clients to disable/enable menu items. svn path=/trunk/; revision=18316 --- calendar/gui/calendar-commands.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'calendar/gui/calendar-commands.c') diff --git a/calendar/gui/calendar-commands.c b/calendar/gui/calendar-commands.c index 0dec149adf..d288b8e77c 100644 --- a/calendar/gui/calendar-commands.c +++ b/calendar/gui/calendar-commands.c @@ -506,23 +506,25 @@ sensitize_calendar_commands (GnomeCalendar *gcal, BonoboControl *control, gboole { BonoboUIComponent *uic; int n_selected; + gboolean read_only; uic = bonobo_control_get_ui_component (control); g_assert (uic != NULL); n_selected = enable ? gnome_calendar_get_num_events_selected (gcal) : 0; + read_only = cal_client_is_read_only (gnome_calendar_get_cal_client (gcal)); bonobo_ui_component_set_prop (uic, "/commands/Cut", "sensitive", - n_selected == 0 ? "0" : "1", + n_selected == 0 || read_only ? "0" : "1", NULL); bonobo_ui_component_set_prop (uic, "/commands/Copy", "sensitive", n_selected == 0 ? "0" : "1", NULL); bonobo_ui_component_set_prop (uic, "/commands/Paste", "sensitive", - enable ? "1" : "0", + enable && !read_only ? "1" : "0", NULL); bonobo_ui_component_set_prop (uic, "/commands/Delete", "sensitive", - n_selected == 0 ? "0" : "1", + n_selected == 0 || read_only ? "0" : "1", NULL); } @@ -535,23 +537,25 @@ sensitize_taskpad_commands (GnomeCalendar *gcal, BonoboControl *control, gboolea { BonoboUIComponent *uic; int n_selected; + gboolean read_only; uic = bonobo_control_get_ui_component (control); g_assert (uic != NULL); n_selected = enable ? gnome_calendar_get_num_tasks_selected (gcal) : 0; + read_only = cal_client_is_read_only (gnome_calendar_get_task_pad_cal_client (gcal)); bonobo_ui_component_set_prop (uic, "/commands/Cut", "sensitive", - n_selected == 0 ? "0" : "1", + n_selected == 0 || read_only ? "0" : "1", NULL); bonobo_ui_component_set_prop (uic, "/commands/Copy", "sensitive", n_selected == 0 ? "0" : "1", NULL); bonobo_ui_component_set_prop (uic, "/commands/Paste", "sensitive", - enable ? "1" : "0", + enable && !read_only ? "1" : "0", NULL); bonobo_ui_component_set_prop (uic, "/commands/Delete", "sensitive", - n_selected == 0 ? "0" : "1", + n_selected == 0 || read_only ? "0" : "1", NULL); } -- cgit