aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-day-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-day-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-day-view.c')
-rw-r--r--calendar/gui/e-day-view.c66
1 files changed, 56 insertions, 10 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 36ad251822..c5051f82df 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -44,6 +44,7 @@
#include <gal/widgets/e-gui-utils.h>
#include <gal/widgets/e-popup-menu.h>
#include "e-meeting-edit.h"
+#include "goto.h"
/* Images */
#include "art/bell.xpm"
@@ -320,6 +321,12 @@ 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,
+ gpointer data);
+static void e_day_view_on_goto_today (GtkWidget *widget,
+ gpointer data);
+static void e_day_view_on_goto_date (GtkWidget *widget,
+ gpointer data);
static void e_day_view_on_edit_appointment (GtkWidget *widget,
gpointer data);
static void e_day_view_on_delete_occurrence (GtkWidget *widget,
@@ -3017,8 +3024,18 @@ enum {
};
static EPopupMenu main_items [] = {
- { N_("New Appointment..."), NULL,
+ { 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 },
+
+ { "", NULL, NULL, NULL, 0 },
+
+ { N_("Go to Today"), NULL,
+ e_day_view_on_goto_today, NULL, 0 },
+ { N_("Go to Date..."), NULL,
+ e_day_view_on_goto_date, NULL, 0 },
+
{ NULL, NULL, NULL, NULL, 0 }
};
@@ -3029,10 +3046,6 @@ static EPopupMenu child_items [] = {
e_day_view_on_delete_appointment, NULL, MASK_EDITABLE | MASK_SINGLE | MASK_EDITING },
{ N_("Schedule Meeting"), NULL,
e_day_view_on_schedule_meet, NULL, MASK_EDITING },
- { "", NULL, NULL, NULL, 0},
-
- { N_("New Appointment..."), NULL,
- e_day_view_on_new_appointment, NULL, 0 },
{ "", NULL, NULL, NULL, MASK_SINGLE},
@@ -3102,22 +3115,23 @@ e_day_view_on_event_right_click (EDayView *day_view,
e_popup_menu_run (context_menu, (GdkEvent *) bevent, disable_mask, hide_mask, day_view);
}
-
static void
-e_day_view_on_new_appointment (GtkWidget *widget, gpointer data)
+e_day_view_new_event (EDayView *day_view, gboolean all_day)
{
- EDayView *day_view;
CalComponent *comp;
CalComponentDateTime date;
time_t dtstart, dtend;
struct icaltimetype itt;
- day_view = E_DAY_VIEW (data);
-
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;
@@ -3139,6 +3153,38 @@ e_day_view_on_new_appointment (GtkWidget *widget, gpointer data)
static void
+e_day_view_on_new_appointment (GtkWidget *widget, gpointer data)
+{
+ EDayView *day_view = E_DAY_VIEW (data);
+
+ e_day_view_new_event (day_view, FALSE);
+}
+
+static void
+e_day_view_on_new_full_day (GtkWidget *widget, gpointer data)
+{
+ EDayView *day_view = E_DAY_VIEW (data);
+
+ e_day_view_new_event (day_view, TRUE);
+}
+
+static void
+e_day_view_on_goto_date (GtkWidget *widget, gpointer data)
+{
+ EDayView *day_view = E_DAY_VIEW (data);
+
+ goto_dialog (day_view->calendar);
+}
+
+static void
+e_day_view_on_goto_today (GtkWidget *widget, gpointer data)
+{
+ EDayView *day_view = E_DAY_VIEW (data);
+
+ calendar_goto_today (day_view->calendar);
+}
+
+static void
e_day_view_on_edit_appointment (GtkWidget *widget, gpointer data)
{
EDayView *day_view;