diff options
author | Rodrigo Moya <rodrigo@ximian.com> | 2004-03-05 00:46:27 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@src.gnome.org> | 2004-03-05 00:46:27 +0800 |
commit | c5a4a13b1ba9b689dd0aab9c848584005a3ef551 (patch) | |
tree | c3a6d4df45581fe9393f1971d55b000cd07f4be5 /calendar | |
parent | 967a116256c6c79ca9794e3a0e9c13ce02c95f2f (diff) | |
download | gsoc2013-evolution-c5a4a13b1ba9b689dd0aab9c848584005a3ef551.tar.gz gsoc2013-evolution-c5a4a13b1ba9b689dd0aab9c848584005a3ef551.tar.zst gsoc2013-evolution-c5a4a13b1ba9b689dd0aab9c848584005a3ef551.zip |
set the sensitivity correctly, depending on whether the command applied to
2004-03-04 Rodrigo Moya <rodrigo@ximian.com>
* gui/calendar-commands.c (calendar_control_sensitize_calendar_commands):
set the sensitivity correctly, depending on whether the command applied
to the currently selected event or the default client.
(calendar_control_activate): make sure we start with the menu items
correctly enabled/disabled.
svn path=/trunk/; revision=24968
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/ChangeLog | 8 | ||||
-rw-r--r-- | calendar/gui/calendar-commands.c | 34 | ||||
-rw-r--r-- | calendar/gui/gnome-cal.c | 2 |
3 files changed, 27 insertions, 17 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 46dd8e7f0e..ed8c651f4c 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,5 +1,13 @@ 2004-03-04 Rodrigo Moya <rodrigo@ximian.com> + * gui/calendar-commands.c (calendar_control_sensitize_calendar_commands): + set the sensitivity correctly, depending on whether the command applied + to the currently selected event or the default client. + (calendar_control_activate): make sure we start with the menu items + correctly enabled/disabled. + +2004-03-04 Rodrigo Moya <rodrigo@ximian.com> + Fixes #53496 * gui/dialogs/cal-prefs-dialog.glade: set the same spacing for all diff --git a/calendar/gui/calendar-commands.c b/calendar/gui/calendar-commands.c index 5058b1c66a..efc33cf040 100644 --- a/calendar/gui/calendar-commands.c +++ b/calendar/gui/calendar-commands.c @@ -498,7 +498,7 @@ calendar_control_sensitize_calendar_commands (BonoboControl *control, GnomeCalen int n_selected; GtkWidget *view; ECal *e_cal; - gboolean read_only = FALSE, has_recurrences; + gboolean selected_read_only = FALSE, default_read_only = FALSE, has_recurrences; uic = bonobo_control_get_ui_component (control); g_assert (uic != NULL); @@ -512,35 +512,37 @@ calendar_control_sensitize_calendar_commands (BonoboControl *control, GnomeCalen n_selected = enable ? g_list_length (list) : 0; event = (ECalendarViewEvent *) list ? list->data : NULL; - if (event) { - e_cal_is_read_only (event->comp_data->client, &read_only, NULL); - } else { - e_cal = e_cal_model_get_default_client (gnome_calendar_get_calendar_model (gcal)); - if (e_cal) - e_cal_is_read_only (e_cal, &read_only, NULL); - else - read_only = TRUE; - } + if (event) + e_cal_is_read_only (event->comp_data->client, &selected_read_only, NULL); + else + selected_read_only = TRUE; + + /* retrieve read-onlyness of the default client */ + e_cal = e_cal_model_get_default_client (gnome_calendar_get_calendar_model (gcal)); + if (e_cal) + e_cal_is_read_only (e_cal, &default_read_only, NULL); + else + default_read_only = TRUE; bonobo_ui_component_set_prop (uic, "/commands/EventOpen", "sensitive", n_selected != 1 ? "0" : "1", NULL); bonobo_ui_component_set_prop (uic, "/commands/Cut", "sensitive", - n_selected == 0 || read_only ? "0" : "1", + n_selected == 0 || selected_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 && !read_only ? "1" : "0", + default_read_only ? "0" : "1", NULL); bonobo_ui_component_set_prop (uic, "/commands/Delete", "sensitive", - n_selected == 0 || read_only ? "0" : "1", + n_selected == 0 || selected_read_only ? "0" : "1", NULL); /* occurrence-related menu items */ has_recurrences = FALSE; - if (n_selected > 0 && !read_only) { + if (n_selected > 0 && !selected_read_only) { if (list) { event = (ECalendarViewEvent *) list->data; if (e_cal_util_component_has_recurrences (event->comp_data->icalcomp)) @@ -752,8 +754,8 @@ calendar_control_activate (BonoboControl *control, g_signal_connect (gcal, "taskpad_focus_change", G_CALLBACK (gcal_taskpad_focus_change_cb), control); - calendar_control_sensitize_calendar_commands (control, gcal, FALSE); - sensitize_taskpad_commands (gcal, control, FALSE); + calendar_control_sensitize_calendar_commands (control, gcal, TRUE); + sensitize_taskpad_commands (gcal, control, TRUE); bonobo_ui_component_thaw (uic, NULL); diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 8afd6e7186..381a2fe274 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -1767,7 +1767,7 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal) /* add client to the views */ for (i = 0; i < GNOME_CAL_LAST_VIEW; i++) { ECalModel *model; - + model = e_calendar_view_get_model (priv->views[i]); e_cal_model_add_client (model, ecal); } |