From 95d8e5b20bdc58eb2a72a6f8f75ca99cbd6b169b Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Tue, 22 Apr 2003 18:06:38 +0000 Subject: Fixes #22444 2003-04-21 Rodrigo Moya Fixes #22444 * gui/calendar-commands.c: added new verbs for occurrence-related menu items. (delete_occurrence_cmd): added callback for "Delete this occurrence" menu item. "Delete all occurrences" is just the same as "Delete". (sensitize_calendar_commands): sensitive ocurrence-related menu items. * gui/gnome-cal.[ch] (gnome_calendar_delete_selected_occurrence): new function. (gnome_calendar_get_current_view_widget): made this public. * gui/e-week-view.[ch] (e_week_view_get_selected_event): (e_week_view_delete_occurrence): new functions. (e_week_view_delete_occurrence_internal): real implementation of the 'Delete Occurrence' logic. (e_week_view_on_delete_occurrence): call delete_instance_internal. * gui/e-day-view.[ch] (e_day_view_get_selected_event): (e_day_view_delete_occurrence): new functions. (e_week_view_delete_occurrence_internal): real implementation of the 'Delete Occurrence' logic. (e_week_view_on_delete_occurrence): call delete_occurrence_internal. svn path=/trunk/; revision=20917 --- calendar/gui/gnome-cal.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'calendar/gui/gnome-cal.c') diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index be5de68b80..b56f4a1824 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -347,7 +347,7 @@ dn_query_eval_error_cb (CalQuery *query, const char *error_str, gpointer data) } /* Returns the current view widget, a EDayView or EWeekView. */ -static GtkWidget* +GtkWidget* gnome_calendar_get_current_view_widget (GnomeCalendar *gcal) { GnomeCalendarPrivate *priv; @@ -2853,6 +2853,29 @@ gnome_calendar_delete_selection (GnomeCalendar *gcal) g_assert_not_reached (); } +void +gnome_calendar_delete_selected_occurrence (GnomeCalendar *gcal) +{ + GnomeCalendarPrivate *priv; + FocusLocation location; + GtkWidget *view; + + g_return_if_fail (GNOME_IS_CALENDAR (gcal)); + + priv = gcal->priv; + + location = get_focus_location (gcal); + + if (location == FOCUS_CALENDAR) { + + view = gnome_calendar_get_current_view_widget (gcal); + + if (E_IS_DAY_VIEW (view)) + e_day_view_delete_occurrence (E_DAY_VIEW (view)); + else + e_week_view_delete_occurrence (E_WEEK_VIEW (view)); + } +} ECalendarTable* gnome_calendar_get_task_pad (GnomeCalendar *gcal) -- cgit