From 68a053e3d3626de202240e9f9344e4d3afe78246 Mon Sep 17 00:00:00 2001 From: Kidd Wang Date: Mon, 29 Dec 2003 09:58:32 +0000 Subject: add a menu item for "open appointment". 2003-12-29 Kidd Wang * 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 --- calendar/gui/calendar-commands.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'calendar/gui/calendar-commands.c') diff --git a/calendar/gui/calendar-commands.c b/calendar/gui/calendar-commands.c index c03b722de9..9127ab8d84 100644 --- a/calendar/gui/calendar-commands.c +++ b/calendar/gui/calendar-commands.c @@ -71,6 +71,17 @@ typedef struct { guint taskpad_focused : 1; } FocusData; +static void +file_open_event_cb (BonoboUIComponent *uic, gpointer data, const char *path) +{ + GnomeCalendar *gcal; + + gcal = GNOME_CALENDAR (data); + + e_calendar_view_open_event (gnome_calendar_get_current_view_widget (gcal)); +} + + /* Prints the calendar at its current view and time range */ static void print (GnomeCalendar *gcal, gboolean preview) @@ -532,6 +543,9 @@ calendar_control_sensitize_calendar_commands (BonoboControl *control, GnomeCalen read_only = TRUE; } + bonobo_ui_component_set_prop (uic, "/commands/EventOpen", "sensitive", + n_selected == 0 || read_only ? "0" : "1", + NULL); bonobo_ui_component_set_prop (uic, "/commands/Cut", "sensitive", n_selected == 0 || read_only ? "0" : "1", NULL); @@ -685,6 +699,7 @@ gcal_taskpad_focus_change_cb (GnomeCalendar *gcal, gboolean in, gpointer data) static BonoboUIVerb verbs [] = { + BONOBO_UI_VERB ("EventOpen", file_open_event_cb), BONOBO_UI_VERB ("CalendarPrint", file_print_cb), BONOBO_UI_VERB ("CalendarPrintPreview", file_print_preview_cb), -- cgit v1.2.3