aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2003-07-23 05:56:40 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2003-07-23 05:56:40 +0800
commitc1a24b93ef371ae2d2aca8b905b9d3ed72b16083 (patch)
tree0269ef4595edfa3aae871ec21239d71d970d10d9 /calendar/gui
parentc06781b52c30d59f6b5e6b4225df2f1aa43d177e (diff)
downloadgsoc2013-evolution-c1a24b93ef371ae2d2aca8b905b9d3ed72b16083.tar
gsoc2013-evolution-c1a24b93ef371ae2d2aca8b905b9d3ed72b16083.tar.gz
gsoc2013-evolution-c1a24b93ef371ae2d2aca8b905b9d3ed72b16083.tar.bz2
gsoc2013-evolution-c1a24b93ef371ae2d2aca8b905b9d3ed72b16083.tar.lz
gsoc2013-evolution-c1a24b93ef371ae2d2aca8b905b9d3ed72b16083.tar.xz
gsoc2013-evolution-c1a24b93ef371ae2d2aca8b905b9d3ed72b16083.tar.zst
gsoc2013-evolution-c1a24b93ef371ae2d2aca8b905b9d3ed72b16083.zip
manage the case where the selected events are the popup menu ones.
2003-07-22 Rodrigo Moya <rodrigo@ximian.com> * gui/e-day-view.c (e_day_view_get_selected_events): * gui/e-week-view.c (e_week_view_get_selected_events): manage the case where the selected events are the popup menu ones. svn path=/trunk/; revision=21895
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/e-day-view.c30
-rw-r--r--calendar/gui/e-week-view.c12
2 files changed, 28 insertions, 14 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 53123917e2..707acdddd9 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -3571,21 +3571,31 @@ e_day_view_popup_menu (GtkWidget *widget)
static GList *
e_day_view_get_selected_events (ECalView *cal_view)
{
- EDayViewEvent *event;
+ EDayViewEvent *event = NULL;
GList *list = NULL;
EDayView *day_view = (EDayView *) cal_view;
g_return_val_if_fail (E_IS_DAY_VIEW (day_view), NULL);
- g_return_val_if_fail (day_view->editing_event_day != -1, NULL);
- if (day_view->editing_event_day == E_DAY_VIEW_LONG_EVENT)
- event = &g_array_index (day_view->long_events,
- EDayViewEvent,
- day_view->editing_event_num);
- else
- event = &g_array_index (day_view->events[day_view->editing_event_day],
- EDayViewEvent,
- day_view->editing_event_num);
+ if (day_view->editing_event_num != -1) {
+ if (day_view->editing_event_day == E_DAY_VIEW_LONG_EVENT)
+ event = &g_array_index (day_view->long_events,
+ EDayViewEvent,
+ day_view->editing_event_num);
+ else
+ event = &g_array_index (day_view->events[day_view->editing_event_day],
+ EDayViewEvent,
+ day_view->editing_event_num);
+ } else if (day_view->popup_event_num != -1) {
+ if (day_view->popup_event_day == E_DAY_VIEW_LONG_EVENT)
+ event = &g_array_index (day_view->long_events,
+ EDayViewEvent,
+ day_view->popup_event_num);
+ else
+ event = &g_array_index (day_view->events[day_view->popup_event_day],
+ EDayViewEvent,
+ day_view->popup_event_num);
+ }
if (event)
list = g_list_append (list, event->comp);
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index d3573db107..4a5aceb86f 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -1021,15 +1021,19 @@ e_week_view_focus (GtkWidget *widget, GtkDirectionType direction)
static GList *
e_week_view_get_selected_events (ECalView *cal_view)
{
- EWeekViewEvent *event;
+ EWeekViewEvent *event = NULL;
GList *list = NULL;
EWeekView *week_view = (EWeekView *) cal_view;
g_return_val_if_fail (E_IS_WEEK_VIEW (week_view), NULL);
- g_return_val_if_fail (week_view->editing_event_num != -1, NULL);
- event = &g_array_index (week_view->events, EWeekViewEvent,
- week_view->editing_event_num);
+ if (week_view->editing_event_num != -1) {
+ event = &g_array_index (week_view->events, EWeekViewEvent,
+ week_view->editing_event_num);
+ } else if (week_view->popup_event_num != -1) {
+ event = &g_array_index (week_view->events, EWeekViewEvent,
+ week_view->popup_event_num);
+ }
if (event)
list = g_list_prepend (list, event->comp);