aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2003-07-23 20:14:57 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2003-07-23 20:14:57 +0800
commit3be35526b66418c9ccd664523620c8c7cde550b5 (patch)
tree559eb54a4569725787a3a21440e4506f5fbdcb8e /calendar
parentc1a24b93ef371ae2d2aca8b905b9d3ed72b16083 (diff)
downloadgsoc2013-evolution-3be35526b66418c9ccd664523620c8c7cde550b5.tar.gz
gsoc2013-evolution-3be35526b66418c9ccd664523620c8c7cde550b5.tar.zst
gsoc2013-evolution-3be35526b66418c9ccd664523620c8c7cde550b5.zip
removed unneeded prototypes.
2003-07-23 Rodrigo Moya <rodrigo@ximian.com> * gui/e-day-view.h: * gui/e-week-view.h: removed unneeded prototypes. * gui/e-cal-view.[ch] (e_cal_view_get_visible_time_range): new function. (selection_received): deal correctly with the selected time range. * gui/e-week-view.c (e_week_view_get_visible_time_range): made it private as the implementation of the 'get_visible_time_range' virtual method. * gui/e-day-view.c (e_day_view_get_visible_time_range): ditto. * gui/gnome-cal.c (gnome_calendar_direction): merged redundant 'case'. (focus_current_view): removed redundant code. svn path=/trunk/; revision=21897
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog18
-rw-r--r--calendar/gui/e-cal-view.c92
-rw-r--r--calendar/gui/e-cal-view.h2
-rw-r--r--calendar/gui/e-calendar-view.c92
-rw-r--r--calendar/gui/e-calendar-view.h2
-rw-r--r--calendar/gui/e-day-view.c34
-rw-r--r--calendar/gui/e-day-view.h12
-rw-r--r--calendar/gui/e-week-view.c41
-rw-r--r--calendar/gui/e-week-view.h12
-rw-r--r--calendar/gui/gnome-cal.c50
10 files changed, 147 insertions, 208 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index e3f9ee110f..18949f15ba 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,21 @@
+2003-07-23 Rodrigo Moya <rodrigo@ximian.com>
+
+ * gui/e-day-view.h:
+ * gui/e-week-view.h: removed unneeded prototypes.
+
+ * gui/e-cal-view.[ch] (e_cal_view_get_visible_time_range): new
+ function.
+ (selection_received): deal correctly with the selected time range.
+
+ * gui/e-week-view.c (e_week_view_get_visible_time_range): made it
+ private as the implementation of the 'get_visible_time_range'
+ virtual method.
+
+ * gui/e-day-view.c (e_day_view_get_visible_time_range): ditto.
+
+ * gui/gnome-cal.c (gnome_calendar_direction): merged redundant 'case'.
+ (focus_current_view): removed redundant code.
+
2003-07-22 Rodrigo Moya <rodrigo@ximian.com>
* gui/e-day-view.c (e_day_view_get_selected_events):
diff --git a/calendar/gui/e-cal-view.c b/calendar/gui/e-cal-view.c
index 1b4676beb8..f5c64c049b 100644
--- a/calendar/gui/e-cal-view.c
+++ b/calendar/gui/e-cal-view.c
@@ -95,6 +95,7 @@ e_cal_view_class_init (ECalViewClass *klass)
klass->get_selected_events = NULL;
klass->get_selected_time_range = NULL;
klass->set_selected_time_range = NULL;
+ klass->get_visible_time_range = NULL;
klass->update_query = NULL;
/* clipboard atom */
@@ -141,11 +142,9 @@ selection_received (GtkWidget *invisible,
CalComponent *comp;
time_t selected_time_start, selected_time_end;
struct icaltimetype itime;
- struct icaltimetype tmp_itime;
time_t tt_start, tt_end;
struct icaldurationtype ic_dur;
char *uid;
- CalComponentDateTime ccdt;
icaltimezone *default_zone;
g_return_if_fail (E_IS_CAL_VIEW (cal_view));
@@ -185,40 +184,31 @@ selection_received (GtkWidget *invisible,
if (child_kind == ICAL_VEVENT_COMPONENT ||
child_kind == ICAL_VTODO_COMPONENT ||
child_kind == ICAL_VJOURNAL_COMPONENT) {
- icalcomponent *new_icalcomp;
-
- new_icalcomp = icalcomponent_new_clone (subcomp);
- comp = cal_component_new ();
-
- /* change the day for the event */
- tt_start = icaltime_as_timet (
- icalcomponent_get_dtstart (new_icalcomp));
- tt_end = icaltime_as_timet (
- icalcomponent_get_dtend (new_icalcomp));
+ tt_start = icaltime_as_timet (icalcomponent_get_dtstart (subcomp));
+ tt_end = icaltime_as_timet (icalcomponent_get_dtend (subcomp));
ic_dur = icaldurationtype_from_int (tt_end - tt_start);
+ itime = icaltime_from_timet_with_zone (selected_time_start,
+ FALSE, default_zone);
- tmp_itime = icaltime_from_timet_with_zone (
- selected_time_start, FALSE, default_zone);
- itime = icalcomponent_get_dtstart (new_icalcomp);
- itime.year = tmp_itime.year;
- itime.month = tmp_itime.month;
- itime.day = tmp_itime.day;
-
- cal_component_set_icalcomponent (comp, new_icalcomp);
- ccdt.value = &itime;
- ccdt.tzid = icaltimezone_get_tzid (default_zone);
- cal_component_set_dtstart (comp, &ccdt);
-
+ icalcomponent_set_dtstart (subcomp, itime);
itime = icaltime_add (itime, ic_dur);
- ccdt.value = &itime;
- cal_component_set_dtend (comp, &ccdt);
+ icalcomponent_set_dtend (subcomp, itime);
uid = cal_component_gen_uid ();
+ comp = cal_component_new ();
+ cal_component_set_icalcomponent (
+ comp, icalcomponent_new_clone (subcomp));
cal_component_set_uid (comp, uid);
cal_client_update_object (cal_view->priv->client, comp);
-
- g_free (uid);
+ if (itip_organizer_is_user (comp, cal_view->priv->client) &&
+ send_component_dialog (gtk_widget_get_toplevel (cal_view),
+ cal_view->priv->client, comp, TRUE)) {
+ itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, comp,
+ cal_view->priv->client, NULL);
+ }
+
+ free (uid);
g_object_unref (comp);
}
subcomp = icalcomponent_get_next_component (
@@ -229,39 +219,30 @@ selection_received (GtkWidget *invisible,
}
else {
- comp = cal_component_new ();
-
- /* change the day for the event */
tt_start = icaltime_as_timet (icalcomponent_get_dtstart (icalcomp));
tt_end = icaltime_as_timet (icalcomponent_get_dtend (icalcomp));
ic_dur = icaldurationtype_from_int (tt_end - tt_start);
+ itime = icaltime_from_timet_with_zone (selected_time_start, FALSE, default_zone);
- tmp_itime = icaltime_from_timet_with_zone (
- selected_time_start, FALSE, default_zone);
- itime = icalcomponent_get_dtstart (icalcomp);
- itime.year = tmp_itime.year;
- itime.month = tmp_itime.month;
- itime.day = tmp_itime.day;
-
- cal_component_set_icalcomponent (comp, icalcomp);
- ccdt.value = &itime;
- ccdt.tzid = icaltimezone_get_tzid (default_zone);
- cal_component_set_dtstart (comp, &ccdt);
-
+ icalcomponent_set_dtstart (icalcomp, itime);
itime = icaltime_add (itime, ic_dur);
- ccdt.value = &itime;
- cal_component_set_dtend (comp, &ccdt);
+ icalcomponent_set_dtend (icalcomp, itime);
uid = cal_component_gen_uid ();
- cal_component_set_uid (comp, (const char *) uid);
+ comp = cal_component_new ();
+ cal_component_set_icalcomponent (
+ comp, icalcomponent_new_clone (icalcomp));
+ cal_component_set_uid (comp, uid);
cal_client_update_object (cal_view->priv->client, comp);
-
if (itip_organizer_is_user (comp, cal_view->priv->client) &&
- send_component_dialog (gtk_widget_get_toplevel (cal_view), cal_view->priv->client, comp, TRUE))
- itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, comp, cal_view->priv->client, NULL);
+ send_component_dialog (gtk_widget_get_toplevel (cal_view),
+ cal_view->priv->client, comp, TRUE)) {
+ itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, comp,
+ cal_view->priv->client, NULL);
+ }
- g_free (uid);
+ free (uid);
g_object_unref (comp);
}
@@ -477,6 +458,17 @@ e_cal_view_set_selected_time_range (ECalView *cal_view, time_t start_time, time_
}
}
+gboolean
+e_cal_view_get_visible_time_range (ECalView *cal_view, time_t *start_time, time_t *end_time)
+{
+ g_return_if_fail (E_IS_CAL_VIEW (cal_view));
+
+ if (E_CAL_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->get_visible_time_range) {
+ E_CAL_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->get_visible_time_range (
+ cal_view, start_time, end_time);
+ }
+}
+
void
e_cal_view_update_query (ECalView *cal_view)
{
diff --git a/calendar/gui/e-cal-view.h b/calendar/gui/e-cal-view.h
index d188ee6659..eb22decb26 100644
--- a/calendar/gui/e-cal-view.h
+++ b/calendar/gui/e-cal-view.h
@@ -56,6 +56,7 @@ struct _ECalViewClass {
GList * (* get_selected_events) (ECalView *cal_view);
void (* get_selected_time_range) (ECalView *cal_view, time_t *start_time, time_t *end_time);
void (* set_selected_time_range) (ECalView *cal_view, time_t start_time, time_t end_time);
+ gboolean (* get_visible_time_range) (ECalView *cal_view, time_t *start_time, time_t *end_time);
void (* update_query) (ECalView *cal_view);
};
@@ -73,6 +74,7 @@ void e_cal_view_set_status_message (ECalView *cal_view, const gchar *m
GList *e_cal_view_get_selected_events (ECalView *cal_view);
void e_cal_view_get_selected_time_range (ECalView *cal_view, time_t *start_time, time_t *end_time);
void e_cal_view_set_selected_time_range (ECalView *cal_view, time_t start_time, time_t end_time);
+gboolean e_cal_view_get_visible_time_range (ECalView *cal_view, time_t *start_time, time_t *end_time);
void e_cal_view_update_query (ECalView *cal_view);
void e_cal_view_cut_clipboard (ECalView *cal_view);
diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c
index 1b4676beb8..f5c64c049b 100644
--- a/calendar/gui/e-calendar-view.c
+++ b/calendar/gui/e-calendar-view.c
@@ -95,6 +95,7 @@ e_cal_view_class_init (ECalViewClass *klass)
klass->get_selected_events = NULL;
klass->get_selected_time_range = NULL;
klass->set_selected_time_range = NULL;
+ klass->get_visible_time_range = NULL;
klass->update_query = NULL;
/* clipboard atom */
@@ -141,11 +142,9 @@ selection_received (GtkWidget *invisible,
CalComponent *comp;
time_t selected_time_start, selected_time_end;
struct icaltimetype itime;
- struct icaltimetype tmp_itime;
time_t tt_start, tt_end;
struct icaldurationtype ic_dur;
char *uid;
- CalComponentDateTime ccdt;
icaltimezone *default_zone;
g_return_if_fail (E_IS_CAL_VIEW (cal_view));
@@ -185,40 +184,31 @@ selection_received (GtkWidget *invisible,
if (child_kind == ICAL_VEVENT_COMPONENT ||
child_kind == ICAL_VTODO_COMPONENT ||
child_kind == ICAL_VJOURNAL_COMPONENT) {
- icalcomponent *new_icalcomp;
-
- new_icalcomp = icalcomponent_new_clone (subcomp);
- comp = cal_component_new ();
-
- /* change the day for the event */
- tt_start = icaltime_as_timet (
- icalcomponent_get_dtstart (new_icalcomp));
- tt_end = icaltime_as_timet (
- icalcomponent_get_dtend (new_icalcomp));
+ tt_start = icaltime_as_timet (icalcomponent_get_dtstart (subcomp));
+ tt_end = icaltime_as_timet (icalcomponent_get_dtend (subcomp));
ic_dur = icaldurationtype_from_int (tt_end - tt_start);
+ itime = icaltime_from_timet_with_zone (selected_time_start,
+ FALSE, default_zone);
- tmp_itime = icaltime_from_timet_with_zone (
- selected_time_start, FALSE, default_zone);
- itime = icalcomponent_get_dtstart (new_icalcomp);
- itime.year = tmp_itime.year;
- itime.month = tmp_itime.month;
- itime.day = tmp_itime.day;
-
- cal_component_set_icalcomponent (comp, new_icalcomp);
- ccdt.value = &itime;
- ccdt.tzid = icaltimezone_get_tzid (default_zone);
- cal_component_set_dtstart (comp, &ccdt);
-
+ icalcomponent_set_dtstart (subcomp, itime);
itime = icaltime_add (itime, ic_dur);
- ccdt.value = &itime;
- cal_component_set_dtend (comp, &ccdt);
+ icalcomponent_set_dtend (subcomp, itime);
uid = cal_component_gen_uid ();
+ comp = cal_component_new ();
+ cal_component_set_icalcomponent (
+ comp, icalcomponent_new_clone (subcomp));
cal_component_set_uid (comp, uid);
cal_client_update_object (cal_view->priv->client, comp);
-
- g_free (uid);
+ if (itip_organizer_is_user (comp, cal_view->priv->client) &&
+ send_component_dialog (gtk_widget_get_toplevel (cal_view),
+ cal_view->priv->client, comp, TRUE)) {
+ itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, comp,
+ cal_view->priv->client, NULL);
+ }
+
+ free (uid);
g_object_unref (comp);
}
subcomp = icalcomponent_get_next_component (
@@ -229,39 +219,30 @@ selection_received (GtkWidget *invisible,
}
else {
- comp = cal_component_new ();
-
- /* change the day for the event */
tt_start = icaltime_as_timet (icalcomponent_get_dtstart (icalcomp));
tt_end = icaltime_as_timet (icalcomponent_get_dtend (icalcomp));
ic_dur = icaldurationtype_from_int (tt_end - tt_start);
+ itime = icaltime_from_timet_with_zone (selected_time_start, FALSE, default_zone);
- tmp_itime = icaltime_from_timet_with_zone (
- selected_time_start, FALSE, default_zone);
- itime = icalcomponent_get_dtstart (icalcomp);
- itime.year = tmp_itime.year;
- itime.month = tmp_itime.month;
- itime.day = tmp_itime.day;
-
- cal_component_set_icalcomponent (comp, icalcomp);
- ccdt.value = &itime;
- ccdt.tzid = icaltimezone_get_tzid (default_zone);
- cal_component_set_dtstart (comp, &ccdt);
-
+ icalcomponent_set_dtstart (icalcomp, itime);
itime = icaltime_add (itime, ic_dur);
- ccdt.value = &itime;
- cal_component_set_dtend (comp, &ccdt);
+ icalcomponent_set_dtend (icalcomp, itime);
uid = cal_component_gen_uid ();
- cal_component_set_uid (comp, (const char *) uid);
+ comp = cal_component_new ();
+ cal_component_set_icalcomponent (
+ comp, icalcomponent_new_clone (icalcomp));
+ cal_component_set_uid (comp, uid);
cal_client_update_object (cal_view->priv->client, comp);
-
if (itip_organizer_is_user (comp, cal_view->priv->client) &&
- send_component_dialog (gtk_widget_get_toplevel (cal_view), cal_view->priv->client, comp, TRUE))
- itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, comp, cal_view->priv->client, NULL);
+ send_component_dialog (gtk_widget_get_toplevel (cal_view),
+ cal_view->priv->client, comp, TRUE)) {
+ itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, comp,
+ cal_view->priv->client, NULL);
+ }
- g_free (uid);
+ free (uid);
g_object_unref (comp);
}
@@ -477,6 +458,17 @@ e_cal_view_set_selected_time_range (ECalView *cal_view, time_t start_time, time_
}
}
+gboolean
+e_cal_view_get_visible_time_range (ECalView *cal_view, time_t *start_time, time_t *end_time)
+{
+ g_return_if_fail (E_IS_CAL_VIEW (cal_view));
+
+ if (E_CAL_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->get_visible_time_range) {
+ E_CAL_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->get_visible_time_range (
+ cal_view, start_time, end_time);
+ }
+}
+
void
e_cal_view_update_query (ECalView *cal_view)
{
diff --git a/calendar/gui/e-calendar-view.h b/calendar/gui/e-calendar-view.h
index d188ee6659..eb22decb26 100644
--- a/calendar/gui/e-calendar-view.h
+++ b/calendar/gui/e-calendar-view.h
@@ -56,6 +56,7 @@ struct _ECalViewClass {
GList * (* get_selected_events) (ECalView *cal_view);
void (* get_selected_time_range) (ECalView *cal_view, time_t *start_time, time_t *end_time);
void (* set_selected_time_range) (ECalView *cal_view, time_t start_time, time_t end_time);
+ gboolean (* get_visible_time_range) (ECalView *cal_view, time_t *start_time, time_t *end_time);
void (* update_query) (ECalView *cal_view);
};
@@ -73,6 +74,7 @@ void e_cal_view_set_status_message (ECalView *cal_view, const gchar *m
GList *e_cal_view_get_selected_events (ECalView *cal_view);
void e_cal_view_get_selected_time_range (ECalView *cal_view, time_t *start_time, time_t *end_time);
void e_cal_view_set_selected_time_range (ECalView *cal_view, time_t start_time, time_t end_time);
+gboolean e_cal_view_get_visible_time_range (ECalView *cal_view, time_t *start_time, time_t *end_time);
void e_cal_view_update_query (ECalView *cal_view);
void e_cal_view_cut_clipboard (ECalView *cal_view);
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 707acdddd9..52d9f53a2f 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -154,6 +154,7 @@ static gboolean e_day_view_popup_menu (GtkWidget *widget);
static GList *e_day_view_get_selected_events (ECalView *cal_view);
static void e_day_view_get_selected_time_range (EDayView *day_view, time_t *start_time, time_t *end_time);
static void e_day_view_set_selected_time_range (EDayView *day_view, time_t start_time, time_t end_time);
+static gboolean e_day_view_get_visible_time_range (EDayView *day_view, time_t *start_time, time_t *end_time);
static void e_day_view_update_query (EDayView *day_view);
static void e_day_view_goto_start_of_work_day (EDayView *day_view);
static void e_day_view_goto_end_of_work_day (EDayView *day_view);
@@ -507,6 +508,7 @@ e_day_view_class_init (EDayViewClass *class)
view_class->get_selected_events = e_day_view_get_selected_events;
view_class->get_selected_time_range = e_day_view_get_selected_time_range;
view_class->set_selected_time_range = e_day_view_set_selected_time_range;
+ view_class->get_visible_time_range = e_day_view_get_visible_time_range;
view_class->update_query = e_day_view_update_query;
}
@@ -2247,6 +2249,21 @@ e_day_view_get_selected_time_range (EDayView *day_view,
*end_time = end;
}
+/* Gets the visible time range. Returns FALSE if no time range has been set. */
+static gboolean
+e_day_view_get_visible_time_range (EDayView *day_view,
+ time_t *start_time,
+ time_t *end_time)
+{
+ /* If the date isn't set, return FALSE. */
+ if (day_view->lower == 0 && day_view->upper == 0)
+ return FALSE;
+
+ *start_time = day_view->day_starts[0];
+ *end_time = day_view->day_starts[day_view->days_shown];
+
+ return TRUE;
+}
static void
e_day_view_recalc_day_starts (EDayView *day_view,
@@ -7732,23 +7749,6 @@ e_day_view_get_time_string_width (EDayView *day_view)
return time_width;
}
-/* Gets the visible time range. Returns FALSE if no time range has been set. */
-gboolean
-e_day_view_get_visible_time_range (EDayView *day_view,
- time_t *start_time,
- time_t *end_time)
-{
- /* If the date isn't set, return FALSE. */
- if (day_view->lower == 0 && day_view->upper == 0)
- return FALSE;
-
- *start_time = day_view->day_starts[0];
- *end_time = day_view->day_starts[day_view->days_shown];
-
- return TRUE;
-}
-
-
/* Queues a layout, unless one is already queued. */
static void
e_day_view_queue_layout (EDayView *day_view)
diff --git a/calendar/gui/e-day-view.h b/calendar/gui/e-day-view.h
index dd95eba078..119a5f5fd0 100644
--- a/calendar/gui/e-day-view.h
+++ b/calendar/gui/e-day-view.h
@@ -509,11 +509,6 @@ void e_day_view_set_query (EDayView *day_view,
void e_day_view_set_default_category (EDayView *day_view,
const char *category);
-/* Gets the visible time range. Returns FALSE if no time range has been set. */
-gboolean e_day_view_get_visible_time_range (EDayView *day_view,
- time_t *start_time,
- time_t *end_time);
-
/* Whether we are displaying a work-week, in which case the display always
starts on the first day of the working week. */
gboolean e_day_view_get_work_week_view (EDayView *day_view);
@@ -572,11 +567,6 @@ void e_day_view_set_timezone (EDayView *day_view,
icaltimezone *zone);
-/* Clipboard-related functions */
-void e_day_view_cut_clipboard (EDayView *day_view);
-void e_day_view_copy_clipboard (EDayView *day_view);
-void e_day_view_paste_clipboard (EDayView *day_view);
-
void e_day_view_delete_event (EDayView *day_view);
void e_day_view_delete_occurrence (EDayView *day_view);
@@ -584,8 +574,6 @@ void e_day_view_delete_occurrence (EDayView *day_view);
/* Returns the number of selected events (0 or 1 at present). */
gint e_day_view_get_num_events_selected (EDayView *day_view);
-CalComponent *e_day_view_get_selected_event (EDayView *day_view);
-
/*
* Internal functions called by the associated canvas items.
*/
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index 4a5aceb86f..3277eb9c60 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -113,6 +113,7 @@ static gboolean e_week_view_focus (GtkWidget *widget,
static GList *e_week_view_get_selected_events (ECalView *cal_view);
static void e_week_view_get_selected_time_range (EWeekView *cal_view, time_t *start_time, time_t *end_time);
static void e_week_view_set_selected_time_range (EWeekView *cal_view, time_t start_time, time_t end_time);
+static gboolean e_week_view_get_visible_time_range (EWeekView *cal_view, time_t *start_time, time_t *end_time);
static void e_week_view_update_query (EWeekView *week_view);
static void e_week_view_draw_shadow (EWeekView *week_view);
@@ -263,6 +264,7 @@ e_week_view_class_init (EWeekViewClass *class)
view_class->get_selected_events = e_week_view_get_selected_events;
view_class->get_selected_time_range = e_week_view_get_selected_time_range;
view_class->set_selected_time_range = e_week_view_set_selected_time_range;
+ view_class->get_visible_time_range = e_week_view_get_visible_time_range;
view_class->update_query = e_week_view_update_query;
}
@@ -1486,6 +1488,25 @@ e_week_view_get_selected_time_range (EWeekView *week_view,
*end_time = week_view->day_starts[end_day + 1];
}
+/* Gets the visible time range. Returns FALSE if no time range has been set. */
+static gboolean
+e_week_view_get_visible_time_range (EWeekView *week_view,
+ time_t *start_time,
+ time_t *end_time)
+{
+ gint num_days;
+
+ /* If we don't have a valid date set yet, return FALSE. */
+ if (!g_date_valid (&week_view->first_day_shown))
+ return FALSE;
+
+ num_days = week_view->multi_week_view ? week_view->weeks_shown * 7 : 7;
+ *start_time = week_view->day_starts[0];
+ *end_time = week_view->day_starts[num_days];
+
+ return TRUE;
+}
+
/* Note that the returned date may be invalid if no date has been set yet. */
void
@@ -4136,26 +4157,6 @@ e_week_view_get_time_string_width (EWeekView *week_view)
return time_width;
}
-/* Gets the visible time range. Returns FALSE if no time range has been set. */
-gboolean
-e_week_view_get_visible_time_range (EWeekView *week_view,
- time_t *start_time,
- time_t *end_time)
-{
- gint num_days;
-
- /* If we don't have a valid date set yet, return FALSE. */
- if (!g_date_valid (&week_view->first_day_shown))
- return FALSE;
-
- num_days = week_view->multi_week_view ? week_view->weeks_shown * 7 : 7;
- *start_time = week_view->day_starts[0];
- *end_time = week_view->day_starts[num_days];
-
- return TRUE;
-}
-
-
/* Queues a layout, unless one is already queued. */
static void
e_week_view_queue_layout (EWeekView *week_view)
diff --git a/calendar/gui/e-week-view.h b/calendar/gui/e-week-view.h
index 7b3d85711b..4b14dce298 100644
--- a/calendar/gui/e-week-view.h
+++ b/calendar/gui/e-week-view.h
@@ -385,11 +385,6 @@ void e_week_view_set_selected_time_range_visible (EWeekView *week_view,
time_t start_time,
time_t end_time);
-/* Gets the visible time range. Returns FALSE if no time range has been set. */
-gboolean e_week_view_get_visible_time_range (EWeekView *week_view,
- time_t *start_time,
- time_t *end_time);
-
/* Whether to display 1 week or 1 month (5 weeks). It defaults to 1 week. */
gboolean e_week_view_get_multi_week_view (EWeekView *week_view);
void e_week_view_set_multi_week_view (EWeekView *week_view,
@@ -426,19 +421,12 @@ icaltimezone* e_week_view_get_timezone (EWeekView *week_view);
void e_week_view_set_timezone (EWeekView *week_view,
icaltimezone *zone);
-/* Clipboard related functions */
-void e_week_view_cut_clipboard (EWeekView *week_view);
-void e_week_view_copy_clipboard (EWeekView *week_view);
-void e_week_view_paste_clipboard (EWeekView *week_view);
-
void e_week_view_delete_event (EWeekView *week_view);
void e_week_view_delete_occurrence (EWeekView *week_view);
/* Returns the number of selected events (0 or 1 at present). */
gint e_week_view_get_num_events_selected (EWeekView *week_view);
-CalComponent *e_week_view_get_selected_event (EWeekView *week_view);
-
/*
* Internal functions called by the associated canvas items.
*/
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index f405a16142..61b4980586 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -1215,12 +1215,6 @@ gnome_calendar_direction (GnomeCalendar *gcal, int direction)
break;
case GNOME_CAL_WORK_WEEK_VIEW:
- start_time = time_add_week_with_zone (start_time, direction,
- priv->zone);
- end_time = time_add_week_with_zone (end_time, direction,
- priv->zone);
- break;
-
case GNOME_CAL_WEEK_VIEW:
start_time = time_add_week_with_zone (start_time, direction,
priv->zone);
@@ -1291,27 +1285,7 @@ focus_current_view (GnomeCalendar *gcal)
priv = gcal->priv;
- switch (priv->current_view_type) {
- case GNOME_CAL_DAY_VIEW:
- gtk_widget_grab_focus (priv->day_view);
- break;
-
- case GNOME_CAL_WORK_WEEK_VIEW:
- gtk_widget_grab_focus (priv->work_week_view);
- break;
-
- case GNOME_CAL_WEEK_VIEW:
- gtk_widget_grab_focus (priv->week_view);
- break;
-
- case GNOME_CAL_MONTH_VIEW:
- gtk_widget_grab_focus (priv->month_view);
- break;
-
- default:
- g_warning ("A penguin fell on its face!");
- g_assert_not_reached ();
- }
+ gtk_widget_grab_focus (gnome_calendar_get_current_view_widget (gcal));
}
void
@@ -2555,26 +2529,8 @@ gnome_calendar_get_visible_time_range (GnomeCalendar *gcal,
priv = gcal->priv;
- switch (priv->current_view_type) {
- case GNOME_CAL_DAY_VIEW:
- retval = e_day_view_get_visible_time_range (E_DAY_VIEW (priv->day_view), start_time, end_time);
- break;
-
- case GNOME_CAL_WORK_WEEK_VIEW:
- retval = e_day_view_get_visible_time_range (E_DAY_VIEW (priv->work_week_view), start_time, end_time);
- break;
-
- case GNOME_CAL_WEEK_VIEW:
- retval = e_week_view_get_visible_time_range (E_WEEK_VIEW (priv->week_view), start_time, end_time);
- break;
-
- case GNOME_CAL_MONTH_VIEW:
- retval = e_week_view_get_visible_time_range (E_WEEK_VIEW (priv->month_view), start_time, end_time);
- break;
-
- default:
- g_assert_not_reached ();
- }
+ e_cal_view_get_visible_time_range (E_CAL_VIEW (gnome_calendar_get_current_view_widget (gcal)),
+ start_time, end_time);
return retval;
}