diff options
author | Rodrigo Moya <rodrigo@ximian.com> | 2001-06-15 07:26:30 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@src.gnome.org> | 2001-06-15 07:26:30 +0800 |
commit | efd9bd119ca61ca8f2d7d2d9e724a5c51911fc51 (patch) | |
tree | 4af0d85a26a2ea0a1299f6690d77c00f7028024a /calendar/gui/e-week-view.c | |
parent | 9a52bdf0d14b19c40d65fa4ad1c1103fee36e165 (diff) | |
download | gsoc2013-evolution-efd9bd119ca61ca8f2d7d2d9e724a5c51911fc51.tar.gz gsoc2013-evolution-efd9bd119ca61ca8f2d7d2d9e724a5c51911fc51.tar.zst gsoc2013-evolution-efd9bd119ca61ca8f2d7d2d9e724a5c51911fc51.zip |
finished implementation of Paste stuff
2001-06-15 Rodrigo Moya <rodrigo@ximian.com>
* gui/e-day-view.c (selection_received): finished implementation
of Paste stuff
* gui/e-week-view.c (selection_received): ditto
svn path=/trunk/; revision=10243
Diffstat (limited to 'calendar/gui/e-week-view.c')
-rw-r--r-- | calendar/gui/e-week-view.c | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index fa4ea144d0..65ec0bfa21 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -3017,6 +3017,11 @@ enum { }; static EPopupMenu main_items [] = { + { N_("Paste"), NULL, + e_week_view_on_paste, NULL, 0 }, + + { "", NULL, NULL, NULL, 0 }, + { N_("New Appointment..."), NULL, e_week_view_on_new_appointment, NULL, 0 }, { N_("New All Day Event"), NULL, @@ -3464,13 +3469,40 @@ selection_clear_event (GtkWidget *invisible, } } -static void selection_received (GtkWidget *invisible, - GtkSelectionData *selection_data, - guint time, - EWeekView *week_view) +static void +selection_received (GtkWidget *invisible, + GtkSelectionData *selection_data, + guint time, + EWeekView *week_view) { + char *comp_str; + icalcomponent *icalcomp; + time_t dtstart, dtend; + struct icaltimetype itime; + CalComponent *comp; + + g_return_if_fail (E_IS_WEEK_VIEW (week_view)); + if (selection_data->length < 0 || selection_data->type != GDK_SELECTION_TYPE_STRING) { return; } + + comp_str = (char *) selection_data->data; + icalcomp = icalparser_parse_string ((const char *) comp_str); + if (icalcomp) { + dtstart = week_view->day_starts[week_view->selection_start_day]; + itime = icaltime_from_timet (dtstart, TRUE); + icalcomponent_set_dtstart (icalcomp, itime); + + dtend = week_view->day_starts[week_view->selection_end_day + 1]; + itime = icaltime_from_timet (dtend, TRUE); + icalcomponent_set_dtend (icalcomp, itime); + + comp = cal_component_new (); + cal_component_set_icalcomponent (comp, icalcomp); + cal_client_update_object (week_view->client, comp); + + gtk_object_unref (GTK_OBJECT (comp)); + } } |