aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-day-view.c
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@ximian.com>2001-03-18 16:16:40 +0800
committerMiguel de Icaza <miguel@src.gnome.org>2001-03-18 16:16:40 +0800
commitf4b4da4fcb6a59f56c1fff88ba08a6c9995b807c (patch)
tree174273901eb0b57d53848dc3993e7fd7aa1ed9d5 /calendar/gui/e-day-view.c
parent3370188296f555ac67b0f859ce2209c2eeba34af (diff)
downloadgsoc2013-evolution-f4b4da4fcb6a59f56c1fff88ba08a6c9995b807c.tar
gsoc2013-evolution-f4b4da4fcb6a59f56c1fff88ba08a6c9995b807c.tar.gz
gsoc2013-evolution-f4b4da4fcb6a59f56c1fff88ba08a6c9995b807c.tar.bz2
gsoc2013-evolution-f4b4da4fcb6a59f56c1fff88ba08a6c9995b807c.tar.lz
gsoc2013-evolution-f4b4da4fcb6a59f56c1fff88ba08a6c9995b807c.tar.xz
gsoc2013-evolution-f4b4da4fcb6a59f56c1fff88ba08a6c9995b807c.tar.zst
gsoc2013-evolution-f4b4da4fcb6a59f56c1fff88ba08a6c9995b807c.zip
Added ShowWeekView, ShowMonthView, ShowDay, ShowWorkWeek to the View menu.
2001-03-17 Miguel de Icaza <miguel@ximian.com> * evolution-calendar.xml: Added ShowWeekView, ShowMonthView, ShowDay, ShowWorkWeek to the View menu. * evolution.xml, evolution-mail.xml: Provide "Actions" in the toplevel evolution. Fill in Actions/Component in Evolution-mail (no visual changes, just internal changes). * evolution-calendar.xml: Added Actions menu. Added New Verb EditNewEvent. 2001-03-17 Miguel de Icaza <miguel@ximian.com> * gui/e-day-view.c (e_day_view_on_new_event, e_day_view_on_new_appointment): Simplifed this function to use the shared code. * gui/e-week-view.c (e_week_view_on_new_event, e_week_view_on_new_appointment): ditto. * gui/gnome-cal.c (gnome_calendar_new_appointment_for): New function used to launch editor components with a time range. A bunch of functions use this code now instead of duplicating code all over the place svn path=/trunk/; revision=8794
Diffstat (limited to 'calendar/gui/e-day-view.c')
-rw-r--r--calendar/gui/e-day-view.c53
1 files changed, 11 insertions, 42 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index c5051f82df..510572d152 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -321,7 +321,7 @@ static gboolean e_day_view_auto_scroll_handler (gpointer data);
static void e_day_view_on_new_appointment (GtkWidget *widget,
gpointer data);
-static void e_day_view_on_new_full_day (GtkWidget *widget,
+static void e_day_view_on_new_event (GtkWidget *widget,
gpointer data);
static void e_day_view_on_goto_today (GtkWidget *widget,
gpointer data);
@@ -3027,7 +3027,7 @@ static EPopupMenu main_items [] = {
{ N_("New Appointment"), NULL,
e_day_view_on_new_appointment, NULL, 0 },
{ N_("New All Day Event"), NULL,
- e_day_view_on_new_full_day, NULL, 0 },
+ e_day_view_on_new_event, NULL, 0 },
{ "", NULL, NULL, NULL, 0 },
@@ -3116,56 +3116,25 @@ e_day_view_on_event_right_click (EDayView *day_view,
}
static void
-e_day_view_new_event (EDayView *day_view, gboolean all_day)
-{
- CalComponent *comp;
- CalComponentDateTime date;
- time_t dtstart, dtend;
- struct icaltimetype itt;
-
- comp = cal_component_new ();
- cal_component_set_new_vtype (comp, CAL_COMPONENT_EVENT);
- e_day_view_get_selected_time_range (day_view, &dtstart, &dtend);
-
- if (all_day){
- dtstart = time_day_begin (dtstart);
- dtend = time_day_end (dtend);
- }
-
- date.value = &itt;
- date.tzid = NULL;
-
- *date.value = icaltime_from_timet (dtstart, FALSE);
- cal_component_set_dtstart (comp, &date);
-
- *date.value = icaltime_from_timet (dtend, FALSE);
- cal_component_set_dtend (comp, &date);
-
- cal_component_commit_sequence (comp);
-
- if (day_view->calendar)
- gnome_calendar_edit_object (day_view->calendar, comp);
- else
- g_warning ("Calendar not set");
-
- gtk_object_unref (GTK_OBJECT (comp));
-}
-
-
-static void
e_day_view_on_new_appointment (GtkWidget *widget, gpointer data)
{
EDayView *day_view = E_DAY_VIEW (data);
+ time_t dtstart, dtend;
- e_day_view_new_event (day_view, FALSE);
+ e_day_view_get_selected_time_range (day_view, &dtstart, &dtend);
+ gnome_calendar_new_appointment_for (
+ day_view->calendar, dtstart, dtend, FALSE);
}
static void
-e_day_view_on_new_full_day (GtkWidget *widget, gpointer data)
+e_day_view_on_new_event (GtkWidget *widget, gpointer data)
{
EDayView *day_view = E_DAY_VIEW (data);
+ time_t dtstart, dtend;
- e_day_view_new_event (day_view, TRUE);
+ e_day_view_get_selected_time_range (day_view, &dtstart, &dtend);
+ gnome_calendar_new_appointment_for (
+ day_view->calendar, dtstart, dtend, TRUE);
}
static void