aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-calendar-view.c
diff options
context:
space:
mode:
authorAndrew Wu <Yang.Wu@sun.com>2004-01-09 15:48:31 +0800
committerHarry Lu <haip@src.gnome.org>2004-01-09 15:48:31 +0800
commit8f04fc1559807f287f20f6a10604dc16addfca5f (patch)
tree969aede90fbc199b1f17730c68e82db882c52e26 /calendar/gui/e-calendar-view.c
parent88ab6df1309919eaca6ce10106bae4cdb8b37525 (diff)
downloadgsoc2013-evolution-8f04fc1559807f287f20f6a10604dc16addfca5f.tar.gz
gsoc2013-evolution-8f04fc1559807f287f20f6a10604dc16addfca5f.tar.zst
gsoc2013-evolution-8f04fc1559807f287f20f6a10604dc16addfca5f.zip
add a new signal "event_move" and its key binding.
2004-01-09 Andrew Wu <Yang.Wu@sun.com> * gui/e-cal-view.c (e_calendar_view_class_init): add a new signal "event_move" and its key binding. * gui/e-cal-view.h: add a new type "ECalViewMoveDirection". add a new virtual method "event_move" for ECalView. * gui/e-day-view.c (e_day_view_event_move), (e_day_view_change_event_time): Use "Alt + Arrow" to move a selected event through time lines or different days. * gui/e-day-view.h: add a new property "last_edited_comp_string" for EWeekView. * gui/e-week-view.c (e_week_view_class_init), (e_week_view_init), (e_week_view_reshape_events), (e_week_view_event_move), (e_week_view_get_day_offset_of_event), (e_week_view_scroll_a_step), (e_week_view_change_event_time), (e_week_view_do_key_press), (e_week_view_move_selection_day), (e_week_view_get_adjust_days_for_move_up), (e_week_view_get_adjust_days_for_move_down), (e_week_view_get_adjust_days_for_move_left), (e_week_view_get_adjust_days_for_move_right): Use "Alt + Arrow" to move a selected event through different days. * gui/e-week-view.h: add a new property "last_edited_comp_string" for EWeekView. svn path=/trunk/; revision=24128
Diffstat (limited to 'calendar/gui/e-calendar-view.c')
-rw-r--r--calendar/gui/e-calendar-view.c71
1 files changed, 71 insertions, 0 deletions
diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c
index 1f65723d2b..1aade80154 100644
--- a/calendar/gui/e-calendar-view.c
+++ b/calendar/gui/e-calendar-view.c
@@ -97,6 +97,7 @@ enum {
EVENT_CHANGED,
EVENT_ADDED,
OPEN_EVENT,
+ EVENT_MOVE,
LAST_SIGNAL
};
@@ -166,6 +167,7 @@ e_calendar_view_class_init (ECalendarViewClass *klass)
klass->get_visible_time_range = NULL;
klass->update_query = NULL;
klass->open_event = e_calendar_view_open_event;
+ klass->event_move = NULL;
g_object_class_install_property (gobject_class, PROP_MODEL,
g_param_spec_object ("model", NULL, NULL, E_TYPE_CAL_MODEL,
@@ -227,6 +229,16 @@ e_calendar_view_class_init (ECalendarViewClass *klass)
G_TYPE_NONE, 1,
G_TYPE_POINTER);
+ e_calendar_view_signals [EVENT_MOVE] =
+ g_signal_new ("event_move",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+ G_STRUCT_OFFSET (ECalendarViewClass, event_move),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__INT,
+ G_TYPE_NONE, 1,
+ G_TYPE_INT);
+
/* clipboard atom */
if (!clipboard_atom)
clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE);
@@ -242,6 +254,48 @@ e_calendar_view_class_init (ECalendarViewClass *klass)
GDK_CONTROL_MASK,
"open_event", 0);
+ /* Alt+Arrow, move the editing event*/
+ gtk_binding_entry_add_signal (binding_set, GDK_Up,
+ GDK_MOD1_MASK,
+ "event_move", 1,
+ G_TYPE_ENUM,
+ E_CAL_VIEW_MOVE_UP);
+ gtk_binding_entry_add_signal (binding_set, GDK_KP_Up,
+ GDK_MOD1_MASK,
+ "event_move", 1,
+ G_TYPE_ENUM,
+ E_CAL_VIEW_MOVE_UP);
+ gtk_binding_entry_add_signal (binding_set, GDK_Down,
+ GDK_MOD1_MASK,
+ "event_move", 1,
+ G_TYPE_ENUM,
+ E_CAL_VIEW_MOVE_DOWN);
+ gtk_binding_entry_add_signal (binding_set, GDK_KP_Down,
+ GDK_MOD1_MASK,
+ "event_move", 1,
+ G_TYPE_ENUM,
+ E_CAL_VIEW_MOVE_DOWN);
+ gtk_binding_entry_add_signal (binding_set, GDK_Left,
+ GDK_MOD1_MASK,
+ "event_move", 1,
+ G_TYPE_ENUM,
+ E_CAL_VIEW_MOVE_LEFT);
+ gtk_binding_entry_add_signal (binding_set, GDK_KP_Left,
+ GDK_MOD1_MASK,
+ "event_move", 1,
+ G_TYPE_ENUM,
+ E_CAL_VIEW_MOVE_LEFT);
+ gtk_binding_entry_add_signal (binding_set, GDK_Right,
+ GDK_MOD1_MASK,
+ "event_move", 1,
+ G_TYPE_ENUM,
+ E_CAL_VIEW_MOVE_RIGHT);
+ gtk_binding_entry_add_signal (binding_set, GDK_KP_Right,
+ GDK_MOD1_MASK,
+ "event_move", 1,
+ G_TYPE_ENUM,
+ E_CAL_VIEW_MOVE_RIGHT);
+
/* init the accessibility support for e_day_view */
e_cal_view_a11y_init ();
}
@@ -1520,3 +1574,20 @@ e_calendar_view_edit_appointment (ECalendarView *cal_view,
comp_editor_focus (ce);
}
+
+void
+e_calendar_view_modify_and_send (ECalComponent *comp,
+ ECal *client,
+ CalObjModType mod,
+ GtkWindow *toplevel,
+ gboolean new)
+{
+ if (e_cal_modify_object (client, e_cal_component_get_icalcomponent (comp), mod, NULL)) {
+ if (itip_organizer_is_user (comp, client) &&
+ send_component_dialog (toplevel, client, comp, new)) {
+ itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp, client, NULL);
+ } else {
+ g_message (G_STRLOC ": Could not update the object!");
+ }
+ }
+}