diff options
author | Harish Krishnaswamy <kharish@src.gnome.org> | 2004-11-25 22:51:18 +0800 |
---|---|---|
committer | Harish Krishnaswamy <kharish@src.gnome.org> | 2004-11-25 22:51:18 +0800 |
commit | 28009dd47c5a879ec598cc70021ab9e95694f3d9 (patch) | |
tree | e25c1d8064ae9271a51b8a5b5ad9daa538bed9c9 | |
parent | 94cc53a7057dec2a655102268772b73efe32384e (diff) | |
download | gsoc2013-evolution-28009dd47c5a879ec598cc70021ab9e95694f3d9.tar.gz gsoc2013-evolution-28009dd47c5a879ec598cc70021ab9e95694f3d9.tar.zst gsoc2013-evolution-28009dd47c5a879ec598cc70021ab9e95694f3d9.zip |
Evo UI Hackfest : harish
* gui/calendar-component.c:
(new_calendar_cb), (edit_calendar_cb): Use modified_setup_edit_calendar call.
(popup_event_cb): If source is null (Rt click on a source group), show the new
calendar popup menu item. Else, do not show the new calendar option.
* gui/dialogs/calendar-setup.[ch] (eccp_get_source_type): Compare the
source_groups by their uid and not the pointers, so that the correct option
is activated on the combo box.
(calendar_setup_edit_calendar) : add a source_group parameter to the function.
(calendar_setup_new_calendar): Use modified signature of the above function.
* gui/e-calendar-view.c (on_edit_appointment): check the icalcomponent
to see if it is a meeting and set the argument to e_calendar_view_edit_appointment
correctly.
svn path=/trunk/; revision=27991
-rw-r--r-- | calendar/ChangeLog | 15 | ||||
-rw-r--r-- | calendar/gui/calendar-component.c | 19 | ||||
-rw-r--r-- | calendar/gui/dialogs/calendar-setup.c | 8 | ||||
-rw-r--r-- | calendar/gui/dialogs/calendar-setup.h | 2 | ||||
-rw-r--r-- | calendar/gui/e-calendar-view.c | 3 |
5 files changed, 38 insertions, 9 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index e13531cd8f..566e77b4a9 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,18 @@ +2004-11-25 Harish Krishnaswamy <kharish@novell.com> + + * gui/calendar-component.c: + (new_calendar_cb), (edit_calendar_cb): Use modified_setup_edit_calendar call. + (popup_event_cb): If source is null (Rt click on a source group), show the new + calendar popup menu item. Else, do not show the new calendar option. + * gui/dialogs/calendar-setup.[ch] (eccp_get_source_type): Compare the + source_groups by their uid and not the pointers, so that the correct option + is activated on the combo box. + (calendar_setup_edit_calendar) : add a source_group parameter to the function. + (calendar_setup_new_calendar): Use modified signature of the above function. + * gui/e-calendar-view.c (on_edit_appointment): check the icalcomponent + to see if it is a meeting and set the argument to e_calendar_view_edit_appointment + correctly. + 2004-11-25 Chenthill Palanisamy <pchenthill@novell.com> * gui/dialogs/event-deitor.c (show_meeting): removed the 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); diff --git a/calendar/gui/dialogs/calendar-setup.c b/calendar/gui/dialogs/calendar-setup.c index 1996cc6db1..f848504981 100644 --- a/calendar/gui/dialogs/calendar-setup.c +++ b/calendar/gui/dialogs/calendar-setup.c @@ -198,7 +198,7 @@ eccp_get_source_type (EConfig *ec, EConfigItem *item, GtkWidget *parent, GtkWidg gtk_list_store_append (store, &iter); gtk_list_store_set (store, &iter, 0, e_source_group_peek_name (group), 1, group, -1); - if (sdialog->source_group == group) + if (!strcmp (e_source_group_peek_uid (sdialog->source_group), e_source_group_peek_uid (group))) active = i; i++; } @@ -347,7 +347,7 @@ static ECalConfigItem ectp_items[] = { * Show calendar properties for @source. **/ void -calendar_setup_edit_calendar (struct _GtkWindow *parent, ESource *source) +calendar_setup_edit_calendar (struct _GtkWindow *parent, ESource *source, ESourceGroup *group) { CalendarSourceDialog *sdialog = g_new0 (CalendarSourceDialog, 1); char *xml; @@ -380,6 +380,8 @@ calendar_setup_edit_calendar (struct _GtkWindow *parent, ESource *source) sdialog->source_group = (ESourceGroup *)sdialog->menu_source_groups->data; g_object_unref (gconf); + if (group) + sdialog->source_group = (ESourceGroup *)group; } /* HACK: doesn't work if you don't do this */ @@ -407,7 +409,7 @@ calendar_setup_edit_calendar (struct _GtkWindow *parent, ESource *source) void calendar_setup_new_calendar (struct _GtkWindow *parent) { - calendar_setup_edit_calendar (parent, NULL); + calendar_setup_edit_calendar (parent, NULL, NULL); } void diff --git a/calendar/gui/dialogs/calendar-setup.h b/calendar/gui/dialogs/calendar-setup.h index f0e1a04ceb..3e266df93c 100644 --- a/calendar/gui/dialogs/calendar-setup.h +++ b/calendar/gui/dialogs/calendar-setup.h @@ -30,7 +30,7 @@ extern "C" { #pragma } #endif -void calendar_setup_edit_calendar (struct _GtkWindow *parent, struct _ESource *source); +void calendar_setup_edit_calendar (struct _GtkWindow *parent, struct _ESource *source, struct _ESourceGroup *group); void calendar_setup_new_calendar (struct _GtkWindow *parent); void calendar_setup_edit_task_list (struct _GtkWindow *parent, struct _ESource *source); diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c index c831711779..c35dbd95fe 100644 --- a/calendar/gui/e-calendar-view.c +++ b/calendar/gui/e-calendar-view.c @@ -995,7 +995,8 @@ on_edit_appointment (EPopup *ep, EPopupItem *pitem, void *data) if (event) e_calendar_view_edit_appointment (cal_view, event->comp_data->client, - event->comp_data->icalcomp, FALSE); + event->comp_data->icalcomp, + icalcomponent_get_first_property(event->comp_data->icalcomp, ICAL_ATTENDEE_PROPERTY)); g_list_free (selected); } |