aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-day-view.c
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2001-06-14 19:51:11 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2001-06-14 19:51:11 +0800
commita241f9afe91b2b45db6aa242ffb98fc2a3d91c4e (patch)
tree43b8085fe0da3c6345571ad914c8669c7f37f590 /calendar/gui/e-day-view.c
parent5938953eeaf3ccb311b6d24dc0cd70c88de815c9 (diff)
downloadgsoc2013-evolution-a241f9afe91b2b45db6aa242ffb98fc2a3d91c4e.tar.gz
gsoc2013-evolution-a241f9afe91b2b45db6aa242ffb98fc2a3d91c4e.tar.zst
gsoc2013-evolution-a241f9afe91b2b45db6aa242ffb98fc2a3d91c4e.zip
added popup menu items for cut/copy/paste
2001-06-14 Rodrigo Moya <rodrigo@ximian.com> * gui/e-day-view.[ch]: added popup menu items for cut/copy/paste * gui/e-week-view.[ch]: ditto svn path=/trunk/; revision=10229
Diffstat (limited to 'calendar/gui/e-day-view.c')
-rw-r--r--calendar/gui/e-day-view.c63
1 files changed, 59 insertions, 4 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index cd3f08aa77..71db1c05b2 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -321,6 +321,9 @@ static void e_day_view_on_delete_occurrence (GtkWidget *widget,
gpointer data);
static void e_day_view_on_delete_appointment (GtkWidget *widget,
gpointer data);
+static void e_day_view_on_cut (GtkWidget *widget, gpointer data);
+static void e_day_view_on_copy (GtkWidget *widget, gpointer data);
+static void e_day_view_on_paste (GtkWidget *widget, gpointer data);
static void e_day_view_on_schedule_meet (GtkWidget *widget,
gpointer data);
static void e_day_view_on_unrecur_appointment (GtkWidget *widget,
@@ -3195,6 +3198,12 @@ static EPopupMenu child_items [] = {
e_day_view_on_edit_appointment, NULL, MASK_EDITABLE | MASK_EDITING },
{ N_("Delete this Appointment"), NULL,
e_day_view_on_delete_appointment, NULL, MASK_EDITABLE | MASK_SINGLE | MASK_EDITING },
+ { N_("Cut"), NULL,
+ e_day_view_on_cut, NULL, MASK_EDITABLE | MASK_EDITING },
+ { N_("Copy"), NULL,
+ e_day_view_on_copy, NULL, 0 },
+ { N_("Paste"), NULL,
+ e_day_view_on_paste, NULL, MASK_EDITABLE | MASK_EDITING },
{ N_("Schedule Meeting"), NULL,
e_day_view_on_schedule_meet, NULL, MASK_EDITING },
@@ -3378,6 +3387,56 @@ e_day_view_on_delete_appointment (GtkWidget *widget, gpointer data)
}
}
+static void
+e_day_view_on_cut (GtkWidget *widget, gpointer data)
+{
+ EDayView *day_view;
+ EDayViewEvent *event;
+ const char *uid;
+
+ day_view = E_DAY_VIEW (data);
+
+ e_day_view_on_copy (widget, data);
+
+ event = e_day_view_get_popup_menu_event (day_view);
+ if (event == NULL)
+ return;
+
+ cal_component_get_uid (event->comp, &uid);
+ cal_client_remove_object (day_view->client, uid);
+}
+
+static void
+e_day_view_on_copy (GtkWidget *widget, gpointer data)
+{
+ EDayView *day_view;
+ EDayViewEvent *event;
+ char *comp_str;
+
+ day_view = E_DAY_VIEW (data);
+
+ event = e_day_view_get_popup_menu_event (day_view);
+ if (event == NULL)
+ return;
+
+ comp_str = cal_component_get_as_string (event->comp);
+ if (day_view->clipboard_selection)
+ g_free (day_view->clipboard_selection);
+ day_view->clipboard_selection = comp_str;
+
+ gtk_selection_owner_set (day_view->invisible, clipboard_atom, GDK_CURRENT_TIME);
+}
+
+static void
+e_day_view_on_paste (GtkWidget *widget, gpointer data)
+{
+ EDayView *day_view = E_DAY_VIEW (data);
+
+ gtk_selection_convert (day_view->invisible,
+ clipboard_atom,
+ GDK_SELECTION_TYPE_STRING,
+ GDK_CURRENT_TIME);
+}
static void
e_day_view_on_schedule_meet (GtkWidget *widget, gpointer data)
@@ -6462,8 +6521,4 @@ static void selection_received (GtkWidget *invisible,
selection_data->type != GDK_SELECTION_TYPE_STRING) {
return;
}
-
- if (day_view->clipboard_selection != NULL)
- g_free (day_view->clipboard_selection);
- day_view->clipboard_selection = g_strdup ((gchar *) selection_data->data);
}