aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/calendar-component.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/calendar-component.c')
-rw-r--r--calendar/gui/calendar-component.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c
index 70b9ccd22c..5362abbad8 100644
--- a/calendar/gui/calendar-component.c
+++ b/calendar/gui/calendar-component.c
@@ -363,7 +363,7 @@ delete_calendar_cb (EPopup *ep, EPopupItem *pitem, void *data)
static void
new_calendar_cb (EPopup *ep, EPopupItem *pitem, void *data)
{
- calendar_setup_new_calendar (GTK_WINDOW (gtk_widget_get_toplevel(ep->target->widget)));
+ calendar_setup_edit_calendar (GTK_WINDOW (gtk_widget_get_toplevel(ep->target->widget)), NULL, pitem->user_data);
}
static void
@@ -376,7 +376,7 @@ edit_calendar_cb (EPopup *ep, EPopupItem *pitem, void *data)
if (!selected_source)
return;
- calendar_setup_edit_calendar (GTK_WINDOW (gtk_widget_get_toplevel(ep->target->widget)), selected_source);
+ calendar_setup_edit_calendar (GTK_WINDOW (gtk_widget_get_toplevel(ep->target->widget)), selected_source, NULL);
}
static EPopupItem ecc_source_popups[] = {
@@ -412,8 +412,19 @@ popup_event_cb(ESourceSelector *selector, ESource *insource, GdkEventButton *eve
t = e_cal_popup_target_new_source(ep, selector);
t->target.widget = (GtkWidget *)component_view->calendar;
- for (i=0;i<sizeof(ecc_source_popups)/sizeof(ecc_source_popups[0]);i++)
- menus = g_slist_prepend(menus, &ecc_source_popups[i]);
+ if (!insource) {
+
+ ESourceGroup *group;
+
+ group = e_source_selector_get_primary_source_group (selector);
+ g_object_ref (group);
+ ((EPopupItem) ecc_source_popups [0]).user_data = group;
+ menus = g_slist_prepend (menus, &ecc_source_popups [0]);
+ }
+ else {
+ for (i=1;i<sizeof(ecc_source_popups)/sizeof(ecc_source_popups[0]);i++)
+ menus = g_slist_prepend(menus, &ecc_source_popups[i]);
+ }
e_popup_add_items((EPopup *)ep, menus, ecc_source_popup_free, component_view);