aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-week-view.c
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@ximian.com>2001-03-17 14:43:15 +0800
committerMiguel de Icaza <miguel@src.gnome.org>2001-03-17 14:43:15 +0800
commitbdb087eaeba3937fd9ce86176a9e0a5d09d899f5 (patch)
treedfef6f4bc53bb2e5f0cd0cfb4aa67dea60d7ad39 /calendar/gui/e-week-view.c
parentfcb4ed5a4f851aabae47aa5c376253246c3f216c (diff)
downloadgsoc2013-evolution-bdb087eaeba3937fd9ce86176a9e0a5d09d899f5.tar
gsoc2013-evolution-bdb087eaeba3937fd9ce86176a9e0a5d09d899f5.tar.gz
gsoc2013-evolution-bdb087eaeba3937fd9ce86176a9e0a5d09d899f5.tar.bz2
gsoc2013-evolution-bdb087eaeba3937fd9ce86176a9e0a5d09d899f5.tar.lz
gsoc2013-evolution-bdb087eaeba3937fd9ce86176a9e0a5d09d899f5.tar.xz
gsoc2013-evolution-bdb087eaeba3937fd9ce86176a9e0a5d09d899f5.tar.zst
gsoc2013-evolution-bdb087eaeba3937fd9ce86176a9e0a5d09d899f5.zip
Moved functionality here from e_day_view_on_new_appointment. Allows
2001-03-17 Miguel de Icaza <miguel@ximian.com> * gui/e-week-view.c (e_week_view_new_event): Moved functionality here from e_day_view_on_new_appointment. Allows setting for "full day" event. (e_week_view_on_new_full_day): New function for making a full day event. (e_week_view_on_goto_date): Go To support. (e_week_view_on_goto_today): Goto today support. * gui/e-day-view.c (e_day_view_new_event): Moved functionality here from e_day_view_on_new_appointment. Allows setting for "full day" event. (e_day_view_on_new_full_day): New function for making a full day event. (e_day_view_on_goto_date): Go To support. (e_day_view_on_goto_today): Goto today support. * main_items: Add New All Day Event; Go to Today; Go to Date. svn path=/trunk/; revision=8778
Diffstat (limited to 'calendar/gui/e-week-view.c')
-rw-r--r--calendar/gui/e-week-view.c56
1 files changed, 52 insertions, 4 deletions
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index 28b62ae824..8b05b113c8 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -45,6 +45,7 @@
#include <gal/widgets/e-gui-utils.h>
#include <gal/widgets/e-canvas-utils.h>
#include "e-meeting-edit.h"
+#include "goto.h"
/* Images */
#include "art/bell.xpm"
@@ -161,6 +162,12 @@ static gboolean e_week_view_on_jump_button_event (GnomeCanvasItem *item,
static gint e_week_view_key_press (GtkWidget *widget, GdkEventKey *event);
static void e_week_view_on_new_appointment (GtkWidget *widget,
gpointer data);
+static void e_week_view_on_new_full_day (GtkWidget *widget,
+ gpointer data);
+static void e_week_view_on_goto_today (GtkWidget *widget,
+ gpointer data);
+static void e_week_view_on_goto_date (GtkWidget *widget,
+ gpointer data);
static void e_week_view_on_edit_appointment (GtkWidget *widget,
gpointer data);
static void e_week_view_on_delete_occurrence (GtkWidget *widget,
@@ -3227,6 +3234,15 @@ enum {
static EPopupMenu main_items [] = {
{ N_("New Appointment..."), NULL,
e_week_view_on_new_appointment, NULL, 0 },
+ { N_("New All Day Event"), NULL,
+ e_week_view_on_new_full_day, NULL, 0 },
+
+ { "", NULL, NULL, NULL, 0 },
+
+ { N_("Go to Today"), NULL,
+ e_week_view_on_goto_today, NULL, 0 },
+ { N_("Go to Date..."), NULL,
+ e_week_view_on_goto_date, NULL, 0 },
{ NULL, NULL, NULL, NULL, 0 }
};
@@ -3300,16 +3316,13 @@ e_week_view_show_popup_menu (EWeekView *week_view,
static void
-e_week_view_on_new_appointment (GtkWidget *widget, gpointer data)
+e_week_view_new_event (EWeekView *week_view, gboolean all_day)
{
- EWeekView *week_view;
CalComponent *comp;
CalComponentDateTime date;
struct icaltimetype itt;
time_t dt;
- week_view = E_WEEK_VIEW (data);
-
comp = cal_component_new ();
cal_component_set_new_vtype (comp, CAL_COMPONENT_EVENT);
@@ -3317,10 +3330,14 @@ e_week_view_on_new_appointment (GtkWidget *widget, gpointer data)
date.tzid = NULL;
dt = week_view->day_starts[week_view->selection_start_day];
+ if (all_day)
+ dt = time_day_begin (dt);
*date.value = icaltime_from_timet (dt, TRUE);
cal_component_set_dtstart (comp, &date);
dt = week_view->day_starts[week_view->selection_end_day + 1];
+ if (all_day)
+ dt = time_day_end (dt);
*date.value = icaltime_from_timet (dt, TRUE);
cal_component_set_dtend (comp, &date);
@@ -3334,6 +3351,37 @@ e_week_view_on_new_appointment (GtkWidget *widget, gpointer data)
gtk_object_unref (GTK_OBJECT (comp));
}
+static void
+e_week_view_on_new_appointment (GtkWidget *widget, gpointer data)
+{
+ EWeekView *week_view = E_WEEK_VIEW (data);
+
+ e_week_view_new_event (week_view, FALSE);
+}
+
+static void
+e_week_view_on_new_full_day (GtkWidget *widget, gpointer data)
+{
+ EWeekView *week_view = E_WEEK_VIEW (data);
+
+ e_week_view_new_event (week_view, TRUE);
+}
+
+static void
+e_week_view_on_goto_date (GtkWidget *widget, gpointer data)
+{
+ EWeekView *week_view = E_WEEK_VIEW (data);
+
+ goto_dialog (week_view->calendar);
+}
+
+static void
+e_week_view_on_goto_today (GtkWidget *widget, gpointer data)
+{
+ EWeekView *week_view = E_WEEK_VIEW (data);
+
+ calendar_goto_today (week_view->calendar);
+}
static void
e_week_view_on_edit_appointment (GtkWidget *widget, gpointer data)