diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-05-22 01:06:45 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-05-22 01:06:45 +0800 |
commit | 84c2e3735ce6e4df88142e86446f9179b6e341e4 (patch) | |
tree | 7e6d2043810d0c37ee2581f0783095aefdec1e1b /plugins | |
parent | aaa180af5abef44bb3e3d3c3c5968ca191a3dbda (diff) | |
parent | 2914345f9672559fed0ad88d2841ea4801d8d244 (diff) | |
download | gsoc2013-evolution-84c2e3735ce6e4df88142e86446f9179b6e341e4.tar.gz gsoc2013-evolution-84c2e3735ce6e4df88142e86446f9179b6e341e4.tar.zst gsoc2013-evolution-84c2e3735ce6e4df88142e86446f9179b6e341e4.zip |
Merge branch 'master' into kill-bonobo
Conflicts:
addressbook/gui/component/addressbook-view.c
addressbook/gui/component/component-factory.c
addressbook/gui/component/eab-composer-util.h
addressbook/gui/widgets/Makefile.am
addressbook/gui/widgets/e-addressbook-model.c
addressbook/gui/widgets/e-addressbook-view.c
addressbook/gui/widgets/e-addressbook-view.h
addressbook/gui/widgets/eab-gui-util.c
addressbook/gui/widgets/eab-gui-util.h
addressbook/gui/widgets/eab-menu.h
addressbook/gui/widgets/eab-popup.h
calendar/gui/calendar-component.c
calendar/gui/e-cal-event.h
calendar/gui/e-calendar-table.c
calendar/gui/e-calendar-view.c
calendar/gui/e-calendar-view.h
calendar/gui/e-memo-table.c
calendar/gui/memos-component.c
calendar/gui/tasks-component.c
composer/e-composer-header-table.c
composer/e-composer-private.h
composer/e-msg-composer.c
composer/e-msg-composer.h
composer/evolution-composer.ui
configure.ac
data/icons/Makefile.am
em-format/em-format.c
em-format/em-format.h
mail/Makefile.am
mail/e-mail-shell-migrate.c
mail/e-searching-tokenizer.c
mail/e-searching-tokenizer.h
mail/em-composer-utils.c
mail/em-composer-utils.h
mail/em-folder-browser.c
mail/em-folder-tree-model.c
mail/em-folder-view.c
mail/em-format-html-display.c
mail/em-format-html-display.h
mail/em-mailer-prefs.c
mail/em-message-browser.c
plugins/vcard-inline/Makefile.am
plugins/vcard-inline/org-gnome-vcard-inline.eplug.xml
plugins/vcard-inline/vcard-inline.c
shell/e-component-registry.h
shell/e-shell-window.c
shell/es-menu.h
widgets/misc/e-filter-bar.c
widgets/misc/e-filter-bar.h
widgets/misc/e-search-bar.c
widgets/misc/e-search-bar.h
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/groupwise-features/Makefile.am | 2 | ||||
-rw-r--r-- | plugins/groupwise-features/org-gnome-groupwise-features.eplug.xml | 5 | ||||
-rw-r--r-- | plugins/groupwise-features/org-gnome-shared-folder.error.xml | 18 | ||||
-rw-r--r-- | plugins/groupwise-features/process-meeting.c | 264 | ||||
-rw-r--r-- | plugins/itip-formatter/itip-formatter.c | 19 | ||||
-rw-r--r-- | plugins/vcard-inline/org-gnome-vcard-inline.eplug.xml | 4 | ||||
-rw-r--r-- | plugins/vcard-inline/vcard-inline.c | 7 |
7 files changed, 291 insertions, 28 deletions
diff --git a/plugins/groupwise-features/Makefile.am b/plugins/groupwise-features/Makefile.am index 42b68c58ec..53b0ab6948 100644 --- a/plugins/groupwise-features/Makefile.am +++ b/plugins/groupwise-features/Makefile.am @@ -59,6 +59,7 @@ glade_DATA = \ error_DATA = \ org-gnome-shared-folder.error \ + org-gnome-process-meeting.error \ org-gnome-proxy.error \ org-gnome-proxy-login.error \ org-gnome-mail-retract.error @@ -72,6 +73,7 @@ EXTRA_DIST = \ org-gnome-compose-send-options.xml \ org-gnome-groupwise-features.eplug.xml \ org-gnome-shared-folder.error.xml \ + org-gnome-process-meeting.error.xml \ org-gnome-proxy.error.xml \ org-gnome-proxy-login.error.xml \ org-gnome-mail-retract.error.xml diff --git a/plugins/groupwise-features/org-gnome-groupwise-features.eplug.xml b/plugins/groupwise-features/org-gnome-groupwise-features.eplug.xml index 7a707fdcc9..226872b6a8 100644 --- a/plugins/groupwise-features/org-gnome-groupwise-features.eplug.xml +++ b/plugins/groupwise-features/org-gnome-groupwise-features.eplug.xml @@ -92,6 +92,11 @@ </menu> </hook> + <hook class="org.gnome.evolution.calendar.popup:1.0"> + <menu id="org.gnome.evolution.calendar.view.popup" target="select" factory = "org_gnome_retract_resend"> + </menu> + </hook> + <hook class="org.gnome.evolution.mail.popup:1.0"> <menu id="org.gnome.evolution.mail.folderview.popup" target="select" factory = "org_gnome_retract_message"> diff --git a/plugins/groupwise-features/org-gnome-shared-folder.error.xml b/plugins/groupwise-features/org-gnome-shared-folder.error.xml index ca63ad80aa..8ef056728b 100644 --- a/plugins/groupwise-features/org-gnome-shared-folder.error.xml +++ b/plugins/groupwise-features/org-gnome-shared-folder.error.xml @@ -15,23 +15,5 @@ You cannot share this folder with the specified user "{0}" </_secondary> </error> -<error id="recurrence-accept" type="question" default="GTK_RESPONSE_YES"> -<_primary>This is a recurring meeting</_primary> -<!--Translators: "it" is a "recurring meeting" (string refers to "This is a recurring meeting") --> -<_secondary>Would you like to accept it?</_secondary> - <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/> - <button label="This instance" response="GTK_RESPONSE_NO"/> - <button label="All instances" response="GTK_RESPONSE_YES"/> -</error> - -<error id="recurrence-decline" type="question" default="GTK_RESPONSE_YES"> -<_primary>This is a recurring meeting</_primary> -<!--Translators: "it" is a "recurring meeting" (string refers to "This is a recurring meeting") --> -<_secondary>Would you like to decline it?</_secondary> - <button stock="gtk-cancel" response="GTK_RESPONSE_CANCEL"/> - <button label="This instance" response="GTK_RESPONSE_NO"/> - <button label="All instances" response="GTK_RESPONSE_YES"/> -</error> - </error-list> diff --git a/plugins/groupwise-features/process-meeting.c b/plugins/groupwise-features/process-meeting.c index 412502f0b3..bc046c0a05 100644 --- a/plugins/groupwise-features/process-meeting.c +++ b/plugins/groupwise-features/process-meeting.c @@ -43,9 +43,11 @@ typedef struct { ECalendarView *c_view; void org_gnome_accept(EPlugin *ep, ECalPopupTargetSelect *target); +void org_gnome_retract_resend (EPlugin *ep, ECalPopupTargetSelect *target); static void on_accept_meeting (EPopup *ep, EPopupItem *pitem, void *data); static void on_accept_meeting_tentative (EPopup *ep, EPopupItem *pitem, void *data); static void on_decline_meeting (EPopup *ep, EPopupItem *pitem, void *data); +static void on_resend_meeting (EPopup *ep, EPopupItem *pitem, void *data); static EPopupItem popup_items[] = { { E_POPUP_ITEM, "41.accept", N_("Accept"), on_accept_meeting, NULL, GTK_STOCK_APPLY, 0, E_CAL_POPUP_SELECT_NOTEDITING | E_CAL_POPUP_SELECT_MEETING | E_CAL_POPUP_SELECT_ACCEPTABLE}, @@ -227,9 +229,9 @@ process_meeting (ECalendarView *cal_view, icalparameter_partstat status) const char *msg; if (status == ICAL_PARTSTAT_ACCEPTED || status == ICAL_PARTSTAT_TENTATIVE) - msg = "org.gnome.evolution.mail_shared_folder:recurrence-accept"; + msg = "org.gnome.evolution.process_meeting:recurrence-accept"; else - msg = "org.gnome.evolution.mail_shared_folder:recurrence-decline"; + msg = "org.gnome.evolution.process_meeting:recurrence-decline"; response = e_error_run (NULL, msg, NULL); if (response == GTK_RESPONSE_YES) { @@ -282,3 +284,261 @@ on_decline_meeting (EPopup *ep, EPopupItem *pitem, void *data) process_meeting (cal_view, ICAL_PARTSTAT_DECLINED); } + +static gboolean +is_meeting_owner (ECalComponent *comp, ECal *client) +{ + ECalComponentOrganizer org; + char *email = NULL; + const char *strip = NULL; + gboolean ret_val = FALSE; + + if (!(e_cal_component_has_attendees (comp) && + e_cal_get_save_schedules (client))) + return ret_val; + + e_cal_component_get_organizer (comp, &org); + strip = itip_strip_mailto (org.value); + + if (e_cal_get_cal_address (client, &email, NULL) && !g_ascii_strcasecmp (email, strip)) { + ret_val = TRUE; + } + + if (!ret_val) + ret_val = e_account_list_find(itip_addresses_get(), E_ACCOUNT_FIND_ID_ADDRESS, strip) != NULL; + + g_free (email); + return ret_val; +} + + +typedef struct { + ECal *client; + ECalComponent *comp; + CalObjModType mod; +} ThreadData; + +static EPopupItem retract_popup_items[] = { +{ E_POPUP_ITEM, "49.resend", N_("Rese_nd Meeting..."), on_resend_meeting, NULL, GTK_STOCK_EDIT, 0, E_CAL_POPUP_SELECT_NOTEDITING | E_CAL_POPUP_SELECT_MEETING} +}; + +void +org_gnome_retract_resend (EPlugin *ep, ECalPopupTargetSelect *target) +{ + GSList *menus = NULL; + GList *selected; + int i = 0; + static int first = 0; + const char *uri = NULL; + ECalendarView *cal_view = E_CALENDAR_VIEW (target->target.widget); + ECalComponent *comp = NULL; + ECalendarViewEvent *event = NULL; + + c_view = cal_view; + selected = e_calendar_view_get_selected_events (cal_view); + if (selected) { + event = (ECalendarViewEvent *) selected->data; + + uri = e_cal_get_uri (event->comp_data->client); + } else + return; + + if (!uri) + return; + + if (! g_strrstr (uri, "groupwise://")) + return ; + + comp = e_cal_component_new (); + e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp)); + + if (!is_meeting_owner (comp, event->comp_data->client)) { + g_object_unref (comp); + return; + } + + /* for translation*/ + if (!first) { + retract_popup_items[0].label = _(retract_popup_items[0].label); + } + + first++; + + for (i = 0; i < sizeof (retract_popup_items) / sizeof (retract_popup_items[0]); i++) + menus = g_slist_prepend (menus, &retract_popup_items[i]); + + e_popup_add_items (target->target.popup, menus, NULL, popup_free, NULL); + + g_object_unref (comp); +} + +static void +add_retract_data (ECalComponent *comp, const char *retract_comment, CalObjModType mod) +{ + icalcomponent *icalcomp = NULL; + icalproperty *icalprop = NULL; + + icalcomp = e_cal_component_get_icalcomponent (comp); + if (retract_comment && *retract_comment) + icalprop = icalproperty_new_x (retract_comment); + else + icalprop = icalproperty_new_x ("0"); + icalproperty_set_x_name (icalprop, "X-EVOLUTION-RETRACT-COMMENT"); + icalcomponent_add_property (icalcomp, icalprop); + + if (mod == CALOBJ_MOD_ALL) + icalprop = icalproperty_new_x ("All"); + else + icalprop = icalproperty_new_x ("This"); + icalproperty_set_x_name (icalprop, "X-EVOLUTION-RECUR-MOD"); + icalcomponent_add_property (icalcomp, icalprop); +} + +static void +free_thread_data (ThreadData *data) +{ + if (data == NULL) + return; + + if (data->client) + g_object_unref (data->client); + + if (data->comp) + g_object_unref (data->comp); + + g_free (data); +} + +static gpointer +retract_object (gpointer val) +{ + ThreadData *data = val; + icalcomponent *icalcomp = NULL, *mod_comp = NULL; + GList *users = NULL; + char *rid = NULL; + const char *uid; + GError *error = NULL; + + add_retract_data (data->comp, NULL, data->mod); + + icalcomp = e_cal_component_get_icalcomponent (data->comp); + icalcomponent_set_method (icalcomp, ICAL_METHOD_CANCEL); + + if (!e_cal_send_objects (data->client, icalcomp, &users, + &mod_comp, &error)) { + /* FIXME report error */ + g_warning ("Unable to retract the meeting \n"); + g_clear_error (&error); + return GINT_TO_POINTER (1); + } + + if (mod_comp) + icalcomponent_free (mod_comp); + + if (users) { + g_list_foreach (users, (GFunc) g_free, NULL); + g_list_free (users); + } + + rid = e_cal_component_get_recurid_as_string (data->comp); + e_cal_component_get_uid (data->comp, &uid); + + if (!e_cal_remove_object_with_mod (data->client, uid, + rid, data->mod, &error)) { + g_warning ("Unable to remove the item \n"); + g_clear_error (&error); + return GINT_TO_POINTER (1); + } + g_free (rid); + + free_thread_data (data) ; + return GINT_TO_POINTER (0); +} + +static void +object_created_cb (CompEditor *ce, gpointer data) +{ + GThread *thread = NULL; + int response; + GError *error = NULL; + + gtk_widget_hide (GTK_WIDGET (ce)); + + response = e_error_run (NULL, "org.gnome.evolution.process_meeting:resend-retract", NULL); + if (response == GTK_RESPONSE_NO) { + free_thread_data (data) ; + return; + } + + thread = g_thread_create ((GThreadFunc) retract_object, data , FALSE, &error); + if (!thread) { + g_warning (G_STRLOC ": %s", error->message); + g_error_free (error); + } +} + +static void +on_resend_meeting (EPopup *ep, EPopupItem *pitem, void *data) +{ + ECalendarView *cal_view = c_view; + GList *selected; + + selected = e_calendar_view_get_selected_events (cal_view); + if (selected) { + ECalendarViewEvent *event = (ECalendarViewEvent *) selected->data; + ECalComponent *comp = e_cal_component_new (); + ECalComponent *new_comp = NULL; + gboolean recurring = FALSE; + CalObjModType mod = CALOBJ_MOD_THIS; + ThreadData *data = NULL; + gint response; + const char *msg; + /* inserting the boolean to share the code between resend and retract */ + gboolean resend = TRUE; + + e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp)); + if (e_cal_component_has_recurrences (comp) || e_cal_component_is_instance (comp)) + recurring = TRUE; + + if (recurring == TRUE) + msg = "org.gnome.evolution.process_meeting:resend-recurrence"; + else + msg = "org.gnome.evolution.process_meeting:resend"; + + response = e_error_run (NULL, msg, NULL); + if (response == GTK_RESPONSE_YES) { + mod = CALOBJ_MOD_ALL; + } else if (response == GTK_RESPONSE_CANCEL) { + g_object_unref (comp); + return; + } + + data = g_new0 (ThreadData, 1); + data->client = g_object_ref (event->comp_data->client); + data->comp = comp; + data->mod = mod; + + if (resend) + { + guint flags = 0; + char *new_uid = NULL; + CompEditor *ce; + icalcomponent *icalcomp; + + flags |= COMP_EDITOR_NEW_ITEM; + flags |= COMP_EDITOR_MEETING; + flags |= COMP_EDITOR_USER_ORG; + + new_comp = e_cal_component_clone (comp); + new_uid = e_cal_component_gen_uid (); + e_cal_component_set_recurid (new_comp, NULL); + e_cal_component_set_uid (new_comp, new_uid); + icalcomp = icalcomponent_new_clone (e_cal_component_get_icalcomponent (new_comp)); + ce = e_calendar_view_open_event_with_flags (cal_view, data->client, icalcomp, flags); + + g_signal_connect (ce, "object_created", G_CALLBACK (object_created_cb), data); + g_object_unref (new_comp); + g_free (new_uid); + } + } +} diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index 6eebfdee92..04049ef6d5 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -38,6 +38,7 @@ #include <camel/camel-multipart.h> #include <camel/camel-service.h> #include <camel/camel-store.h> +#include <camel/camel-db.h> #include <libecal/e-cal.h> #include <libecal/e-cal-time-util.h> #include <libedataserverui/e-source-selector.h> @@ -831,9 +832,12 @@ find_server (struct _itip_puri *pitip, ECalComponent *comp) } } - if (current_source) + if (current_source) { l = sources_conflict; - else { + + pitip->progress_info_id = itip_view_add_lower_info_item (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_PROGRESS, + _("Opening the calendar. Please wait..")); + } else { pitip->progress_info_id = itip_view_add_lower_info_item (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_PROGRESS, _("Searching for an existing version of this appointment")); @@ -1876,6 +1880,7 @@ view_response_cb (GtkWidget *widget, ItipViewResponse response, gpointer data) camel_message_info_free (mi); if (tag) { int i = 0, count; + GSList *list = NULL; count = camel_folder_summary_count (pitip->folder->summary); for (i = 0; i < count; i++) { @@ -1884,12 +1889,18 @@ view_response_cb (GtkWidget *widget, ItipViewResponse response, gpointer data) continue; camel_message_info_ref (mi); if ( camel_message_info_user_tag (mi, "recurrence-key") && g_str_equal (camel_message_info_user_tag (mi, "recurrence-key"), tag)) { + camel_folder_summary_remove_uid_fast (pitip->folder->summary, (char *)(mi->uid)); + camel_folder_change_info_remove_uid (changes, (char *) mi->uid); + list = g_slist_prepend (list, (gpointer) mi->uid); - camel_folder_summary_remove_uid(pitip->folder->summary, (char *)(mi->uid)); - camel_folder_change_info_remove_uid (changes, (char *)(mi->uid)); + /* step back once to have the right index */ + count--; + i--; } camel_message_info_free (mi); } + camel_db_delete_uids (pitip->folder->parent_store->cdb_w, pitip->folder->full_name, list, NULL); + g_slist_free (list); } } else { /* Either not a recurring appointment or "apply-to-all" is not selected. So just delete this instance alone */ diff --git a/plugins/vcard-inline/org-gnome-vcard-inline.eplug.xml b/plugins/vcard-inline/org-gnome-vcard-inline.eplug.xml index c54587d369..f9b2c1693e 100644 --- a/plugins/vcard-inline/org-gnome-vcard-inline.eplug.xml +++ b/plugins/vcard-inline/org-gnome-vcard-inline.eplug.xml @@ -14,11 +14,11 @@ <hook class="org.gnome.evolution.mail.format:1.0"> <group id="EMFormatHTMLDisplay"> <item - mime_type="text/vCard" + mime_type="text/vcard" format="org_gnome_vcard_inline_format" flags="inline_disposition"/> <item - mime_type="text/x-vCard" + mime_type="text/x-vcard" format="org_gnome_vcard_inline_format" flags="inline_disposition"/> </group> diff --git a/plugins/vcard-inline/vcard-inline.c b/plugins/vcard-inline/vcard-inline.c index 211eb69c2d..0e10b3a82a 100644 --- a/plugins/vcard-inline/vcard-inline.c +++ b/plugins/vcard-inline/vcard-inline.c @@ -224,8 +224,11 @@ org_gnome_vcard_inline_embed (EMFormatHTML *format, } else if (length > 2) { gchar *text; - text = g_strdup_printf ( - _("There are %d other contacts."), length - 1); + /* Translators: This will always be two or more. */ + text = g_strdup_printf (ngettext ( + "There is %d other contact.", + "There are %d other contacts.", + length - 1), length - 1); gtk_label_set_text (GTK_LABEL (widget), text); gtk_widget_show (widget); g_free (text); |