From 6f42e1922604ce384de19f6fe71dc73b184892e1 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Tue, 28 Oct 2003 18:45:49 +0000 Subject: connect to "fill_popup_menu" on the ESourceSelector. 2003-10-28 Rodrigo Moya * gui/calendar-component.c (impl_createControls): connect to "fill_popup_menu" on the ESourceSelector. (fill_popup_menu_callback): add popup menu items here. (add_popup_menu_item): new function to add items to the popup menu. (new_calendar_cb): callbacks for the popup menu items. svn path=/trunk/; revision=23108 --- calendar/ChangeLog | 1 + calendar/gui/calendar-component.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 75873a6d39..9ba69e517f 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -5,6 +5,7 @@ (fill_popup_menu_callback): add popup menu items here. (add_popup_menu_item): new function to add items to the popup menu. + (new_calendar_cb): callbacks for the popup menu items. 2003-10-28 Rodrigo Moya diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c index 82332073ad..a64d0bc339 100644 --- a/calendar/gui/calendar-component.c +++ b/calendar/gui/calendar-component.c @@ -30,6 +30,7 @@ #include "calendar-commands.h" #include "gnome-cal.h" #include "migration.h" +#include "dialogs/new-calendar.h" #include "widgets/misc/e-source-selector.h" @@ -145,10 +146,16 @@ add_popup_menu_item (GtkMenu *menu, const char *label, const char *pixmap, gtk_widget_show (item); } +static void +new_calendar_cb (GtkWidget *widget, ESourceSelector *selector) +{ + new_calendar_dialog (GTK_WINDOW (gtk_widget_get_toplevel (widget))); +} + static void fill_popup_menu_callback (ESourceSelector *selector, GtkMenu *menu, CalendarComponent *comp) { - add_popup_menu_item (menu, _("_New Calendar"), NULL, NULL, selector); + add_popup_menu_item (menu, _("_New Calendar"), NULL, G_CALLBACK (new_calendar_cb), selector); } static void -- cgit