aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-08-19 11:26:46 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-08-19 11:26:46 +0800
commit32d802c8ba01fcba9547d335f54cb87f0acb544d (patch)
tree822ec32af03e4f1376818ff542908dd94e059ec1 /calendar
parent026e76465697c7a8df48af89f4b3845902219fe7 (diff)
downloadgsoc2013-evolution-32d802c8ba01fcba9547d335f54cb87f0acb544d.tar.gz
gsoc2013-evolution-32d802c8ba01fcba9547d335f54cb87f0acb544d.tar.zst
gsoc2013-evolution-32d802c8ba01fcba9547d335f54cb87f0acb544d.zip
More GnomeCalendar cleanup.
Diffstat (limited to 'calendar')
-rw-r--r--calendar/gui/gnome-cal.c90
-rw-r--r--calendar/gui/gnome-cal.h72
-rw-r--r--calendar/gui/goto.c4
3 files changed, 41 insertions, 125 deletions
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index 10766477eb..7f2328f735 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -2319,27 +2319,6 @@ gnome_calendar_set_selected_time_range (GnomeCalendar *gcal,
}
/**
- * gnome_calendar_get_selected_time_range:
- * @gcal: A calendar view.
- * @start_time: Return value for the start of the time selection.
- * @end_time: Return value for the end of the time selection.
- *
- * Queries the time selection range on the calendar view.
- **/
-void
-gnome_calendar_get_selected_time_range (GnomeCalendar *gcal,
- time_t *start_time,
- time_t *end_time)
-{
- ECalModel *model;
-
- g_return_if_fail (GNOME_IS_CALENDAR (gcal));
-
- model = gnome_calendar_get_model (gcal);
- e_cal_model_get_time_range (model, start_time, end_time);
-}
-
-/**
* gnome_calendar_new_task:
* @gcal: An Evolution calendar.
* @param dtstart Start time of the task, in same timezone as model.
@@ -2493,47 +2472,6 @@ gnome_calendar_hpane_resized (GtkWidget *w, GdkEventButton *e, GnomeCalendar *gc
return FALSE;
}
-void
-gnome_calendar_cut_clipboard (GnomeCalendar *gcal)
-{
- GnomeCalendarViewType view_type;
- ECalendarView *view;
-
- g_return_if_fail (GNOME_IS_CALENDAR (gcal));
-
- view_type = gnome_calendar_get_view (gcal);
- view = gnome_calendar_get_calendar_view (gcal, view_type);
-
- e_calendar_view_cut_clipboard (view);
-}
-
-void
-gnome_calendar_copy_clipboard (GnomeCalendar *gcal)
-{
- GnomeCalendarViewType view_type;
- ECalendarView *view;
-
- g_return_if_fail (GNOME_IS_CALENDAR (gcal));
-
- view_type = gnome_calendar_get_view (gcal);
- view = gnome_calendar_get_calendar_view (gcal, view_type);
-
- e_calendar_view_copy_clipboard (view);
-}
-
-void
-gnome_calendar_paste_clipboard (GnomeCalendar *gcal)
-{
- GnomeCalendarViewType view_type;
- ECalendarView *view;
-
- g_return_if_fail (GNOME_IS_CALENDAR (gcal));
-
- view_type = gnome_calendar_get_view (gcal);
- view = gnome_calendar_get_calendar_view (gcal, view_type);
-
- e_calendar_view_paste_clipboard (view);
-}
void
gnome_calendar_notify_dates_shown_changed (GnomeCalendar *gcal)
@@ -2591,34 +2529,6 @@ gnome_calendar_get_num_events_selected (GnomeCalendar *gcal)
return retval;
}
-void
-gnome_calendar_delete_selection (GnomeCalendar *gcal)
-{
- GnomeCalendarViewType view_type;
- ECalendarView *view;
-
- g_return_if_fail (GNOME_IS_CALENDAR (gcal));
-
- view_type = gnome_calendar_get_view (gcal);
- view = gnome_calendar_get_calendar_view (gcal, view_type);
-
- e_calendar_view_delete_selected_events (view);
-}
-
-void
-gnome_calendar_delete_selected_occurrence (GnomeCalendar *gcal)
-{
- GnomeCalendarViewType view_type;
- ECalendarView *view;
-
- g_return_if_fail (GNOME_IS_CALENDAR (gcal));
-
- view_type = gnome_calendar_get_view (gcal);
- view = gnome_calendar_get_calendar_view (gcal, view_type);
-
- e_calendar_view_delete_selected_occurrence (view);
-}
-
static gboolean
check_instance_cb (ECalComponent *comp,
time_t instance_start,
diff --git a/calendar/gui/gnome-cal.h b/calendar/gui/gnome-cal.h
index a9e24921e2..a6befeaf7a 100644
--- a/calendar/gui/gnome-cal.h
+++ b/calendar/gui/gnome-cal.h
@@ -36,12 +36,24 @@
#include "e-calendar-table.h"
-#define GNOME_TYPE_CALENDAR (gnome_calendar_get_type ())
-#define GNOME_CALENDAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNOME_TYPE_CALENDAR, GnomeCalendar))
-#define GNOME_CALENDAR_CLASS(klass) (G_TYPE_CHECK_INSTANCE_CAST_CLASS ((klass), GNOME_TYPE_CALENDAR, \
- GnomeCalendarClass))
-#define GNOME_IS_CALENDAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNOME_TYPE_CALENDAR))
-#define GNOME_IS_CALENDAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNOME_TYPE_CALENDAR))
+/* Standard GObject macros */
+#define GNOME_TYPE_CALENDAR \
+ (gnome_calendar_get_type ())
+#define GNOME_CALENDAR(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), GNOME_TYPE_CALENDAR, GnomeCalendar))
+#define GNOME_CALENDAR_CLASS(cls) \
+ (G_TYPE_CHECK_INSTANCE_CAST_CLASS \
+ ((cls), GNOME_TYPE_CALENDAR, GnomeCalendarClass))
+#define GNOME_IS_CALENDAR(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE \
+ ((obj), GNOME_TYPE_CALENDAR))
+#define GNOME_IS_CALENDAR_CLASS(cls) \
+ (G_TYPE_CHECK_CLASS_TYPE \
+ ((cls), GNOME_TYPE_CALENDAR))
+#define GNOME_CALENDAR_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS \
+ ((obj), GNOME_TYPE_CALENDAR, GnomeCalendarClass))
G_BEGIN_DECLS
@@ -75,8 +87,6 @@ typedef enum {
struct _GnomeCalendar {
GtkVBox vbox;
-
- /* Private data */
GnomeCalendarPrivate *priv;
};
@@ -109,10 +119,14 @@ void gnome_calendar_set_date_navigator
(GnomeCalendar *gcal,
ECalendar *date_navigator);
ECalModel * gnome_calendar_get_model (GnomeCalendar *gcal);
-
-gboolean gnome_calendar_remove_source (GnomeCalendar *gcal, ESource *source);
-gboolean gnome_calendar_remove_source_by_uid (GnomeCalendar *gcal, const gchar *uid);
-gboolean gnome_calendar_set_default_source (GnomeCalendar *gcal, ESource *source);
+gboolean gnome_calendar_remove_source (GnomeCalendar *gcal,
+ ESource *source);
+gboolean gnome_calendar_remove_source_by_uid
+ (GnomeCalendar *gcal,
+ const gchar *uid);
+gboolean gnome_calendar_set_default_source
+ (GnomeCalendar *gcal,
+ ESource *source);
void gnome_calendar_update_query (GnomeCalendar *gcal);
void gnome_calendar_set_search_query (GnomeCalendar *gcal,
const gchar *sexp,
@@ -120,16 +134,15 @@ void gnome_calendar_set_search_query (GnomeCalendar *gcal,
time_t start_range,
time_t end_range);
-void gnome_calendar_next (GnomeCalendar *gcal);
-void gnome_calendar_previous (GnomeCalendar *gcal);
-void gnome_calendar_goto (GnomeCalendar *gcal,
+void gnome_calendar_next (GnomeCalendar *gcal);
+void gnome_calendar_previous (GnomeCalendar *gcal);
+void gnome_calendar_goto (GnomeCalendar *gcal,
time_t new_time);
void gnome_calendar_update_view_times(GnomeCalendar *gcal,
time_t start_time);
-void gnome_calendar_dayjump (GnomeCalendar *gcal,
+void gnome_calendar_dayjump (GnomeCalendar *gcal,
time_t time);
-/* Jumps to the current day */
-void gnome_calendar_goto_today (GnomeCalendar *gcal);
+void gnome_calendar_goto_today (GnomeCalendar *gcal);
GnomeCalendarViewType
gnome_calendar_get_view (GnomeCalendar *gcal);
@@ -150,12 +163,9 @@ void gnome_calendar_set_range_selected
void gnome_calendar_set_selected_time_range
(GnomeCalendar *gcal,
time_t start_time);
-void gnome_calendar_get_selected_time_range
- (GnomeCalendar *gcal,
- time_t *start_time,
- time_t *end_time);
-
-void gnome_calendar_new_task (GnomeCalendar *gcal, time_t *dtstart, time_t *dtend);
+void gnome_calendar_new_task (GnomeCalendar *gcal,
+ time_t *dtstart,
+ time_t *dtend);
/* Returns the selected time range for the current view. Note that this may be
different from the fields in the GnomeCalendar, since the view may clip
@@ -169,20 +179,14 @@ void gnome_calendar_notify_dates_shown_changed
(GnomeCalendar *gcal);
/* Returns the number of selected events (0 or 1 at present). */
-gint gnome_calendar_get_num_events_selected (GnomeCalendar *gcal);
-
-/* Clipboard operations */
-void gnome_calendar_cut_clipboard (GnomeCalendar *gcal);
-void gnome_calendar_copy_clipboard (GnomeCalendar *gcal);
-void gnome_calendar_paste_clipboard (GnomeCalendar *gcal);
+gint gnome_calendar_get_num_events_selected
+ (GnomeCalendar *gcal);
-void gnome_calendar_delete_selection (GnomeCalendar *gcal);
-void gnome_calendar_delete_selected_occurrence (GnomeCalendar *gcal);
-void gnome_calendar_purge (GnomeCalendar *gcal,
+void gnome_calendar_purge (GnomeCalendar *gcal,
time_t older_than);
/* Direct calendar component operations */
-void gnome_calendar_edit_appointment (GnomeCalendar *gcal,
+void gnome_calendar_edit_appointment (GnomeCalendar *gcal,
const gchar * src_uid,
const gchar * comp_uid,
const gchar * comp_rid);
diff --git a/calendar/gui/goto.c b/calendar/gui/goto.c
index 15e8337ce1..b795ad9291 100644
--- a/calendar/gui/goto.c
+++ b/calendar/gui/goto.c
@@ -213,6 +213,7 @@ void
goto_dialog (GnomeCalendar *gcal)
{
#if 0 /* KILL-BONOBO */
+ ECalModel *model;
time_t start_time;
struct icaltimetype tt;
gint b;
@@ -243,7 +244,8 @@ goto_dialog (GnomeCalendar *gcal)
}
dlg->gcal = gcal;
- gnome_calendar_get_selected_time_range (dlg->gcal, &start_time, NULL);
+ model = gnome_calendar_get_model (gcal);
+ e_cal_model_get_time_range (model, &start_time, NULL);
tt = icaltime_from_timet_with_zone (start_time, FALSE, gnome_calendar_get_timezone (gcal));
dlg->year_val = tt.year;
dlg->month_val = tt.month - 1;