aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/gnome-cal.c
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2003-07-23 05:13:38 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2003-07-23 05:13:38 +0800
commit806e63b32a7fdca4899d89ba236a0eb64726707c (patch)
treeb16e3db0eb30e98b7a700d6854310f3a736c1062 /calendar/gui/gnome-cal.c
parent2c6ab566c91705955a8de51a2937fa97f2a79d91 (diff)
downloadgsoc2013-evolution-806e63b32a7fdca4899d89ba236a0eb64726707c.tar.gz
gsoc2013-evolution-806e63b32a7fdca4899d89ba236a0eb64726707c.tar.zst
gsoc2013-evolution-806e63b32a7fdca4899d89ba236a0eb64726707c.zip
added "get_selected_events", and "update_query" virtual methods.
2003-07-22 Rodrigo Moya <rodrigo@ximian.com> * gui/e-cal-view.[ch]: added "get_selected_events", and "update_query" virtual methods. (e_cal_view_class_init): initialize new virtual methods. (e_cal_view_destroy): destroy new private members. (e_cal_view_get_selected_events, e_cal_view_set_cal_client, e_cal_view_get_cal_client): new functions. (e_cal_view_cut_clipboard, e_cal_view_copy_clipboard, e_cal_view_paste_clipboard): merged clipboard stuff. * gui/e-day-view.c (e_day_view_cut_clipboard, e_day_view_copy_clipboard, e_day_view_paste_clipboard): removed. (e_day_view_get_selected_events): made these private as the implementation of the 'get_selected_events' base class virtual method. * gui/e-week-view.c (e_week_view_get_selected_events): ditto. (e_week_view_cut_clipboard, e_week_view_copy_clipboard, e_week_view_paste_clipboard): removed. * gui/calendar-commands.c (sensitize_calendar_commands): call e_cal_view_get_selected_events. * gui/gnome-cal.c: removed a lot of redundant code thanks to the above changes. svn path=/trunk/; revision=21893
Diffstat (limited to 'calendar/gui/gnome-cal.c')
-rw-r--r--calendar/gui/gnome-cal.c94
1 files changed, 10 insertions, 84 deletions
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index d8bcff310c..a144b77ef5 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -665,28 +665,7 @@ gnome_calendar_set_query (GnomeCalendar *gcal, const char *sexp)
update_query (gcal);
/* Set the query on the main view */
-
- switch (priv->current_view_type) {
- case GNOME_CAL_DAY_VIEW:
- e_day_view_set_query (E_DAY_VIEW (priv->day_view), sexp);
- break;
-
- case GNOME_CAL_WORK_WEEK_VIEW:
- e_day_view_set_query (E_DAY_VIEW (priv->work_week_view), sexp);
- break;
-
- case GNOME_CAL_WEEK_VIEW:
- e_week_view_set_query (E_WEEK_VIEW (priv->week_view), sexp);
- break;
-
- case GNOME_CAL_MONTH_VIEW:
- e_week_view_set_query (E_WEEK_VIEW (priv->month_view), sexp);
- break;
-
- default:
- g_warning ("A penguin bit my hand!");
- g_assert_not_reached ();
- }
+ e_cal_view_set_query (E_CAL_VIEW (gnome_calendar_get_current_view_widget (gcal)), sexp);
/* Set the query on the task pad */
@@ -1211,35 +1190,9 @@ gnome_calendar_update_view_times (GnomeCalendar *gcal)
priv = gcal->priv;
- switch (priv->current_view_type) {
- case GNOME_CAL_DAY_VIEW:
- e_day_view_set_selected_time_range (E_DAY_VIEW (priv->day_view),
- priv->selection_start_time,
- priv->selection_end_time);
- break;
-
- case GNOME_CAL_WORK_WEEK_VIEW:
- e_day_view_set_selected_time_range (E_DAY_VIEW (priv->work_week_view),
- priv->selection_start_time,
- priv->selection_end_time);
- break;
-
- case GNOME_CAL_WEEK_VIEW:
- e_week_view_set_selected_time_range (E_WEEK_VIEW (priv->week_view),
- priv->selection_start_time,
- priv->selection_end_time);
- break;
-
- case GNOME_CAL_MONTH_VIEW:
- e_week_view_set_selected_time_range (E_WEEK_VIEW (priv->month_view),
- priv->selection_start_time,
- priv->selection_end_time);
- break;
-
- default:
- g_warning ("My penguin is gone!");
- g_assert_not_reached ();
- }
+ e_cal_view_set_selected_time_range (E_CAL_VIEW (gnome_calendar_get_current_view_widget (gcal)),
+ priv->selection_start_time,
+ priv->selection_end_time);
}
static void
@@ -2002,14 +1955,10 @@ gnome_calendar_construct (GnomeCalendar *gcal)
g_signal_connect (priv->client, "backend_died",
G_CALLBACK (backend_died_cb), gcal);
- e_day_view_set_cal_client (E_DAY_VIEW (priv->day_view),
- priv->client);
- e_day_view_set_cal_client (E_DAY_VIEW (priv->work_week_view),
- priv->client);
- e_week_view_set_cal_client (E_WEEK_VIEW (priv->week_view),
- priv->client);
- e_week_view_set_cal_client (E_WEEK_VIEW (priv->month_view),
- priv->client);
+ e_cal_view_set_cal_client (E_CAL_VIEW (priv->day_view), priv->client);
+ e_cal_view_set_cal_client (E_CAL_VIEW (priv->work_week_view), priv->client);
+ e_cal_view_set_cal_client (E_CAL_VIEW (priv->week_view), priv->client);
+ e_cal_view_set_cal_client (E_CAL_VIEW (priv->month_view), priv->client);
/*
* TaskPad Folder Client.
@@ -2587,31 +2536,8 @@ gnome_calendar_get_current_time_range (GnomeCalendar *gcal,
priv = gcal->priv;
- switch (priv->current_view_type) {
- case GNOME_CAL_DAY_VIEW:
- e_day_view_get_selected_time_range (E_DAY_VIEW (priv->day_view),
- start_time, end_time);
- break;
-
- case GNOME_CAL_WORK_WEEK_VIEW:
- e_day_view_get_selected_time_range (E_DAY_VIEW (priv->work_week_view),
- start_time, end_time);
- break;
-
- case GNOME_CAL_WEEK_VIEW:
- e_week_view_get_selected_time_range (E_WEEK_VIEW (priv->week_view),
- start_time, end_time);
- break;
-
- case GNOME_CAL_MONTH_VIEW:
- e_week_view_get_selected_time_range (E_WEEK_VIEW (priv->month_view),
- start_time, end_time);
- break;
-
- default:
- g_message ("My penguin is gone!");
- g_assert_not_reached ();
- }
+ e_cal_view_get_selected_time_range (E_CAL_VIEW (gnome_calendar_get_current_view_widget (gcal)),
+ start_time, end_time);
}