diff options
author | Kidd Wang <kidd.wang@sun.com> | 2003-12-29 17:58:32 +0800 |
---|---|---|
committer | Harry Lu <haip@src.gnome.org> | 2003-12-29 17:58:32 +0800 |
commit | 68a053e3d3626de202240e9f9344e4d3afe78246 (patch) | |
tree | ad5aedc23ff1eb4f9a97ae0c1c785886d4495bb1 /calendar/gui/e-calendar-view.c | |
parent | 4d52f684219df276a621cf7a40fea3f3112c578b (diff) | |
download | gsoc2013-evolution-68a053e3d3626de202240e9f9344e4d3afe78246.tar.gz gsoc2013-evolution-68a053e3d3626de202240e9f9344e4d3afe78246.tar.zst gsoc2013-evolution-68a053e3d3626de202240e9f9344e4d3afe78246.zip |
add a menu item for "open appointment".
2003-12-29 Kidd Wang <kidd.wang@sun.com>
* gui/calendar-commands.c (file_open_event_cb): add a menu item
for "open appointment".
* gui/e-cal-view.[ch] (e_calendar_view_open_event): add a signal
"open_event" and bind it to "ctrl+o". When the signal is delivered,
a dialog will be opened to edit the selected event.
* gui/e-calendar-table.c (e_calendar_table_on_key_press): press "ctrl-o"
to open a dialog.
svn path=/trunk/; revision=24012
Diffstat (limited to 'calendar/gui/e-calendar-view.c')
-rw-r--r-- | calendar/gui/e-calendar-view.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c index ffaca9bedb..1f65723d2b 100644 --- a/calendar/gui/e-calendar-view.c +++ b/calendar/gui/e-calendar-view.c @@ -25,6 +25,8 @@ #include <string.h> #include <gtk/gtkimage.h> #include <gtk/gtkstock.h> +#include <gdk/gdkkeysyms.h> +#include <gtk/gtkbindings.h> #include <libgnome/gnome-i18n.h> #include <gal/util/e-util.h> #include "e-util/e-dialog-utils.h" @@ -94,6 +96,7 @@ enum { TIMEZONE_CHANGED, EVENT_CHANGED, EVENT_ADDED, + OPEN_EVENT, LAST_SIGNAL }; @@ -143,6 +146,8 @@ e_calendar_view_class_init (ECalendarViewClass *klass) GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass); + GtkBindingSet *binding_set; + parent_class = g_type_class_peek_parent (klass); /* Method override */ @@ -160,6 +165,7 @@ e_calendar_view_class_init (ECalendarViewClass *klass) klass->set_selected_time_range = NULL; klass->get_visible_time_range = NULL; klass->update_query = NULL; + klass->open_event = e_calendar_view_open_event; g_object_class_install_property (gobject_class, PROP_MODEL, g_param_spec_object ("model", NULL, NULL, E_TYPE_CAL_MODEL, @@ -202,6 +208,15 @@ e_calendar_view_class_init (ECalendarViewClass *klass) G_TYPE_NONE, 1, G_TYPE_POINTER); + e_calendar_view_signals[OPEN_EVENT] = + g_signal_new ("open_event", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (ECalendarViewClass, open_event), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + e_calendar_view_signals[EVENT_ADDED] = g_signal_new ("event_added", G_TYPE_FROM_CLASS (object_class), @@ -216,6 +231,17 @@ e_calendar_view_class_init (ECalendarViewClass *klass) if (!clipboard_atom) clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE); + + /* + * Key bindings + */ + + binding_set = gtk_binding_set_by_class (klass); + + gtk_binding_entry_add_signal (binding_set, GDK_o, + GDK_CONTROL_MASK, + "open_event", 0); + /* init the accessibility support for e_day_view */ e_cal_view_a11y_init (); } @@ -1333,6 +1359,23 @@ e_calendar_view_create_popup_menu (ECalendarView *cal_view) return popup; } +void +e_calendar_view_open_event (ECalendarView *cal_view) +{ + GList *selected; + + selected = e_calendar_view_get_selected_events (cal_view); + if (selected) { + ECalendarViewEvent *event = (ECalendarViewEvent *) selected->data; + + if (event) + e_calendar_view_edit_appointment (cal_view, event->comp_data->client, + event->comp_data->icalcomp, FALSE); + + g_list_free (selected); + } +} + /** * e_calendar_view_new_appointment_for * @cal_view: A calendar view. |