From 831d6dca44ecaa272b4ef5e1cfc29578e7ba5435 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 30 Oct 2010 14:23:01 -0400 Subject: Kill mail_append_mail(). Use e_mail_folder_append_message() instead. --- plugins/templates/templates.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c index 815ee69882..bca45f040f 100644 --- a/plugins/templates/templates.c +++ b/plugins/templates/templates.c @@ -31,6 +31,7 @@ #include +#include #include #include #include @@ -710,7 +711,10 @@ got_message_draft_cb (EMsgComposer *composer, camel_message_info_set_flags ( info, CAMEL_MESSAGE_SEEN | CAMEL_MESSAGE_DRAFT, ~0); - mail_append_mail (folder, message, info, NULL, composer); + /* FIXME No async callback, so... hope for the best? */ + e_mail_folder_append_message ( + folder, message, info, G_PRIORITY_DEFAULT, + NULL, (GAsyncReadyCallback) NULL, NULL); g_object_unref (message); } -- cgit v1.2.3 From 7d20b8fd5fd28a90852c737f35cef7ba03a2c116 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 1 Nov 2010 14:44:23 -0400 Subject: Utilize the new ESourceSelector:primary-selection property. --- plugins/contacts-map/contacts-map.c | 2 +- plugins/save-calendar/csv-format.c | 2 +- plugins/save-calendar/ical-format.c | 2 +- plugins/save-calendar/rdf-format.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins') diff --git a/plugins/contacts-map/contacts-map.c b/plugins/contacts-map/contacts-map.c index bb46be65e6..24297e0243 100644 --- a/plugins/contacts-map/contacts-map.c +++ b/plugins/contacts-map/contacts-map.c @@ -112,7 +112,7 @@ show_map_general (ESourceSelector *selector) gdouble *min_lng = NULL; gdouble *max_lng = NULL; - primary_source = (ESource*)e_source_selector_peek_primary_selection (selector); + primary_source = (ESource*)e_source_selector_get_primary_selection (selector); uri = e_source_get_uri (primary_source); book = e_book_new_from_uri (uri, NULL); diff --git a/plugins/save-calendar/csv-format.c b/plugins/save-calendar/csv-format.c index 58dd9ac5af..6b147d88a2 100644 --- a/plugins/save-calendar/csv-format.c +++ b/plugins/save-calendar/csv-format.c @@ -327,7 +327,7 @@ do_save_calendar_csv (FormatHandler *handler, if (!dest_uri) return; - primary_source = e_source_selector_peek_primary_selection (selector); + primary_source = e_source_selector_get_primary_selection (selector); /* open source client */ source_client = e_auth_new_cal_from_source (primary_source, type); diff --git a/plugins/save-calendar/ical-format.c b/plugins/save-calendar/ical-format.c index 2458a14c1d..fa4f6a5515 100644 --- a/plugins/save-calendar/ical-format.c +++ b/plugins/save-calendar/ical-format.c @@ -90,7 +90,7 @@ do_save_calendar_ical (FormatHandler *handler, ESourceSelector *selector, ECalSo GList *objects; icalcomponent *top_level = NULL; - primary_source = e_source_selector_peek_primary_selection (selector); + primary_source = e_source_selector_get_primary_selection (selector); if (!dest_uri) return; diff --git a/plugins/save-calendar/rdf-format.c b/plugins/save-calendar/rdf-format.c index 8014fe9ddf..462f4f2a31 100644 --- a/plugins/save-calendar/rdf-format.c +++ b/plugins/save-calendar/rdf-format.c @@ -191,7 +191,7 @@ do_save_calendar_rdf (FormatHandler *handler, ESourceSelector *selector, ECalSou if (!dest_uri) return; - primary_source = e_source_selector_peek_primary_selection (selector); + primary_source = e_source_selector_get_primary_selection (selector); /* open source client */ source_client = e_auth_new_cal_from_source (primary_source, type); -- cgit v1.2.3 From fd75cdf70810071a8bbbe471490ba027d3830f4d Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 4 Nov 2010 11:24:58 +0100 Subject: Add missing libeshell.la to LIBADD in pst-import plugin --- plugins/pst-import/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/pst-import/Makefile.am b/plugins/pst-import/Makefile.am index 0c6c89b5b9..b4745b6226 100644 --- a/plugins/pst-import/Makefile.am +++ b/plugins/pst-import/Makefile.am @@ -30,9 +30,9 @@ liborg_gnome_pst_import_la_SOURCES = pst-importer.c liborg_gnome_pst_import_la_LDFLAGS = -module -avoid-version $(NO_UNDEFINED) liborg_gnome_pst_import_la_LIBADD = \ + $(top_builddir)/shell/libeshell.la \ $(top_builddir)/mail/libevolution-mail.la \ $(top_builddir)/e-util/libeutil.la \ - $(CAMEL_LIBS) \ $(EVOLUTION_CALENDAR_LIBS) \ $(EVOLUTION_MAIL_LIBS) \ $(GNOME_PLATFORM_LIBS) \ -- cgit v1.2.3 From a2e309c2a1735bd68b315aa971388e20db3a8621 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 1 Nov 2010 16:32:21 -0400 Subject: Rename CalUnits to EDurationType. And move the definition to e-util-enums.h so we get a GType for it. --- plugins/itip-formatter/itip-formatter.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins') diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index 79d0bd14b4..3630ec30d0 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -1889,7 +1889,7 @@ extract_itip_data (struct _itip_puri *pitip, GtkContainer *container, gboolean * if (calendar_config_get_use_default_reminder ()) { ECalComponentAlarm *acomp; gint interval; - CalUnits units; + EDurationType units; ECalComponentAlarmTrigger trigger; interval = calendar_config_get_default_reminder_interval (); @@ -1905,13 +1905,13 @@ extract_itip_data (struct _itip_puri *pitip, GtkContainer *container, gboolean * trigger.u.rel_duration.is_neg = TRUE; switch (units) { - case CAL_MINUTES: + case E_DURATION_MINUTES: trigger.u.rel_duration.minutes = interval; break; - case CAL_HOURS: + case E_DURATION_HOURS: trigger.u.rel_duration.hours = interval; break; - case CAL_DAYS: + case E_DURATION_DAYS: trigger.u.rel_duration.days = interval; break; default: -- cgit v1.2.3 From 1f17dab6b0d9c5413dea38dcc95e7a7bb5b4bd9b Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 2 Nov 2010 11:49:38 -0400 Subject: Move calendar preferences to the calendar module. Continue replacing the use of calendar-config functions with GObject property bindings to EShellSettings properties. --- plugins/itip-formatter/itip-formatter.c | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) (limited to 'plugins') diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index 3630ec30d0..149d1652c7 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -43,7 +43,6 @@ #include #include #include -#include #include #include #include @@ -542,10 +541,15 @@ static ECal * start_calendar_server (struct _itip_puri *pitip, ESource *source, ECalSourceType type, FormatItipOpenFunc func, gpointer data) { ECal *ecal; + EShell *shell; + EShellSettings *shell_settings; icaltimezone *zone = NULL; g_return_val_if_fail (source != NULL, NULL); + shell = e_shell_get_default (); + shell_settings = e_shell_get_shell_settings (shell); + ecal = g_hash_table_lookup (pitip->ecals[type], e_source_peek_uid (source)); if (ecal) { pitip->current_ecal = ecal; @@ -567,7 +571,7 @@ start_calendar_server (struct _itip_puri *pitip, ESource *source, ECalSourceType g_hash_table_insert (pitip->ecals[type], g_strdup (e_source_peek_uid (source)), ecal); - zone = calendar_config_get_icaltimezone (); + zone = e_shell_settings_get_pointer (shell_settings, "cal-timezone"); e_cal_set_default_timezone (ecal, zone, NULL); e_cal_open_async (ecal, TRUE); @@ -1680,6 +1684,8 @@ set_itip_error (struct _itip_puri *pitip, GtkContainer *container, const gchar * static gboolean extract_itip_data (struct _itip_puri *pitip, GtkContainer *container, gboolean *have_alarms) { + EShell *shell; + EShellSettings *shell_settings; icalproperty *prop; icalcomponent_kind kind = ICAL_NO_COMPONENT; icalcomponent *tz_comp; @@ -1687,6 +1693,10 @@ extract_itip_data (struct _itip_puri *pitip, GtkContainer *container, gboolean * icalcomponent *alarm_comp; icalcompiter alarm_iter; ECalComponent *comp; + gboolean use_default_reminder; + + shell = e_shell_get_default (); + shell_settings = e_shell_get_shell_settings (shell); if (!pitip->vcalendar) { set_itip_error (pitip, container, @@ -1886,14 +1896,20 @@ extract_itip_data (struct _itip_puri *pitip, GtkContainer *container, gboolean * }; /* Add default reminder if the config says so */ - if (calendar_config_get_use_default_reminder ()) { + + use_default_reminder = e_shell_settings_get_boolean ( + shell_settings, "cal-use-default-reminder"); + + if (use_default_reminder) { ECalComponentAlarm *acomp; gint interval; EDurationType units; ECalComponentAlarmTrigger trigger; - interval = calendar_config_get_default_reminder_interval (); - units = calendar_config_get_default_reminder_units (); + interval = e_shell_settings_get_int ( + shell_settings, "cal-default-reminder-interval"); + units = e_shell_settings_get_int ( + shell_settings, "cal-default-reminder-units"); acomp = e_cal_component_alarm_new (); @@ -2286,6 +2302,8 @@ in_proper_folder (CamelFolder *folder) static gboolean format_itip_object (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject *pobject) { + EShell *shell; + EShellSettings *shell_settings; struct _itip_puri *info; ECalComponentText text; ECalComponentOrganizer organizer; @@ -2299,6 +2317,9 @@ format_itip_object (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject gboolean response_enabled; gboolean have_alarms = FALSE; + shell = e_shell_get_default (); + shell_settings = e_shell_get_shell_settings (shell); + info = (struct _itip_puri *) em_format_find_puri ((EMFormat *)efh, pobject->classid); /* Accounts */ @@ -2498,7 +2519,7 @@ format_itip_object (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject g_string_free (gstring, TRUE); } - to_zone = calendar_config_get_icaltimezone (); + to_zone = e_shell_settings_get_pointer (shell_settings, "cal-timezone"); e_cal_component_get_dtstart (info->comp, &datetime); info->start_time = 0; -- cgit v1.2.3 From ecd4e2f295a3d97d6b92d4be6c9aff6abd44a253 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 8 Nov 2010 17:53:30 +0100 Subject: Bug #632176 - Force user name on Google calendar/address book --- .../google-account-setup/google-contacts-source.c | 41 ++++++++++++++++++++-- .../google-account-setup/google-contacts-source.h | 6 ++++ plugins/google-account-setup/google-source.c | 19 ++++++++-- .../org-gnome-evolution-google.eplug.xml | 4 +-- 4 files changed, 64 insertions(+), 6 deletions(-) (limited to 'plugins') diff --git a/plugins/google-account-setup/google-contacts-source.c b/plugins/google-account-setup/google-contacts-source.c index 5f4bf3fc57..0fe49911b0 100644 --- a/plugins/google-account-setup/google-contacts-source.c +++ b/plugins/google-account-setup/google-contacts-source.c @@ -94,7 +94,9 @@ on_username_entry_changed (GtkEntry *entry, gpointer user_data) text = gtk_entry_get_text (entry); - if (strstr (text, "@")) { + if (!text || !*text) { + username = NULL; + } else if (strstr (text, "@")) { username = g_strdup (text); } else { username = g_strdup_printf ("%s@gmail.com", text); @@ -207,6 +209,41 @@ on_interval_combo_changed (GtkComboBox *combo, gpointer user_data) g_free (value_string); } +gpointer +check_username_filled (ESource *source) +{ + gboolean res = TRUE; + + g_return_val_if_fail (source != NULL, NULL); + + if (g_ascii_strncasecmp (GOOGLE_BASE_URI, e_source_group_peek_base_uri (e_source_peek_group (source)), strlen (GOOGLE_BASE_URI)) == 0) { + gchar *username = g_strdup (e_source_get_property (source, "username")); + + if (username) + username = g_strstrip (username); + + res = username && *username; + + g_free (username); + } + + return GINT_TO_POINTER (res ? 1 : 0); +} + +gpointer +plugin_google_contacts_check (EPlugin *epl, EConfigHookPageCheckData *data) +{ + EABConfigTargetSource *t; + + g_return_val_if_fail (data != NULL, NULL); + g_return_val_if_fail (data->target != NULL, NULL); + + t = (EABConfigTargetSource *) data->target; + g_return_val_if_fail (t->source != NULL, NULL); + + return check_username_filled (t->source); +} + struct ui_data { GtkWidget *widget; }; @@ -262,7 +299,7 @@ plugin_google_contacts (EPlugin *epl, g_object_set_data (G_OBJECT (epl), "gwidget", NULL); - if (g_ascii_strncasecmp ("google://", base_uri, 9) != 0) + if (g_ascii_strncasecmp (GOOGLE_BASE_URI, base_uri, 9) != 0) return NULL; /* Build up the UI */ diff --git a/plugins/google-account-setup/google-contacts-source.h b/plugins/google-account-setup/google-contacts-source.h index 289ea0b40f..97130c1651 100644 --- a/plugins/google-account-setup/google-contacts-source.h +++ b/plugins/google-account-setup/google-contacts-source.h @@ -21,9 +21,15 @@ #ifndef __GOOGLE_CONTACTS_SOURCE_H__ #define __GOOGLE_CONTACTS_SOURCE_H__ +#define GOOGLE_BASE_URI "google://" + GtkWidget *plugin_google_contacts (EPlugin *epl, EConfigHookItemFactoryData *data); +gpointer plugin_google_contacts_check (EPlugin *epl, EConfigHookPageCheckData *data); + +gpointer check_username_filled (ESource *source); + void ensure_google_contacts_source_group (void); void remove_google_contacts_source_group (void); diff --git a/plugins/google-account-setup/google-source.c b/plugins/google-account-setup/google-source.c index 2f6dfdc12e..b5865c7780 100644 --- a/plugins/google-account-setup/google-source.c +++ b/plugins/google-account-setup/google-source.c @@ -51,7 +51,6 @@ #include "google-contacts-source.h" -#define GOOGLE_BASE_URI "google://" #define CALENDAR_LOCATION "://www.google.com/calendar/feeds/" #define CALENDAR_DEFAULT_PATH "/private/full" #define URL_GET_SUBSCRIBED_CALENDARS "://www.google.com/calendar/feeds/default/allcalendars/full" @@ -63,6 +62,7 @@ /* prototypes */ gint e_plugin_lib_enable (EPlugin *ep, gint enable); GtkWidget *plugin_google (EPlugin *epl, EConfigHookItemFactoryData *data); +gpointer plugin_google_check (EPlugin *epl, EConfigHookPageCheckData *data); void e_calendar_google_migrate (EPlugin *epl, ECalEventTargetBackend *data); /*****************************************************************************/ @@ -223,7 +223,8 @@ update_source_uris (ESource *source, const gchar *uri) e_source_set_relative_uri (source, uri); user = e_source_get_property (source, "username"); - g_return_if_fail (user != NULL); + if (!user) + return; feeds = strstr (uri, "/feeds/"); g_return_if_fail (feeds != NULL); @@ -571,6 +572,20 @@ retrieve_list_sensitize (GtkEntry *username_entry, gtk_widget_set_sensitive (button, sensitive); } +gpointer +plugin_google_check (EPlugin *epl, EConfigHookPageCheckData *data) +{ + ECalConfigTargetSource *t; + + g_return_val_if_fail (data != NULL, NULL); + g_return_val_if_fail (data->target != NULL, NULL); + + t = (ECalConfigTargetSource *) data->target; + g_return_val_if_fail (t->source != NULL, NULL); + + return check_username_filled (t->source); +} + GtkWidget * plugin_google (EPlugin *epl, EConfigHookItemFactoryData *data) diff --git a/plugins/google-account-setup/org-gnome-evolution-google.eplug.xml b/plugins/google-account-setup/org-gnome-evolution-google.eplug.xml index 2148cb8b50..16cd61afc8 100644 --- a/plugins/google-account-setup/org-gnome-evolution-google.eplug.xml +++ b/plugins/google-account-setup/org-gnome-evolution-google.eplug.xml @@ -7,7 +7,7 @@ <_description>Add Google Calendars to Evolution. - + @@ -16,7 +16,7 @@ - + -- cgit v1.2.3 From 8d6f2ea7daa64c2c83cfb62a531ef566dc193ebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fridrich=20=C5=A0trba?= Date: Fri, 12 Nov 2010 10:11:24 +0100 Subject: Fix windows build of backup-restore plugin --- plugins/backup-restore/backup-restore.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'plugins') diff --git a/plugins/backup-restore/backup-restore.c b/plugins/backup-restore/backup-restore.c index 1c6e0d0014..21b8436dff 100644 --- a/plugins/backup-restore/backup-restore.c +++ b/plugins/backup-restore/backup-restore.c @@ -39,6 +39,14 @@ #include "shell/e-shell-utils.h" #include "shell/e-shell-window.h" +#ifdef G_OS_WIN32 +#ifdef localtime_r +#undef localtime_r +#endif +/* The localtime() in Microsoft's C library *is* thread-safe */ +#define localtime_r(timep, result) (localtime (timep) ? memcpy ((result), localtime (timep), sizeof (*(result))) : 0) +#endif + gboolean e_plugin_ui_init (GtkUIManager *ui_manager, EShellWindow *shell_window); -- cgit v1.2.3 From 2e1a37d574b322186ebfe5fc78ec4865c3bd300c Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 25 Nov 2010 18:21:22 +0100 Subject: Bug #634387 - Crash in bbdb_sync_buddy_list_in_thread --- plugins/bbdb/gaimbuddies.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/bbdb/gaimbuddies.c b/plugins/bbdb/gaimbuddies.c index ebafc85f7a..62fc89d9ec 100644 --- a/plugins/bbdb/gaimbuddies.c +++ b/plugins/bbdb/gaimbuddies.c @@ -208,7 +208,7 @@ bbdb_sync_buddy_list_in_thread (gpointer data) for (l = std->blist; l != NULL; l = l->next) { GaimBuddy *b = l->data; EBookQuery *query; - GList *contacts; + GList *contacts = NULL; GError *error = NULL; EContact *c; @@ -219,7 +219,10 @@ bbdb_sync_buddy_list_in_thread (gpointer data) /* Look for an exact match full name == buddy alias */ query = e_book_query_field_test (E_CONTACT_FULL_NAME, E_BOOK_QUERY_IS, b->alias); - e_book_get_contacts (std->book, query, &contacts, NULL); + if (!e_book_get_contacts (std->book, query, &contacts, NULL)) { + e_book_query_unref (query); + continue; + } e_book_query_unref (query); if (contacts != NULL) { -- cgit v1.2.3 From f3e171349c429f4ed25fd0cadba391e04220c380 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 26 Nov 2010 10:21:43 +0100 Subject: [vCard-inline] Check also text/directory parts --- plugins/vcard-inline/org-gnome-vcard-inline.eplug.xml | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'plugins') diff --git a/plugins/vcard-inline/org-gnome-vcard-inline.eplug.xml b/plugins/vcard-inline/org-gnome-vcard-inline.eplug.xml index 61e96d4cab..45b8a7b6ef 100644 --- a/plugins/vcard-inline/org-gnome-vcard-inline.eplug.xml +++ b/plugins/vcard-inline/org-gnome-vcard-inline.eplug.xml @@ -22,6 +22,10 @@ mime_type="text/x-vcard" format="org_gnome_vcard_inline_format" flags="inline_disposition"/> + -- cgit v1.2.3 From ce02a16bd15a1911038d31861b788d38025e2e65 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 29 Nov 2010 21:31:43 +0100 Subject: Added few translator comments As requested in bug #635414 --- plugins/email-custom-header/email-custom-header.c | 28 +++++++++++++++-------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'plugins') diff --git a/plugins/email-custom-header/email-custom-header.c b/plugins/email-custom-header/email-custom-header.c index b28d648522..d44dc0f744 100644 --- a/plugins/email-custom-header/email-custom-header.c +++ b/plugins/email-custom-header/email-custom-header.c @@ -315,17 +315,17 @@ epech_setup_widgets (CustomHeaderOptionsDialog *mch) gint sub_index,row_combo,column_combo; gint header_section_id,sub_type_index,row,column; gint i; - gchar *str; - static const gchar *security_field = N_("Security:"); + const gchar *str; + static const gchar *security_field = NC_("email-custom-header-Security", "Security:"); static struct _security_values { const gchar *value, *str; } security_values[] = { - { "Personal", N_("Personal") } , - { "Unclassified", N_("Unclassified") }, - { "Protected", N_("Protected") }, - { "InConfidence", N_("Confidential") }, - { "Secret", N_("Secret") }, - { "Topsecret", N_("Top secret") }, + { "Personal", NC_("email-custom-header-Security", "Personal") } , + { "Unclassified", NC_("email-custom-header-Security", "Unclassified") }, + { "Protected", NC_("email-custom-header-Security", "Protected") }, + { "InConfidence", NC_("email-custom-header-Security", "Confidential") }, + { "Secret", NC_("email-custom-header-Security", "Secret") }, + { "Topsecret", NC_("email-custom-header-Security", "Top secret") }, { NULL, NULL } }; @@ -340,7 +340,11 @@ epech_setup_widgets (CustomHeaderOptionsDialog *mch) temp_header_ptr = &g_array_index (priv->email_custom_header_details, EmailCustomHeaderDetails,header_section_id); str = (temp_header_ptr->header_type_value)->str; if (strcmp (str, security_field) == 0) { - str = _(security_field); + gchar *tmp = g_strconcat ("email-custom-header-Security" "\004", security_field, NULL); + + str = g_dpgettext (NULL, tmp, strlen ("email-custom-header-Security") + 1); + + g_free (tmp); } gtk_label_set_markup (GTK_LABEL (priv->header_type_name_label), str); @@ -369,7 +373,11 @@ epech_setup_widgets (CustomHeaderOptionsDialog *mch) str = (temp_header_value_ptr->sub_header_string_value)->str; for (i = 0; security_values[i].value != NULL; i++) { if (strcmp (str, security_values[i].value) == 0) { - str = _(security_values[i].str); + gchar *tmp = g_strconcat ("email-custom-header-Security" "\004", security_values[i].str, NULL); + + str = g_dpgettext (NULL, tmp, strlen ("email-custom-header-Security") + 1); + + g_free (tmp); break; } } -- cgit v1.2.3 From 12ea46655183a26ab59627c5adc43369d9729e50 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 2 Dec 2010 15:04:09 +0100 Subject: Bug #555324 - Ask for destination before "Save in Addressbook" inline vCard --- plugins/vcard-inline/vcard-inline.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/vcard-inline/vcard-inline.c b/plugins/vcard-inline/vcard-inline.c index 5891344d22..dfa19666e9 100644 --- a/plugins/vcard-inline/vcard-inline.c +++ b/plugins/vcard-inline/vcard-inline.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "addressbook/gui/merging/eab-contact-merging.h" #include "addressbook/gui/widgets/eab-contact-display.h" @@ -151,10 +152,22 @@ org_gnome_vcard_inline_save_cb (VCardInlinePObject *vcard_object) { ESource *source; GList *contact_list; + GtkWidget*dialog; g_return_if_fail (vcard_object->source_list != NULL); - source = e_source_list_peek_default_source (vcard_object->source_list); + dialog = e_source_selector_dialog_new (NULL, vcard_object->source_list); + + e_source_selector_dialog_select_default_source (E_SOURCE_SELECTOR_DIALOG (dialog)); + + if (gtk_dialog_run (GTK_DIALOG (dialog)) != GTK_RESPONSE_OK) { + gtk_widget_destroy (dialog); + return; + } + + source = e_source_selector_dialog_peek_primary_selection (E_SOURCE_SELECTOR_DIALOG (dialog)); + gtk_widget_destroy (dialog); + g_return_if_fail (source != NULL); contact_list = g_list_copy (vcard_object->contact_list); -- cgit v1.2.3 From a63688f4e72be7b2b93312e4af0403a4a3e0517b Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 3 Dec 2010 20:03:29 +0100 Subject: CalDAV plugin - use saved password, if available, for server browsing --- plugins/caldav/caldav-browse-server.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'plugins') diff --git a/plugins/caldav/caldav-browse-server.c b/plugins/caldav/caldav-browse-server.c index e7d6140646..b7d0761982 100644 --- a/plugins/caldav/caldav-browse-server.c +++ b/plugins/caldav/caldav-browse-server.c @@ -786,6 +786,9 @@ soup_authenticate (SoupSession *session, SoupMessage *msg, SoupAuth *auth, gbool if (!username || !*username || (retrying && (!password || !*password))) return; + if (!retrying && !password) + password = e_passwords_get_password ("Calendar", g_object_get_data (dialog, "caldav-auth-key")); + if (!password || !*password || retrying) { gchar *pass, *prompt, *add = NULL; gchar *bold_user, *bold_host; @@ -811,7 +814,7 @@ soup_authenticate (SoupSession *session, SoupMessage *msg, SoupAuth *auth, gbool } pass = e_passwords_ask_password (_("Enter password"), - "Calendar", "caldav-search-server", prompt, + "Calendar", g_object_get_data (dialog, "caldav-auth-key"), prompt, E_PASSWORDS_REMEMBER_NEVER | E_PASSWORDS_DISABLE_REMEMBER | E_PASSWORDS_SECRET, NULL, GTK_WINDOW (dialog)); @@ -1108,7 +1111,7 @@ init_dialog (GtkDialog *dialog, GtkWidget **new_url_entry, const gchar *url, con GtkTreeSelection *selection; SoupSession *session; EProxy *proxy; - SoupURI *proxy_uri = NULL; + SoupURI *soup_uri = NULL; GThread *thread; GError *error = NULL; GMutex *thread_mutex; @@ -1214,10 +1217,10 @@ init_dialog (GtkDialog *dialog, GtkWidget **new_url_entry, const gchar *url, con /* use proxy if necessary */ if (e_proxy_require_proxy_for_uri (proxy, url)) { - proxy_uri = e_proxy_peek_uri_for (proxy, url); + soup_uri = e_proxy_peek_uri_for (proxy, url); } - g_object_set (session, SOUP_SESSION_PROXY_URI, proxy_uri, NULL); + g_object_set (session, SOUP_SESSION_PROXY_URI, soup_uri, NULL); g_object_unref (proxy); g_signal_connect (session, "authenticate", G_CALLBACK (soup_authenticate), dialog); @@ -1235,11 +1238,18 @@ init_dialog (GtkDialog *dialog, GtkWidget **new_url_entry, const gchar *url, con break; } + soup_uri = soup_uri_new (url); + soup_uri_set_scheme (soup_uri, "caldav"); + soup_uri_set_user (soup_uri, username); + + g_object_set_data_full (G_OBJECT (dialog), "caldav-auth-key", soup_uri_to_string (soup_uri, FALSE), g_free); g_object_set_data_full (G_OBJECT (dialog), "caldav-source-type", g_strdup (source_type_str), g_free); g_object_set_data_full (G_OBJECT (dialog), "caldav-base-url", g_strdup (url), g_free); g_object_set_data_full (G_OBJECT (dialog), "caldav-username", g_strdup (username), g_free); g_object_set_data_full (G_OBJECT (dialog), "caldav-session", session, NULL); /* it is freed at the end of thread life */ + soup_uri_free (soup_uri); + thread_mutex = g_mutex_new (); thread_cond = g_cond_new (); -- cgit v1.2.3 From ffd6e528086d2c752f61c71332c3526d11473661 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 3 Dec 2010 15:36:40 -0600 Subject: Avoid a crash when building templates menu. --- plugins/templates/templates.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'plugins') diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c index bca45f040f..625c70245b 100644 --- a/plugins/templates/templates.c +++ b/plugins/templates/templates.c @@ -618,6 +618,11 @@ build_template_menus_recurse (GtkUIManager *ui_manager, /* FIXME Not passing a GCancellable or GError here. */ template = camel_folder_get_message_sync ( folder, uid, NULL, NULL); + + /* FIXME Do something more intelligent with errors. */ + if (template == NULL) + continue; + g_object_ref (template); action_label = -- cgit v1.2.3 From 320c4ce807a9b24a3d9c4e02e408158d5cfbf125 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 8 Dec 2010 14:31:58 +0100 Subject: Bug #631568 - Scheduling Meetings with CalDAV calendars --- plugins/caldav/caldav-browse-server.c | 189 +++++++++++++++++++++++++++++++--- plugins/caldav/caldav-browse-server.h | 2 +- plugins/caldav/caldav-source.c | 40 +++++-- 3 files changed, 206 insertions(+), 25 deletions(-) (limited to 'plugins') diff --git a/plugins/caldav/caldav-browse-server.c b/plugins/caldav/caldav-browse-server.c index b7d0761982..46c7c9f923 100644 --- a/plugins/caldav/caldav-browse-server.c +++ b/plugins/caldav/caldav-browse-server.c @@ -39,6 +39,8 @@ #include #include +#include +#include #include "caldav-browse-server.h" @@ -61,7 +63,7 @@ enum { COL_BOOL_SENSITIVE }; -typedef void (*process_message_cb) (GObject *dialog, const gchar *msg_path, guint status_code, const gchar *msg_body, gpointer user_data); +typedef void (*process_message_cb) (GObject *dialog, const gchar *msg_path, guint status_code, const gchar *reason_phrase, const gchar *msg_body, gpointer user_data); static void send_xml_message (xmlDocPtr doc, gboolean depth_1, const gchar *url, GObject *dialog, process_message_cb cb, gpointer cb_user_data, const gchar *info); @@ -170,6 +172,12 @@ report_error (GObject *dialog, gboolean is_fatal, const gchar *msg) w = g_object_get_data (dialog, "caldav-tree-sw"); gtk_widget_hide (w); + w = g_object_get_data (dialog, "caldav-usermail-hbox"); + gtk_widget_hide (w); + + w = g_object_get_data (dialog, "caldav-new-autoschedule-check"); + gtk_widget_hide (w); + w = gtk_label_new (msg); gtk_widget_show (w); gtk_box_pack_start (GTK_BOX (content_area), w, TRUE, TRUE, 10); @@ -186,7 +194,7 @@ report_error (GObject *dialog, gboolean is_fatal, const gchar *msg) } static gboolean -check_soup_status (GObject *dialog, guint status_code, const gchar *msg_body, gboolean is_fatal) +check_soup_status (GObject *dialog, guint status_code, const gchar *reason_phrase, const gchar *msg_body, gboolean is_fatal) { gchar *msg; @@ -200,7 +208,7 @@ check_soup_status (GObject *dialog, guint status_code, const gchar *msg_body, gb } else { const gchar *phrase = soup_status_get_phrase (status_code); - msg = g_strdup_printf (_("Server returned unexpected data.\n%d - %s"), status_code, phrase ? phrase : _("Unknown error")); + msg = g_strdup_printf (_("Server returned unexpected data.\n%d - %s"), status_code, reason_phrase ? reason_phrase : (phrase ? phrase : _("Unknown error"))); } report_error (dialog, is_fatal, msg); @@ -313,7 +321,7 @@ add_collection_node_to_tree (GtkTreeStore *store, GtkTreeIter *parent_iter, cons /* called with "caldav-thread-mutex" unlocked; 'user_data' is parent tree iter, NULL for "User's calendars" */ static void -traverse_users_calendars_cb (GObject *dialog, const gchar *msg_path, guint status_code, const gchar *msg_body, gpointer user_data) +traverse_users_calendars_cb (GObject *dialog, const gchar *msg_path, guint status_code, const gchar *reason_phrase, const gchar *msg_body, gpointer user_data) { xmlDocPtr doc; xmlXPathContextPtr xpctx; @@ -323,7 +331,7 @@ traverse_users_calendars_cb (GObject *dialog, const gchar *msg_path, guint statu g_return_if_fail (dialog != NULL); g_return_if_fail (GTK_IS_DIALOG (dialog)); - if (!check_soup_status (dialog, status_code, msg_body, TRUE)) + if (!check_soup_status (dialog, status_code, reason_phrase, msg_body, TRUE)) return; g_return_if_fail (msg_body != NULL); @@ -533,6 +541,7 @@ fetch_folder_content (GObject *dialog, const gchar *relative_path, const GtkTree xmlNewTextChild (node, nsdav, XC "resourcetype", NULL); xmlNewTextChild (node, nsc, XC "calendar-description", NULL); xmlNewTextChild (node, nsc, XC "supported-calendar-component-set", NULL); + xmlNewTextChild (node, nsc, XC "calendar-user-address-set", NULL); xmlNewTextChild (node, nscs, XC "getctag", NULL); xmlNewTextChild (node, nsical, XC "calendar-color", NULL); @@ -562,19 +571,91 @@ fetch_folder_content (GObject *dialog, const gchar *relative_path, const GtkTree g_free (url); } +static gboolean +mail_account_configured (const gchar *email) +{ + gboolean found = FALSE; + EAccountList *accounts; + EIterator *iterator; + + g_return_val_if_fail (email != NULL, FALSE); + g_return_val_if_fail (*email, FALSE); + + accounts = e_get_account_list (); + g_return_val_if_fail (accounts != NULL, FALSE); + + for (iterator = e_list_get_iterator (E_LIST (accounts)); + !found && e_iterator_is_valid (iterator); + e_iterator_next (iterator)) { + EAccount *acc = (EAccount *) e_iterator_get (iterator); + const gchar *address; + + if (!acc) + continue; + + address = e_account_get_string (acc, E_ACCOUNT_ID_ADDRESS); + if (!address || !*address) + continue; + + found = g_strcmp0 (address, email) == 0; + } + + g_object_unref (iterator); + + return found; +} + +static void +add_usermail (GtkComboBoxText *usermail_combo, const gchar *email, gboolean is_first) +{ + GtkTreeModel *model; + GtkTreeIter iter; + gboolean found = FALSE; + + g_return_if_fail (usermail_combo != NULL); + g_return_if_fail (email != NULL); + + if (!*email) + return; + + model = gtk_combo_box_get_model (GTK_COMBO_BOX (usermail_combo)); + g_return_if_fail (model != NULL); + + if (gtk_tree_model_get_iter_first (model, &iter)) { + do { + gchar *value = NULL; + + gtk_tree_model_get (model, &iter, 0, &value, -1); + + found = value && g_ascii_strcasecmp (value, email) == 0; + if (found && (is_first || mail_account_configured (email))) + gtk_combo_box_set_active_iter (GTK_COMBO_BOX (usermail_combo), &iter); + + g_free (value); + } while (!found && gtk_tree_model_iter_next (model, &iter)); + } + + if (!found) { + gtk_combo_box_text_append_text (usermail_combo, email); + if (gtk_tree_model_iter_n_children (model, NULL) == 1 || is_first || mail_account_configured (email)) + gtk_combo_box_set_active (GTK_COMBO_BOX (usermail_combo), gtk_tree_model_iter_n_children (model, NULL) - 1); + } +} + /* called with "caldav-thread-mutex" unlocked; user_data is not NULL when called second time on principal */ static void -find_users_calendar_cb (GObject *dialog, const gchar *msg_path, guint status_code, const gchar *msg_body, gpointer user_data) +find_users_calendar_cb (GObject *dialog, const gchar *msg_path, guint status_code, const gchar *reason_phrase, const gchar *msg_body, gpointer user_data) { xmlDocPtr doc; xmlXPathContextPtr xpctx; + xmlXPathObjectPtr suppObj; gchar *calendar_home_set, *url; gboolean base_url_is_calendar = FALSE; g_return_if_fail (dialog != NULL); g_return_if_fail (GTK_IS_DIALOG (dialog)); - if (!check_soup_status (dialog, status_code, msg_body, TRUE)) + if (!check_soup_status (dialog, status_code, reason_phrase, msg_body, TRUE)) return; g_return_if_fail (msg_body != NULL); @@ -592,6 +673,30 @@ find_users_calendar_cb (GObject *dialog, const gchar *msg_path, guint status_cod if (user_data == NULL) base_url_is_calendar = xpath_exists (xpctx, NULL, "/D:multistatus/D:response/D:propstat/D:prop/D:resourcetype/C:calendar"); + if (xpath_exists (xpctx, &suppObj, "/D:multistatus/D:response/D:propstat/D:prop/C:calendar-user-address-set")) { + if (suppObj->type == XPATH_NODESET) { + GtkComboBoxText *usermail_combo = GTK_COMBO_BOX_TEXT (g_object_get_data (dialog, "caldav-new-usermail-combo")); + gboolean is_first = TRUE; + gint jj, szjj = xmlXPathNodeSetGetLength (suppObj->nodesetval); + + for (jj = 0; jj < szjj; jj++) { + gchar *href = xpath_get_string (xpctx, "/D:multistatus/D:response/D:propstat/D:prop/C:calendar-user-address-set/D:href[%d]", jj + 1); + + if (!href || !g_str_has_prefix (href, "mailto:")) { + g_free (href); + continue; + } + + add_usermail (usermail_combo, href + 7, is_first); + is_first = FALSE; + + g_free (href); + } + } + + xmlXPathFreeObject (suppObj); + } + calendar_home_set = xpath_get_string (xpctx, "/D:multistatus/D:response/D:propstat/D:prop/C:calendar-home-set/D:href"); if (user_data == NULL && (!calendar_home_set || !*calendar_home_set)) { g_free (calendar_home_set); @@ -620,6 +725,7 @@ find_users_calendar_cb (GObject *dialog, const gchar *msg_path, guint status_cod node = xmlNewTextChild (root, nsdav, XC "prop", NULL); xmlNewTextChild (node, nsdav, XC "current-user-principal", NULL); xmlNewTextChild (node, nsc, XC "calendar-home-set", NULL); + xmlNewTextChild (node, nsc, XC "calendar-user-address-set", NULL); url = change_url_path (g_object_get_data (dialog, "caldav-base-url"), calendar_home_set); if (url) { @@ -896,6 +1002,7 @@ poll_for_message_sent_cb (gpointer data) guint status_code = -1; gchar *msg_path = NULL; gchar *msg_body = NULL; + gchar *reason_phrase = NULL; g_return_val_if_fail (data != NULL, FALSE); @@ -920,12 +1027,21 @@ poll_for_message_sent_cb (gpointer data) if (pd->cb) { const SoupURI *suri = soup_message_get_uri (pd->message); + const gchar *header; status_code = pd->message->status_code; + reason_phrase = g_strdup (pd->message->reason_phrase); msg_body = g_strndup (pd->message->response_body->data, pd->message->response_body->length); if (suri && suri->path) msg_path = g_strdup (suri->path); + + header = soup_message_headers_get (pd->message->response_headers, "DAV"); + if (header) { + gboolean autoschedule = soup_header_contains (header, "calendar-auto-schedule"); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (g_object_get_data (pd->dialog, "caldav-new-autoschedule-check")), autoschedule); + } } g_object_unref (pd->message); @@ -939,11 +1055,12 @@ poll_for_message_sent_cb (gpointer data) g_mutex_unlock (mutex); if (!again && pd->cb) { - (*pd->cb) (pd->dialog, msg_path, status_code, msg_body, pd->cb_user_data); + (*pd->cb) (pd->dialog, msg_path, status_code, reason_phrase, msg_body, pd->cb_user_data); } g_free (msg_body); g_free (msg_path); + g_free (reason_phrase); return again; } @@ -1102,10 +1219,10 @@ tree_row_expanded_cb (GtkTreeView *tree, GtkTreeIter *iter, GtkTreePath *path, G } static void -init_dialog (GtkDialog *dialog, GtkWidget **new_url_entry, const gchar *url, const gchar *username, gint source_type) +init_dialog (GtkDialog *dialog, GtkWidget **new_url_entry, GtkWidget **new_usermail_combo, GtkWidget **new_autoschedule_check, const gchar *url, const gchar *username, const gchar *usermail, gboolean autoschedule, gint source_type) { GtkBox *content_area; - GtkWidget *label, *info_box, *spinner, *info_label; + GtkWidget *label, *info_box, *spinner, *info_label, *hbox; GtkWidget *tree, *scrolled_window; GtkTreeStore *store; GtkTreeSelection *selection; @@ -1123,6 +1240,8 @@ init_dialog (GtkDialog *dialog, GtkWidget **new_url_entry, const gchar *url, con g_return_if_fail (dialog != NULL); g_return_if_fail (GTK_IS_DIALOG (dialog)); g_return_if_fail (new_url_entry != NULL); + g_return_if_fail (new_usermail_combo != NULL); + g_return_if_fail (new_autoschedule_check != NULL); g_return_if_fail (url != NULL); content_area = GTK_BOX (gtk_dialog_get_content_area (dialog)); @@ -1136,7 +1255,18 @@ init_dialog (GtkDialog *dialog, GtkWidget **new_url_entry, const gchar *url, con g_signal_connect (G_OBJECT (*new_url_entry), "changed", G_CALLBACK (url_entry_changed), dialog); + *new_usermail_combo = gtk_combo_box_text_new (); + if (usermail && *usermail) { + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (*new_usermail_combo), usermail); + gtk_combo_box_set_active (GTK_COMBO_BOX (*new_usermail_combo), 0); + } + + *new_autoschedule_check = gtk_check_button_new_with_mnemonic (_("Server _handles meeting invitations")); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (*new_autoschedule_check), autoschedule); + g_object_set_data (G_OBJECT (dialog), "caldav-new-url-entry", *new_url_entry); + g_object_set_data (G_OBJECT (dialog), "caldav-new-usermail-combo", *new_usermail_combo); + g_object_set_data (G_OBJECT (dialog), "caldav-new-autoschedule-check", *new_autoschedule_check); label = gtk_label_new (_("List of available calendars:")); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); @@ -1157,6 +1287,7 @@ init_dialog (GtkDialog *dialog, GtkWidget **new_url_entry, const gchar *url, con tree = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store)); gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolled_window), tree); + gtk_widget_set_size_request (scrolled_window, 320, 240); gtk_box_pack_start (content_area, scrolled_window, TRUE, TRUE, 0); g_object_set_data (G_OBJECT (dialog), "caldav-tree", tree); @@ -1199,6 +1330,19 @@ init_dialog (GtkDialog *dialog, GtkWidget **new_url_entry, const gchar *url, con gtk_box_pack_start (content_area, info_box, FALSE, FALSE, 0); + hbox = gtk_hbox_new (FALSE, 2); + gtk_box_pack_start (content_area, hbox, FALSE, FALSE, 0); + + label = gtk_label_new_with_mnemonic (_("User e-_mail:")); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), *new_usermail_combo); + + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 2); + gtk_box_pack_start (GTK_BOX (hbox), *new_usermail_combo, FALSE, FALSE, 2); + + g_object_set_data (G_OBJECT (dialog), "caldav-usermail-hbox", hbox); + + gtk_box_pack_start (content_area, *new_autoschedule_check, FALSE, FALSE, 0); + gtk_widget_show_all (GTK_WIDGET (content_area)); gtk_widget_hide (*new_url_entry); gtk_widget_hide (spinner); @@ -1283,6 +1427,7 @@ init_dialog (GtkDialog *dialog, GtkWidget **new_url_entry, const gchar *url, con xmlNewTextChild (node, nsdav, XC "principal-URL", NULL); xmlNewTextChild (node, nsdav, XC "resourcetype", NULL); xmlNewTextChild (node, nsc, XC "calendar-home-set", NULL); + xmlNewTextChild (node, nsc, XC "calendar-user-address-set", NULL); send_xml_message (doc, FALSE, url, G_OBJECT (dialog), find_users_calendar_cb, NULL, _("Searching for user's calendars...")); @@ -1359,9 +1504,9 @@ prepare_url (const gchar *server_url, gboolean use_ssl) } gchar * -caldav_browse_server (GtkWindow *parent, const gchar *server_url, const gchar *username, gboolean use_ssl, gint source_type) +caldav_browse_server (GtkWindow *parent, const gchar *server_url, const gchar *username, gboolean use_ssl, gchar **new_usermail, gboolean *new_autoschedule, gint source_type) { - GtkWidget *dialog, *new_url_entry; + GtkWidget *dialog, *new_url_entry, *new_usermail_combo, *new_autoschedule_check; gchar *url, *new_url = NULL; g_return_val_if_fail (server_url != NULL, NULL); @@ -1383,13 +1528,25 @@ caldav_browse_server (GtkWindow *parent, const gchar *server_url, const gchar *u NULL); new_url_entry = NULL; - init_dialog (GTK_DIALOG (dialog), &new_url_entry, url, username, source_type); + new_usermail_combo = NULL; + new_autoschedule_check = NULL; + init_dialog (GTK_DIALOG (dialog), &new_url_entry, &new_usermail_combo, &new_autoschedule_check, url, username, new_usermail ? *new_usermail : NULL, new_autoschedule ? *new_autoschedule : FALSE, source_type); if (new_url_entry && gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) { - const gchar *nu = gtk_entry_get_text (GTK_ENTRY (new_url_entry)); + const gchar *txt; + + txt = gtk_entry_get_text (GTK_ENTRY (new_url_entry)); + if (txt && *txt) + new_url = change_url_path (server_url, txt); + + txt = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (new_usermail_combo)); + if (txt && *txt && new_usermail) { + g_free (*new_usermail); + *new_usermail = g_strdup (txt); + } - if (nu && *nu) - new_url = change_url_path (server_url, nu); + if (new_autoschedule) + *new_autoschedule = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (new_autoschedule_check)); } gtk_widget_destroy (dialog); diff --git a/plugins/caldav/caldav-browse-server.h b/plugins/caldav/caldav-browse-server.h index 5c7cde6291..aa8b5e6f5d 100644 --- a/plugins/caldav/caldav-browse-server.h +++ b/plugins/caldav/caldav-browse-server.h @@ -27,6 +27,6 @@ /* Opens a window with a list of available calendars for a given server; Returns server URL of a calendar user chose, or NULL to let it be as is. */ -gchar *caldav_browse_server (GtkWindow *parent, const gchar *server_url, const gchar *username, gboolean use_ssl, gint source_type); +gchar *caldav_browse_server (GtkWindow *parent, const gchar *server_url, const gchar *username, gboolean use_ssl, gchar **new_usermail, gboolean *new_autoschedule, gint source_type); #endif /* CALDAV_BROWSE_SERVER_H */ diff --git a/plugins/caldav/caldav-source.c b/plugins/caldav/caldav-source.c index a3129af3a4..8c99c81567 100644 --- a/plugins/caldav/caldav-source.c +++ b/plugins/caldav/caldav-source.c @@ -146,34 +146,53 @@ user_changed_cb (GtkEntry *editable, ESource *source) static void browse_cal_clicked_cb (GtkButton *button, gpointer user_data) { - GtkEntry *url, *username; - GtkToggleButton *ssl; - gchar *new_url; + GtkEntry *url, *username, *usermail; + GtkToggleButton *ssl, *autoschedule; + gchar *new_url, *new_usermail; + gboolean new_autoschedule; g_return_if_fail (button != NULL); url = g_object_get_data (G_OBJECT (button), "caldav-url"); - username = g_object_get_data (G_OBJECT (button), "caldav-username"); ssl = g_object_get_data (G_OBJECT (button), "caldav-ssl"); + username = g_object_get_data (G_OBJECT (button), "caldav-username"); + usermail = g_object_get_data (G_OBJECT (button), "caldav-usermail"); + autoschedule = g_object_get_data (G_OBJECT (button), "caldav-autoschedule"); g_return_if_fail (url != NULL); g_return_if_fail (GTK_IS_ENTRY (url)); - g_return_if_fail (username != NULL); - g_return_if_fail (GTK_IS_ENTRY (username)); g_return_if_fail (ssl != NULL); g_return_if_fail (GTK_IS_TOGGLE_BUTTON (ssl)); + g_return_if_fail (username != NULL); + g_return_if_fail (GTK_IS_ENTRY (username)); + g_return_if_fail (usermail != NULL); + g_return_if_fail (GTK_IS_ENTRY (usermail)); + g_return_if_fail (autoschedule != NULL); + g_return_if_fail (GTK_IS_TOGGLE_BUTTON (autoschedule)); + + new_usermail = g_strdup (gtk_entry_get_text (usermail)), + new_autoschedule = gtk_toggle_button_get_active (autoschedule); new_url = caldav_browse_server ( GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (button))), gtk_entry_get_text (url), gtk_entry_get_text (username), gtk_toggle_button_get_active (ssl), + &new_usermail, + &new_autoschedule, GPOINTER_TO_INT (user_data)); if (new_url) { gtk_entry_set_text (url, new_url); g_free (new_url); + + if (new_usermail) + gtk_entry_set_text (usermail, new_usermail); + + gtk_toggle_button_set_active (autoschedule, new_autoschedule); } + + g_free (new_usermail); } GtkWidget * @@ -183,7 +202,7 @@ oge_caldav (EPlugin *epl, ECalConfigTargetSource *t = (ECalConfigTargetSource *) data->target; ESource *source; SoupURI *suri; - GtkWidget *parent, *location, *ssl, *user, *browse_cal; + GtkWidget *parent, *location, *ssl, *user, *mail, *autoschedule, *browse_cal; gchar *uri, *username; guint n_rows; @@ -232,6 +251,9 @@ oge_caldav (EPlugin *epl, g_free (uri); g_free (username); + mail = e_plugin_util_add_entry (parent, _("User e-_mail:"), source, "usermail"); + autoschedule = e_plugin_util_add_check (parent, _("Server _handles meeting invitations"), source, "autoschedule", "1", "0"); + browse_cal = gtk_button_new_with_mnemonic (_("Brows_e server for a calendar")); gtk_widget_show (browse_cal); g_object_get (parent, "n-rows", &n_rows, NULL); @@ -240,8 +262,10 @@ oge_caldav (EPlugin *epl, n_rows, n_rows + 1, GTK_FILL, 0, 0, 0); g_object_set_data (G_OBJECT (browse_cal), "caldav-url", location); - g_object_set_data (G_OBJECT (browse_cal), "caldav-username", user); g_object_set_data (G_OBJECT (browse_cal), "caldav-ssl", ssl); + g_object_set_data (G_OBJECT (browse_cal), "caldav-username", user); + g_object_set_data (G_OBJECT (browse_cal), "caldav-usermail", mail); + g_object_set_data (G_OBJECT (browse_cal), "caldav-autoschedule", autoschedule); g_signal_connect ( browse_cal, "clicked", -- cgit v1.2.3 From fb1874306786d0ef9527463bfed870dc07915084 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 8 Dec 2010 15:59:01 +0100 Subject: Bug #633332 - Preserve port number in WebDAV address book --- plugins/webdav-account-setup/webdav-contacts-source.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/webdav-account-setup/webdav-contacts-source.c b/plugins/webdav-account-setup/webdav-contacts-source.c index 6ce62e4bdd..870fa46b13 100644 --- a/plugins/webdav-account-setup/webdav-contacts-source.c +++ b/plugins/webdav-account-setup/webdav-contacts-source.c @@ -123,9 +123,17 @@ set_ui_from_source (ui_data *data) gtk_toggle_button_set_active (data->avoid_ifmatch_toggle, avoid_ifmatch); /* it's really a http or https protocol */ - if (suri) + if (suri) { + gint port; + + port = soup_uri_get_port (suri); + soup_uri_set_scheme (suri, use_ssl ? "https" : "http"); + if (port > 0 && port != soup_uri_get_port (suri)) + soup_uri_set_port (suri, port); + } + /* remove user/username and set user field */ if (suri && suri->user != NULL) { gtk_entry_set_text (data->username_entry, suri->user); -- cgit v1.2.3 From bbd5f80d888288edac588907b2f0ff7df8faef2a Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 10 Dec 2010 18:42:48 +0100 Subject: Properly translate NC_ messages --- plugins/email-custom-header/email-custom-header.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'plugins') diff --git a/plugins/email-custom-header/email-custom-header.c b/plugins/email-custom-header/email-custom-header.c index d44dc0f744..6deb67a8e6 100644 --- a/plugins/email-custom-header/email-custom-header.c +++ b/plugins/email-custom-header/email-custom-header.c @@ -339,13 +339,8 @@ epech_setup_widgets (CustomHeaderOptionsDialog *mch) priv->header_type_name_label = gtk_label_new (""); temp_header_ptr = &g_array_index (priv->email_custom_header_details, EmailCustomHeaderDetails,header_section_id); str = (temp_header_ptr->header_type_value)->str; - if (strcmp (str, security_field) == 0) { - gchar *tmp = g_strconcat ("email-custom-header-Security" "\004", security_field, NULL); - - str = g_dpgettext (NULL, tmp, strlen ("email-custom-header-Security") + 1); - - g_free (tmp); - } + if (strcmp (str, security_field) == 0) + str = g_dpgettext2 (GETTEXT_PACKAGE, "email-custom-header-Security", security_field); gtk_label_set_markup (GTK_LABEL (priv->header_type_name_label), str); gtk_table_attach (GTK_TABLE (priv->header_table), priv->header_type_name_label, 0, 1, row, column, @@ -373,11 +368,7 @@ epech_setup_widgets (CustomHeaderOptionsDialog *mch) str = (temp_header_value_ptr->sub_header_string_value)->str; for (i = 0; security_values[i].value != NULL; i++) { if (strcmp (str, security_values[i].value) == 0) { - gchar *tmp = g_strconcat ("email-custom-header-Security" "\004", security_values[i].str, NULL); - - str = g_dpgettext (NULL, tmp, strlen ("email-custom-header-Security") + 1); - - g_free (tmp); + str = g_dpgettext2 (GETTEXT_PACKAGE, "email-custom-header-Security", security_values[i].str); break; } } -- cgit v1.2.3 From d61a48b9d9bcf8d315b05ffb8be10b3d9d64c0ee Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 6 Jan 2011 15:52:23 +0100 Subject: Bug #633854 - [templates] Crash in build_template_menus_recurse --- plugins/templates/templates.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c index 625c70245b..9b664bbe55 100644 --- a/plugins/templates/templates.c +++ b/plugins/templates/templates.c @@ -567,10 +567,10 @@ build_template_menus_recurse (GtkUIManager *ui_manager, gchar *path; guint ii; + folder_name = folder_info->name; /* FIXME Not passing a GCancellable or GError here. */ folder = camel_store_get_folder_sync ( store, folder_info->full_name, 0, NULL, NULL); - folder_name = camel_folder_get_name (folder); action_name = g_strdup_printf ( "templates-menu-%d", *action_count); @@ -603,9 +603,15 @@ build_template_menus_recurse (GtkUIManager *ui_manager, path, action_count, merge_id, folder_info->child, message_folder, message_uid); + if (!folder) { + g_free (path); + folder_info = folder_info->next; + continue; + } + /* Get the UIDs for this folder and add them to the menu. */ uids = camel_folder_get_uids (folder); - for (ii = 0; ii < uids->len; ii++) { + for (ii = 0; uids && ii < uids->len; ii++) { CamelMimeMessage *template; const gchar *uid = uids->pdata[ii], *muid; guint32 flags; @@ -666,8 +672,9 @@ build_template_menus_recurse (GtkUIManager *ui_manager, g_object_unref (action); g_free (action_name); } - camel_folder_free_uids (folder, uids); + camel_folder_free_uids (folder, uids); + g_object_unref (folder); g_free (path); folder_info = folder_info->next; -- cgit v1.2.3 From 97a91ab8f7880db0c20e964a23169f6966b82d6a Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Thu, 6 Jan 2011 16:28:06 +0100 Subject: Fix all back up that should be backup --- plugins/backup-restore/backup-restore.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins') diff --git a/plugins/backup-restore/backup-restore.c b/plugins/backup-restore/backup-restore.c index 21b8436dff..2ff0ff1bc9 100644 --- a/plugins/backup-restore/backup-restore.c +++ b/plugins/backup-restore/backup-restore.c @@ -180,7 +180,7 @@ action_settings_backup_cb (GtkAction *action, file = e_shell_run_save_dialog ( e_shell_window_get_shell (shell_window), - _("Select name of the Evolution back up file"), + _("Select name of the Evolution backup file"), suggest, "*.tar.gz", (GtkCallback) set_local_only, NULL); @@ -213,7 +213,7 @@ action_settings_backup_cb (GtkAction *action, mask = dialog_prompt_user ( GTK_WINDOW (shell_window), - _("_Restart Evolution after back up"), + _("_Restart Evolution after backup"), "org.gnome.backup-restore:backup-confirm", NULL); if (mask & BR_OK) { path = g_file_get_path (file); @@ -239,7 +239,7 @@ action_settings_restore_cb (GtkAction *action, file = e_shell_run_open_dialog ( e_shell_window_get_shell (shell_window), - _("Select name of the Evolution back up file to restore"), + _("Select name of the Evolution backup file to restore"), (GtkCallback) set_local_only, NULL); if (file == NULL) @@ -320,14 +320,14 @@ backup_restore_page (EPlugin *ep, EConfigHookItemFactoryData *hook_data) gtk_container_set_border_width (GTK_CONTAINER (page), 12); hbox = gtk_hbox_new (FALSE, 6); - label = gtk_label_new (_("You can restore Evolution from your back up. It can restore all the Mails, Calendars, Tasks, Memos, Contacts. It also restores all your personal settings, mail filters etc.")); + label = gtk_label_new (_("You can restore Evolution from your backup. It can restore all the Mails, Calendars, Tasks, Memos, Contacts. It also restores all your personal settings, mail filters etc.")); gtk_label_set_line_wrap ((GtkLabel *)label, TRUE); gtk_label_set_single_line_mode ((GtkLabel *)label, FALSE); gtk_box_pack_start ((GtkBox *)hbox, label, FALSE, FALSE, 6); gtk_box_pack_start ((GtkBox *)page, hbox, FALSE, FALSE, 0); hbox = gtk_hbox_new (FALSE, 6); - cbox = gtk_check_button_new_with_mnemonic (_("_Restore Evolution from the back up file")); + cbox = gtk_check_button_new_with_mnemonic (_("_Restore Evolution from the backup file")); g_signal_connect (cbox, "toggled", G_CALLBACK (check_toggled), assistant); gtk_box_pack_start ((GtkBox *)hbox, cbox, FALSE, FALSE, 6); gtk_box_pack_start ((GtkBox *)page, hbox, FALSE, FALSE, 0); @@ -345,7 +345,7 @@ backup_restore_page (EPlugin *ep, EConfigHookItemFactoryData *hook_data) gtk_widget_set_sensitive (hbox, FALSE); gtk_assistant_append_page (assistant, page); - gtk_assistant_set_page_title (assistant, page, _("Restore from back up")); + gtk_assistant_set_page_title (assistant, page, _("Restore from backup")); gtk_widget_show_all (page); g_object_set_data ((GObject *)assistant, "restore", GINT_TO_POINTER (FALSE)); -- cgit v1.2.3 From 0af3ff804c0d71c76fd63f0a2a152cac7de64863 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 13 Jan 2011 10:54:58 -0500 Subject: Fudge gtk_widget_get_preferred_size() for gtk2. Easy enough to fake gtk_widget_get_preferred_size() in gtk2 using gtk_widget_size_request(). Reduces diff noise with gtk3 branch. --- plugins/mark-all-read/mark-all-read.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mark-all-read/mark-all-read.c b/plugins/mark-all-read/mark-all-read.c index 62b8102d9d..6e527d653c 100644 --- a/plugins/mark-all-read/mark-all-read.c +++ b/plugins/mark-all-read/mark-all-read.c @@ -38,6 +38,9 @@ #include #include +/* backward-compatibility cruft */ +#include "e-util/gtk-compat.h" + #define PRIMARY_TEXT \ N_("Also mark messages in subfolders?") #define SECONDARY_TEXT \ @@ -79,7 +82,7 @@ box_mapped_cb (GtkWidget *box, /* In order to get decent line wrapping we need to wait until the * box containing the buttons is mapped, and then resize the label * to the same width as the box. */ - gtk_widget_size_request (box, &requisition); + gtk_widget_get_preferred_size (box, &requisition, NULL); gtk_widget_set_size_request (label, requisition.width, -1); } -- cgit v1.2.3 From d6ce64dc1925f5efb9fdfbc503400b7def2e7cfb Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 18 Jan 2011 18:02:03 +0100 Subject: Bug #633788 - Mail plugin's update-actions handler is never called --- plugins/mailing-list-actions/mailing-list-actions.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/mailing-list-actions/mailing-list-actions.c b/plugins/mailing-list-actions/mailing-list-actions.c index fd3ae6c0fa..8090c21063 100644 --- a/plugins/mailing-list-actions/mailing-list-actions.c +++ b/plugins/mailing-list-actions/mailing-list-actions.c @@ -348,7 +348,8 @@ update_actions_cb (EMailReader *reader, { gboolean sensitive; - sensitive = (state & E_MAIL_READER_SELECTION_IS_MAILING_LIST); + sensitive = (state & E_MAIL_READER_SELECTION_IS_MAILING_LIST) != 0 + && (state & E_MAIL_READER_SELECTION_SINGLE) != 0; gtk_action_group_set_sensitive (action_group, sensitive); } -- cgit v1.2.3 From 3cce94edcbd2c0969e72bdb53dfeefe4d76551f0 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 19 Jan 2011 14:56:35 +0100 Subject: Bug #634403 - Mails Label popup menu is not updated properly --- plugins/templates/templates.c | 1 + 1 file changed, 1 insertion(+) (limited to 'plugins') diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c index 9b664bbe55..3e3bb49195 100644 --- a/plugins/templates/templates.c +++ b/plugins/templates/templates.c @@ -780,6 +780,7 @@ update_actions_cb (EShellView *shell_view) gtk_ui_manager_remove_ui (ui_manager, merge_id); e_action_group_remove_all_actions (action_group); + gtk_ui_manager_ensure_update (ui_manager); if (!plugin_enabled) return; -- cgit v1.2.3 From 48cc23d33dd6f1d29e0f61694973877df6ccf38a Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 22 Jan 2011 10:56:17 -0500 Subject: Bug 640025 - Silence debug output in spamassassin plugin --- plugins/sa-junk-plugin/em-junk-filter.c | 1 - 1 file changed, 1 deletion(-) (limited to 'plugins') diff --git a/plugins/sa-junk-plugin/em-junk-filter.c b/plugins/sa-junk-plugin/em-junk-filter.c index 260fe935a6..830a10563b 100644 --- a/plugins/sa-junk-plugin/em-junk-filter.c +++ b/plugins/sa-junk-plugin/em-junk-filter.c @@ -719,7 +719,6 @@ em_junk_sa_report_junk (EPlugin *ep, EMJunkTarget *target) return; sub = g_strdup (camel_mime_message_get_subject (msg)); - g_print ("\nreport junk?? %s\n", sub); d(fprintf (stderr, "em_junk_sa_report_junk\n")); if (em_junk_sa_is_available (&target->error)) { -- cgit v1.2.3 From dfc28aa9cefad63fb0fc926ce725f7cad8125cb0 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 16 Dec 2010 14:03:25 -0500 Subject: Drop support for gtk+-2.0. --- plugins/calendar-weather/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/calendar-weather/Makefile.am b/plugins/calendar-weather/Makefile.am index 96f1fd2da7..5cc4b8cd07 100644 --- a/plugins/calendar-weather/Makefile.am +++ b/plugins/calendar-weather/Makefile.am @@ -14,7 +14,7 @@ liborg_gnome_calendar_weather_la_CPPFLAGS = \ $(SOURCE_SEL_CFLAGS) \ -DWEATHER_DATADIR=\""$(weatherdatadir)"\" \ -DWEATHER_EDS_DATADIR=\""$(eds_datadir)/weather"\" \ - $(LIBGWEATHER_CFLAGS) + $(GWEATHER_CFLAGS) liborg_gnome_calendar_weather_la_SOURCES = calendar-weather.c liborg_gnome_calendar_weather_la_LDFLAGS = -module -avoid-version $(NO_UNDEFINED) @@ -22,7 +22,7 @@ liborg_gnome_calendar_weather_la_LIBADD = \ $(top_builddir)/calendar/gui/libevolution-calendar.la \ $(top_builddir)/e-util/libeutil.la \ $(EVOLUTION_CALENDAR_LIBS) \ - $(LIBGWEATHER_LIBS) \ + $(GWEATHER_LIBS) \ $(GNOME_PLATFORM_LIBS) EXTRA_DIST = \ -- cgit v1.2.3 From 753c60fc67a0a56a5f119c14ffa54ea9af95c208 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 9 Nov 2010 08:48:33 -0500 Subject: Drop backward-compatibility cruft. --- plugins/backup-restore/backup.c | 3 --- plugins/caldav/caldav-browse-server.c | 1 - plugins/calendar-file/calendar-file.c | 3 --- plugins/calendar-weather/calendar-weather.c | 3 --- plugins/email-custom-header/email-custom-header.c | 3 --- plugins/external-editor/external-editor.c | 3 --- plugins/google-account-setup/google-contacts-source.c | 3 --- plugins/mark-all-read/mark-all-read.c | 6 ------ plugins/publish-calendar/url-editor-dialog.c | 6 ------ 9 files changed, 31 deletions(-) (limited to 'plugins') diff --git a/plugins/backup-restore/backup.c b/plugins/backup-restore/backup.c index 555eebe2d8..9334de3b20 100644 --- a/plugins/backup-restore/backup.c +++ b/plugins/backup-restore/backup.c @@ -709,9 +709,6 @@ main (gint argc, gchar **argv) GTK_RESPONSE_REJECT, NULL); -#if !GTK_CHECK_VERSION(2,90,7) - g_object_set (progress_dialog, "has-separator", FALSE, NULL); -#endif gtk_container_set_border_width (GTK_CONTAINER (progress_dialog), 12); action_area = gtk_dialog_get_action_area ( diff --git a/plugins/caldav/caldav-browse-server.c b/plugins/caldav/caldav-browse-server.c index 46c7c9f923..95937e0dbf 100644 --- a/plugins/caldav/caldav-browse-server.c +++ b/plugins/caldav/caldav-browse-server.c @@ -40,7 +40,6 @@ #include #include -#include #include "caldav-browse-server.h" diff --git a/plugins/calendar-file/calendar-file.c b/plugins/calendar-file/calendar-file.c index b554843d65..e81411a153 100644 --- a/plugins/calendar-file/calendar-file.c +++ b/plugins/calendar-file/calendar-file.c @@ -27,9 +27,6 @@ #include #include -/* backward-compatibility cruft */ -#include "e-util/gtk-compat.h" - gint e_plugin_lib_enable (EPlugin *ep, gint enable); gint diff --git a/plugins/calendar-weather/calendar-weather.c b/plugins/calendar-weather/calendar-weather.c index 3dda9ebd4a..45cb5c48ed 100644 --- a/plugins/calendar-weather/calendar-weather.c +++ b/plugins/calendar-weather/calendar-weather.c @@ -37,9 +37,6 @@ #include #undef GWEATHER_I_KNOW_THIS_IS_UNSTABLE -/* backward-compatibility cruft */ -#include "e-util/gtk-compat.h" - GtkWidget *e_calendar_weather_location (EPlugin *epl, EConfigHookItemFactoryData *data); GtkWidget *e_calendar_weather_refresh (EPlugin *epl, EConfigHookItemFactoryData *data); GtkWidget *e_calendar_weather_units (EPlugin *epl, EConfigHookItemFactoryData *data); diff --git a/plugins/email-custom-header/email-custom-header.c b/plugins/email-custom-header/email-custom-header.c index 6deb67a8e6..24e76e3d6c 100644 --- a/plugins/email-custom-header/email-custom-header.c +++ b/plugins/email-custom-header/email-custom-header.c @@ -35,9 +35,6 @@ #include "e-util/e-util.h" #include "email-custom-header.h" -/* backward-compatibility cruft */ -#include "e-util/gtk-compat.h" - #define d(x) #define GCONF_KEY_CUSTOM_HEADER "/apps/evolution/eplugin/email_custom_header/customHeader" diff --git a/plugins/external-editor/external-editor.c b/plugins/external-editor/external-editor.c index 97ddc5b8a2..be215706ba 100644 --- a/plugins/external-editor/external-editor.c +++ b/plugins/external-editor/external-editor.c @@ -47,9 +47,6 @@ #include -/* backward-compatibility cruft */ -#include "e-util/gtk-compat.h" - #define d(x) #define EDITOR_GCONF_KEY_COMMAND "/apps/evolution/eplugin/external-editor/editor-command" diff --git a/plugins/google-account-setup/google-contacts-source.c b/plugins/google-account-setup/google-contacts-source.c index 0fe49911b0..85e52df1c3 100644 --- a/plugins/google-account-setup/google-contacts-source.c +++ b/plugins/google-account-setup/google-contacts-source.c @@ -37,9 +37,6 @@ #include "google-contacts-source.h" -/* backward-compatibility cruft */ -#include "e-util/gtk-compat.h" - void ensure_google_contacts_source_group (void) { diff --git a/plugins/mark-all-read/mark-all-read.c b/plugins/mark-all-read/mark-all-read.c index 6e527d653c..20b5a2d5e3 100644 --- a/plugins/mark-all-read/mark-all-read.c +++ b/plugins/mark-all-read/mark-all-read.c @@ -38,9 +38,6 @@ #include #include -/* backward-compatibility cruft */ -#include "e-util/gtk-compat.h" - #define PRIMARY_TEXT \ N_("Also mark messages in subfolders?") #define SECONDARY_TEXT \ @@ -114,9 +111,6 @@ prompt_user (gboolean has_subfolders) dialog = gtk_dialog_new (); widget = gtk_dialog_get_action_area (GTK_DIALOG (dialog)); gtk_widget_hide (widget); -#if !GTK_CHECK_VERSION(2,90,7) - g_object_set (dialog, "has-separator", FALSE, NULL); -#endif gtk_window_set_title (GTK_WINDOW (dialog), ""); g_signal_connect ( dialog, "map", diff --git a/plugins/publish-calendar/url-editor-dialog.c b/plugins/publish-calendar/url-editor-dialog.c index 89bec64276..4af662def4 100644 --- a/plugins/publish-calendar/url-editor-dialog.c +++ b/plugins/publish-calendar/url-editor-dialog.c @@ -29,9 +29,6 @@ #include #include -/* backward-compatibility cruft */ -#include "e-util/gtk-compat.h" - static GtkDialogClass *parent_class = NULL; static void @@ -381,9 +378,6 @@ url_editor_dialog_construct (UrlEditorDialog *dialog) gtk_container_add (GTK_CONTAINER (content_area), toplevel); gtk_container_set_border_width (GTK_CONTAINER (dialog), 6); -#if !GTK_CHECK_VERSION(2,90,7) - g_object_set (dialog, "has-separator", FALSE, NULL); -#endif dialog->cancel = gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL); dialog->ok = gtk_dialog_add_button (GTK_DIALOG (dialog), GTK_STOCK_OK, GTK_RESPONSE_OK); -- cgit v1.2.3 From ba05584de52f5f953eee7e458ebf4d45da5a3319 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 13 Jan 2011 22:55:52 -0500 Subject: Dialogs no longer have separators. --- plugins/caldav/caldav-browse-server.c | 2 +- plugins/email-custom-header/org-gnome-email-custom-header.ui | 1 - plugins/groupwise-features/proxy-add-dialog.ui | 1 - plugins/groupwise-features/proxy-login-dialog.ui | 1 - plugins/groupwise-features/share-folder-common.c | 2 +- 5 files changed, 2 insertions(+), 5 deletions(-) (limited to 'plugins') diff --git a/plugins/caldav/caldav-browse-server.c b/plugins/caldav/caldav-browse-server.c index 95937e0dbf..00bcdcfebc 100644 --- a/plugins/caldav/caldav-browse-server.c +++ b/plugins/caldav/caldav-browse-server.c @@ -1521,7 +1521,7 @@ caldav_browse_server (GtkWindow *parent, const gchar *server_url, const gchar *u dialog = gtk_dialog_new_with_buttons ( _("Browse for a CalDAV calendar"), parent, - GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR, + GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); diff --git a/plugins/email-custom-header/org-gnome-email-custom-header.ui b/plugins/email-custom-header/org-gnome-email-custom-header.ui index e1d347df8c..26857d9997 100644 --- a/plugins/email-custom-header/org-gnome-email-custom-header.ui +++ b/plugins/email-custom-header/org-gnome-email-custom-header.ui @@ -17,7 +17,6 @@ GDK_GRAVITY_NORTH_WEST True False - True True diff --git a/plugins/groupwise-features/proxy-add-dialog.ui b/plugins/groupwise-features/proxy-add-dialog.ui index e1050f4f4f..3aafc15ead 100644 --- a/plugins/groupwise-features/proxy-add-dialog.ui +++ b/plugins/groupwise-features/proxy-add-dialog.ui @@ -16,7 +16,6 @@ GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True - True True diff --git a/plugins/groupwise-features/proxy-login-dialog.ui b/plugins/groupwise-features/proxy-login-dialog.ui index a8c33317ca..341c63f832 100644 --- a/plugins/groupwise-features/proxy-login-dialog.ui +++ b/plugins/groupwise-features/proxy-login-dialog.ui @@ -16,7 +16,6 @@ GDK_WINDOW_TYPE_HINT_DIALOG GDK_GRAVITY_NORTH_WEST True - True True diff --git a/plugins/groupwise-features/share-folder-common.c b/plugins/groupwise-features/share-folder-common.c index 4a4e57aa11..790edb4d8a 100644 --- a/plugins/groupwise-features/share-folder-common.c +++ b/plugins/groupwise-features/share-folder-common.c @@ -313,7 +313,7 @@ new_folder_response (EMFolderSelector *emfs, gint response, EMFolderTreeModel *m cnc = get_cnc (store); users_dialog = gtk_dialog_new_with_buttons ( - _("Users"), NULL, GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); + _("Users"), NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); w = gtk_label_new_with_mnemonic (_("Enter the users and set permissions")); gtk_widget_show (w); content_area = gtk_dialog_get_content_area (GTK_DIALOG (users_dialog)); -- cgit v1.2.3 From 21ab8044dab93b6367463593628ec42befda4f67 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 29 Jan 2011 10:50:53 -0500 Subject: Coding style and whitespace cleanup. --- plugins/caldav/caldav-source.c | 4 +++- plugins/google-account-setup/google-contacts-source.c | 10 +++++++--- plugins/vcard-inline/vcard-inline.c | 7 +++++-- 3 files changed, 15 insertions(+), 6 deletions(-) (limited to 'plugins') diff --git a/plugins/caldav/caldav-source.c b/plugins/caldav/caldav-source.c index 8c99c81567..6f50ae4dcb 100644 --- a/plugins/caldav/caldav-source.c +++ b/plugins/caldav/caldav-source.c @@ -252,7 +252,9 @@ oge_caldav (EPlugin *epl, g_free (username); mail = e_plugin_util_add_entry (parent, _("User e-_mail:"), source, "usermail"); - autoschedule = e_plugin_util_add_check (parent, _("Server _handles meeting invitations"), source, "autoschedule", "1", "0"); + autoschedule = e_plugin_util_add_check ( + parent, _("Server _handles meeting invitations"), + source, "autoschedule", "1", "0"); browse_cal = gtk_button_new_with_mnemonic (_("Brows_e server for a calendar")); gtk_widget_show (browse_cal); diff --git a/plugins/google-account-setup/google-contacts-source.c b/plugins/google-account-setup/google-contacts-source.c index 85e52df1c3..46f0d4362c 100644 --- a/plugins/google-account-setup/google-contacts-source.c +++ b/plugins/google-account-setup/google-contacts-source.c @@ -213,8 +213,12 @@ check_username_filled (ESource *source) g_return_val_if_fail (source != NULL, NULL); - if (g_ascii_strncasecmp (GOOGLE_BASE_URI, e_source_group_peek_base_uri (e_source_peek_group (source)), strlen (GOOGLE_BASE_URI)) == 0) { - gchar *username = g_strdup (e_source_get_property (source, "username")); + if (g_ascii_strncasecmp ( + GOOGLE_BASE_URI, e_source_group_peek_base_uri ( + e_source_peek_group (source)), strlen (GOOGLE_BASE_URI)) == 0) { + gchar *username; + + username = g_strdup (e_source_get_property (source, "username")); if (username) username = g_strstrip (username); @@ -238,7 +242,7 @@ plugin_google_contacts_check (EPlugin *epl, EConfigHookPageCheckData *data) t = (EABConfigTargetSource *) data->target; g_return_val_if_fail (t->source != NULL, NULL); - return check_username_filled (t->source); + return check_username_filled (t->source); } struct ui_data { diff --git a/plugins/vcard-inline/vcard-inline.c b/plugins/vcard-inline/vcard-inline.c index dfa19666e9..c4ab567b22 100644 --- a/plugins/vcard-inline/vcard-inline.c +++ b/plugins/vcard-inline/vcard-inline.c @@ -158,14 +158,17 @@ org_gnome_vcard_inline_save_cb (VCardInlinePObject *vcard_object) dialog = e_source_selector_dialog_new (NULL, vcard_object->source_list); - e_source_selector_dialog_select_default_source (E_SOURCE_SELECTOR_DIALOG (dialog)); + e_source_selector_dialog_select_default_source ( + E_SOURCE_SELECTOR_DIALOG (dialog)); if (gtk_dialog_run (GTK_DIALOG (dialog)) != GTK_RESPONSE_OK) { gtk_widget_destroy (dialog); return; } - source = e_source_selector_dialog_peek_primary_selection (E_SOURCE_SELECTOR_DIALOG (dialog)); + source = e_source_selector_dialog_peek_primary_selection ( + E_SOURCE_SELECTOR_DIALOG (dialog)); + gtk_widget_destroy (dialog); g_return_if_fail (source != NULL); -- cgit v1.2.3 From 0109aa3a92b484ebb85c6481e5a8e39819b1f011 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 30 Jan 2011 11:32:55 -0500 Subject: More whitespace cleanup. --- plugins/addressbook-file/addressbook-file.c | 2 +- plugins/audio-inline/audio-inline.c | 4 +- plugins/bogo-junk-plugin/bf-junk-filter.c | 2 +- plugins/caldav/caldav-source.c | 2 +- plugins/email-custom-header/email-custom-header.c | 52 ++++++------- plugins/email-custom-header/email-custom-header.h | 4 +- plugins/google-account-setup/google-source.c | 2 +- plugins/groupwise-features/camel-gw-listener.c | 64 ++++++++-------- .../groupwise-features/groupwise-account-setup.c | 6 +- plugins/groupwise-features/proxy-login.c | 6 +- plugins/groupwise-features/proxy.c | 20 ++--- plugins/groupwise-features/send-options.c | 4 +- plugins/itip-formatter/itip-formatter.c | 80 ++++++++++---------- plugins/sa-junk-plugin/em-junk-filter.c | 2 +- plugins/save-calendar/csv-format.c | 6 +- plugins/tnef-attachments/tnef-plugin.c | 88 +++++++++++----------- 16 files changed, 172 insertions(+), 172 deletions(-) (limited to 'plugins') diff --git a/plugins/addressbook-file/addressbook-file.c b/plugins/addressbook-file/addressbook-file.c index 0adcf9a701..cb742588e3 100644 --- a/plugins/addressbook-file/addressbook-file.c +++ b/plugins/addressbook-file/addressbook-file.c @@ -43,7 +43,7 @@ e_book_file_dummy (EPlugin *epl, EConfigHookItemFactoryData *data) gchar *uri_text; const gchar *relative_uri; - uri_text = e_source_get_uri (source); + uri_text = e_source_get_uri (source); if (strncmp (uri_text, "file", 4)) { g_free (uri_text); diff --git a/plugins/audio-inline/audio-inline.c b/plugins/audio-inline/audio-inline.c index 3aebff938e..a454709757 100644 --- a/plugins/audio-inline/audio-inline.c +++ b/plugins/audio-inline/audio-inline.c @@ -244,9 +244,9 @@ org_gnome_audio_inline_play_clicked (GtkWidget *button, EMFormatHTMLPObject *pob } } - gst_element_get_state (po->playbin, &cur_state, NULL, 0); + gst_element_get_state (po->playbin, &cur_state, NULL, 0); - if (cur_state >= GST_STATE_PAUSED) { + if (cur_state >= GST_STATE_PAUSED) { gst_element_set_state (po->playbin, GST_STATE_READY); } diff --git a/plugins/bogo-junk-plugin/bf-junk-filter.c b/plugins/bogo-junk-plugin/bf-junk-filter.c index ddaf200af2..7d479ce611 100644 --- a/plugins/bogo-junk-plugin/bf-junk-filter.c +++ b/plugins/bogo-junk-plugin/bf-junk-filter.c @@ -401,7 +401,7 @@ org_gnome_bogo_convert_unicode (struct _EPlugin *epl, struct _EConfigHookItemFac g_object_get (data->parent, "n-rows", &n_rows, NULL); if (data->old) - return data->old; + return data->old; check = gtk_check_button_new_with_mnemonic (_("Convert message text to _Unicode")); diff --git a/plugins/caldav/caldav-source.c b/plugins/caldav/caldav-source.c index 6f50ae4dcb..ec15c70453 100644 --- a/plugins/caldav/caldav-source.c +++ b/plugins/caldav/caldav-source.c @@ -248,7 +248,7 @@ oge_caldav (EPlugin *epl, user, "changed", G_CALLBACK (user_changed_cb), source); - g_free (uri); + g_free (uri); g_free (username); mail = e_plugin_util_add_entry (parent, _("User e-_mail:"), source, "usermail"); diff --git a/plugins/email-custom-header/email-custom-header.c b/plugins/email-custom-header/email-custom-header.c index 24e76e3d6c..23f474c5ef 100644 --- a/plugins/email-custom-header/email-custom-header.c +++ b/plugins/email-custom-header/email-custom-header.c @@ -83,7 +83,7 @@ GtkWidget *org_gnome_email_custom_header_config_option (struct _EPlugin *epl, st gint e_plugin_lib_enable (EPlugin *ep, gint enable) { - return 0; + return 0; } static void @@ -335,8 +335,8 @@ epech_setup_widgets (CustomHeaderOptionsDialog *mch) /* To create an empty label widget. Text will be added dynamically. */ priv->header_type_name_label = gtk_label_new (""); temp_header_ptr = &g_array_index (priv->email_custom_header_details, EmailCustomHeaderDetails,header_section_id); - str = (temp_header_ptr->header_type_value)->str; - if (strcmp (str, security_field) == 0) + str = (temp_header_ptr->header_type_value)->str; + if (strcmp (str, security_field) == 0) str = g_dpgettext2 (GETTEXT_PACKAGE, "email-custom-header-Security", security_field); gtk_label_set_markup (GTK_LABEL (priv->header_type_name_label), str); @@ -351,7 +351,7 @@ epech_setup_widgets (CustomHeaderOptionsDialog *mch) } for (sub_index = 0,row_combo = 0,column_combo = 1; sub_index < priv->combo_box_header_value->len; - sub_index++,row_combo++,column_combo++) { + sub_index++,row_combo++,column_combo++) { temp = &g_array_index (priv->email_custom_header_details, EmailCustomHeaderDetails,sub_index); sub_combo_box_ptr = &g_array_index (priv->combo_box_header_value, HeaderValueComboBox,sub_index); @@ -485,25 +485,25 @@ epech_append_to_custom_header (CustomHeaderOptionsDialog *dialog, gint state, gp static void epech_custom_header_options_commit (EMsgComposer *comp, gpointer user_data) { - EMsgComposer *composer; - EmailCustomHeaderWindow *new_email_custom_header_window = NULL; - CustomHeaderOptionsDialog *current_dialog = NULL; + EMsgComposer *composer; + EmailCustomHeaderWindow *new_email_custom_header_window = NULL; + CustomHeaderOptionsDialog *current_dialog = NULL; - composer = (EMsgComposer *) user_data; + composer = (EMsgComposer *) user_data; - if (!user_data || !EMAIL_CUSTOM_HEADER_OPTIONS_IS_DIALOG (user_data)) + if (!user_data || !EMAIL_CUSTOM_HEADER_OPTIONS_IS_DIALOG (user_data)) return; new_email_custom_header_window = g_object_get_data ((GObject *) composer, "compowindow"); - if (new_email_custom_header_window) { + if (new_email_custom_header_window) { current_dialog = new_email_custom_header_window->epech_dialog; - } + } - if (current_dialog) { + if (current_dialog) { g_free (current_dialog); current_dialog = NULL; - } + } if (new_email_custom_header_window) { g_free (new_email_custom_header_window); @@ -526,12 +526,12 @@ epech_check_existing_composer_window (gconstpointer compowindow, gconstpointer o static void destroy_compo_data (gpointer data) { - EmailCustomHeaderWindow *compo_data = (EmailCustomHeaderWindow *) data; + EmailCustomHeaderWindow *compo_data = (EmailCustomHeaderWindow *) data; - if (!compo_data) - return; + if (!compo_data) + return; - g_free (compo_data); + g_free (compo_data); } static void action_email_custom_header_cb (GtkAction *action, EMsgComposer *composer) @@ -554,10 +554,10 @@ static void action_email_custom_header_cb (GtkAction *action, EMsgComposer *comp } else { dialog = epech_dialog_new (); if (dialog) { - EmailCustomHeaderWindow *new_email_custom_header_window; - new_email_custom_header_window = g_new0 (EmailCustomHeaderWindow, 1); - new_email_custom_header_window->epech_window = window; - new_email_custom_header_window->epech_dialog = dialog; + EmailCustomHeaderWindow *new_email_custom_header_window; + new_email_custom_header_window = g_new0 (EmailCustomHeaderWindow, 1); + new_email_custom_header_window->epech_window = window; + new_email_custom_header_window->epech_dialog = dialog; g_object_set_data_full ((GObject *) composer, "compowindow", new_email_custom_header_window, destroy_compo_data); } } @@ -613,12 +613,12 @@ commit_changes (ConfigData *cd) -1); /* Check if the keyword is not empty */ - if ((keyword) && (g_utf8_strlen (g_strstrip (keyword), -1) > 0)) { - if ((value) && (g_utf8_strlen (g_strstrip (value), -1) > 0)) { + if ((keyword) && (g_utf8_strlen (g_strstrip (keyword), -1) > 0)) { + if ((value) && (g_utf8_strlen (g_strstrip (value), -1) > 0)) { keyword = g_strconcat (keyword, "=", value, NULL); - } - header_config_list = g_slist_append (header_config_list, g_strdup (keyword)); - } + } + header_config_list = g_slist_append (header_config_list, g_strdup (keyword)); + } g_free (keyword); g_free (value); diff --git a/plugins/email-custom-header/email-custom-header.h b/plugins/email-custom-header/email-custom-header.h index ac2b8f1204..00fa2ef763 100644 --- a/plugins/email-custom-header/email-custom-header.h +++ b/plugins/email-custom-header/email-custom-header.h @@ -65,8 +65,8 @@ struct _CustomHeaderOptionsDialogClass { typedef struct _EmailCustomHeaderWindow { - GdkWindow *epech_window; - CustomHeaderOptionsDialog *epech_dialog; + GdkWindow *epech_window; + CustomHeaderOptionsDialog *epech_dialog; }EmailCustomHeaderWindow; enum { diff --git a/plugins/google-account-setup/google-source.c b/plugins/google-account-setup/google-source.c index b5865c7780..335aece2e5 100644 --- a/plugins/google-account-setup/google-source.c +++ b/plugins/google-account-setup/google-source.c @@ -119,7 +119,7 @@ static gboolean is_email (const gchar *address) { /* This is supposed to check if the address's domain could be - an FQDN but alas, it's not worth the pain and suffering. */ + an FQDN but alas, it's not worth the pain and suffering. */ const gchar *at; at = strchr (address, '@'); diff --git a/plugins/groupwise-features/camel-gw-listener.c b/plugins/groupwise-features/camel-gw-listener.c index fff8af3dd1..ff00f50913 100644 --- a/plugins/groupwise-features/camel-gw-listener.c +++ b/plugins/groupwise-features/camel-gw-listener.c @@ -143,17 +143,17 @@ static GwAccountInfo* lookup_account_info (const gchar *key) { GList *list; - GwAccountInfo *info; + GwAccountInfo *info; gint found = 0; - if (!key) - return NULL; + if (!key) + return NULL; info = NULL; - for (list = g_list_first (groupwise_accounts); list; list = g_list_next (list)) { - info = (GwAccountInfo *) (list->data); - found = (strcmp (info->uid, key) == 0); + for (list = g_list_first (groupwise_accounts); list; list = g_list_next (list)) { + info = (GwAccountInfo *) (list->data); + found = (strcmp (info->uid, key) == 0); if (found) break; } @@ -175,7 +175,7 @@ add_esource (const gchar *conf_key, GwAccountInfo *info, const gchar *source_na ESourceList *source_list; ESourceGroup *group; ESource *source; - GConfClient* client; + GConfClient* client; GSList *ids, *temp; const gchar *source_selection_key; gchar *relative_uri; @@ -268,15 +268,15 @@ static void remove_esource (const gchar *conf_key, const gchar *group_name, gchar * source_name, const gchar * relative_uri) { ESourceList *list; - GSList *groups; + GSList *groups; gboolean found_group; GConfClient* client; GSList *ids; GSList *node_tobe_deleted; const gchar *source_selection_key; - client = gconf_client_get_default (); - list = e_source_list_new_for_gconf (client, conf_key); + client = gconf_client_get_default (); + list = e_source_list_new_for_gconf (client, conf_key); groups = e_source_list_peek_groups (list); found_group = FALSE; @@ -339,7 +339,7 @@ static void modify_esource (const gchar * conf_key, GwAccountInfo *old_account_info, EAccount *a, CamelURL *new_url) { ESourceList *list; - GSList *groups; + GSList *groups; gchar *old_relative_uri; CamelURL *url; gboolean found_group; @@ -356,7 +356,7 @@ modify_esource (const gchar * conf_key, GwAccountInfo *old_account_info, EAccoun old_relative_uri = g_strdup_printf ("%s@%s/", url->user, poa_address); client = gconf_client_get_default (); - list = e_source_list_new_for_gconf (client, conf_key); + list = e_source_list_new_for_gconf (client, conf_key); groups = e_source_list_peek_groups (list); found_group = FALSE; @@ -456,7 +456,7 @@ static GList* get_addressbook_names_from_server (gchar *source_url) { gchar *key; - EGwConnection *cnc; + EGwConnection *cnc; gchar *password; GList *book_list = NULL; gint status, count = 0; @@ -472,15 +472,15 @@ get_addressbook_names_from_server (gchar *source_url) guint32 flags = E_PASSWORDS_REMEMBER_FOREVER|E_PASSWORDS_SECRET; url = camel_url_new (source_url, NULL); - if (url == NULL) { - return NULL; - } + if (url == NULL) { + return NULL; + } poa_address = url->host; if (!poa_address || strlen (poa_address) ==0) return NULL; soap_port = camel_url_get_param (url, "soap_port"); - if (!soap_port || strlen (soap_port) == 0) + if (!soap_port || strlen (soap_port) == 0) soap_port = "7191"; use_ssl = camel_url_get_param (url, "use_ssl"); @@ -571,8 +571,8 @@ add_addressbook_sources (EAccount *account) { CamelURL *url; ESourceList *list; - ESourceGroup *group; - ESource *source; + ESourceGroup *group; + ESource *source; gchar *base_uri; const gchar *soap_port; GList *books_list, *temp_list; @@ -581,7 +581,7 @@ add_addressbook_sources (EAccount *account) const gchar *poa_address; gboolean is_frequent_contacts = FALSE, is_writable = FALSE; - url = camel_url_new (account->source->url, NULL); + url = camel_url_new (account->source->url, NULL); if (url == NULL) { return FALSE; } @@ -663,7 +663,7 @@ modify_addressbook_sources ( EAccount *account, GwAccountInfo *existing_account_ { CamelURL *url; ESourceList *list; - ESourceGroup *group; + ESourceGroup *group; GSList *groups; gboolean found_group; gboolean delete_group; @@ -746,7 +746,7 @@ static void remove_addressbook_sources (GwAccountInfo *existing_account_info) { ESourceList *list; - ESourceGroup *group; + ESourceGroup *group; GSList *groups; gboolean found_group; CamelURL *url; @@ -841,7 +841,7 @@ account_removed (EAccountList *account_listener, EAccount *account) g_free (info->uid); g_free (info->name); g_free (info->source_url); - g_free (info); + g_free (info); } static void @@ -1014,15 +1014,15 @@ camel_gw_listener_get_type (void) if (!camel_gw_listener_type) { static GTypeInfo info = { - sizeof (CamelGwListenerClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) camel_gw_listener_class_init, - NULL, NULL, - sizeof (CamelGwListener), - 0, - (GInstanceInitFunc) camel_gw_listener_init - }; + sizeof (CamelGwListenerClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) camel_gw_listener_class_init, + NULL, NULL, + sizeof (CamelGwListener), + 0, + (GInstanceInitFunc) camel_gw_listener_init + }; camel_gw_listener_type = g_type_register_static (PARENT_TYPE, "CamelGwListener", &info, 0); } diff --git a/plugins/groupwise-features/groupwise-account-setup.c b/plugins/groupwise-features/groupwise-account-setup.c index 4cd8c3ca56..335a3b525e 100644 --- a/plugins/groupwise-features/groupwise-account-setup.c +++ b/plugins/groupwise-features/groupwise-account-setup.c @@ -50,9 +50,9 @@ static void set_esource_props (const gchar *path, EAccount *a, GConfClient *client, const gchar *name) { ESourceList *list; - GSList *groups; + GSList *groups; - list = e_source_list_new_for_gconf (client, path); + list = e_source_list_new_for_gconf (client, path); groups = e_source_list_peek_groups (list); for (; groups != NULL; groups = g_slist_next (groups)) { @@ -84,7 +84,7 @@ set_esource_props (const gchar *path, EAccount *a, GConfClient *client, const gc void ensure_mandatory_esource_properties (EPlugin *ep, ESEventTargetUpgrade *target) { - GConfClient* client; + GConfClient* client; EAccountList *al; EIterator *it; diff --git a/plugins/groupwise-features/proxy-login.c b/plugins/groupwise-features/proxy-login.c index e40771295b..61e32216a4 100644 --- a/plugins/groupwise-features/proxy-login.c +++ b/plugins/groupwise-features/proxy-login.c @@ -159,7 +159,7 @@ proxy_login_get_type (void) }; type = g_type_register_static (G_TYPE_OBJECT, "proxyLoginType", - &info, 0); + &info, 0); } return type; @@ -192,7 +192,7 @@ proxy_get_password (EAccount *account, gchar **user_name, gchar **password) return 0; soap_port = camel_url_get_param (url, "soap_port"); - if (!soap_port || strlen (soap_port) == 0) + if (!soap_port || strlen (soap_port) == 0) soap_port = "7191"; use_ssl = camel_url_get_param (url, "use_ssl"); @@ -235,7 +235,7 @@ proxy_login_get_cnc (EAccount *account, GtkWindow *password_dlg_parrent) return NULL; soap_port = camel_url_get_param (url, "soap_port"); - if (!soap_port || strlen (soap_port) == 0) + if (!soap_port || strlen (soap_port) == 0) soap_port = "7191"; use_ssl = camel_url_get_param (url, "use_ssl"); diff --git a/plugins/groupwise-features/proxy.c b/plugins/groupwise-features/proxy.c index 3d350232db..555d3f716b 100644 --- a/plugins/groupwise-features/proxy.c +++ b/plugins/groupwise-features/proxy.c @@ -233,7 +233,7 @@ proxy_dialog_get_type (void) type = g_type_register_static (G_TYPE_OBJECT, "proxyDialogType", - &info, 0); + &info, 0); } return type; @@ -477,7 +477,7 @@ proxy_get_cnc (EAccount *account, GtkWindow *parent_window) return NULL; soap_port = camel_url_get_param (url, "soap_port"); - if (!soap_port || strlen (soap_port) == 0) + if (!soap_port || strlen (soap_port) == 0) soap_port = "7191"; use_ssl = camel_url_get_param (url, "use_ssl"); @@ -853,7 +853,7 @@ static void proxy_remove_account (GtkWidget *button, EAccount *account) { GtkTreeIter iter; - GtkTreeModel *model; + GtkTreeModel *model; proxyDialogPrivate *priv; proxyHandler *deleted; GtkTreeSelection* account_select; @@ -864,8 +864,8 @@ proxy_remove_account (GtkWidget *button, EAccount *account) priv = prd->priv; account_select = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->tree)); - if (gtk_tree_selection_get_selected (account_select, &model, &iter)) { - gtk_tree_model_get (model, &iter, ACCOUNT_NAME, &account_mailid, -1); + if (gtk_tree_selection_get_selected (account_select, &model, &iter)) { + gtk_tree_model_get (model, &iter, ACCOUNT_NAME, &account_mailid, -1); account_mailid = g_strrstr (account_mailid, "\n") + 1; deleted = proxy_get_item_from_list (account, account_mailid); @@ -873,7 +873,7 @@ proxy_remove_account (GtkWidget *button, EAccount *account) deleted->flags |= E_GW_PROXY_DELETED; proxy_update_tree_view (account); - } + } } static void @@ -998,7 +998,7 @@ static void proxy_edit_account (GtkWidget *button, EAccount *account) { GtkTreeIter iter; - GtkTreeModel *model; + GtkTreeModel *model; proxyDialogPrivate *priv; GtkTreeSelection* account_select; proxyHandler *edited; @@ -1014,8 +1014,8 @@ proxy_edit_account (GtkWidget *button, EAccount *account) account_select = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->tree)); - if (gtk_tree_selection_get_selected (account_select, &model, &iter)) { - gtk_tree_model_get (model, &iter, ACCOUNT_NAME, &account_mailid, -1); + if (gtk_tree_selection_get_selected (account_select, &model, &iter)) { + gtk_tree_model_get (model, &iter, ACCOUNT_NAME, &account_mailid, -1); account_mailid = g_strrstr (account_mailid, "\n") + 1; edited = proxy_get_item_from_list (account, account_mailid); if (edited) { @@ -1034,5 +1034,5 @@ proxy_edit_account (GtkWidget *button, EAccount *account) gtk_widget_hide (contacts); gtk_widget_show (GTK_WIDGET (priv->main)); } - } + } } diff --git a/plugins/groupwise-features/send-options.c b/plugins/groupwise-features/send-options.c index a3c08ca90c..8b0aa48b55 100644 --- a/plugins/groupwise-features/send-options.c +++ b/plugins/groupwise-features/send-options.c @@ -67,7 +67,7 @@ get_cnc (GtkWindow *parent_window) return NULL; soap_port = camel_url_get_param (url, "soap_port"); - if (!soap_port || strlen (soap_port) == 0) + if (!soap_port || strlen (soap_port) == 0) soap_port = "7191"; use_ssl = camel_url_get_param (url, "use_ssl"); @@ -350,7 +350,7 @@ send_options_copy_check_changed (EGwSendOptions *n_opts) e_send_options_copy_status_options (sod->data->copts, gcopts); e_send_options_copy_status_options (sod->data->topts, gtopts); - if (check_general_changed (ggopts, o_gopts)) + if (check_general_changed (ggopts, o_gopts)) changed = TRUE; if (check_status_options_changed (gmopts, o_gmopts)) changed = TRUE; diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index 149d1652c7..a401865c0e 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -730,7 +730,7 @@ find_cal_opened_cb (ECal *ecal, const GError *error, gpointer data) * Replies only make sense for events with an organizer. */ if (!e_cal_get_static_capability (ecal, CAL_STATIC_CAPABILITY_SAVE_SCHEDULES) && - (pitip->method == ICAL_METHOD_PUBLISH || pitip->method == ICAL_METHOD_REQUEST) && + (pitip->method == ICAL_METHOD_PUBLISH || pitip->method == ICAL_METHOD_REQUEST) && pitip->has_organizer) { rsvp_enabled = TRUE; } @@ -848,7 +848,7 @@ find_server (struct _itip_puri *pitip, ECalComponent *comp) sources = e_source_group_peek_sources (group); for (m = sources; m; m = m->next) { - gchar *source_uri = NULL; + gchar *source_uri = NULL; source = m->data; @@ -2036,7 +2036,7 @@ view_response_cb (GtkWidget *widget, ItipViewResponse response, gpointer data) /*FIXME Save schedules is misused here, remove it */ save_schedules = e_cal_get_static_capability (pitip->current_ecal, - CAL_STATIC_CAPABILITY_SAVE_SCHEDULES); + CAL_STATIC_CAPABILITY_SAVE_SCHEDULES); switch (response) { case ITIP_VIEW_RESPONSE_ACCEPT: @@ -2153,40 +2153,40 @@ view_response_cb (GtkWidget *widget, ItipViewResponse response, gpointer data) if (!save_schedules && pitip->delete_message && pitip->folder) camel_folder_delete_message (pitip->folder, pitip->uid); - if (itip_view_get_rsvp (ITIP_VIEW (pitip->view)) && status) { - ECalComponent *comp = NULL; - icalcomponent *ical_comp; - icalvalue *value; - const gchar *attendee, *comment; - GSList *l, *list = NULL; + if (itip_view_get_rsvp (ITIP_VIEW (pitip->view)) && status) { + ECalComponent *comp = NULL; + icalcomponent *ical_comp; + icalvalue *value; + const gchar *attendee, *comment; + GSList *l, *list = NULL; gboolean found; - comp = e_cal_component_clone (pitip->comp); - if (comp == NULL) - return; + comp = e_cal_component_clone (pitip->comp); + if (comp == NULL) + return; - if (pitip->to_address == NULL) - find_to_address (pitip, pitip->ical_comp, NULL); - g_assert (pitip->to_address != NULL); + if (pitip->to_address == NULL) + find_to_address (pitip, pitip->ical_comp, NULL); + g_assert (pitip->to_address != NULL); - ical_comp = e_cal_component_get_icalcomponent (comp); + ical_comp = e_cal_component_get_icalcomponent (comp); /* Remove all attendees except the one we are responding as */ found = FALSE; - for (prop = icalcomponent_get_first_property (ical_comp, ICAL_ATTENDEE_PROPERTY); - prop != NULL; - prop = icalcomponent_get_next_property (ical_comp, ICAL_ATTENDEE_PROPERTY)) - { - gchar *text; - - value = icalproperty_get_value (prop); - if (!value) - continue; + for (prop = icalcomponent_get_first_property (ical_comp, ICAL_ATTENDEE_PROPERTY); + prop != NULL; + prop = icalcomponent_get_next_property (ical_comp, ICAL_ATTENDEE_PROPERTY)) + { + gchar *text; + + value = icalproperty_get_value (prop); + if (!value) + continue; - attendee = icalvalue_get_string (value); + attendee = icalvalue_get_string (value); - text = g_strdup (itip_strip_mailto (attendee)); - text = g_strstrip (text); + text = g_strdup (itip_strip_mailto (attendee)); + text = g_strstrip (text); /* We do this to ensure there is at most one * attendee in the response */ @@ -2194,15 +2194,15 @@ view_response_cb (GtkWidget *widget, ItipViewResponse response, gpointer data) list = g_slist_prepend (list, prop); else if (!g_ascii_strcasecmp (pitip->to_address, text)) found = TRUE; - g_free (text); - } + g_free (text); + } - for (l = list; l; l = l->next) { - prop = l->data; - icalcomponent_remove_property (ical_comp, prop); - icalproperty_free (prop); - } - g_slist_free (list); + for (l = list; l; l = l->next) { + prop = l->data; + icalcomponent_remove_property (ical_comp, prop); + icalproperty_free (prop); + } + g_slist_free (list); /* Add a comment if there user set one */ comment = itip_view_get_rsvp_comment (ITIP_VIEW (pitip->view)); @@ -2219,17 +2219,17 @@ view_response_cb (GtkWidget *widget, ItipViewResponse response, gpointer data) e_cal_component_set_comment_list (comp, &comments); } - e_cal_component_rescan (comp); - if (itip_send_comp (E_CAL_COMPONENT_METHOD_REPLY, comp, pitip->current_ecal, pitip->top_level, NULL, NULL, TRUE, FALSE) && pitip->folder) { + e_cal_component_rescan (comp); + if (itip_send_comp (E_CAL_COMPONENT_METHOD_REPLY, comp, pitip->current_ecal, pitip->top_level, NULL, NULL, TRUE, FALSE) && pitip->folder) { camel_folder_set_message_flags ( pitip->folder, pitip->uid, CAMEL_MESSAGE_ANSWERED, CAMEL_MESSAGE_ANSWERED); } - g_object_unref (comp); + g_object_unref (comp); - } + } } static gboolean diff --git a/plugins/sa-junk-plugin/em-junk-filter.c b/plugins/sa-junk-plugin/em-junk-filter.c index 830a10563b..ed52242ade 100644 --- a/plugins/sa-junk-plugin/em-junk-filter.c +++ b/plugins/sa-junk-plugin/em-junk-filter.c @@ -942,7 +942,7 @@ org_gnome_sa_use_remote_tests (struct _EPlugin *epl, struct _EConfigHookItemFact g_object_get (data->parent, "n-rows", &n_rows, NULL); if (data->old) - return data->old; + return data->old; check = gtk_check_button_new_with_mnemonic (_("I_nclude remote tests")); label = gtk_label_new (NULL); diff --git a/plugins/save-calendar/csv-format.c b/plugins/save-calendar/csv-format.c index 6b147d88a2..a91c813799 100644 --- a/plugins/save-calendar/csv-format.c +++ b/plugins/save-calendar/csv-format.c @@ -281,9 +281,9 @@ userstring_to_systemstring (const gchar *userstring) i++; break; case 't': - str = g_string_append_c (str, '\t'); - i++; - break; + str = g_string_append_c (str, '\t'); + i++; + break; } } else { str = g_string_append_c (str, text[i]); diff --git a/plugins/tnef-attachments/tnef-plugin.c b/plugins/tnef-attachments/tnef-plugin.c index 9828b60e7d..e25bff8afc 100644 --- a/plugins/tnef-attachments/tnef-plugin.c +++ b/plugins/tnef-attachments/tnef-plugin.c @@ -100,14 +100,14 @@ org_gnome_format_tnef (gpointer ep, EMFormatHookTarget *t) g_object_unref (out); /* Extracting the winmail.dat */ - TNEFInitialize (&tnef); + TNEFInitialize (&tnef); tnef.Debug = verbose; - if (TNEFParseFile (name, &tnef) == -1) { + if (TNEFParseFile (name, &tnef) == -1) { printf("ERROR processing file\n"); - } + } processTnef (&tnef, tmpdir); - TNEFFree (&tnef); + TNEFFree (&tnef); /* Extraction done */ dir = opendir (tmpdir); @@ -772,7 +772,7 @@ void printRrule (FILE *fptr, gchar *recur_data, gint size, TNEFStruct *tnef) variableLength *filename; if (size < 0x1F) { - return; + return; } fprintf(fptr, "RRULE:FREQ="); @@ -780,63 +780,63 @@ void printRrule (FILE *fptr, gchar *recur_data, gint size, TNEFStruct *tnef) if (recur_data[0x04] == 0x0A) { fprintf(fptr, "DAILY"); - if (recur_data[0x16] == 0x23 || recur_data[0x16] == 0x22 || - recur_data[0x16] == 0x21) { - if ((filename=MAPIFindUserProp (&(tnef->MapiProperties), - PROP_TAG (PT_I2, 0x0011))) != MAPI_UNDEFINED) { + if (recur_data[0x16] == 0x23 || recur_data[0x16] == 0x22 || + recur_data[0x16] == 0x21) { + if ((filename=MAPIFindUserProp (&(tnef->MapiProperties), + PROP_TAG (PT_I2, 0x0011))) != MAPI_UNDEFINED) { fprintf(fptr, ";INTERVAL=%d", *(filename->data)); - } - if (recur_data[0x16] == 0x22 || recur_data[0x16] == 0x21) { + } + if (recur_data[0x16] == 0x22 || recur_data[0x16] == 0x21) { fprintf(fptr, ";COUNT=%d", - getRruleCount (recur_data[0x1B], recur_data[0x1A])); - } - } else if (recur_data[0x16] == 0x3E) { + getRruleCount (recur_data[0x1B], recur_data[0x1A])); + } + } else if (recur_data[0x16] == 0x3E) { fprintf(fptr, ";BYDAY=MO,TU,WE,TH,FR"); - if (recur_data[0x1A] == 0x22 || recur_data[0x1A] == 0x21) { + if (recur_data[0x1A] == 0x22 || recur_data[0x1A] == 0x21) { fprintf(fptr, ";COUNT=%d", - getRruleCount (recur_data[0x1F], recur_data[0x1E])); - } - } + getRruleCount (recur_data[0x1F], recur_data[0x1E])); + } + } } else if (recur_data[0x04] == 0x0B) { fprintf(fptr, "WEEKLY;INTERVAL=%d;BYDAY=%s", - recur_data[0x0E], getRruleDayname (recur_data[0x16])); - if (recur_data[0x1A] == 0x22 || recur_data[0x1A] == 0x21) { + recur_data[0x0E], getRruleDayname (recur_data[0x16])); + if (recur_data[0x1A] == 0x22 || recur_data[0x1A] == 0x21) { fprintf(fptr, ";COUNT=%d", - getRruleCount (recur_data[0x1F], recur_data[0x1E])); - } + getRruleCount (recur_data[0x1F], recur_data[0x1E])); + } } else if (recur_data[0x04] == 0x0C) { fprintf(fptr, "MONTHLY"); - if (recur_data[0x06] == 0x02) { + if (recur_data[0x06] == 0x02) { fprintf(fptr, ";INTERVAL=%d;BYMONTHDAY=%d", recur_data[0x0E], - recur_data[0x16]); - if (recur_data[0x1A] == 0x22 || recur_data[0x1A] == 0x21) { + recur_data[0x16]); + if (recur_data[0x1A] == 0x22 || recur_data[0x1A] == 0x21) { fprintf(fptr, ";COUNT=%d", getRruleCount(recur_data[0x1F], - recur_data[0x1E])); - } - } else if (recur_data[0x06] == 0x03) { + recur_data[0x1E])); + } + } else if (recur_data[0x06] == 0x03) { fprintf(fptr, ";BYDAY=%s;BYSETPOS=%d;INTERVAL=%d", - getRruleDayname (recur_data[0x16]), - recur_data[0x1A] == 0x05 ? -1 : recur_data[0x1A], - recur_data[0x0E]); - if (recur_data[0x1E] == 0x22 || recur_data[0x1E] == 0x21) { + getRruleDayname (recur_data[0x16]), + recur_data[0x1A] == 0x05 ? -1 : recur_data[0x1A], + recur_data[0x0E]); + if (recur_data[0x1E] == 0x22 || recur_data[0x1E] == 0x21) { fprintf(fptr, ";COUNT=%d", getRruleCount(recur_data[0x23], - recur_data[0x22])); - } - } + recur_data[0x22])); + } + } } else if (recur_data[0x04] == 0x0D) { fprintf(fptr, "YEARLY;BYMONTH=%d", - getRruleMonthNum (recur_data[0x0A], recur_data[0x0B])); - if (recur_data[0x06] == 0x02) { + getRruleMonthNum (recur_data[0x0A], recur_data[0x0B])); + if (recur_data[0x06] == 0x02) { fprintf(fptr, ";BYMONTHDAY=%d", recur_data[0x16]); - } else if (recur_data[0x06] == 0x03) { + } else if (recur_data[0x06] == 0x03) { fprintf(fptr, ";BYDAY=%s;BYSETPOS=%d", - getRruleDayname (recur_data[0x16]), - recur_data[0x1A] == 0x05 ? -1 : recur_data[0x1A]); - } - if (recur_data[0x1E] == 0x22 || recur_data[0x1E] == 0x21) { + getRruleDayname (recur_data[0x16]), + recur_data[0x1A] == 0x05 ? -1 : recur_data[0x1A]); + } + if (recur_data[0x1E] == 0x22 || recur_data[0x1E] == 0x21) { fprintf(fptr, ";COUNT=%d", getRruleCount(recur_data[0x23], - recur_data[0x22])); - } + recur_data[0x22])); + } } fprintf(fptr, "\n"); } -- cgit v1.2.3 From dc94b1067eda911a0670d31bef996297af2db92c Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Mon, 31 Jan 2011 14:03:34 +0100 Subject: Add translator comment. See bug #641020. --- plugins/groupwise-features/camel-gw-listener.c | 1 + 1 file changed, 1 insertion(+) (limited to 'plugins') diff --git a/plugins/groupwise-features/camel-gw-listener.c b/plugins/groupwise-features/camel-gw-listener.c index ff00f50913..02af85b91f 100644 --- a/plugins/groupwise-features/camel-gw-listener.c +++ b/plugins/groupwise-features/camel-gw-listener.c @@ -503,6 +503,7 @@ get_addressbook_names_from_server (gchar *source_url) password = e_passwords_get_password ("Groupwise", key); if (!password) { + /* Translators: First %s is the server name, second %s is user name */ password_prompt = g_strdup_printf (_("Enter password for %s (user %s)"), poa_address, url->user); prompt = g_strconcat (failed_auth ? failed_auth : "", password_prompt, NULL); -- cgit v1.2.3 From a9fb511ced4cfaffb7109e58a9db66e6279e309c Mon Sep 17 00:00:00 2001 From: Punit Jain Date: Tue, 1 Feb 2011 12:17:05 +0530 Subject: bug #641069 - tnef plugin vulnerabilities Resolves directory traversal and buffer overflow vulnerabilities. --- plugins/tnef-attachments/tnef-plugin.c | 102 ++++++++++++++++++++++----------- 1 file changed, 69 insertions(+), 33 deletions(-) (limited to 'plugins') diff --git a/plugins/tnef-attachments/tnef-plugin.c b/plugins/tnef-attachments/tnef-plugin.c index e25bff8afc..4148008264 100644 --- a/plugins/tnef-attachments/tnef-plugin.c +++ b/plugins/tnef-attachments/tnef-plugin.c @@ -25,6 +25,7 @@ /* We include gi18n-lib.h so that we have strings translated directly for this package */ #include +#include #include #include @@ -67,6 +68,19 @@ guchar getRruleCount (guchar a, guchar b); guchar getRruleMonthNum (guchar a, guchar b); gchar * getRruleDayname (guchar a); +static gchar* +sanitize_filename (const gchar *filename) +{ + gchar * sanitized_name; + sanitized_name = g_path_get_basename (filename); + if (sanitized_name == NULL || !g_strcmp0 (sanitized_name, ".")) { + g_free (sanitized_name); + return NULL; + } else { + return g_strdelimit (sanitized_name, " ", '_'); + } +} + void org_gnome_format_tnef (gpointer ep, EMFormatHookTarget *t) { @@ -216,8 +230,9 @@ void processTnef (TNEFStruct *tnef, const gchar *tmpdir) { Attachment *p; gint RealAttachment; gint object; - gchar ifilename[256]; - gint i, count; + gchar *ifilename = NULL; + gchar *absfilename, *file; + gint count; gint foundCal=0; FILE *fptr; @@ -255,10 +270,13 @@ void processTnef (TNEFStruct *tnef, const gchar *tmpdir) { != MAPI_UNDEFINED) { variableLength buf; if ((buf.data = (gchar *) DecompressRTF (filename, &buf.size)) != NULL) { - sprintf(ifilename, "%s/%s.rtf", tmpdir, tnef->subject.data); - for (i=0; isubject.data); + if (!file) + return; + absfilename = g_strconcat (file, ".rtf", NULL); + ifilename = g_build_filename (tmpdir, file, NULL); + g_free (absfilename); + g_free (file); if ((fptr = fopen(ifilename, "wb"))==NULL) { printf("ERROR: Error writing file to disk!"); @@ -347,13 +365,14 @@ void processTnef (TNEFStruct *tnef, const gchar *tmpdir) { } if (filename->size == 1) { filename->size = 20; - sprintf(tmpname, "file_%03i.dat", count); + g_sprintf(tmpname, "file_%03i.dat", count); filename->data = tmpname; } - sprintf(ifilename, "%s/%s", tmpdir, filename->data); - for (i=0; idata); + if (!absfilename) + return; + ifilename = g_build_filename (tmpdir, absfilename, NULL); + g_free (absfilename); if ((fptr = fopen(ifilename, "wb"))==NULL) { printf("ERROR: Error writing file to disk!"); @@ -375,33 +394,43 @@ void processTnef (TNEFStruct *tnef, const gchar *tmpdir) { } /* if size>0 */ p=p->next; } /* while p!= null */ + g_free (ifilename); } void saveVCard (TNEFStruct *tnef, const gchar *tmpdir) { - gchar ifilename[512]; + gchar *ifilename; + gchar *absfilename, *file=NULL; FILE *fptr; variableLength *vl; variableLength *pobox, *street, *city, *state, *zip, *country; dtr thedate; - gint boolean, i; + gint boolean; if ((vl = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_DISPLAY_NAME))) == MAPI_UNDEFINED) { if ((vl=MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_COMPANY_NAME))) == MAPI_UNDEFINED) { if (tnef->subject.size > 0) { - sprintf(ifilename, "%s/%s.vcard", tmpdir, tnef->subject.data); - } else { - sprintf(ifilename, "%s/unknown.vcard", tmpdir); - } - } else { - sprintf(ifilename, "%s/%s.vcard", tmpdir, vl->data); + file = sanitize_filename (tnef->subject.data); + if (!file) + return; + absfilename = g_strconcat (file, ".vcard", NULL); + } else + absfilename = g_strdup ("unknown.vcard"); + } else { + file = sanitize_filename (vl->data); + if (!file) + return; + absfilename = g_strconcat (file, ".vcard", NULL); } } else { - sprintf(ifilename, "%s/%s.vcard", tmpdir, vl->data); + file = sanitize_filename (vl->data); + if (!file) + return; + absfilename = g_strconcat (file, ".vcard", NULL); } - for (i=0; idata[index] == ' ') vl->data[index--] = 0; - sprintf(ifilename, "%s/%s.ics", tmpdir, vl->data); - for (i=0; idata); + if (!file) + return; + absfilename = g_strconcat (file, ".vcf", NULL); + ifilename = g_build_filename (tmpdir, absfilename, NULL); + g_free (file); + g_free (absfilename); + printf("%s\n", ifilename); if ((fptr = fopen(ifilename, "wb"))==NULL) { @@ -1210,7 +1246,7 @@ void saveVTask (TNEFStruct *tnef, const gchar *tmpdir) { fprintf(fptr, "END:VCALENDAR\n"); fclose (fptr); } - + g_free (ifilename); } void fprintProperty (TNEFStruct *tnef, FILE *fptr, DWORD proptype, DWORD propid, const gchar text[]) { -- cgit v1.2.3 From a10247b540f298d0ae6360b5d31f7f47a733adf8 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 1 Feb 2011 18:09:00 +0100 Subject: Bug #635144 - Using external editor duplicates signature --- plugins/external-editor/external-editor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/external-editor/external-editor.c b/plugins/external-editor/external-editor.c index be215706ba..b3f58410af 100644 --- a/plugins/external-editor/external-editor.c +++ b/plugins/external-editor/external-editor.c @@ -193,7 +193,7 @@ update_composer_text (GArray *array) composer = g_array_index (array, gpointer, 0); text = g_array_index (array, gpointer, 1); - e_msg_composer_set_body_text (composer, text, -1); + e_msg_composer_set_body_text (composer, text, FALSE); enable_composer (composer); -- cgit v1.2.3 From c49e3012a029bb78dc759a9fc8dfc1103a36d976 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Vr=C3=A1til?= Date: Wed, 2 Feb 2011 17:07:07 -0500 Subject: Bug 222423 - Support Face headers The configuration section for the Face plugin now has a preview image. Also promoting this plugin out of "experimental" status so more distros will pick it up. --- plugins/face/face.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'plugins') diff --git a/plugins/face/face.c b/plugins/face/face.c index 57e80832e6..576a5acfb8 100644 --- a/plugins/face/face.c +++ b/plugins/face/face.c @@ -27,7 +27,7 @@ #include "composer/e-msg-composer.h" #include -#include +#include #include #include #include @@ -282,8 +282,8 @@ choose_new_face (void) GtkWidget *filesel, *preview; GtkFileFilter *filter; - filesel = gtk_file_chooser_dialog_new (_ - ("Select a png picture (the best 48*48 of size < 720 bytes)"), + filesel = gtk_file_chooser_dialog_new ( + _("Select a Face Picture"), NULL, GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, @@ -328,18 +328,15 @@ toggled_check_include_by_default_cb (GtkWidget *widget, gpointer data) } static void -click_load_face_cb (GtkButton *butt, gpointer data) +click_load_face_cb (GtkButton *butt, + GtkImage *image) { GdkPixbuf *face; - GtkWidget *img; - - img = gtk_button_get_image (butt); - g_return_if_fail (img != NULL); face = choose_new_face (); if (face) { - gtk_image_set_from_pixbuf (GTK_IMAGE (img), face); + gtk_image_set_from_pixbuf (image, face); g_object_unref (face); } } @@ -364,11 +361,12 @@ get_cfg_widget (void) g_object_unref (face); butt = gtk_button_new_with_mnemonic (_("Load new _Face picture")); - gtk_button_set_image (GTK_BUTTON (butt), img); - g_signal_connect (butt, "clicked", G_CALLBACK (click_load_face_cb), NULL); + g_signal_connect (butt, "clicked", G_CALLBACK (click_load_face_cb), img); gtk_box_pack_start (GTK_BOX (vbox), butt, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox), img, FALSE, FALSE, 0); + gtk_widget_show_all (vbox); return vbox; -- cgit v1.2.3 From 0478e01708ab2460901f7a2fb8cae749a4e85c45 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 3 Feb 2011 10:45:03 +0100 Subject: Bug #641011 - Ugly appointment editing windows --- plugins/imap-features/imap-headers.c | 1 + 1 file changed, 1 insertion(+) (limited to 'plugins') diff --git a/plugins/imap-features/imap-headers.c b/plugins/imap-features/imap-headers.c index 9ec5fb923e..dd4032ed6d 100644 --- a/plugins/imap-features/imap-headers.c +++ b/plugins/imap-features/imap-headers.c @@ -340,6 +340,7 @@ org_gnome_imap_headers (EPlugin *epl, EConfigHookItemFactoryData *data) g_signal_connect (selection, "changed", G_CALLBACK (epif_tv_selection_changed), ui->remove_header); gtk_notebook_append_page ((GtkNotebook *)(data->parent), vbox, gtk_label_new(_("IMAP Headers"))); + gtk_container_child_set (GTK_CONTAINER (data->parent), vbox, "tab-fill", FALSE, "tab-expand", FALSE, NULL); gtk_widget_show_all (vbox); return GTK_WIDGET (vbox); -- cgit v1.2.3 From ba348cbed126b4b636339d1317ad6a1e908a37b7 Mon Sep 17 00:00:00 2001 From: Bharath Acharya Date: Mon, 7 Feb 2011 10:05:22 +0530 Subject: Bug #641451 - Crash in folder_selection_button_new Crash when importing any pst file. --- plugins/dbx-import/dbx-importer.c | 16 +++++++++++----- plugins/pst-import/pst-importer.c | 14 +++++++++----- 2 files changed, 20 insertions(+), 10 deletions(-) (limited to 'plugins') diff --git a/plugins/dbx-import/dbx-importer.c b/plugins/dbx-import/dbx-importer.c index 0105dfe236..c7d1e6cb92 100644 --- a/plugins/dbx-import/dbx-importer.c +++ b/plugins/dbx-import/dbx-importer.c @@ -67,6 +67,7 @@ #include #include +#include #include #include #include @@ -90,10 +91,6 @@ gint e_plugin_lib_enable (EPlugin *ep, gint enable); so declare the functions here TODO: sort out whether this should really be private */ -typedef struct _EMFolderSelectionButton EMFolderSelectionButton; -GtkWidget *em_folder_selection_button_new (const gchar *title, const gchar *caption); -void em_folder_selection_button_set_selection (EMFolderSelectionButton *button, const gchar *uri); -const gchar *em_folder_selection_button_get_selection (EMFolderSelectionButton *button); typedef struct { MailMsg base; @@ -189,6 +186,9 @@ folder_selected (EMFolderSelectionButton *button, EImportTargetURI *target) GtkWidget * org_gnome_evolution_readdbx_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) { + EShell *shell; + EShellBackend *shell_backend; + EMailSession *session; GtkWidget *hbox, *w; GtkLabel *label; gchar *select_uri = NULL; @@ -229,8 +229,14 @@ org_gnome_evolution_readdbx_getwidget (EImport *ei, EImportTarget *target, EImpo label = GTK_LABEL (w); + shell = e_shell_get_default (); + shell_backend = e_shell_get_backend_by_name (shell, "mail"); + session = e_mail_backend_get_session (E_MAIL_BACKEND (shell_backend)); + w = em_folder_selection_button_new ( - _("Select folder"), _("Select folder to import OE folder into")); + session, _("Select folder"), + _("Select folder to import into")); + gtk_label_set_mnemonic_widget (label, w); em_folder_selection_button_set_selection ((EMFolderSelectionButton *)w, select_uri); folder_selected ((EMFolderSelectionButton *)w, (EImportTargetURI *)target); diff --git a/plugins/pst-import/pst-importer.c b/plugins/pst-import/pst-importer.c index d0a69ddece..40cd745bbf 100644 --- a/plugins/pst-import/pst-importer.c +++ b/plugins/pst-import/pst-importer.c @@ -54,6 +54,7 @@ #include #include +#include #include #include #include @@ -100,10 +101,6 @@ gint e_plugin_lib_enable (EPlugin *ep, gint enable); so declare the functions here TODO: sort out whether this should really be private */ -typedef struct _EMFolderSelectionButton EMFolderSelectionButton; -GtkWidget *em_folder_selection_button_new (const gchar *title, const gchar *caption); -void em_folder_selection_button_set_selection (EMFolderSelectionButton *button, const gchar *uri); -const gchar *em_folder_selection_button_get_selection (EMFolderSelectionButton *button); static guchar pst_signature[] = { '!', 'B', 'D', 'N' }; @@ -295,6 +292,9 @@ get_suggested_foldername (EImportTargetURI *target) GtkWidget * org_credativ_evolution_readpst_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) { + EShell *shell; + EShellBackend *shell_backend; + EMailSession *session; GtkWidget *hbox, *framebox, *w; gchar *foldername; @@ -313,7 +313,11 @@ org_credativ_evolution_readpst_getwidget (EImport *ei, EImportTarget *target, EI g_signal_connect (w, "toggled", G_CALLBACK (checkbox_mail_toggle_cb), target); gtk_box_pack_start ((GtkBox *) hbox, w, FALSE, FALSE, 0); - w = em_folder_selection_button_new (_("Select folder"), _("Select folder to import into")); + shell = e_shell_get_default (); + shell_backend = e_shell_get_backend_by_name (shell, "mail"); + session = e_mail_backend_get_session (E_MAIL_BACKEND (shell_backend)); + + w = em_folder_selection_button_new (session, _("Select folder"), _("Select folder to import into")); foldername = get_suggested_foldername ((EImportTargetURI *) target); ((EImportTargetURI *) target)->uri_dest = g_strdup (foldername); em_folder_selection_button_set_selection ((EMFolderSelectionButton *) w, foldername); -- cgit v1.2.3 From 2c31a5bc23cf5a092c0621bf34554ffb2b6ae2ec Mon Sep 17 00:00:00 2001 From: Kjartan Maraas Date: Tue, 8 Feb 2011 11:57:50 -0500 Subject: Bug 641756 - Fix warnings from GCC 4.6 GCC learned how to find dead assignments. --- plugins/dbx-import/dbx-importer.c | 3 --- plugins/sa-junk-plugin/em-junk-filter.c | 3 --- plugins/tnef-attachments/tnef-plugin.c | 4 ---- 3 files changed, 10 deletions(-) (limited to 'plugins') diff --git a/plugins/dbx-import/dbx-importer.c b/plugins/dbx-import/dbx-importer.c index c7d1e6cb92..ca6fc1fd99 100644 --- a/plugins/dbx-import/dbx-importer.c +++ b/plugins/dbx-import/dbx-importer.c @@ -750,7 +750,6 @@ void org_gnome_evolution_readdbx_import (EImport *ei, EImportTarget *target, EImportImporter *im) { DbxImporter *m; - gint id; m = mail_msg_new (&dbx_import_info); g_datalist_set_data (&target->data, "dbx-msg", m); @@ -771,8 +770,6 @@ org_gnome_evolution_readdbx_import (EImport *ei, EImportTarget *target, EImportI m->cancellable, "status", G_CALLBACK (dbx_status), m); - id = m->base.seq; - mail_msg_unordered_push (m); } diff --git a/plugins/sa-junk-plugin/em-junk-filter.c b/plugins/sa-junk-plugin/em-junk-filter.c index ed52242ade..19df46826a 100644 --- a/plugins/sa-junk-plugin/em-junk-filter.c +++ b/plugins/sa-junk-plugin/em-junk-filter.c @@ -712,14 +712,11 @@ em_junk_sa_report_junk (EPlugin *ep, EMJunkTarget *target) "spam", NULL }; - gchar *sub = NULL; CamelMimeMessage *msg = target->m; if (!is_installed) return; - sub = g_strdup (camel_mime_message_get_subject (msg)); - d(fprintf (stderr, "em_junk_sa_report_junk\n")); if (em_junk_sa_is_available (&target->error)) { if (no_allow_tell && em_junk_sa_local_only) diff --git a/plugins/tnef-attachments/tnef-plugin.c b/plugins/tnef-attachments/tnef-plugin.c index 4148008264..1324535328 100644 --- a/plugins/tnef-attachments/tnef-plugin.c +++ b/plugins/tnef-attachments/tnef-plugin.c @@ -878,7 +878,6 @@ void saveVCalendar (TNEFStruct *tnef, const gchar *tmpdir) { FILE *fptr; gint index; DWORD *dword_ptr; - DWORD dword_val; dtr thedate; ifilename = g_build_filename (tmpdir, "calendar.vcf", NULL); @@ -1098,7 +1097,6 @@ void saveVCalendar (TNEFStruct *tnef, const gchar *tmpdir) { if ((filename=MAPIFindUserProp (&(tnef->MapiProperties), PROP_TAG (PT_BOOLEAN, 0x8506))) != MAPI_UNDEFINED) { dword_ptr = (DWORD*)filename->data; - dword_val = SwapDWord ((BYTE*)dword_ptr); fprintf(fptr, "CLASS:" ); if (*dword_ptr == 1) { fprintf(fptr,"PRIVATE\n"); @@ -1131,7 +1129,6 @@ void saveVTask (TNEFStruct *tnef, const gchar *tmpdir) { dtr thedate; FILE *fptr; DWORD *dword_ptr; - DWORD dword_val; vl = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_CONVERSATION_TOPIC)); @@ -1234,7 +1231,6 @@ void saveVTask (TNEFStruct *tnef, const gchar *tmpdir) { PROP_TAG (PT_BOOLEAN, 0x8506)); if (filename != MAPI_UNDEFINED) { dword_ptr = (DWORD*)filename->data; - dword_val = SwapDWord ((BYTE*)dword_ptr); fprintf(fptr, "CLASS:" ); if (*dword_ptr == 1) { fprintf(fptr,"PRIVATE\n"); -- cgit v1.2.3 From 4adc621fe04e13a71227874f93850e78c3dd7b97 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 10 Feb 2011 12:16:21 +0100 Subject: Bug #641701 - Issues with pst-import plugin --- plugins/pst-import/pst-importer.c | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'plugins') diff --git a/plugins/pst-import/pst-importer.c b/plugins/pst-import/pst-importer.c index 40cd745bbf..f764848d12 100644 --- a/plugins/pst-import/pst-importer.c +++ b/plugins/pst-import/pst-importer.c @@ -114,7 +114,7 @@ struct _PstImporter { gchar *status_what; gint status_pc; gint status_timeout_id; - GCancellable *status; + GCancellable *cancellable; pst_file pst; @@ -650,6 +650,9 @@ string_to_utf8 (const gchar *string) { gchar *utf8; + if (g_utf8_validate (string, -1, NULL)) + return g_strdup (string); + utf8 = g_locale_to_utf8 (string, -1, NULL, NULL, NULL); return utf8; @@ -737,6 +740,11 @@ pst_create_folder (PstImporter *m) g_assert (g_str_has_prefix (dest, parent)); + if (m->folder) { + g_object_unref (m->folder); + m->folder = NULL; + } + dest_len = strlen (dest); dest_end = dest + dest_len; @@ -752,20 +760,20 @@ pst_create_folder (PstImporter *m) folder = e_mail_session_uri_to_folder_sync ( session, dest, CAMEL_STORE_FOLDER_CREATE, cancellable, &m->base.error); - g_object_unref (folder); + if (folder) + g_object_unref (folder); + else + break; *pos = '/'; } } g_free (dest); - if (m->folder) { - g_object_unref (m->folder); - } - - m->folder = e_mail_session_uri_to_folder_sync ( - session, m->folder_uri, CAMEL_STORE_FOLDER_CREATE, - cancellable, &m->base.error); + if (!m->base.error) + m->folder = e_mail_session_uri_to_folder_sync ( + session, m->folder_uri, CAMEL_STORE_FOLDER_CREATE, + cancellable, &m->base.error); } /** @@ -821,6 +829,8 @@ pst_process_email (PstImporter *m, pst_item *item) if (m->folder == NULL) { pst_create_folder (m); + if (!m->folder) + return; } camel_folder_freeze (m->folder); @@ -1591,7 +1601,7 @@ static void pst_import_free (PstImporter *m) { // pst_close (&m->pst); - g_object_unref (m->status); + g_object_unref (m->cancellable); g_free (m->status_what); g_mutex_free (m->status_lock); @@ -1670,9 +1680,10 @@ pst_import (EImport *ei, EImportTarget *target) m->status_timeout_id = g_timeout_add (100, pst_status_timeout, m); /*m->status_timeout_id = NULL;*/ m->status_lock = g_mutex_new (); + m->cancellable = camel_operation_new (); g_signal_connect ( - m->status, "status", + m->cancellable, "status", G_CALLBACK (pst_status), m); id = m->base.seq; @@ -1703,7 +1714,7 @@ org_credativ_evolution_readpst_cancel (EImport *ei, EImportTarget *target, EImpo PstImporter *m = g_datalist_get_data (&target->data, "pst-msg"); if (m) { - g_cancellable_cancel (m->status); + g_cancellable_cancel (m->cancellable); } } -- cgit v1.2.3 From 7a1677520d439aee68c5ab0268a951d0b411e3a0 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 12 Feb 2011 11:37:05 -0500 Subject: Remove NULL checks for GObject methods. As of GLib 2.28 all GObject virtual methods, including constructed(), are safe to chain up to unconditionally. Remove unnecessary checks. --- plugins/groupwise-features/junk-settings.c | 8 ++++---- plugins/groupwise-features/share-folder.c | 16 +++++++++------- plugins/itip-formatter/itip-view.c | 4 ++-- 3 files changed, 15 insertions(+), 13 deletions(-) (limited to 'plugins') diff --git a/plugins/groupwise-features/junk-settings.c b/plugins/groupwise-features/junk-settings.c index 4ec4159ab6..6b0233d2bc 100644 --- a/plugins/groupwise-features/junk-settings.c +++ b/plugins/groupwise-features/junk-settings.c @@ -93,13 +93,13 @@ junk_settings_finalise (GObject *obj) } static void -junk_settings_dispose (GObject *obj) +junk_settings_dispose (GObject *object) { - JunkSettings *js = (JunkSettings *) obj; + JunkSettings *js = (JunkSettings *) object; free_all (js); - if (G_OBJECT_CLASS (parent_class)->dispose) - G_OBJECT_CLASS (parent_class)->dispose (obj); + /* Chain up to parent's dispose() method. */ + G_OBJECT_CLASS (parent_class)->dispose (object); } static void diff --git a/plugins/groupwise-features/share-folder.c b/plugins/groupwise-features/share-folder.c index 765232d915..ea42265b4f 100644 --- a/plugins/groupwise-features/share-folder.c +++ b/plugins/groupwise-features/share-folder.c @@ -95,23 +95,25 @@ share_folder_class_init (ShareFolderClass *klass) } static void -share_folder_finalise (GObject *obj) +share_folder_finalise (GObject *object) { - ShareFolder *sf = (ShareFolder *) obj; + ShareFolder *sf = (ShareFolder *) object; g_object_unref (sf->builder); free_all (sf); - G_OBJECT_CLASS (parent_class)->finalize (obj); + + /* Chain up to parent's finalize() method. */ + G_OBJECT_CLASS (parent_class)->finalize (object); } static void -share_folder_dispose (GObject *obj) +share_folder_dispose (GObject *object) { - ShareFolder *sf = (ShareFolder *) obj; + ShareFolder *sf = (ShareFolder *) object; free_all (sf); - if (G_OBJECT_CLASS (parent_class)->dispose) - G_OBJECT_CLASS (parent_class)->dispose (obj); + /* Chain up to parent's dispose() method. */ + G_OBJECT_CLASS (parent_class)->dispose (object); } static void diff --git a/plugins/itip-formatter/itip-view.c b/plugins/itip-formatter/itip-view.c index 4a2925196f..70ae97784e 100644 --- a/plugins/itip-formatter/itip-view.c +++ b/plugins/itip-formatter/itip-view.c @@ -915,8 +915,8 @@ itip_view_dispose (GObject *object) view->priv = NULL; } - if (G_OBJECT_CLASS (itip_view_parent_class)->dispose) - G_OBJECT_CLASS (itip_view_parent_class)->dispose (object); + /* Chain up to parent's dispose() method. */ + G_OBJECT_CLASS (itip_view_parent_class)->dispose (object); } static void -- cgit v1.2.3 From 4b9ac3879d25d14cbaaab9237626257c3561f7ff Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 14 Feb 2011 19:15:36 +0100 Subject: Fix few memory leaks --- plugins/calendar-weather/calendar-weather.c | 8 ++++++-- plugins/templates/templates.c | 2 -- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'plugins') diff --git a/plugins/calendar-weather/calendar-weather.c b/plugins/calendar-weather/calendar-weather.c index 45cb5c48ed..f9d1180429 100644 --- a/plugins/calendar-weather/calendar-weather.c +++ b/plugins/calendar-weather/calendar-weather.c @@ -49,7 +49,7 @@ gint e_plugin_lib_enable (EPlugin *epl, gint enable); gint e_plugin_lib_enable (EPlugin *epl, gint enable) { - GList *l; + GList *l, *saved_cats; const gchar *tmp; gint ii; @@ -71,8 +71,10 @@ e_plugin_lib_enable (EPlugin *epl, gint enable) tmp = _(categories[0].description); + saved_cats = e_categories_get_list (); + /* Add the categories icons if we don't have them. */ - for (l = e_categories_get_list (); l; l = g_list_next (l)) { + for (l = saved_cats; l; l = g_list_next (l)) { if (!strcmp ((const gchar *)l->data, tmp)) goto exit; } @@ -88,6 +90,8 @@ e_plugin_lib_enable (EPlugin *epl, gint enable) } exit: + g_list_free (saved_cats); + return 0; } diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c index 3e3bb49195..fd8f8021f7 100644 --- a/plugins/templates/templates.c +++ b/plugins/templates/templates.c @@ -629,8 +629,6 @@ build_template_menus_recurse (GtkUIManager *ui_manager, if (template == NULL) continue; - g_object_ref (template); - action_label = camel_mime_message_get_subject (template); if (action_label == NULL || *action_label == '\0') -- cgit v1.2.3 From fcb29478f605deb787c62fc7567c5c7f897585bb Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 18 Feb 2011 19:35:59 -0500 Subject: Coding style and whitespace cleanup. --- plugins/face/face.c | 2 +- plugins/tnef-attachments/tnef-plugin.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins') diff --git a/plugins/face/face.c b/plugins/face/face.c index 576a5acfb8..8f50f16d68 100644 --- a/plugins/face/face.c +++ b/plugins/face/face.c @@ -365,7 +365,7 @@ get_cfg_widget (void) gtk_box_pack_start (GTK_BOX (vbox), butt, FALSE, FALSE, 0); - gtk_box_pack_start (GTK_BOX (vbox), img, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox), img, FALSE, FALSE, 0); gtk_widget_show_all (vbox); diff --git a/plugins/tnef-attachments/tnef-plugin.c b/plugins/tnef-attachments/tnef-plugin.c index 1324535328..977189edb4 100644 --- a/plugins/tnef-attachments/tnef-plugin.c +++ b/plugins/tnef-attachments/tnef-plugin.c @@ -68,7 +68,7 @@ guchar getRruleCount (guchar a, guchar b); guchar getRruleMonthNum (guchar a, guchar b); gchar * getRruleDayname (guchar a); -static gchar* +static gchar * sanitize_filename (const gchar *filename) { gchar * sanitized_name; @@ -409,7 +409,7 @@ void saveVCard (TNEFStruct *tnef, const gchar *tmpdir) { if ((vl = MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_DISPLAY_NAME))) == MAPI_UNDEFINED) { if ((vl=MAPIFindProperty (&(tnef->MapiProperties), PROP_TAG (PT_STRING8, PR_COMPANY_NAME))) == MAPI_UNDEFINED) { if (tnef->subject.size > 0) { - file = sanitize_filename (tnef->subject.data); + file = sanitize_filename (tnef->subject.data); if (!file) return; absfilename = g_strconcat (file, ".vcard", NULL); @@ -1124,7 +1124,7 @@ void saveVTask (TNEFStruct *tnef, const gchar *tmpdir) { variableLength *filename; gint index; gchar *ifilename; - gchar *absfilename, *file; + gchar *absfilename, *file; gchar *charptr, *charptr2; dtr thedate; FILE *fptr; -- cgit v1.2.3 From a117ff91429fd396ad477d15e230a2d45aa2c98f Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 28 Feb 2011 16:07:27 +0100 Subject: Bug #641456 - Crash in pst_process_appointment at pst-importer.c --- plugins/pst-import/pst-importer.c | 83 ++++++++------------------------------- 1 file changed, 16 insertions(+), 67 deletions(-) (limited to 'plugins') diff --git a/plugins/pst-import/pst-importer.c b/plugins/pst-import/pst-importer.c index f764848d12..c9449695ca 100644 --- a/plugins/pst-import/pst-importer.c +++ b/plugins/pst-import/pst-importer.c @@ -1488,96 +1488,45 @@ fill_calcomponent (PstImporter *m, pst_item *item, ECalComponent *ec, const gcha } static void -pst_process_appointment (PstImporter *m, pst_item *item) +pst_process_component (PstImporter *m, pst_item *item, const gchar *comp_type, ECal *cal) { ECalComponent *ec; + GError *error = NULL; g_return_if_fail (item->appointment != NULL); ec = e_cal_component_new (); e_cal_component_set_new_vtype (ec, E_CAL_COMPONENT_EVENT); - fill_calcomponent (m, item, ec, "appointment"); - set_cal_attachments (m->calendar, ec, m, item->attach); + fill_calcomponent (m, item, ec, comp_type); + set_cal_attachments (cal, ec, m, item->attach); - if (!e_cal_create_object (m->calendar, e_cal_component_get_icalcomponent (ec), NULL, NULL)) { - g_warning("Creation of appointment failed"); - g_free (ec); + if (!e_cal_create_object (cal, e_cal_component_get_icalcomponent (ec), NULL, &error)) { + g_warning ("Creation of %s failed: %s", comp_type, error ? error->message : "Unknown error"); } g_object_unref (ec); + if (error) + g_error_free (error); } static void -pst_process_task (PstImporter *m, pst_item *item) +pst_process_appointment (PstImporter *m, pst_item *item) { - ECalComponent *ec; - - g_return_if_fail (item->appointment != NULL); - - ec = e_cal_component_new (); - e_cal_component_set_new_vtype (ec, E_CAL_COMPONENT_TODO); - - fill_calcomponent (m, item, ec, "task"); - set_cal_attachments (m->tasks, ec, m, item->attach); - - /* Note - libpst is missing many fields. E.g. task status, start/completion date, % complete */ - - if (!e_cal_create_object (m->tasks, e_cal_component_get_icalcomponent (ec), NULL, NULL)) { - g_warning("Creation of task failed"); - g_free (ec); - } - - g_object_unref (ec); + pst_process_component (m, item, "appointment", m->calendar); +} +static void +pst_process_task (PstImporter *m, pst_item *item) +{ + pst_process_component (m, item, "task", m->tasks); } static void pst_process_journal (PstImporter *m, pst_item *item) { - ECalComponent *ec; - - g_return_if_fail (item->appointment != NULL); - - /*j = item->journal;*/ - ec = e_cal_component_new (); - e_cal_component_set_new_vtype (ec, E_CAL_COMPONENT_JOURNAL); - - fill_calcomponent (m, item, ec, "journal"); - set_cal_attachments (m->journal, ec, m, item->attach); - - /* Note - an Evo memo entry does not have date started/finished or type fields :( */ - /*if (j) { - ECalComponentText text; - struct icaltimetype tt_start, tt_end; - ECalComponentDateTime dt_start, dt_end; - - if (j->start) { - tt_start = get_ical_date (j->start, FALSE); - dt_start.value = &tt_start; - dt_start.tzid = NULL; - e_cal_component_set_dtstart (ec, &dt_start); - g_message ("journal start:%s", rfc2445_datetime_format (j->start)); - } - - if (j->end) { - tt_end = get_ical_date (j->end, FALSE); - dt_end.value = &tt_end; - dt_end.tzid = NULL; - e_cal_component_set_dtend (ec, &dt_end); - g_message ("end:%s", rfc2445_datetime_format (j->end)); - } - g_message ("type: %s", j->type); - }*/ - - if (!e_cal_create_object (m->journal, e_cal_component_get_icalcomponent (ec), NULL, NULL)) { - g_warning("Creation of journal entry failed"); - g_free (ec); - } - - g_object_unref (ec); - + pst_process_component (m, item, "journal", m->journal); } /* Print an error message - maybe later bring up an error dialog? */ -- cgit v1.2.3 From 7cd21fa82a975cc5bbd640869bf77a62c7b30f0a Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 1 Mar 2011 12:08:39 +0100 Subject: Bug #642447 - Invalid reads while disabling groupwise account --- plugins/groupwise-features/camel-gw-listener.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'plugins') diff --git a/plugins/groupwise-features/camel-gw-listener.c b/plugins/groupwise-features/camel-gw-listener.c index 02af85b91f..28efe5c94b 100644 --- a/plugins/groupwise-features/camel-gw-listener.c +++ b/plugins/groupwise-features/camel-gw-listener.c @@ -324,6 +324,9 @@ remove_esource (const gchar *conf_key, const gchar *group_name, gchar * source_n } } + if (found_group) + break; + } } @@ -400,6 +403,9 @@ modify_esource (const gchar * conf_key, GwAccountInfo *old_account_info, EAccoun break; } } + + if (found_group) + break; } } @@ -749,7 +755,6 @@ remove_addressbook_sources (GwAccountInfo *existing_account_info) ESourceList *list; ESourceGroup *group; GSList *groups; - gboolean found_group; CamelURL *url; gchar *base_uri; GConfClient *client; @@ -769,17 +774,14 @@ remove_addressbook_sources (GwAccountInfo *existing_account_info) list = e_source_list_new_for_gconf (client, "/apps/evolution/addressbook/sources" ); groups = e_source_list_peek_groups (list); - found_group = FALSE; - - for (; groups != NULL && !found_group; groups = g_slist_next (groups)) { + for (; groups != NULL; groups = g_slist_next (groups)) { group = E_SOURCE_GROUP (groups->data); if ( strcmp ( e_source_group_peek_base_uri (group), base_uri) == 0 && strcmp (e_source_group_peek_name (group), existing_account_info->name) == 0) { e_source_list_remove_group (list, group); e_source_list_sync (list, NULL); - found_group = TRUE; - + break; } } g_object_unref (list); @@ -967,6 +969,7 @@ prune_proxies (void) { if (parent_id_name) { e_source_group_remove_source (group, source); e_source_list_remove_group (sources, group); + break; } } } -- cgit v1.2.3 From b22ac14482bbf215e5ad457104580c624706feda Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 1 Mar 2011 13:04:09 -0500 Subject: Fix Gtk-Doc comment notation. Seeing lots of what I assume to be doxygen syntax in comment blocks. --- plugins/pst-import/pst-importer.c | 65 ++++++++++++++++++++++++++------------- 1 file changed, 43 insertions(+), 22 deletions(-) (limited to 'plugins') diff --git a/plugins/pst-import/pst-importer.c b/plugins/pst-import/pst-importer.c index c9449695ca..afd4767d5c 100644 --- a/plugins/pst-import/pst-importer.c +++ b/plugins/pst-import/pst-importer.c @@ -206,8 +206,6 @@ folder_selected (EMFolderSelectionButton *button, EImportTargetURI *target) /** * Suggest a folder to import data into - * @param target - * @return */ static gchar * get_suggested_foldername (EImportTargetURI *target) @@ -639,11 +637,13 @@ pst_process_item (PstImporter *m, pst_desc_tree *d_ptr) } /** - * Convert string to utf8. Currently we just use the locale, but maybe there is encoding - * information hidden somewhere in the PST file? + * string_to_utf8: + * @string: String from PST file * - * @param string String from PST file - * @return utf8 representation (caller should free), or NULL for error. + * Convert string to utf8. Currently we just use the locale, but maybe + * there is encoding information hidden somewhere in the PST file? + * + * Returns: utf8 representation (caller should free), or NULL for error. */ gchar * string_to_utf8 (const gchar *string) @@ -659,9 +659,12 @@ string_to_utf8 (const gchar *string) } /** + * foldername_to_utf8: + * @foldername: from PST file + * * Convert foldername to utf8 and escape characters if needed - * @param foldername from PST file - * @return converted folder name, or NULL for error. Caller should free + * + * Returns: converted folder name, or NULL for error. Caller should free */ gchar * foldername_to_utf8 (const gchar *pstname) @@ -712,8 +715,11 @@ pst_process_folder (PstImporter *m, pst_item *item) } /** - * Create current folder in mail hierarchy. Parent folders will also be created. - * @param m PstImporter set to current folder + * pst_create_folder: + * @m: PstImporter set to current folder + * + * Create current folder in mail hierarchy. Parent folders will also be + * created. */ static void pst_create_folder (PstImporter *m) @@ -777,9 +783,13 @@ pst_create_folder (PstImporter *m) } /** - * Create a camel mime part from given PST attachment - * @param attach attachment to convert - * @return CamelMimePart containing data and mime type + * attachment_to_part: + * @m: a #PstImporter + * @attach: attachment to convert + * + * Create a #CamelMimePart from given PST attachment + * + * Returns: #CamelMimePart containing data and mime type */ static CamelMimePart * attachment_to_part (PstImporter *m, pst_item_attach *attach) @@ -1213,10 +1223,13 @@ pst_process_contact (PstImporter *m, pst_item *item) } /** + * get_ical_date: + * @date: time value from libpst + * @is_date: treat as date only (all day event)? + * * Convert pst time to icaltimetype - * @param date time value from libpst - * @param is_date treat as date only (all day event)? - * @return converted date + * + * Returns: converted date */ struct icaltimetype get_ical_date (FILETIME *date, gboolean is_date) @@ -1682,10 +1695,13 @@ e_plugin_lib_enable (EPlugin *ep, gint enable) } /** + * pst_init: + * @pst: pst_file structure to be used by libpst + * @filename: path to file + * * Open PST file and determine root folder name - * @param pst: pst_file structure to be used by libpst - * @param filename : path to file - * @return 0 for sucess, -1 for failure + * + * Returns: 0 for sucess, -1 for failure */ gint pst_init (pst_file *pst, gchar *filename) @@ -1717,10 +1733,15 @@ pst_init (pst_file *pst, gchar *filename) } /** + * get_pst_rootname: + * @pst: pst_file structure to be used by libpst + * @filename: if non %NULL, fallback to this name if folder name is not + * available + * * Open determine root folder name of PST file - * @param pst: pst_file structure to be used by libpst - * @param filename : if non NULL, fallback to this name if folder name is not available - * @return pointer to name of root folder (should be freed by caller), or NULL if error + * + * Returns: pointer to name of root folder (should be freed by caller), + * or %NULL if error */ gchar * get_pst_rootname (pst_file *pst, gchar *filename) -- cgit v1.2.3 From 2533e52b8cf543eed874d220a3f039eebe67253e Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 2 Mar 2011 15:12:02 +0100 Subject: Do not leak attachments in a mail view --- plugins/mail-to-task/mail-to-task.c | 1 + 1 file changed, 1 insertion(+) (limited to 'plugins') diff --git a/plugins/mail-to-task/mail-to-task.c b/plugins/mail-to-task/mail-to-task.c index 794badc969..558489578a 100644 --- a/plugins/mail-to-task/mail-to-task.c +++ b/plugins/mail-to-task/mail-to-task.c @@ -384,6 +384,7 @@ set_attachments (ECal *client, ECalComponent *comp, CamelMimeMessage *message) /* XXX Does this take ownership of the list? */ e_cal_component_set_attachment_list (comp, uri_list); + e_attachment_store_remove_all (store); g_object_unref (destination); g_object_unref (store); } -- cgit v1.2.3 From f1710c9a4a28132429ef945533c0a528f27a2fb8 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 4 Mar 2011 14:01:03 +0100 Subject: Bug #643693 - Crash opening attached text/html mail --- plugins/prefer-plain/prefer-plain.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/prefer-plain/prefer-plain.c b/plugins/prefer-plain/prefer-plain.c index 21c5a6b625..50b0d2852a 100644 --- a/plugins/prefer-plain/prefer-plain.c +++ b/plugins/prefer-plain/prefer-plain.c @@ -70,9 +70,25 @@ make_part_attachment (EMFormat *format, CamelStream *stream, CamelMimePart *part em_format_part_as ( format, stream, part, "application/octet-stream", NULL); - } else + } else if (i == -1 && CAMEL_IS_MIME_MESSAGE (part)) { + /* message was asked to be formatted as text/html; + might be for cases where message itself is a text/html part */ + CamelMimePart *new_part; + CamelDataWrapper *content; + + content = camel_medium_get_content (CAMEL_MEDIUM (part)); + g_return_if_fail (content != NULL); + + new_part = camel_mime_part_new (); + camel_medium_set_content (CAMEL_MEDIUM (new_part), content); + + em_format_part (format, stream, new_part, NULL); + + g_object_unref (new_part); + } else { /* FIXME Not passing a GCancellable here. */ em_format_part (format, stream, part, NULL); + } g_string_truncate (format->part_id, partidlen); } -- cgit v1.2.3 From c6fd77460f5baf88528f5da2ffb99e86a2885ff0 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 5 Mar 2011 12:33:49 -0500 Subject: Coding style and whitespace cleanup. --- plugins/dbx-import/dbx-importer.c | 53 ++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 14 deletions(-) (limited to 'plugins') diff --git a/plugins/dbx-import/dbx-importer.c b/plugins/dbx-import/dbx-importer.c index ca6fc1fd99..f4dd0506d5 100644 --- a/plugins/dbx-import/dbx-importer.c +++ b/plugins/dbx-import/dbx-importer.c @@ -81,13 +81,26 @@ #define gmtime_r(tp,tmp) (gmtime(tp)?(*(tmp)=*gmtime(tp),(tmp)):0) #endif -gboolean org_gnome_evolution_readdbx_supported (EPlugin *epl, EImportTarget *target); -GtkWidget *org_gnome_evolution_readdbx_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im); -void org_gnome_evolution_readdbx_import (EImport *ei, EImportTarget *target, EImportImporter *im); -void org_gnome_evolution_readdbx_cancel (EImport *ei, EImportTarget *target, EImportImporter *im); -gint e_plugin_lib_enable (EPlugin *ep, gint enable); - -/* em-folder-selection-button.h is private, even though other internal evo plugins use it! +gboolean org_gnome_evolution_readdbx_supported + (EPlugin *epl, + EImportTarget *target); +GtkWidget * org_gnome_evolution_readdbx_getwidget + (EImport *ei, + EImportTarget *target, + EImportImporter *im); +void org_gnome_evolution_readdbx_import + (EImport *ei, + EImportTarget *target, + EImportImporter *im); +void org_gnome_evolution_readdbx_cancel + (EImport *ei, + EImportTarget *target, + EImportImporter *im); +gint e_plugin_lib_enable (EPlugin *ep, + gint enable); + +/* em-folder-selection-button.h is private, even though other internal + * evo plugins use it! so declare the functions here TODO: sort out whether this should really be private */ @@ -184,7 +197,9 @@ folder_selected (EMFolderSelectionButton *button, EImportTargetURI *target) } GtkWidget * -org_gnome_evolution_readdbx_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) +org_gnome_evolution_readdbx_getwidget (EImport *ei, + EImportTarget *target, + EImportImporter *im) { EShell *shell; EShellBackend *shell_backend; @@ -330,7 +345,8 @@ static gboolean dbx_load_index_table (DbxImporter *m, guint32 pos, guint32 *inde return FALSE; } - d(printf("Index at %x: indexCount %x, anotherTablePtr %x\n", pos, tindex.indexCount, tindex.anotherTablePtr)); + d(printf("Index at %x: indexCount %x, anotherTablePtr %x\n", + pos, tindex.indexCount, tindex.anotherTablePtr)); if (tindex.indexCount > 0) { if (!dbx_load_index_table (m, tindex.anotherTablePtr, index_ofs)) @@ -454,7 +470,8 @@ dbx_read_mail_body (DbxImporter *m, guint32 offset, gint bodyfd) buffer = g_malloc (buflen); } d(printf("Reading %d bytes from %lx\n", hdr.blocksize, offset + sizeof(hdr))); - if (dbx_pread (m->dbx_fd, buffer, hdr.blocksize, offset + sizeof (hdr)) != hdr.blocksize) { + if (dbx_pread (m->dbx_fd, buffer, hdr.blocksize, + offset + sizeof (hdr)) != hdr.blocksize) { g_set_error ( &m->base.error, CAMEL_ERROR, CAMEL_ERROR_GENERIC, @@ -560,7 +577,9 @@ dbx_import_file (DbxImporter *m) gint missing = 0; m->status_what = NULL; filename = g_filename_from_uri (((EImportTargetURI *)m->target)->uri_src, NULL, NULL); - m->parent_uri = g_strdup (((EImportTargetURI *)m->target)->uri_dest); /* Destination folder, was set in our widget */ + + /* Destination folder, was set in our widget */ + m->parent_uri = g_strdup (((EImportTargetURI *)m->target)->uri_dest); cancellable = e_activity_get_cancellable (m->base.activity); @@ -727,7 +746,9 @@ dbx_status_timeout (gpointer data) pc = importer->status_pc; g_mutex_unlock (importer->status_lock); - e_import_status (importer->target->import, (EImportTarget *)importer->target, what, pc); + e_import_status ( + importer->target->import, + (EImportTarget *) importer->target, what, pc); } return TRUE; @@ -747,7 +768,9 @@ dbx_status (CamelOperation *op, const gchar *what, gint pc, gpointer data) /* Start the main import operation */ void -org_gnome_evolution_readdbx_import (EImport *ei, EImportTarget *target, EImportImporter *im) +org_gnome_evolution_readdbx_import (EImport *ei, + EImportTarget *target, + EImportImporter *im) { DbxImporter *m; @@ -774,7 +797,9 @@ org_gnome_evolution_readdbx_import (EImport *ei, EImportTarget *target, EImportI } void -org_gnome_evolution_readdbx_cancel (EImport *ei, EImportTarget *target, EImportImporter *im) +org_gnome_evolution_readdbx_cancel (EImport *ei, + EImportTarget *target, + EImportImporter *im) { DbxImporter *m = g_datalist_get_data (&target->data, "dbx-msg"); -- cgit v1.2.3 From 9a1d03400b5f3d035178a311607c53f56b237265 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 9 Mar 2011 11:52:31 +0100 Subject: Bug #641939 - [publish-calendar] Doesn't read online state on start --- plugins/publish-calendar/publish-calendar.c | 4 +++- plugins/publish-calendar/publish-calendar.ui | 21 +++++++++++++++++++++ plugins/publish-calendar/url-editor-dialog.c | 11 ++++++++++- 3 files changed, 34 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/publish-calendar/publish-calendar.c b/plugins/publish-calendar/publish-calendar.c index da9306331d..3ea3747108 100644 --- a/plugins/publish-calendar/publish-calendar.c +++ b/plugins/publish-calendar/publish-calendar.c @@ -934,8 +934,10 @@ e_plugin_lib_enable (EPlugin *ep, gint enable) if (shell) { g_signal_handlers_disconnect_by_func (shell, G_CALLBACK (online_state_changed), NULL); - if (enable) + if (enable) { + online = e_shell_get_online (shell); g_signal_connect (shell, "notify::online", G_CALLBACK (online_state_changed), NULL); + } } if (enable) { diff --git a/plugins/publish-calendar/publish-calendar.ui b/plugins/publish-calendar/publish-calendar.ui index 43205237b2..efd9613aec 100644 --- a/plugins/publish-calendar/publish-calendar.ui +++ b/plugins/publish-calendar/publish-calendar.ui @@ -401,6 +401,8 @@ 0 + False + False @@ -436,6 +438,8 @@ 1 + False + False @@ -471,16 +475,21 @@ 2 + False + False 1 + False + False False + False 1 @@ -543,6 +552,7 @@ False + True end 1 @@ -550,6 +560,8 @@ 0 + False + False @@ -578,6 +590,7 @@ False + True end 1 @@ -585,6 +598,8 @@ 1 + False + False @@ -614,6 +629,7 @@ False + True end 1 @@ -621,6 +637,8 @@ 2 + False + False @@ -642,11 +660,14 @@ 1 + False + False False + False 3 diff --git a/plugins/publish-calendar/url-editor-dialog.c b/plugins/publish-calendar/url-editor-dialog.c index 4af662def4..9c49dcb104 100644 --- a/plugins/publish-calendar/url-editor-dialog.c +++ b/plugins/publish-calendar/url-editor-dialog.c @@ -209,7 +209,8 @@ publish_service_changed (GtkComboBox *combo, UrlEditorDialog *dialog) break; case TYPE_URI: gtk_label_set_text_with_mnemonic (GTK_LABEL (dialog->server_label), "_Location (URI):"); - gtk_entry_set_text (GTK_ENTRY (dialog->server_entry), ""); + if (uri->service_type != TYPE_URI) + gtk_entry_set_text (GTK_ENTRY (dialog->server_entry), ""); gtk_widget_hide (dialog->file_hbox); gtk_widget_hide (dialog->optional_label); gtk_widget_hide (dialog->port_hbox); @@ -319,6 +320,9 @@ set_from_uri (UrlEditorDialog *dialog) if (euri->path) gtk_entry_set_text (GTK_ENTRY (dialog->file_entry), euri->path); + if (uri->service_type == TYPE_URI) + gtk_entry_set_text (GTK_ENTRY (dialog->server_entry), uri->location); + gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->publish_service), uri->service_type); e_uri_free (euri); @@ -426,6 +430,7 @@ url_editor_dialog_construct (UrlEditorDialog *dialog) if (uri->location && strlen (uri->location)) { set_from_uri (dialog); } + gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->publish_frequency), uri->publish_frequency); gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->type_selector), uri->publish_format); @@ -443,6 +448,10 @@ url_editor_dialog_construct (UrlEditorDialog *dialog) gtk_spin_button_set_value (GTK_SPIN_BUTTON (dialog->fb_duration_spin), uri->fb_duration_value); gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->fb_duration_combo), uri->fb_duration_type); + type_selector_changed (GTK_COMBO_BOX (dialog->type_selector), dialog); + frequency_changed_cb (GTK_COMBO_BOX (dialog->publish_frequency), dialog); + publish_service_changed (GTK_COMBO_BOX (dialog->publish_service), dialog); + g_signal_connect (G_OBJECT (dialog->publish_service), "changed", G_CALLBACK (publish_service_changed), dialog); g_signal_connect (G_OBJECT (dialog->type_selector), "changed", G_CALLBACK (type_selector_changed), dialog); g_signal_connect (G_OBJECT (dialog->publish_frequency), "changed", G_CALLBACK (frequency_changed_cb), dialog); -- cgit v1.2.3 From 3df6594023782ff0c45a0debaf3e237a2e9c50b9 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 14 Mar 2011 08:02:05 +0100 Subject: Fix build break after recent eds changes --- plugins/groupwise-features/addressbook-groupwise.c | 1 + 1 file changed, 1 insertion(+) (limited to 'plugins') diff --git a/plugins/groupwise-features/addressbook-groupwise.c b/plugins/groupwise-features/addressbook-groupwise.c index b55672e836..8dda4dca40 100644 --- a/plugins/groupwise-features/addressbook-groupwise.c +++ b/plugins/groupwise-features/addressbook-groupwise.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include -- cgit v1.2.3 From 40346a792f01a9477507fbbdd25a45a661adb4ca Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 15 Mar 2011 12:51:49 +0100 Subject: Workaround for bug #644792 - [mail-notify] Crash when sending D-Bus message --- plugins/mail-notification/mail-notification.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'plugins') diff --git a/plugins/mail-notification/mail-notification.c b/plugins/mail-notification/mail-notification.c index 8fc64f7da7..5cde1fbf69 100644 --- a/plugins/mail-notification/mail-notification.c +++ b/plugins/mail-notification/mail-notification.c @@ -126,6 +126,14 @@ send_dbus_message (const gchar *name, GVariantBuilder *builder; GError *error = NULL; + g_return_if_fail (name != NULL); + g_return_if_fail (data != NULL); + g_return_if_fail (g_utf8_validate (name, -1, NULL)); + g_return_if_fail (g_utf8_validate (data, -1, NULL)); + g_return_if_fail (msg_uid == NULL || g_utf8_validate (msg_uid, -1, NULL)); + g_return_if_fail (msg_sender == NULL || g_utf8_validate (msg_sender, -1, NULL)); + g_return_if_fail (msg_subject == NULL || g_utf8_validate (msg_subject, -1, NULL)); + /* Create a new message on the DBUS_INTERFACE */ if (!(message = g_dbus_message_new_signal (DBUS_PATH, DBUS_INTERFACE, name))) return; -- cgit v1.2.3 From d5d651cf7885a2d61cb542a990f00489537224c2 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 24 Mar 2011 15:58:48 -0400 Subject: Bug 645545 - Attachment reminder dialog uses wrong expand --- plugins/attachment-reminder/attachment-reminder.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/attachment-reminder/attachment-reminder.c b/plugins/attachment-reminder/attachment-reminder.c index 25b0ddb514..723e8cfe5d 100644 --- a/plugins/attachment-reminder/attachment-reminder.c +++ b/plugins/attachment-reminder/attachment-reminder.c @@ -115,9 +115,8 @@ ask_for_missing_attachment (EPlugin *ep, GtkWindow *window) /*Check buttons*/ check = gtk_check_button_new_with_mnemonic (_("_Do not show this message again.")); - gtk_container_set_border_width ((GtkContainer *)check, 12); content_area = gtk_dialog_get_content_area (dialog); - gtk_box_pack_start (GTK_BOX (content_area), check, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (content_area), check, FALSE, FALSE, 0); gtk_widget_show (check); response = gtk_dialog_run ((GtkDialog *) dialog); -- cgit v1.2.3 From a09a95559ef640f23da644aef845607774c79f38 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 24 Mar 2011 16:47:53 -0400 Subject: Fix alignment of extra widgets in EAlertDialogs. Add e_alert_dialog_get_content_area(), which returns the GtkVBox containing the primary and secondary labels. Use this instead of gtk_dialog_get_content_area() to maintain the dialog's left margin beneath the image. --- plugins/attachment-reminder/attachment-reminder.c | 23 ++++++++++++---------- .../org-gnome-attachment-reminder.error.xml | 2 +- plugins/backup-restore/backup-restore.c | 17 +++++++++------- 3 files changed, 24 insertions(+), 18 deletions(-) (limited to 'plugins') diff --git a/plugins/attachment-reminder/attachment-reminder.c b/plugins/attachment-reminder/attachment-reminder.c index 723e8cfe5d..113424bd78 100644 --- a/plugins/attachment-reminder/attachment-reminder.c +++ b/plugins/attachment-reminder/attachment-reminder.c @@ -105,26 +105,29 @@ org_gnome_evolution_attachment_reminder (EPlugin *ep, EMEventTargetComposer *t) static gboolean ask_for_missing_attachment (EPlugin *ep, GtkWindow *window) { - GtkWidget *check = NULL; - GtkDialog *dialog = NULL; - GtkWidget *content_area; + GtkWidget *check; + GtkWidget *dialog; + GtkWidget *container; gint response; - dialog = (GtkDialog*) e_alert_dialog_new_for_args ( - window, "org.gnome.evolution.plugins.attachment_reminder:attachment-reminder", NULL); + dialog = e_alert_dialog_new_for_args ( + window, "org.gnome.evolution.plugins.attachment_reminder:" + "attachment-reminder", NULL); + + container = e_alert_dialog_get_content_area (E_ALERT_DIALOG (dialog)); /*Check buttons*/ - check = gtk_check_button_new_with_mnemonic (_("_Do not show this message again.")); - content_area = gtk_dialog_get_content_area (dialog); - gtk_box_pack_start (GTK_BOX (content_area), check, FALSE, FALSE, 0); + check = gtk_check_button_new_with_mnemonic ( + _("_Do not show this message again.")); + gtk_box_pack_start (GTK_BOX (container), check, FALSE, FALSE, 0); gtk_widget_show (check); - response = gtk_dialog_run ((GtkDialog *) dialog); + response = gtk_dialog_run (GTK_DIALOG (dialog)); if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check))) e_plugin_enable (ep, FALSE); - gtk_widget_destroy ((GtkWidget *)dialog); + gtk_widget_destroy (dialog); if (response == GTK_RESPONSE_OK) gtk_action_activate (E_COMPOSER_ACTION_ATTACH (window)); diff --git a/plugins/attachment-reminder/org-gnome-attachment-reminder.error.xml b/plugins/attachment-reminder/org-gnome-attachment-reminder.error.xml index 4d77f4475b..8728c98747 100644 --- a/plugins/attachment-reminder/org-gnome-attachment-reminder.error.xml +++ b/plugins/attachment-reminder/org-gnome-attachment-reminder.error.xml @@ -4,7 +4,7 @@ <_primary>Message has no attachments <_secondary>Evolution has found some keywords that suggest that this message should contain an attachment, but cannot find one. - diff --git a/plugins/backup-restore/backup-restore.c b/plugins/backup-restore/backup-restore.c index 2ff0ff1bc9..aa0693ece3 100644 --- a/plugins/backup-restore/backup-restore.c +++ b/plugins/backup-restore/backup-restore.c @@ -113,7 +113,9 @@ sanity_check (const gchar *filename) static guint32 dialog_prompt_user (GtkWindow *parent, const gchar *string, const gchar *tag, ...) { - GtkWidget *mbox, *check = NULL; + GtkWidget *dialog; + GtkWidget *check = NULL; + GtkWidget *container; va_list ap; gint button; guint32 mask = 0; @@ -123,24 +125,25 @@ dialog_prompt_user (GtkWindow *parent, const gchar *string, const gchar *tag, .. alert = e_alert_new_valist (tag, ap); va_end (ap); - mbox = e_alert_dialog_new (parent, alert); + dialog = e_alert_dialog_new (parent, alert); g_object_unref (alert); + container = e_alert_dialog_get_content_area (E_ALERT_DIALOG (dialog)); + check = gtk_check_button_new_with_mnemonic (string); /* We should hardcode this to true */ - gtk_toggle_button_set_active ((GtkToggleButton *)check, TRUE); - gtk_container_set_border_width ((GtkContainer *)check, 12); - gtk_box_pack_start ((GtkBox *)gtk_dialog_get_content_area ((GtkDialog *) mbox), check, TRUE, TRUE, 0); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check), TRUE); + gtk_box_pack_start (GTK_BOX (container), check, FALSE, FALSE, 0); gtk_widget_show (check); - button = gtk_dialog_run ((GtkDialog *) mbox); + button = gtk_dialog_run (GTK_DIALOG (dialog)); if (button == GTK_RESPONSE_YES) mask |= BR_OK; if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check))) mask |= BR_START; - gtk_widget_destroy (mbox); + gtk_widget_destroy (dialog); return mask; } -- cgit v1.2.3 From ea8326df3a64c21ddbcacad5941648b1a86bc7e2 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 28 Mar 2011 15:53:39 -0400 Subject: Remove the profiler plugin. This plugin was for developers, but no one uses it anymore. Plus the only profiling hooks left in Evolution were in the MessageList widget, which performs fine. There's better ways to collect profiling data these days anyway (sysprof, systemtap, etc.). --- plugins/profiler/Makefile.am | 23 -------- .../org-gnome-evolution-profiler.eplug.xml | 15 ------ plugins/profiler/profiler.c | 62 ---------------------- 3 files changed, 100 deletions(-) delete mode 100644 plugins/profiler/Makefile.am delete mode 100644 plugins/profiler/org-gnome-evolution-profiler.eplug.xml delete mode 100644 plugins/profiler/profiler.c (limited to 'plugins') diff --git a/plugins/profiler/Makefile.am b/plugins/profiler/Makefile.am deleted file mode 100644 index 2a61fbafbe..0000000000 --- a/plugins/profiler/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -LIBS = $(SHELL_LIBS) - -@EVO_PLUGIN_RULE@ - -plugin_DATA = org-gnome-evolution-profiler.eplug - -plugin_LTLIBRARIES = liborg-gnome-evolution-profiler.la - -liborg_gnome_evolution_profiler_la_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - -I$(top_srcdir) \ - $(SHELL_CFLAGS) - -liborg_gnome_evolution_profiler_la_SOURCES = profiler.c - -liborg_gnome_evolution_profiler_la_LDFLAGS = -module -avoid-version $(NO_UNDEFINED) - -EXTRA_DIST = org-gnome-evolution-profiler.eplug.xml - -BUILT_SOURCES = $(plugin_DATA) -CLEANFILES = $(BUILT_SOURCES) - --include $(top_srcdir)/git.mk diff --git a/plugins/profiler/org-gnome-evolution-profiler.eplug.xml b/plugins/profiler/org-gnome-evolution-profiler.eplug.xml deleted file mode 100644 index 97720132be..0000000000 --- a/plugins/profiler/org-gnome-evolution-profiler.eplug.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - <_description>Profile data events in Evolution (for developers only). - - - - - - - diff --git a/plugins/profiler/profiler.c b/plugins/profiler/profiler.c deleted file mode 100644 index 9744a684de..0000000000 --- a/plugins/profiler/profiler.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see - * - * - * Authors: - * Michael Zucchi - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include - -#include -#include - -void org_gnome_evolution_profiler_event (EPlugin *ep, EProfileEventTarget *t); - -gint e_plugin_lib_enable (EPlugin *ep, gint enable); - -gint -e_plugin_lib_enable (EPlugin *ep, gint enable) -{ - return 0; -} - -void -org_gnome_evolution_profiler_event (EPlugin *ep, EProfileEventTarget *t) -{ - static FILE *fp; - - if (!fp) { - gchar *name; - - name = g_strdup_printf("eprofile.%ld", (glong) getpid()); - fp = fopen(name, "w"); - if (fp) - fprintf(stderr, "Generating profiling data in '%s'\n", name); - g_free (name); - } - - if (fp) - fprintf(fp, "%d.%d: %s,%s\n", (gint) t->tv.tv_sec, (gint) t->tv.tv_usec, t->id, t->uid); -} -- cgit v1.2.3 From 88ae09989a3c6a21fd106bf2318868516e64e91d Mon Sep 17 00:00:00 2001 From: Kjartan Maraas Date: Fri, 1 Apr 2011 18:34:16 +0200 Subject: Fix translations being boken by removing calls to bindtextdomain() from plugins. It shouldn't be needed for plugins that live in the evolution source tree anyway since they should just use the translation domain they inherit from main(). --- plugins/dbx-import/Makefile.am | 2 -- plugins/dbx-import/dbx-importer.c | 8 -------- plugins/pst-import/Makefile.am | 2 -- plugins/pst-import/pst-importer.c | 8 -------- plugins/tnef-attachments/Makefile.am | 2 -- plugins/tnef-attachments/tnef-plugin.c | 4 ---- 6 files changed, 26 deletions(-) (limited to 'plugins') diff --git a/plugins/dbx-import/Makefile.am b/plugins/dbx-import/Makefile.am index d38010471b..ecd4890c37 100644 --- a/plugins/dbx-import/Makefile.am +++ b/plugins/dbx-import/Makefile.am @@ -17,8 +17,6 @@ liborg_gnome_dbx_import_la_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_srcdir)/widgets \ -I$(top_builddir) \ - -DGETTEXT_PACKAGE="\"$(GETTEXT_PACKAGE)\"" \ - -DLOCALEDIR="\"$(LOCALEDIR)\"" \ $(GNOME_PLATFORM_CFLAGS) \ $(EVOLUTION_CFLAGS) \ $(EVOLUTION_CALENDAR_CFLAGS) \ diff --git a/plugins/dbx-import/dbx-importer.c b/plugins/dbx-import/dbx-importer.c index f4dd0506d5..294b466263 100644 --- a/plugins/dbx-import/dbx-importer.c +++ b/plugins/dbx-import/dbx-importer.c @@ -811,13 +811,5 @@ org_gnome_evolution_readdbx_cancel (EImport *ei, gint e_plugin_lib_enable (EPlugin *ep, gint enable) { - if (enable) { - bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); - bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); - g_message ("DBX Plugin enabled"); - } else { - g_message ("DBX Plugin disabled"); - } - return 0; } diff --git a/plugins/pst-import/Makefile.am b/plugins/pst-import/Makefile.am index b4745b6226..71b37a9d0f 100644 --- a/plugins/pst-import/Makefile.am +++ b/plugins/pst-import/Makefile.am @@ -17,8 +17,6 @@ liborg_gnome_pst_import_la_CPPFLAGS = \ -I$(top_srcdir) \ -I$(top_srcdir)/widgets \ -I$(top_builddir) \ - -DGETTEXT_PACKAGE="\"$(GETTEXT_PACKAGE)\"" \ - -DLOCALEDIR="\"$(LOCALEDIR)\"" \ $(GNOME_PLATFORM_CFLAGS) \ $(EVOLUTION_CFLAGS) \ $(EVOLUTION_CALENDAR_CFLAGS) \ diff --git a/plugins/pst-import/pst-importer.c b/plugins/pst-import/pst-importer.c index afd4767d5c..603e739fe5 100644 --- a/plugins/pst-import/pst-importer.c +++ b/plugins/pst-import/pst-importer.c @@ -1683,14 +1683,6 @@ org_credativ_evolution_readpst_cancel (EImport *ei, EImportTarget *target, EImpo gint e_plugin_lib_enable (EPlugin *ep, gint enable) { - if (enable) { - bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); - bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); - g_message ("pst Plugin enabled"); - } else { - g_message ("pst Plugin disabled"); - } - return 0; } diff --git a/plugins/tnef-attachments/Makefile.am b/plugins/tnef-attachments/Makefile.am index 4cc8a30573..97240ce075 100644 --- a/plugins/tnef-attachments/Makefile.am +++ b/plugins/tnef-attachments/Makefile.am @@ -16,8 +16,6 @@ liborg_gnome_tnef_attachments_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ -I$(top_srcdir)/widgets \ - -DGETTEXT_PACKAGE="\"$(GETTEXT_PACKAGE)\"" \ - -DLOCALEDIR="\"$(localedir)\"" \ $(GNOME_PLATFORM_CFLAGS) \ $(EVOLUTION_MAIL_CFLAGS) \ $(TNEF_CFLAGS) diff --git a/plugins/tnef-attachments/tnef-plugin.c b/plugins/tnef-attachments/tnef-plugin.c index 977189edb4..0f97512757 100644 --- a/plugins/tnef-attachments/tnef-plugin.c +++ b/plugins/tnef-attachments/tnef-plugin.c @@ -216,10 +216,6 @@ e_plugin_lib_enable (EPlugin *ep, gint enable) return 0; loaded = TRUE; - if (enable) { - bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); - bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); - } return 0; } -- cgit v1.2.3 From ea0fdf21ece0f81b6bbe3c08e1c21da76280acd4 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 17 Apr 2011 13:13:55 -0400 Subject: Adapt to sealed up CamelService. --- plugins/groupwise-features/install-shared.c | 6 +++++- plugins/groupwise-features/share-folder-common.c | 11 +++++++---- plugins/itip-formatter/itip-formatter.c | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) (limited to 'plugins') diff --git a/plugins/groupwise-features/install-shared.c b/plugins/groupwise-features/install-shared.c index 0a7cd1ace5..969ea0c30d 100644 --- a/plugins/groupwise-features/install-shared.c +++ b/plugins/groupwise-features/install-shared.c @@ -103,6 +103,8 @@ install_folder_response (EMFolderSelector *emfs, gint response, gpointer *data) container_id = get_container_id (cnc, parent_name); if (e_gw_connection_accept_shared_folder (cnc, folder_name, container_id, (gchar *)item_id, NULL) == E_GW_CONNECTION_STATUS_OK) { + CamelService *service; + CamelURL *url; /* FIXME Not passing a GCancellable or GError here. */ folder = camel_store_get_folder_sync ( @@ -117,7 +119,9 @@ install_folder_response (EMFolderSelector *emfs, gint response, gpointer *data) CAMEL_MESSAGE_DELETED); camel_folder_summary_touch (folder->summary); /* camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed", changes); */ - uri = camel_url_to_string (((CamelService *) store)->url, CAMEL_URL_HIDE_ALL); + service = CAMEL_SERVICE (store); + url = camel_service_get_camel_url (service); + uri = camel_url_to_string (url, CAMEL_URL_HIDE_ALL); account = e_get_account_by_source_url (uri); uri = account->source->url; em_folder_tree_model_remove_store (model, store); diff --git a/plugins/groupwise-features/share-folder-common.c b/plugins/groupwise-features/share-folder-common.c index 790edb4d8a..521bd3a54c 100644 --- a/plugins/groupwise-features/share-folder-common.c +++ b/plugins/groupwise-features/share-folder-common.c @@ -69,8 +69,11 @@ refresh_folder_tree (EMFolderTreeModel *model, CamelStore *store) gchar *uri; EAccount *account; CamelProvider *provider; + CamelURL *url; + + url = camel_service_get_camel_url (CAMEL_SERVICE (store)); + uri = camel_url_to_string (url, CAMEL_URL_HIDE_ALL); - uri = camel_url_to_string (((CamelService *) store)->url, CAMEL_URL_HIDE_ALL); account = e_get_account_by_source_url (uri); if (!account) { return; @@ -436,7 +439,7 @@ get_cnc (CamelStore *store) return NULL; service = CAMEL_SERVICE (store); - url = service->url; + url = camel_service_get_camel_url (service); server_name = g_strdup (url->host); user = g_strdup (url->user); property_value = camel_url_get_param (url, "soap_port"); @@ -453,10 +456,10 @@ get_cnc (CamelStore *store) else uri = g_strconcat ("http://", server_name, ":", port, "/soap", NULL); - cnc = e_gw_connection_new (uri, user, service->url->passwd); + cnc = e_gw_connection_new (uri, user, url->passwd); if (!E_IS_GW_CONNECTION(cnc) && use_ssl && g_str_equal (use_ssl, "when-possible")) { gchar *http_uri = g_strconcat ("http://", uri + 8, NULL); - cnc = e_gw_connection_new (http_uri, user, service->url->passwd); + cnc = e_gw_connection_new (http_uri, user, url->passwd); g_free (http_uri); } g_free (use_ssl); diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index a401865c0e..fcd54279e2 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -834,7 +834,7 @@ find_server (struct _itip_puri *pitip, ECalComponent *comp) parent_store = camel_folder_get_parent_store (pitip->folder); - url = CAMEL_SERVICE (parent_store)->url; + url = camel_service_get_camel_url (CAMEL_SERVICE (parent_store)); uri = camel_url_to_string (url, CAMEL_URL_HIDE_ALL); itip_view_set_buttons_sensitive (ITIP_VIEW (pitip->view), FALSE); -- cgit v1.2.3 From dddda73fe4f06be4b959ab72b629132496be0097 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 18 Apr 2011 16:29:29 +0200 Subject: Bug #646197 - Crash with VALARM without ACTION property --- plugins/itip-formatter/itip-formatter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index fcd54279e2..dcf3874b12 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -1871,7 +1871,7 @@ extract_itip_data (struct _itip_puri *pitip, GtkContainer *container, gboolean * icalcompiter_next (&alarm_iter); p = icalcomponent_get_first_property (alarm_comp, ICAL_ACTION_PROPERTY); - if (icalproperty_get_action (p) == ICAL_ACTION_PROCEDURE) + if (!p || icalproperty_get_action (p) == ICAL_ACTION_PROCEDURE) icalcomponent_remove_component (pitip->ical_comp, alarm_comp); icalcomponent_free (alarm_comp); -- cgit v1.2.3 From 397aeade0545457dae034b0287049aa1cbeed782 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 20 Apr 2011 19:06:35 -0400 Subject: Adapt to CamelService changes. --- plugins/groupwise-features/install-shared.c | 30 ++++++++++------- plugins/groupwise-features/proxy-login.c | 13 ++++++-- plugins/groupwise-features/proxy-login.h | 2 +- plugins/groupwise-features/proxy.c | 6 +--- plugins/groupwise-features/share-folder-common.c | 42 ++++++++++++++---------- 5 files changed, 56 insertions(+), 37 deletions(-) (limited to 'plugins') diff --git a/plugins/groupwise-features/install-shared.c b/plugins/groupwise-features/install-shared.c index 969ea0c30d..3899dab95b 100644 --- a/plugins/groupwise-features/install-shared.c +++ b/plugins/groupwise-features/install-shared.c @@ -59,7 +59,7 @@ install_folder_response (EMFolderSelector *emfs, gint response, gpointer *data) gchar *parent_name; gchar *container_id; const gchar *item_id; - CamelStore *store; + CamelService *service = NULL; CamelFolder *folder; EAccount *account; CamelProvider *provider; @@ -69,6 +69,7 @@ install_folder_response (EMFolderSelector *emfs, gint response, gpointer *data) gtk_widget_destroy (GTK_WIDGET (emfs)); } else { CamelSession *session; + CamelURL *url; EShell *shell; shell = e_shell_get_default (); @@ -91,24 +92,30 @@ install_folder_response (EMFolderSelector *emfs, gint response, gpointer *data) else parent_name = NULL; } - store = (CamelStore *) camel_session_get_service ( - session, uri, CAMEL_PROVIDER_STORE, NULL); - if (store == NULL) { + + url = camel_url_new (uri, NULL); + if (url != NULL) { + service = camel_session_get_service_by_url ( + session, url); + camel_url_free (url); + } + + if (!CAMEL_IS_STORE (service)) { g_strfreev (names); return; } - cnc = get_cnc (store); + cnc = get_cnc (CAMEL_STORE (service)); if (E_IS_GW_CONNECTION (cnc)) { container_id = get_container_id (cnc, parent_name); if (e_gw_connection_accept_shared_folder (cnc, folder_name, container_id, (gchar *)item_id, NULL) == E_GW_CONNECTION_STATUS_OK) { - CamelService *service; CamelURL *url; /* FIXME Not passing a GCancellable or GError here. */ folder = camel_store_get_folder_sync ( - store, "Mailbox", 0, NULL, NULL); + CAMEL_STORE (service), + "Mailbox", 0, NULL, NULL); /*changes = camel_folder_change_info_new (); camel_folder_change_info_remove_uid (changes, (gchar *) item_id); camel_folder_summary_remove_uid (folder->summary, item_id);*/ @@ -119,12 +126,12 @@ install_folder_response (EMFolderSelector *emfs, gint response, gpointer *data) CAMEL_MESSAGE_DELETED); camel_folder_summary_touch (folder->summary); /* camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed", changes); */ - service = CAMEL_SERVICE (store); url = camel_service_get_camel_url (service); uri = camel_url_to_string (url, CAMEL_URL_HIDE_ALL); account = e_get_account_by_source_url (uri); uri = account->source->url; - em_folder_tree_model_remove_store (model, store); + em_folder_tree_model_remove_store ( + model, CAMEL_STORE (service)); provider = camel_provider_get (uri, NULL); if (provider == NULL) { g_strfreev (names); @@ -137,8 +144,9 @@ install_folder_response (EMFolderSelector *emfs, gint response, gpointer *data) return; } - em_folder_tree_model_add_store (model, store, account->name); - g_object_unref (store); + em_folder_tree_model_add_store ( + model, CAMEL_STORE (service), + account->name); } } diff --git a/plugins/groupwise-features/proxy-login.c b/plugins/groupwise-features/proxy-login.c index 61e32216a4..2559dc2079 100644 --- a/plugins/groupwise-features/proxy-login.c +++ b/plugins/groupwise-features/proxy-login.c @@ -350,6 +350,8 @@ proxy_soap_login (gchar *email, GtkWindow *error_parent) proxy_cnc = e_gw_connection_get_proxy_connection (cnc, user_name, password, email, &permissions); if (proxy_cnc) { + CamelService *service; + parent = camel_url_new (e_account_get_string (srcAccount, E_ACCOUNT_SOURCE_URL), NULL); parent_source_url = camel_url_to_string (parent, CAMEL_URL_HIDE_PASSWORD); uri = camel_url_copy (parent); @@ -367,7 +369,12 @@ proxy_soap_login (gchar *email, GtkWindow *error_parent) e_account_list_change (accounts, srcAccount); e_account_list_save (accounts); g_object_set_data ((GObject *)dstAccount, "permissions", GINT_TO_POINTER(permissions)); - mail_get_store (session, e_account_get_string (dstAccount, E_ACCOUNT_SOURCE_URL), NULL, proxy_login_add_new_store, dstAccount); + + service = camel_session_get_service ( + CAMEL_SESSION (session), dstAccount->uid); + if (CAMEL_IS_STORE (service)) + proxy_login_add_new_store ( + CAMEL_STORE (service), dstAccount); g_free (proxy_source_url); g_free (parent_source_url); @@ -386,12 +393,12 @@ proxy_soap_login (gchar *email, GtkWindow *error_parent) } static void -proxy_login_add_new_store (gchar *uri, CamelStore *store, gpointer user_data) +proxy_login_add_new_store (CamelStore *store, + EAccount *account) { EShell *shell; EShellBackend *shell_backend; EMailSession *session; - EAccount *account = user_data; gint permissions = GPOINTER_TO_INT(g_object_get_data ((GObject *)account, "permissions")); shell = e_shell_get_default (); diff --git a/plugins/groupwise-features/proxy-login.h b/plugins/groupwise-features/proxy-login.h index 3c4ba8c392..496e0cb1c1 100644 --- a/plugins/groupwise-features/proxy-login.h +++ b/plugins/groupwise-features/proxy-login.h @@ -52,7 +52,7 @@ struct _proxyLoginClass { GType proxy_login_get_type (void); proxyLogin * proxy_login_new (void); -static void proxy_login_add_new_store (gchar *uri, CamelStore *store, gpointer user_data); +static void proxy_login_add_new_store (CamelStore *store, EAccount *account); static void proxy_login_setup_tree_view (void); proxyLogin* proxy_dialog_new (void); static void proxy_soap_login (gchar *email, GtkWindow *error_parent); diff --git a/plugins/groupwise-features/proxy.c b/plugins/groupwise-features/proxy.c index 555d3f716b..849d4ea3d4 100644 --- a/plugins/groupwise-features/proxy.c +++ b/plugins/groupwise-features/proxy.c @@ -658,9 +658,7 @@ org_gnome_proxy (EPlugin *epl, EConfigHookItemFactoryData *data) g_object_ref (account); store = (CamelOfflineStore *) camel_session_get_service ( - CAMEL_SESSION (session), - e_account_get_string (account, E_ACCOUNT_SOURCE_URL), - CAMEL_PROVIDER_STORE, NULL); + CAMEL_SESSION (session), account->uid); if (store == NULL) return NULL; @@ -724,8 +722,6 @@ org_gnome_proxy (EPlugin *epl, EConfigHookItemFactoryData *data) } } - g_object_unref (store); - return NULL; } diff --git a/plugins/groupwise-features/share-folder-common.c b/plugins/groupwise-features/share-folder-common.c index 521bd3a54c..19d46bad0b 100644 --- a/plugins/groupwise-features/share-folder-common.c +++ b/plugins/groupwise-features/share-folder-common.c @@ -249,7 +249,8 @@ users_dialog_response (GtkWidget *dialog, gint response, struct ShareInfo *ssi) EMFolderSelector *emfs = ssi->emfs; const gchar *uri, *path; EMailSession *session; - CamelStore *store; + CamelService *service = NULL; + CamelURL *url; if (response != GTK_RESPONSE_OK) { gtk_widget_destroy ((GtkWidget *) emfs); @@ -263,18 +264,24 @@ users_dialog_response (GtkWidget *dialog, gint response, struct ShareInfo *ssi) d(printf ("Creating new folder: %s (%s)\n", path, uri)); - store = (CamelStore *) camel_session_get_service ( - CAMEL_SESSION (session), uri, CAMEL_PROVIDER_STORE, NULL); - if (store == NULL) + url = camel_url_new (uri, NULL); + if (url != NULL) { + service = camel_session_get_service_by_url ( + CAMEL_SESSION (session), url); + camel_url_free (url); + } + + if (!CAMEL_IS_STORE (service)) return; - if (!(si = em_folder_tree_model_lookup_store_info (ssi->model, store))) { + si = em_folder_tree_model_lookup_store_info ( + ssi->model, CAMEL_STORE (service)); + if (si == NULL) { g_assert_not_reached (); - g_object_unref (store); return; } - if (CAMEL_IS_VEE_STORE (store)) { + if (CAMEL_IS_VEE_STORE (service)) { EFilterRule *rule; rule = em_vfolder_rule_new (session); @@ -287,7 +294,6 @@ users_dialog_response (GtkWidget *dialog, gint response, struct ShareInfo *ssi) create_folder (si->store, path, new_folder_created_cb, ssi); } - g_object_unref (store); } static void @@ -299,7 +305,8 @@ new_folder_response (EMFolderSelector *emfs, gint response, EMFolderTreeModel *m struct ShareInfo *ssi; const gchar *uri; EGwConnection *cnc; - CamelStore *store; + CamelService *service = NULL; + CamelURL *url; ssi = g_new0 (struct ShareInfo, 1); if (response != GTK_RESPONSE_OK) { @@ -309,12 +316,17 @@ new_folder_response (EMFolderSelector *emfs, gint response, EMFolderTreeModel *m /* i want store at this point to get cnc not sure proper or not*/ uri = em_folder_selector_get_selected_uri (emfs); - store = (CamelStore *) camel_session_get_service ( - session, uri, CAMEL_PROVIDER_STORE, NULL); - if (store == NULL) + + url = camel_url_new (uri, NULL); + if (url != NULL) { + service = camel_session_get_service_by_url (session, url); + camel_url_free (url); + } + + if (!CAMEL_IS_STORE (service)) return; - cnc = get_cnc (store); + cnc = get_cnc (CAMEL_STORE (service)); users_dialog = gtk_dialog_new_with_buttons ( _("Users"), NULL, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); w = gtk_label_new_with_mnemonic (_("Enter the users and set permissions")); @@ -330,10 +342,6 @@ new_folder_response (EMFolderSelector *emfs, gint response, EMFolderTreeModel *m gtk_window_resize (GTK_WINDOW (users_dialog), 350, 300); gtk_widget_show (users_dialog); g_signal_connect (users_dialog, "response", G_CALLBACK (users_dialog_response), ssi); - - g_object_unref (store); - return; - } void -- cgit v1.2.3 From 8cd20682159f0e683cdd81af54611b9511f873a1 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 26 Apr 2011 09:20:50 -0400 Subject: Remove redundant EAccountList utilities. Kill itip_addresses_get() and itip_addresses_get_default(), and use e_get_account_list() and e_get_default_account() instead. --- plugins/groupwise-features/camel-gw-listener.c | 8 ++------ plugins/groupwise-features/groupwise-account-setup.c | 4 ++-- plugins/groupwise-features/gw-ui.c | 4 +++- plugins/itip-formatter/itip-formatter.c | 5 +++-- 4 files changed, 10 insertions(+), 11 deletions(-) (limited to 'plugins') diff --git a/plugins/groupwise-features/camel-gw-listener.c b/plugins/groupwise-features/camel-gw-listener.c index 28efe5c94b..ed73953098 100644 --- a/plugins/groupwise-features/camel-gw-listener.c +++ b/plugins/groupwise-features/camel-gw-listener.c @@ -31,9 +31,9 @@ #include #include #include "e-util/e-alert-dialog.h" -#include #include #include +#include /*stores some info about all currently existing groupwise accounts list of GwAccountInfo structures */ @@ -934,7 +934,6 @@ account_changed (EAccountList *account_listener, EAccount *account) static void prune_proxies (void) { - GConfClient *client = gconf_client_get_default (); EAccountList *account_list; ESourceList *sources; ESourceGroup *group; @@ -948,10 +947,7 @@ prune_proxies (void) { E_CAL_SOURCE_TYPE_JOURNAL }; - account_list = e_account_list_new (client); - /* Is this being leaked */ - g_object_unref (client); - + account_list = e_get_account_list (); e_account_list_prune_proxies (account_list); for (i=0; i<3; i++) { diff --git a/plugins/groupwise-features/groupwise-account-setup.c b/plugins/groupwise-features/groupwise-account-setup.c index 335a3b525e..f232bab055 100644 --- a/plugins/groupwise-features/groupwise-account-setup.c +++ b/plugins/groupwise-features/groupwise-account-setup.c @@ -27,6 +27,7 @@ #include #include "shell/es-event.h" #include +#include #define GROUPWISE_BASE_URI "groupwise://" @@ -88,8 +89,8 @@ ensure_mandatory_esource_properties (EPlugin *ep, ESEventTargetUpgrade *target) EAccountList *al; EIterator *it; + al = e_get_account_list (); client = gconf_client_get_default (); - al = e_account_list_new (client); for (it = e_list_get_iterator ((EList *)al); e_iterator_is_valid (it); @@ -103,7 +104,6 @@ ensure_mandatory_esource_properties (EPlugin *ep, ESEventTargetUpgrade *target) set_esource_props ("/apps/evolution/tasks/sources", a, client, a->name); set_esource_props ("/apps/evolution/memos/sources", a, client, a->name); } - g_object_unref (al); g_object_unref (client); } diff --git a/plugins/groupwise-features/gw-ui.c b/plugins/groupwise-features/gw-ui.c index 3ca262b674..0d64bd9d3c 100644 --- a/plugins/groupwise-features/gw-ui.c +++ b/plugins/groupwise-features/gw-ui.c @@ -20,6 +20,8 @@ #include #include +#include + #include #include @@ -319,7 +321,7 @@ is_meeting_owner (ECalComponent *comp, ECal *client) } if (!ret_val) - ret_val = e_account_list_find (itip_addresses_get (), E_ACCOUNT_FIND_ID_ADDRESS, strip) != NULL; + ret_val = e_account_list_find (e_get_account_list (), E_ACCOUNT_FIND_ID_ADDRESS, strip) != NULL; g_free (email); return ret_val; diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index dcf3874b12..f2455adfa5 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -964,7 +965,7 @@ change_status (icalcomponent *ical_comp, const gchar *address, icalparameter_par } else { EAccount *a; - a = itip_addresses_get_default (); + a = e_get_default_account (); prop = icalproperty_new_attendee (a->id->address); icalcomponent_add_property (ical_comp, prop); @@ -2323,7 +2324,7 @@ format_itip_object (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject info = (struct _itip_puri *) em_format_find_puri ((EMFormat *)efh, pobject->classid); /* Accounts */ - info->accounts = itip_addresses_get (); + info->accounts = e_get_account_list (); /* Source Lists and open ecal clients */ for (i = 0; i < E_CAL_SOURCE_TYPE_LAST; i++) { -- cgit v1.2.3 From 2594b0d00cff45936250e9294ce6eb7cacd87c25 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 26 Apr 2011 11:21:38 -0400 Subject: Add itip_address_is_user(). Convenience function that checks whether the given email address matches a registered mail identity. --- plugins/groupwise-features/gw-ui.c | 2 +- plugins/groupwise-features/proxy-login.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/groupwise-features/gw-ui.c b/plugins/groupwise-features/gw-ui.c index 0d64bd9d3c..08b9382838 100644 --- a/plugins/groupwise-features/gw-ui.c +++ b/plugins/groupwise-features/gw-ui.c @@ -321,7 +321,7 @@ is_meeting_owner (ECalComponent *comp, ECal *client) } if (!ret_val) - ret_val = e_account_list_find (e_get_account_list (), E_ACCOUNT_FIND_ID_ADDRESS, strip) != NULL; + ret_val = itip_address_is_user (strip); g_free (email); return ret_val; diff --git a/plugins/groupwise-features/proxy-login.c b/plugins/groupwise-features/proxy-login.c index 2559dc2079..3f80ac9500 100644 --- a/plugins/groupwise-features/proxy-login.c +++ b/plugins/groupwise-features/proxy-login.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -335,7 +336,7 @@ proxy_soap_login (gchar *email, GtkWindow *error_parent) /* README: There should not be the weird scenario of the proxy itself configured as an account. If so, it is violating the (li)unix philosophy of User creation. So dont care about that scenario*/ - if (e_account_list_find (accounts, E_ACCOUNT_FIND_ID_ADDRESS, email) != NULL) { + if (itip_address_is_user (email)) { e_alert_run_dialog_for_args (error_parent, "org.gnome.evolution.proxy-login:already-loggedin", email, NULL); -- cgit v1.2.3 From 5fcaadbc9a16f711c0fe81933ec9615f289c8fa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Vr=C3=A1til?= Date: Wed, 27 Apr 2011 17:10:14 +0200 Subject: Bug #641845 - Add default expansion variables to templates plugin Users can read values from original message in the template by $ORIG[header] and with a special value $ORIG[body]. --- plugins/templates/org-gnome-templates.eplug.xml | 5 +- plugins/templates/templates.c | 545 +++++++++++++++++++----- 2 files changed, 452 insertions(+), 98 deletions(-) (limited to 'plugins') diff --git a/plugins/templates/org-gnome-templates.eplug.xml b/plugins/templates/org-gnome-templates.eplug.xml index 7c19a6ea23..5bfa8a1e2b 100644 --- a/plugins/templates/org-gnome-templates.eplug.xml +++ b/plugins/templates/org-gnome-templates.eplug.xml @@ -5,9 +5,12 @@ id="org.gnome.evolution.plugin.templates" location="@PLUGINDIR@/liborg-gnome-templates@SOEXT@" _name="Templates"> - <_description>Drafts based template plugin + <_description>Drafts based template plugin. + + You can use variables like $ORIG[subject], $ORIG[from], $ORIG[to] or $ORIG[body], which will be replaced by values from an email you are replying to. + str; + while (next = strstr_nocase (p, find), next) { + if (p < next) + g_string_append_len (str, p, next - p); + if (replacement && *replacement) + g_string_append (str, replacement); + p = next + find_len; + } + g_string_append (str, p); + + g_string_assign (text, str->str); + + g_string_free (str, TRUE); + g_free (find); +} + +static void +replace_email_addresses (GString *template, CamelInternetAddress *internet_address, const gchar *variable) +{ + gint address_index = 0; + GString *emails = g_string_new (""); + const gchar *address_name, *address_email; + + g_return_if_fail (template); + g_return_if_fail (internet_address); + g_return_if_fail (variable); + + while (camel_internet_address_get (internet_address, address_index, &address_name, &address_email)) { + gchar *address = camel_internet_address_format_address (address_name, address_email); + + if (address_index > 0) + g_string_append_printf (emails, ", %s", address); + else + g_string_append_printf (emails, "%s", address); + + address_index++; + g_free (address); + } + replace_template_variable (template, variable, emails->str); + g_string_free (emails, TRUE); +} + +static CamelMimePart* +fill_template (CamelMimeMessage *message, CamelMimePart *template) +{ + struct _camel_header_raw *header; + CamelContentType *ct; + CamelStream *stream; + CamelMimePart *return_part; + CamelMimePart *message_part = NULL; + CamelDataWrapper *dw; + + CamelInternetAddress *internet_address; + + GString *template_body; + GByteArray *byte_array; + + gint i; + gboolean message_html, template_html; + + ct = camel_mime_part_get_content_type (template); + template_html = ct && camel_content_type_is (ct, "text", "html"); + + message_html = FALSE; + /* When template is html, then prefer HTML part of the original message. Otherwise go for plaintext */ + dw = camel_medium_get_content (CAMEL_MEDIUM (message)); + if (CAMEL_IS_MULTIPART (dw)) { + CamelMultipart *multipart = CAMEL_MULTIPART (dw); + + for (i = 0; i < camel_multipart_get_number (multipart); i++) { + CamelMimePart *part = camel_multipart_get_part (multipart, i); + CamelContentType *ct = camel_mime_part_get_content_type (part); + + if (!ct) + continue; + + if (camel_content_type_is (ct, "text", "html") && template_html) { + message_part = camel_multipart_get_part (multipart, i); + message_html = TRUE; + break; + } else if (camel_content_type_is (ct, "text", "plain") && message_html == FALSE) { + message_part = camel_multipart_get_part (multipart, i); + } + } + } else + message_part = CAMEL_MIME_PART (message); + + /* Get content of the template */ + stream = camel_stream_mem_new (); + camel_data_wrapper_decode_to_stream_sync (camel_medium_get_content (CAMEL_MEDIUM (template)), stream, NULL, NULL); + camel_stream_flush (stream, NULL, NULL); + byte_array = camel_stream_mem_get_byte_array (CAMEL_STREAM_MEM (stream)); + template_body = g_string_new_len ((gchar *) byte_array->data, byte_array->len); + g_object_unref (stream); + + /* Replace all $ORIG[header_name] by respective values */ + header = CAMEL_MIME_PART (message)->headers; + while (header) { + if (g_ascii_strncasecmp (header->name, "content-", 8) != 0 && + g_ascii_strncasecmp (header->name, "to", 2) != 0 && + g_ascii_strncasecmp (header->name, "cc", 2) != 0 && + g_ascii_strncasecmp (header->name, "bcc", 3) != 0 && + g_ascii_strncasecmp (header->name, "from", 4) != 0 && + g_ascii_strncasecmp (header->name, "subject", 7) != 0) + replace_template_variable (template_body, header->name, header->value); + + header = header->next; + } + + /* Now manually replace the *subject* header. The header->value for subject header could be + base64 encoded, so let camel_mime_message to decode it for us if needed */ + replace_template_variable (template_body, "subject", camel_mime_message_get_subject (message)); + + /* Replace TO and FROM modifiers. */ + internet_address = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_TO); + replace_email_addresses (template_body, internet_address, "to"); + + internet_address = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_CC); + replace_email_addresses (template_body, internet_address, "cc"); + + internet_address = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_BCC); + replace_email_addresses (template_body, internet_address, "bcc"); + + internet_address = camel_mime_message_get_from (message); + replace_email_addresses (template_body, internet_address, "from"); + + /* Now extract body of the original message and replace the $ORIG[body] modifier in template */ + if (message_part && strstr_nocase (template_body->str, "$ORIG[body]")) { + GString *message_body; + + stream = camel_stream_mem_new (); + camel_data_wrapper_decode_to_stream_sync (camel_medium_get_content (CAMEL_MEDIUM (message_part)), stream, NULL, NULL); + camel_stream_flush (stream, NULL, NULL); + byte_array = camel_stream_mem_get_byte_array (CAMEL_STREAM_MEM (stream)); + message_body = g_string_new_len ((gchar*)byte_array->data, byte_array->len); + g_object_unref (stream); + + if (template_html && !message_html) { + gchar *html = camel_text_to_html (message_body->str, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL | + CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES | + CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS | + CAMEL_MIME_FILTER_TOHTML_MARK_CITATION | + CAMEL_MIME_FILTER_TOHTML_CONVERT_ADDRESSES, 0); + g_string_assign (message_body, html); + g_free (html); + } else if (!template_html && message_html) { + g_string_prepend (message_body, "
");
+			g_string_append (message_body, "
"); + } /* Other cases should not occur. And even if they happen to do, there's nothing we can really do about it */ + + replace_template_variable (template_body, "body", message_body->str); + g_string_free (message_body, TRUE); + } else { + replace_template_variable (template_body, "body", ""); + } + + return_part = camel_mime_part_new (); + + if (template_html) + camel_mime_part_set_content (return_part, template_body->str, template_body->len, "text/html"); + else + camel_mime_part_set_content (return_part, template_body->str, template_body->len, "text/plain"); + + g_string_free (template_body, TRUE); + + return return_part; +} + static void create_new_message (CamelFolder *folder, const gchar *uid, CamelMimeMessage *message, gpointer data) { - GtkAction *action = data; - CamelMimeMessage *new, *template; + CamelMimeMessage *new; + CamelMimeMessage *template = CAMEL_MIME_MESSAGE (data); + CamelMultipart *new_multipart; + CamelContentType *new_content_type = NULL; + CamelDataWrapper *dw; struct _camel_header_raw *header; - CamelStream *mem; EShell *shell; + gint i; + + CamelMimePart *template_part = NULL; + CamelMimePart *out_part = NULL; - g_return_if_fail (data != NULL); + g_return_if_fail (template != NULL); g_return_if_fail (message != NULL); /* FIXME Pass this in somehow. */ shell = e_shell_get_default (); folder = e_mail_local_get_folder (E_MAIL_LOCAL_FOLDER_TEMPLATES); - template = g_object_get_data (G_OBJECT (action), "template"); - /* The new message we are creating */ new = camel_mime_message_new (); + new_multipart = camel_multipart_new (); + camel_data_wrapper_set_mime_type (CAMEL_DATA_WRAPPER (new_multipart), "multipart/alternative"); + camel_multipart_set_boundary (new_multipart, NULL); + + dw = camel_medium_get_content (CAMEL_MEDIUM (template)); + /* If template is a multipart, then try to use HTML. When no HTML part is available, use plaintext. Every other + add as an attachment */ + if (CAMEL_IS_MULTIPART (dw)) { + for (i = 0; i < camel_multipart_get_number (CAMEL_MULTIPART (dw)); i++) { + CamelMimePart *part = camel_multipart_get_part (CAMEL_MULTIPART (dw), i); + CamelContentType *ct = camel_mime_part_get_content_type (part); + + if (ct && camel_content_type_is (ct, "text", "html")) { + new_content_type = ct; + template_part = camel_multipart_get_part (CAMEL_MULTIPART (dw), i); + } else if (ct && camel_content_type_is (ct, "text", "plain") && new_content_type == NULL) { + new_content_type = ct; + template_part = camel_multipart_get_part (CAMEL_MULTIPART (dw), i); + } else { + /* Copy any other parts (attachments...) to the output message */ + camel_mime_part_set_disposition (part, "attachment"); + camel_multipart_add_part (new_multipart, part); + } + } + } else { + CamelContentType *ct = camel_mime_part_get_content_type (CAMEL_MIME_PART (template)); - /* make the exact copy of the template message, with all - its attachments and message structure */ - mem = camel_stream_mem_new (); - camel_data_wrapper_write_to_stream_sync ( - CAMEL_DATA_WRAPPER (template), mem, NULL, NULL); - camel_stream_reset (mem, NULL); - camel_data_wrapper_construct_from_stream_sync ( - CAMEL_DATA_WRAPPER (new), mem, NULL, NULL); - g_object_unref (mem); + if (ct && (camel_content_type_is (ct, "text", "html") || + camel_content_type_is (ct, "text", "plain"))) { + template_part = CAMEL_MIME_PART (template); + new_content_type = ct; + } + } + + /* Here replace all the modifiers in template body by values from message and return the newly created part */ + out_part = fill_template (message, template_part); + + /* Assigning part directly to mime_message causes problem with "Content-type" header displaying + in the HTML message (camel parsing bug?) */ + camel_multipart_add_part (new_multipart, out_part); + g_object_unref (out_part); + camel_medium_set_content (CAMEL_MEDIUM (new), CAMEL_DATA_WRAPPER (new_multipart)); /* Add the headers from the message we are replying to, so CC and that - * stuff is preserved. */ - header = ((CamelMimePart *)message)->headers; + stuff is preserved. Also replace any $ORIG[header-name] modifiers ignoring + 'content-*' headers */ + header = CAMEL_MIME_PART (message)->headers; while (header) { if (g_ascii_strncasecmp (header->name, "content-", 8) != 0) { - camel_medium_add_header ((CamelMedium *) new, - header->name, - header->value); + + /* Some special handling of the 'subject' header */ + if (g_ascii_strncasecmp (header->name, "subject", 7) == 0) { + GString *subject = g_string_new (camel_mime_message_get_subject (template)); + + /* Now replace all possible $ORIG[]s in the subject line by values from original message */ + struct _camel_header_raw *m_header = CAMEL_MIME_PART (message)->headers; + while (m_header) { + if (g_ascii_strncasecmp (m_header->name, "content-", 8) != 0 && + g_ascii_strncasecmp (m_header->name, "subject", 7) !=0) + replace_template_variable (subject, m_header->name, m_header->value); + + m_header = m_header->next; + } + /* Now replace $ORIG[subject] variable, handling possible base64 encryption */ + replace_template_variable (subject, "subject", + camel_mime_message_get_subject (message)); + header->value = g_strdup (subject->str); + g_string_free (subject, TRUE); + } + + camel_medium_add_header (CAMEL_MEDIUM (new), + header->name, + header->value); } + header = header->next; } @@ -522,38 +805,55 @@ create_new_message (CamelFolder *folder, const gchar *uid, CamelMimeMessage *mes /* Create the composer */ em_utils_edit_message (shell, folder, new); + g_object_unref (template); + g_object_unref (new_multipart); g_object_unref (new); } static void action_reply_with_template_cb (GtkAction *action, - const gchar *message_uid) + EShellView *shell_view) { - CamelFolder *folder; + CamelFolder *folder, *template_folder; + EShellContent *shell_content; + EMailReader *reader; + GPtrArray *uids; + const gchar *uid; + CamelMimeMessage *template; - g_return_if_fail (message_uid != NULL); + shell_content = e_shell_view_get_shell_content (shell_view); + reader = E_MAIL_READER (shell_content); + folder = e_mail_reader_get_folder (reader); + uids = e_mail_reader_get_selected_uids (reader); - folder = CAMEL_FOLDER (g_object_get_data (G_OBJECT (action), "message_folder")); - g_return_if_fail (folder != NULL); + if (!uids->len || !folder) + return; g_object_ref (G_OBJECT (action)); - mail_get_message (folder, message_uid, create_new_message, action, mail_msg_unordered_push); + template_folder = g_object_get_data (G_OBJECT (action), "template-folder"); + uid = g_object_get_data (G_OBJECT (action), "template-uid"); + template = camel_folder_get_message_sync (template_folder, uid, NULL, NULL); + + mail_get_message (folder, uids->pdata[0], create_new_message, + (gpointer)template, mail_msg_unordered_push); g_object_unref (G_OBJECT (action)); + + em_utils_uids_free (uids); } static void build_template_menus_recurse (GtkUIManager *ui_manager, - GtkActionGroup *action_group, + GtkActionGroup *action_group, const gchar *menu_path, guint *action_count, guint merge_id, CamelFolderInfo *folder_info, - CamelFolder *message_folder, - const gchar *message_uid) + EShellView *shell_view) { CamelStore *store; + EShellWindow *shell_window = e_shell_view_get_shell_window (shell_view); store = e_mail_local_get_store (); @@ -591,6 +891,12 @@ build_template_menus_recurse (GtkUIManager *ui_manager, ui_manager, merge_id, menu_path, action_name, action_name, GTK_UI_MANAGER_MENU, FALSE); + /* Disconnect previous connection to avoid possible multiple calls because + folder is a persistent structure */ + g_signal_handlers_disconnect_by_func (folder, G_CALLBACK (templates_folder_msg_changed_cb), shell_window); + g_signal_connect (folder, "changed", + G_CALLBACK (templates_folder_msg_changed_cb), shell_window); + path = g_strdup_printf ("%s/%s", menu_path, action_name); g_object_unref (action); @@ -601,7 +907,7 @@ build_template_menus_recurse (GtkUIManager *ui_manager, build_template_menus_recurse ( ui_manager, action_group, path, action_count, merge_id, - folder_info->child, message_folder, message_uid); + folder_info->child, shell_view); if (!folder) { g_free (path); @@ -613,7 +919,7 @@ build_template_menus_recurse (GtkUIManager *ui_manager, uids = camel_folder_get_uids (folder); for (ii = 0; uids && ii < uids->len; ii++) { CamelMimeMessage *template; - const gchar *uid = uids->pdata[ii], *muid; + const gchar *uid = uids->pdata[ii]; guint32 flags; /* If the UIDs is marked for deletion, skip it. */ @@ -641,25 +947,14 @@ build_template_menus_recurse (GtkUIManager *ui_manager, action = gtk_action_new ( action_name, action_label, NULL, NULL); - muid = camel_pstring_strdup (message_uid); - g_object_ref (message_folder); - - g_object_set_data_full ( - G_OBJECT (action), "message_uid", (gpointer) muid, - (GDestroyNotify) camel_pstring_free); - - g_object_set_data_full ( - G_OBJECT (action), "message_folder", message_folder, - (GDestroyNotify) g_object_unref); + g_object_set_data(G_OBJECT (action), "template-uid", (gpointer) uid); - g_object_set_data_full ( - G_OBJECT (action), "template", template, - (GDestroyNotify) g_object_unref); + g_object_set_data(G_OBJECT (action), "template-folder", folder); g_signal_connect ( action, "activate", G_CALLBACK (action_reply_with_template_cb), - (gpointer) muid); + shell_view); gtk_action_group_add_action (action_group, action); @@ -669,6 +964,7 @@ build_template_menus_recurse (GtkUIManager *ui_manager, g_object_unref (action); g_free (action_name); + g_object_unref (template); } camel_folder_free_uids (folder, uids); @@ -750,52 +1046,28 @@ static GtkActionEntry composer_entries[] = { }; static void -update_actions_cb (EShellView *shell_view) +build_menu (EShellWindow *shell_window, + GtkActionGroup *action_group) { - EShellContent *shell_content; - EShellWindow *shell_window; - GtkActionGroup *action_group; - GtkUIManager *ui_manager; - CamelFolderInfo *folder_info; - CamelFolder *templates_folder; + EShellView *shell_view; CamelFolder *folder; CamelStore *store; - EMailReader *reader; - GPtrArray *uids; - const gchar *full_name; - guint action_count = 0; + CamelFolderInfo *folder_info; + GtkUIManager *ui_manager; guint merge_id; - gpointer data; - - shell_content = e_shell_view_get_shell_content (shell_view); - shell_window = e_shell_view_get_shell_window (shell_view); + guint action_count = 0; + const gchar *full_name; ui_manager = e_shell_window_get_ui_manager (shell_window); - action_group = e_lookup_action_group (ui_manager, "templates"); - data = g_object_get_data (G_OBJECT (action_group), "merge-id"); - merge_id = GPOINTER_TO_UINT (data); - g_return_if_fail (merge_id > 0); + shell_view = e_shell_window_get_shell_view (shell_window, "mail"); - gtk_ui_manager_remove_ui (ui_manager, merge_id); - e_action_group_remove_all_actions (action_group); - gtk_ui_manager_ensure_update (ui_manager); - - if (!plugin_enabled) - return; - - reader = E_MAIL_READER (shell_content); - folder = e_mail_reader_get_folder (reader); - uids = e_mail_reader_get_selected_uids (reader); - - if (uids->len != 1) - goto exit; + merge_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (action_group), "merge-id")); /* Now recursively build template submenus in the pop-up menu. */ - store = e_mail_local_get_store (); - templates_folder = e_mail_local_get_folder ( + folder = e_mail_local_get_folder ( E_MAIL_LOCAL_FOLDER_TEMPLATES); - full_name = camel_folder_get_full_name (templates_folder); + full_name = camel_folder_get_full_name (folder); /* FIXME Not passing a GCancellable or GError here. */ folder_info = camel_store_get_folder_info_sync ( @@ -807,11 +1079,32 @@ update_actions_cb (EShellView *shell_view) ui_manager, action_group, "/mail-message-popup/mail-message-templates", &action_count, merge_id, folder_info, - folder, uids->pdata[0]); + shell_view); camel_store_free_folder_info (store, folder_info); -exit: - em_utils_uids_free (uids); +} + +static void +update_actions_cb (EShellView *shell_view, GtkActionGroup *action_group) +{ + GList *list; + gint length; + + if (!plugin_enabled) + return; + + list = gtk_action_group_list_actions (action_group); + length = g_list_length (list); + + if (!length) { + EShellWindow *shell_window = e_shell_view_get_shell_window (shell_view); + build_menu (shell_window, action_group); + } + + gtk_action_group_set_sensitive (action_group, TRUE); + gtk_action_group_set_visible (action_group, TRUE); + + g_list_free (list); } gboolean @@ -831,31 +1124,89 @@ init_composer_actions (GtkUIManager *ui_manager, } static void -mail_shell_view_created_cb (EShellWindow *shell_window, - EShellView *shell_view) +rebuild_template_menu (EShellWindow *shell_window) +{ + GtkUIManager *ui_manager; + GtkActionGroup *action_group; + guint merge_id; + + ui_manager = e_shell_window_get_ui_manager (shell_window); + + action_group = e_lookup_action_group (ui_manager, "templates"); + merge_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (action_group), "merge-id")); + + gtk_ui_manager_remove_ui (ui_manager, merge_id); + e_action_group_remove_all_actions (action_group); + gtk_ui_manager_ensure_update (ui_manager); + + build_menu (shell_window, action_group); +} + +static void +templates_folder_msg_changed_cb (CamelFolder *folder, + CamelFolderChangeInfo *change_info, + EShellWindow *shell_window) { - g_signal_connect ( - shell_view, "update-actions", - G_CALLBACK (update_actions_cb), NULL); + rebuild_template_menu (shell_window); } -gboolean -init_shell_actions (GtkUIManager *ui_manager, - EShellWindow *shell_window) +static void +templates_folder_changed_cb (CamelStore *store, + CamelFolderInfo *folder_info, + EShellWindow *shell_window) { - EShellView *shell_view; + if (folder_info->full_name && strstr (folder_info->full_name, _("Templates")) != NULL) + rebuild_template_menu (shell_window); +} + +static void +templates_folder_renamed_cb (CamelStore *store, + const gchar *old_name, + CamelFolderInfo *folder_info, + EShellWindow *shell_window) +{ + if (folder_info->full_name && strstr (folder_info->full_name, _("Templates")) != NULL) + rebuild_template_menu (shell_window); +} + +static void +mail_shell_view_created_cb (EShellWindow *shell_window, + EShellView *shell_view) +{ + GtkUIManager *ui_manager; GtkActionGroup *action_group; + CamelFolder *folder; + CamelStore *store; guint merge_id; - /* This is where we keep dynamically-built menu items. */ + ui_manager = e_shell_window_get_ui_manager (shell_window); e_shell_window_add_action_group (shell_window, "templates"); action_group = e_lookup_action_group (ui_manager, "templates"); - merge_id = gtk_ui_manager_new_merge_id (ui_manager); + g_object_set_data (G_OBJECT (action_group), "merge-id", + GUINT_TO_POINTER (merge_id)); - g_object_set_data ( - G_OBJECT (action_group), "merge-id", - GUINT_TO_POINTER (merge_id)); + folder = e_mail_local_get_folder (E_MAIL_LOCAL_FOLDER_TEMPLATES); + store = e_mail_local_get_store (); + + g_signal_connect (folder, "changed", + G_CALLBACK (templates_folder_msg_changed_cb), shell_window); + g_signal_connect (store, "folder-created", + G_CALLBACK (templates_folder_changed_cb), shell_window); + g_signal_connect (store, "folder-deleted", + G_CALLBACK (templates_folder_changed_cb), shell_window); + g_signal_connect (store, "folder-renamed", + G_CALLBACK (templates_folder_renamed_cb), shell_window); + + g_signal_connect (shell_view, "update-actions", + G_CALLBACK (update_actions_cb), action_group); +} + +gboolean +init_shell_actions (GtkUIManager *ui_manager, + EShellWindow *shell_window) +{ + EShellView *shell_view; /* Be careful not to instantiate the mail view ourselves. */ shell_view = e_shell_window_peek_shell_view (shell_window, "mail"); -- cgit v1.2.3 From 77397e699d0840a58aa507144631680a74bd8bed Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Fri, 29 Apr 2011 09:49:02 -0400 Subject: Adapt to extra arg in camel_session_get_service_by_url(). --- plugins/groupwise-features/install-shared.c | 2 +- plugins/groupwise-features/share-folder-common.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/groupwise-features/install-shared.c b/plugins/groupwise-features/install-shared.c index 3899dab95b..d43d6fa0fa 100644 --- a/plugins/groupwise-features/install-shared.c +++ b/plugins/groupwise-features/install-shared.c @@ -96,7 +96,7 @@ install_folder_response (EMFolderSelector *emfs, gint response, gpointer *data) url = camel_url_new (uri, NULL); if (url != NULL) { service = camel_session_get_service_by_url ( - session, url); + session, url, CAMEL_PROVIDER_STORE); camel_url_free (url); } diff --git a/plugins/groupwise-features/share-folder-common.c b/plugins/groupwise-features/share-folder-common.c index 19d46bad0b..dcf470d06a 100644 --- a/plugins/groupwise-features/share-folder-common.c +++ b/plugins/groupwise-features/share-folder-common.c @@ -267,7 +267,7 @@ users_dialog_response (GtkWidget *dialog, gint response, struct ShareInfo *ssi) url = camel_url_new (uri, NULL); if (url != NULL) { service = camel_session_get_service_by_url ( - CAMEL_SESSION (session), url); + session, url, CAMEL_PROVIDER_STORE); camel_url_free (url); } @@ -319,7 +319,8 @@ new_folder_response (EMFolderSelector *emfs, gint response, EMFolderTreeModel *m url = camel_url_new (uri, NULL); if (url != NULL) { - service = camel_session_get_service_by_url (session, url); + service = camel_session_get_service_by_url ( + session, url, CAMEL_PROVIDER_STORE); camel_url_free (url); } -- cgit v1.2.3 From 384f70e95857297ccbab047b995c21943d9c812a Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 30 Apr 2011 10:19:40 -0400 Subject: groupwise-features: Fix a compiler warning. --- plugins/groupwise-features/share-folder-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins') diff --git a/plugins/groupwise-features/share-folder-common.c b/plugins/groupwise-features/share-folder-common.c index dcf470d06a..3adb7542e5 100644 --- a/plugins/groupwise-features/share-folder-common.c +++ b/plugins/groupwise-features/share-folder-common.c @@ -267,7 +267,7 @@ users_dialog_response (GtkWidget *dialog, gint response, struct ShareInfo *ssi) url = camel_url_new (uri, NULL); if (url != NULL) { service = camel_session_get_service_by_url ( - session, url, CAMEL_PROVIDER_STORE); + CAMEL_SESSION (session), url, CAMEL_PROVIDER_STORE); camel_url_free (url); } -- cgit v1.2.3 From 5fcf41925becbac39447b315097b062de2bfd0a1 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 2 May 2011 14:21:21 -0400 Subject: EMEventTargetFolder: Add an EAccount member. The mail-notification plugin can use the EAccount member directly instead of searching for it by URI. --- plugins/mail-notification/mail-notification.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'plugins') diff --git a/plugins/mail-notification/mail-notification.c b/plugins/mail-notification/mail-notification.c index 5cde1fbf69..9f236c072a 100644 --- a/plugins/mail-notification/mail-notification.c +++ b/plugins/mail-notification/mail-notification.c @@ -379,16 +379,13 @@ new_notify_status (EMEventTargetFolder *t) gchar *msg; if (!status_count) { - EAccount *account; - gchar *name = t->name; + gchar *folder_name; - account = e_get_account_by_source_url (t->uri); - - if (account != NULL) { - name = g_strdup_printf ( - "%s/%s", e_account_get_string ( - account, E_ACCOUNT_NAME), name); - } + if (t->account != NULL) + folder_name = g_strdup_printf ( + "%s/%s", t->account->name, t->name); + else + folder_name = g_strdup (t->name); status_count = t->new; @@ -397,10 +394,9 @@ new_notify_status (EMEventTargetFolder *t) msg = g_strdup_printf (ngettext ( "You have received %d new message\nin %s.", "You have received %d new messages\nin %s.", - status_count), status_count, name); + status_count), status_count, folder_name); - if (name != t->name) - g_free (name); + g_free (folder_name); if (t->msg_sender) { gchar *tmp, *str; -- cgit v1.2.3 From 7b4a69edc4a67445ae11c77135772934e4d380a2 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Mon, 2 May 2011 15:34:56 -0400 Subject: EMConfigTargetAccount: Add original_account member. Rename the existing 'account' member to 'modified_account' and add an 'original_account' member so plugins have direct access to both. Mostly of benefit to the imap-features plugin. --- plugins/groupwise-features/proxy.c | 6 +++--- plugins/groupwise-features/send-options.c | 2 +- plugins/imap-features/imap-headers.c | 26 +++++++++++++++----------- 3 files changed, 19 insertions(+), 15 deletions(-) (limited to 'plugins') diff --git a/plugins/groupwise-features/proxy.c b/plugins/groupwise-features/proxy.c index 849d4ea3d4..1db29531e6 100644 --- a/plugins/groupwise-features/proxy.c +++ b/plugins/groupwise-features/proxy.c @@ -519,7 +519,7 @@ proxy_abort (GtkWidget *button, EConfigHookItemFactoryData *data) proxyDialog *prd = NULL; target_account = (EMConfigTargetAccount *)data->config->target; - account = target_account->account; + account = target_account->modified_account; prd = g_object_get_data ((GObject *)account, "prd"); if (!prd || !prd->priv || !prd->priv->proxy_list) @@ -540,7 +540,7 @@ proxy_commit (GtkWidget *button, EConfigHookItemFactoryData *data) proxyDialog *prd = NULL; target_account = (EMConfigTargetAccount *)data->config->target; - account = target_account->account; + account = target_account->modified_account; prd = g_object_get_data ((GObject *)account, "prd"); /* In case of non-GroupWise preferences edit, "prd" will be NULL. */ @@ -653,7 +653,7 @@ org_gnome_proxy (EPlugin *epl, EConfigHookItemFactoryData *data) session = e_mail_backend_get_session (E_MAIL_BACKEND (shell_backend)); target_account = (EMConfigTargetAccount *)data->config->target; - account = target_account->account; + account = target_account->modified_account; /* We are using some g_object_set on this. We shuold also avoid double-free later. So reffing */ g_object_ref (account); diff --git a/plugins/groupwise-features/send-options.c b/plugins/groupwise-features/send-options.c index 8b0aa48b55..1e6ef396c3 100644 --- a/plugins/groupwise-features/send-options.c +++ b/plugins/groupwise-features/send-options.c @@ -201,7 +201,7 @@ org_gnome_send_options (EPlugin *epl, EConfigHookItemFactoryData *data) gchar *markup; target_account = (EMConfigTargetAccount *)data->config->target; - account = target_account->account; + account = target_account->modified_account; if (!g_strrstr (account->source->url, "groupwise://")) return NULL; diff --git a/plugins/imap-features/imap-headers.c b/plugins/imap-features/imap-headers.c index dd4032ed6d..35fbecacd0 100644 --- a/plugins/imap-features/imap-headers.c +++ b/plugins/imap-features/imap-headers.c @@ -76,15 +76,16 @@ void imap_headers_commit (EPlugin *efp, EConfigHookItemFactoryData *data) { EMConfigTargetAccount *target_account; - EAccount *account; + EAccount *original_account; + EAccount *modified_account; gboolean use_imap = g_getenv ("USE_IMAP") != NULL; target_account = (EMConfigTargetAccount *)data->config->target; - account = target_account->account; + original_account = target_account->original_account; + modified_account = target_account->modified_account; - if (g_str_has_prefix (account->source->url, "imap://") || - (use_imap && g_str_has_prefix (account->source->url, "groupwise://"))) { - EAccount *temp = NULL; + if (g_str_has_prefix (modified_account->source->url, "imap://") || + (use_imap && g_str_has_prefix (modified_account->source->url, "groupwise://"))) { EAccountList *accounts = e_get_account_list (); CamelURL *url = NULL; GtkTreeModel *model; @@ -94,9 +95,9 @@ imap_headers_commit (EPlugin *efp, EConfigHookItemFactoryData *data) str = g_string_new(""); - temp = e_get_account_by_source_url (account->source->url); - - url = camel_url_new (e_account_get_string (account, E_ACCOUNT_SOURCE_URL), NULL); + url = camel_url_new ( + e_account_get_string ( + modified_account, E_ACCOUNT_SOURCE_URL), NULL); model = gtk_tree_view_get_model (ui->custom_headers_tree); if (gtk_tree_model_get_iter_first (model, &iter)) { @@ -125,10 +126,13 @@ imap_headers_commit (EPlugin *efp, EConfigHookItemFactoryData *data) camel_url_set_param (url, "basic_headers", NULL); } - e_account_set_string (temp, E_ACCOUNT_SOURCE_URL, camel_url_to_string (url, 0)); + /* FIXME Leaking URL string? */ + e_account_set_string ( + original_account, E_ACCOUNT_SOURCE_URL, + camel_url_to_string (url, 0)); camel_url_free (url); g_string_free (str, TRUE); - e_account_list_change (accounts, temp); + e_account_list_change (accounts, original_account); e_account_list_save (accounts); } } @@ -269,7 +273,7 @@ org_gnome_imap_headers (EPlugin *epl, EConfigHookItemFactoryData *data) ui = g_new0 (EPImapFeaturesData, 1); target_account = (EMConfigTargetAccount *)data->config->target; - account = target_account->account; + account = target_account->modified_account; if (!g_str_has_prefix (account->source->url, "imap://") && !(use_imap && g_str_has_prefix (account->source->url, "groupwise://"))) return NULL; -- cgit v1.2.3 From 9e0f0f529f363717fa0a2884fe576d8a26ed3df2 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 3 May 2011 08:59:35 -0400 Subject: Drop 'folder_uri' param from em_utils_folder_is_drafts(). --- plugins/itip-formatter/itip-formatter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index f2455adfa5..f63f9623ba 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -2286,7 +2286,7 @@ in_proper_folder (CamelFolder *folder) /* or anything else except of sent, outbox or drafts folder */ (!em_utils_folder_is_sent (folder, folder_uri) && !em_utils_folder_is_outbox (folder, folder_uri) && - !em_utils_folder_is_drafts (folder, folder_uri)) + !em_utils_folder_is_drafts (folder)) )); } else { /* cannot check for Inbox folder here */ @@ -2294,7 +2294,7 @@ in_proper_folder (CamelFolder *folder) (CAMEL_IS_VEE_FOLDER (folder)) || ( !em_utils_folder_is_sent (folder, folder_uri) && !em_utils_folder_is_outbox (folder, folder_uri) && - !em_utils_folder_is_drafts (folder, folder_uri))); + !em_utils_folder_is_drafts (folder))); } return res; -- cgit v1.2.3 From b9f932b1b84349e80e8383d925a00a75a3b7fe29 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 3 May 2011 09:16:49 -0400 Subject: Drop 'folder_uri' param from em_utils_folder_is_sent(). --- plugins/itip-formatter/itip-formatter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index f63f9623ba..a90ff38bbe 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -2284,7 +2284,7 @@ in_proper_folder (CamelFolder *folder) /* or any other virtual folder */ CAMEL_IS_VEE_FOLDER (folder) || /* or anything else except of sent, outbox or drafts folder */ - (!em_utils_folder_is_sent (folder, folder_uri) && + (!em_utils_folder_is_sent (folder) && !em_utils_folder_is_outbox (folder, folder_uri) && !em_utils_folder_is_drafts (folder)) )); @@ -2292,7 +2292,7 @@ in_proper_folder (CamelFolder *folder) /* cannot check for Inbox folder here */ res = (folder->folder_flags & (CAMEL_FOLDER_IS_TRASH | CAMEL_FOLDER_IS_JUNK)) == 0 && ( (CAMEL_IS_VEE_FOLDER (folder)) || ( - !em_utils_folder_is_sent (folder, folder_uri) && + !em_utils_folder_is_sent (folder) && !em_utils_folder_is_outbox (folder, folder_uri) && !em_utils_folder_is_drafts (folder))); } -- cgit v1.2.3 From c3b983d6e12e218b6f908cf263e7e08570332d6a Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 3 May 2011 09:40:49 -0400 Subject: Drop 'folder_uri' param from em_utils_folder_is_outbox(). --- plugins/itip-formatter/itip-formatter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index a90ff38bbe..96dadab0ea 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -2285,7 +2285,7 @@ in_proper_folder (CamelFolder *folder) CAMEL_IS_VEE_FOLDER (folder) || /* or anything else except of sent, outbox or drafts folder */ (!em_utils_folder_is_sent (folder) && - !em_utils_folder_is_outbox (folder, folder_uri) && + !em_utils_folder_is_outbox (folder) && !em_utils_folder_is_drafts (folder)) )); } else { @@ -2293,7 +2293,7 @@ in_proper_folder (CamelFolder *folder) res = (folder->folder_flags & (CAMEL_FOLDER_IS_TRASH | CAMEL_FOLDER_IS_JUNK)) == 0 && ( (CAMEL_IS_VEE_FOLDER (folder)) || ( !em_utils_folder_is_sent (folder) && - !em_utils_folder_is_outbox (folder, folder_uri) && + !em_utils_folder_is_outbox (folder) && !em_utils_folder_is_drafts (folder))); } -- cgit v1.2.3 From b8a932ae1e8b10344525ae2a5a78894e98ac2540 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 3 May 2011 10:45:46 -0400 Subject: Fix compiler warnings. Mostly dead assignments. --- plugins/itip-formatter/itip-formatter.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'plugins') diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index 96dadab0ea..d93f2f5384 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -2260,7 +2260,6 @@ in_proper_folder (CamelFolder *folder) EMailBackend *backend; EMailSession *session; MailFolderCache *folder_cache; - const gchar *folder_uri; gboolean res = TRUE; gint flags = 0; @@ -2273,8 +2272,6 @@ in_proper_folder (CamelFolder *folder) session = e_mail_backend_get_session (backend); folder_cache = e_mail_session_get_folder_cache (session); - folder_uri = camel_folder_get_uri (folder); - if (mail_folder_cache_get_folder_info_flags (folder_cache, folder, &flags)) { /* it should be neither trash nor junk folder, */ res = ((flags & CAMEL_FOLDER_TYPE_TRASH) != CAMEL_FOLDER_TYPE_TRASH && -- cgit v1.2.3 From 06411bdbbb3e6877c679007c269c84b05713f895 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 3 May 2011 13:42:15 -0400 Subject: Remove 'from_uri' params from e-msg-composer-utils.c. Pass CamelFolder objects instead, which are already available at almost every call site. --- plugins/mailing-list-actions/mailing-list-actions.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'plugins') diff --git a/plugins/mailing-list-actions/mailing-list-actions.c b/plugins/mailing-list-actions/mailing-list-actions.c index 8090c21063..310c9affce 100644 --- a/plugins/mailing-list-actions/mailing-list-actions.c +++ b/plugins/mailing-list-actions/mailing-list-actions.c @@ -100,12 +100,11 @@ e_plugin_lib_enable (EPlugin *ep, gint enable) typedef struct { EMailReader *reader; EmlaAction action; - gchar * uri; } emla_action_data; static void emla_list_action_do (CamelFolder *folder, - const gchar *uid, + const gchar *message_uid, CamelMimeMessage *msg, gpointer data) { @@ -121,10 +120,16 @@ emla_list_action_do (CamelFolder *folder, EShellBackend *shell_backend; EAccount *account; GtkWindow *window; + CamelStore *store; + const gchar *uid; if (msg == NULL) return; + store = camel_folder_get_parent_store (folder); + uid = camel_service_get_uid (CAMEL_SERVICE (store)); + account = e_get_account_by_uid (uid); + backend = e_mail_reader_get_backend (action_data->reader); shell_backend = E_SHELL_BACKEND (backend); @@ -181,14 +186,14 @@ emla_list_action_do (CamelFolder *folder, if (send_message_response == GTK_RESPONSE_YES) { /* directly send message */ composer = e_msg_composer_new_from_url (shell, url); - if ((account = e_get_account_by_source_url (action_data->uri))) + if (account != NULL) e_composer_header_table_set_account ( e_msg_composer_get_header_table (composer), account); e_msg_composer_send (composer); } else if (send_message_response == GTK_RESPONSE_NO) { /* show composer */ - em_utils_compose_new_message_with_mailto (shell, url, action_data->uri); + em_utils_compose_new_message_with_mailto (shell, url, folder); } goto exit; @@ -212,7 +217,6 @@ emla_list_action_do (CamelFolder *folder, exit: g_object_unref (action_data->reader); - g_free (action_data->uri); g_free (action_data); g_free (url); } @@ -224,10 +228,8 @@ emla_list_action (EMailReader *reader, CamelFolder *folder; GPtrArray *uids; emla_action_data *data; - const gchar *folder_uri; folder = e_mail_reader_get_folder (reader); - folder_uri = e_mail_reader_get_folder_uri (reader); uids = e_mail_reader_get_selected_uids (reader); g_return_if_fail (uids->len == 1); @@ -235,7 +237,6 @@ emla_list_action (EMailReader *reader, data = g_malloc (sizeof (emla_action_data)); data->reader = g_object_ref (reader); data->action = action; - data->uri = g_strdup (folder_uri); mail_get_message ( folder, uids->pdata[0], -- cgit v1.2.3 From b4d14fdbe518e1009fd67e590c8d90ff5dc58382 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 3 May 2011 15:18:15 -0400 Subject: groupwise-features: Avoid e_get_account_by_source_url(). Use e_get_account_by_uid() instead. --- plugins/groupwise-features/install-shared.c | 7 +++---- plugins/groupwise-features/proxy-login.c | 22 +++++++++++++--------- plugins/groupwise-features/share-folder-common.c | 13 +++++-------- 3 files changed, 21 insertions(+), 21 deletions(-) (limited to 'plugins') diff --git a/plugins/groupwise-features/install-shared.c b/plugins/groupwise-features/install-shared.c index d43d6fa0fa..6d290d0993 100644 --- a/plugins/groupwise-features/install-shared.c +++ b/plugins/groupwise-features/install-shared.c @@ -110,7 +110,7 @@ install_folder_response (EMFolderSelector *emfs, gint response, gpointer *data) container_id = get_container_id (cnc, parent_name); if (e_gw_connection_accept_shared_folder (cnc, folder_name, container_id, (gchar *)item_id, NULL) == E_GW_CONNECTION_STATUS_OK) { - CamelURL *url; + const gchar *uid; /* FIXME Not passing a GCancellable or GError here. */ folder = camel_store_get_folder_sync ( @@ -126,9 +126,8 @@ install_folder_response (EMFolderSelector *emfs, gint response, gpointer *data) CAMEL_MESSAGE_DELETED); camel_folder_summary_touch (folder->summary); /* camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed", changes); */ - url = camel_service_get_camel_url (service); - uri = camel_url_to_string (url, CAMEL_URL_HIDE_ALL); - account = e_get_account_by_source_url (uri); + uid = camel_service_get_uid (service); + account = e_get_account_by_uid (uid); uri = account->source->url; em_folder_tree_model_remove_store ( model, CAMEL_STORE (service)); diff --git a/plugins/groupwise-features/proxy-login.c b/plugins/groupwise-features/proxy-login.c index 3f80ac9500..55d4ecff36 100644 --- a/plugins/groupwise-features/proxy-login.c +++ b/plugins/groupwise-features/proxy-login.c @@ -508,10 +508,12 @@ gw_proxy_login_cb (GtkAction *action, EShellView *shell_view) GtkTreeModel *model = NULL; GtkTreeIter iter; GtkWidget *tbox_account_name; + CamelStore *store; + EAccount *account; gboolean is_store = FALSE; - gchar *uri = NULL; proxyLoginPrivate *priv; EGwConnection *cnc; + const gchar *uid; shell_sidebar = e_shell_view_get_shell_sidebar (shell_view); g_object_get (shell_sidebar, "folder-tree", &folder_tree, NULL); @@ -523,15 +525,19 @@ gw_proxy_login_cb (GtkAction *action, EShellView *shell_view) if (!gtk_tree_selection_get_selected (selection, &model, &iter)) return; - gtk_tree_model_get (model, &iter, COL_STRING_URI, &uri, COL_BOOL_IS_STORE, &is_store, -1); + gtk_tree_model_get ( + model, &iter, + COL_POINTER_CAMEL_STORE, &store, + COL_BOOL_IS_STORE, &is_store, -1); - if (!is_store || !uri) { - g_free (uri); + if (!is_store) return; - } + + uid = camel_service_get_uid (CAMEL_SERVICE (store)); + account = e_get_account_by_uid (uid); /* This pops-up the password dialog in case the User has forgot-passwords explicitly */ - cnc = proxy_login_get_cnc (e_get_account_by_source_url (uri), NULL); + cnc = proxy_login_get_cnc (account, NULL); if (cnc) g_object_unref (cnc); @@ -542,7 +548,7 @@ gw_proxy_login_cb (GtkAction *action, EShellView *shell_view) e_load_ui_builder_definition (priv->builder, "proxy-login-dialog.ui"); priv->main = e_builder_get_widget (priv->builder, "proxy_login_dialog"); - pld->account = e_get_account_by_source_url (uri); + pld->account = account; priv->tree = GTK_TREE_VIEW (e_builder_get_widget (priv->builder, "proxy_login_treeview")); priv->store = gtk_tree_store_new (2, GDK_TYPE_PIXBUF, @@ -554,6 +560,4 @@ gw_proxy_login_cb (GtkAction *action, EShellView *shell_view) gtk_widget_grab_focus (tbox_account_name); g_signal_connect (GTK_DIALOG (priv->main), "response", G_CALLBACK(proxy_login_cb), e_shell_view_get_shell_window (shell_view)); gtk_widget_show (GTK_WIDGET (priv->main)); - - g_free (uri); } diff --git a/plugins/groupwise-features/share-folder-common.c b/plugins/groupwise-features/share-folder-common.c index 3adb7542e5..20720e916c 100644 --- a/plugins/groupwise-features/share-folder-common.c +++ b/plugins/groupwise-features/share-folder-common.c @@ -66,18 +66,16 @@ static void refresh_folder_tree (EMFolderTreeModel *model, CamelStore *store); static void refresh_folder_tree (EMFolderTreeModel *model, CamelStore *store) { - gchar *uri; EAccount *account; CamelProvider *provider; - CamelURL *url; + const gchar *uid; + gchar *uri; - url = camel_service_get_camel_url (CAMEL_SERVICE (store)); - uri = camel_url_to_string (url, CAMEL_URL_HIDE_ALL); + uid = camel_service_get_uid (CAMEL_SERVICE (store)); + account = e_get_account_by_uid (uid); - account = e_get_account_by_source_url (uri); - if (!account) { + if (account == NULL) return; - } uri = account->source->url; em_folder_tree_model_remove_store (model, store); @@ -89,7 +87,6 @@ refresh_folder_tree (EMFolderTreeModel *model, CamelStore *store) if (!(provider->flags & CAMEL_PROVIDER_IS_STORAGE)) return; em_folder_tree_model_add_store (model, store, account->name); - /* g_object_unref (store); */ } void -- cgit v1.2.3 From 218bd67a1e0ab29971d3bf7f1c111210b0d74e2d Mon Sep 17 00:00:00 2001 From: Vibha Yadav Date: Wed, 4 May 2011 17:34:48 +0530 Subject: Bug 649365 - Creation of new repository evolution-groupwise Removing groupwise plugin code from evolution. --- plugins/groupwise-features/Makefile.am | 97 -- plugins/groupwise-features/addressbook-groupwise.c | 69 -- plugins/groupwise-features/camel-gw-listener.c | 1043 -------------------- plugins/groupwise-features/camel-gw-listener.h | 58 -- .../groupwise-features/groupwise-account-setup.c | 138 --- plugins/groupwise-features/gw-ui.c | 459 --------- plugins/groupwise-features/gw-ui.h | 38 - plugins/groupwise-features/install-shared.c | 274 ----- plugins/groupwise-features/junk-mail-settings.c | 119 --- plugins/groupwise-features/junk-settings.c | 428 -------- plugins/groupwise-features/junk-settings.h | 82 -- plugins/groupwise-features/junk-settings.ui | 458 --------- plugins/groupwise-features/mail-retract.c | 119 --- plugins/groupwise-features/mail-send-options.c | 246 ----- plugins/groupwise-features/mail-send-options.h | 43 - plugins/groupwise-features/notification.ui | 216 ---- .../org-gnome-compose-send-options.xml | 17 - .../org-gnome-groupwise-features.eplug.xml | 108 -- .../org-gnome-mail-retract.error.xml | 8 - .../org-gnome-process-meeting.error.xml | 44 - .../org-gnome-proxy-login.error.xml | 16 - .../groupwise-features/org-gnome-proxy.error.xml | 27 - .../org-gnome-shared-folder.error.xml | 19 - plugins/groupwise-features/process-meeting.c | 442 --------- plugins/groupwise-features/properties.ui | 756 -------------- plugins/groupwise-features/proxy-add-dialog.ui | 730 -------------- plugins/groupwise-features/proxy-listing.ui | 153 --- plugins/groupwise-features/proxy-login-dialog.ui | 191 ---- plugins/groupwise-features/proxy-login.c | 563 ----------- plugins/groupwise-features/proxy-login.h | 62 -- plugins/groupwise-features/proxy.c | 1034 ------------------- plugins/groupwise-features/proxy.h | 65 -- plugins/groupwise-features/send-options.c | 567 ----------- plugins/groupwise-features/share-folder-common.c | 519 ---------- plugins/groupwise-features/share-folder.c | 767 -------------- plugins/groupwise-features/share-folder.h | 100 -- plugins/groupwise-features/status-track.c | 271 ----- 37 files changed, 10346 deletions(-) delete mode 100644 plugins/groupwise-features/Makefile.am delete mode 100644 plugins/groupwise-features/addressbook-groupwise.c delete mode 100644 plugins/groupwise-features/camel-gw-listener.c delete mode 100644 plugins/groupwise-features/camel-gw-listener.h delete mode 100644 plugins/groupwise-features/groupwise-account-setup.c delete mode 100644 plugins/groupwise-features/gw-ui.c delete mode 100644 plugins/groupwise-features/gw-ui.h delete mode 100644 plugins/groupwise-features/install-shared.c delete mode 100644 plugins/groupwise-features/junk-mail-settings.c delete mode 100644 plugins/groupwise-features/junk-settings.c delete mode 100644 plugins/groupwise-features/junk-settings.h delete mode 100644 plugins/groupwise-features/junk-settings.ui delete mode 100644 plugins/groupwise-features/mail-retract.c delete mode 100644 plugins/groupwise-features/mail-send-options.c delete mode 100644 plugins/groupwise-features/mail-send-options.h delete mode 100644 plugins/groupwise-features/notification.ui delete mode 100644 plugins/groupwise-features/org-gnome-compose-send-options.xml delete mode 100644 plugins/groupwise-features/org-gnome-groupwise-features.eplug.xml delete mode 100644 plugins/groupwise-features/org-gnome-mail-retract.error.xml delete mode 100644 plugins/groupwise-features/org-gnome-process-meeting.error.xml delete mode 100644 plugins/groupwise-features/org-gnome-proxy-login.error.xml delete mode 100644 plugins/groupwise-features/org-gnome-proxy.error.xml delete mode 100644 plugins/groupwise-features/org-gnome-shared-folder.error.xml delete mode 100644 plugins/groupwise-features/process-meeting.c delete mode 100644 plugins/groupwise-features/properties.ui delete mode 100644 plugins/groupwise-features/proxy-add-dialog.ui delete mode 100644 plugins/groupwise-features/proxy-listing.ui delete mode 100644 plugins/groupwise-features/proxy-login-dialog.ui delete mode 100644 plugins/groupwise-features/proxy-login.c delete mode 100644 plugins/groupwise-features/proxy-login.h delete mode 100644 plugins/groupwise-features/proxy.c delete mode 100644 plugins/groupwise-features/proxy.h delete mode 100644 plugins/groupwise-features/send-options.c delete mode 100644 plugins/groupwise-features/share-folder-common.c delete mode 100644 plugins/groupwise-features/share-folder.c delete mode 100644 plugins/groupwise-features/share-folder.h delete mode 100644 plugins/groupwise-features/status-track.c (limited to 'plugins') diff --git a/plugins/groupwise-features/Makefile.am b/plugins/groupwise-features/Makefile.am deleted file mode 100644 index 848f5bfc09..0000000000 --- a/plugins/groupwise-features/Makefile.am +++ /dev/null @@ -1,97 +0,0 @@ -if OS_WIN32 -NO_UNDEFINED_REQUIRED_LIBS = $(top_builddir)/mail/libevolution-mail.la -endif - -@EVO_PLUGIN_RULE@ - -plugin_DATA = org-gnome-groupwise-features.eplug org-gnome-compose-send-options.xml - -plugin_LTLIBRARIES = liborg-gnome-groupwise-features.la - -liborg_gnome_groupwise_features_la_CPPFLAGS = \ - $(AM_CPPFLAGS) \ - -I$(top_srcdir) \ - -I$(top_srcdir)/widgets \ - -I$(top_srcdir)/widgets/misc \ - -I$(top_builddir)/composer \ - -I$(top_builddir)/mail \ - $(EVOLUTION_MAIL_CFLAGS) \ - $(EVOLUTION_CALENDAR_CFLAGS) \ - $(EVOLUTION_ADDRESSBOOK_CFLAGS) \ - $(CAMEL_GROUPWISE_CFLAGS) \ - $(GNOME_PLATFORM_CFLAGS) \ - -DEVOLUTION_UIDIR=\""$(uidir)"\" \ - -DEVOLUTION_IMAGESDIR=\""$(imagesdir)"\" - -liborg_gnome_groupwise_features_la_SOURCES = \ - gw-ui.h \ - gw-ui.c \ - share-folder-common.c \ - share-folder.c \ - share-folder.h \ - install-shared.c \ - send-options.c \ - mail-send-options.c \ - mail-send-options.h \ - status-track.c \ - addressbook-groupwise.c \ - junk-mail-settings.c \ - junk-settings.c \ - junk-settings.h \ - proxy.h \ - proxy.c \ - proxy-login.h \ - proxy-login.c \ - process-meeting.c \ - mail-retract.c \ - camel-gw-listener.c \ - camel-gw-listener.h \ - groupwise-account-setup.c - -liborg_gnome_groupwise_features_la_LIBADD= \ - $(top_builddir)/e-util/libeutil.la \ - $(top_builddir)/composer/libcomposer.la \ - $(top_builddir)/shell/libeshell.la \ - $(top_builddir)/calendar/gui/libevolution-calendar.la \ - $(top_builddir)/widgets/misc/libemiscwidgets.la \ - $(top_builddir)/filter/libfilter.la \ - $(top_builddir)/mail/libevolution-mail.la \ - $(EVOLUTION_CALENDAR_LIBS) \ - $(EVOLUTION_MAIL_LIBS) \ - $(CAMEL_GROUPWISE_LIBS) \ - $(GNOME_PLATFORM_LIBS) - -liborg_gnome_groupwise_features_la_LDFLAGS = -module -avoid-version $(NO_UNDEFINED) - -ui_DATA = \ - properties.ui \ - notification.ui \ - junk-settings.ui \ - proxy-add-dialog.ui \ - proxy-listing.ui \ - proxy-login-dialog.ui - -error_DATA = \ - org-gnome-shared-folder.error \ - org-gnome-proxy.error \ - org-gnome-proxy-login.error \ - org-gnome-process-meeting.error \ - org-gnome-mail-retract.error - -errordir = $(privdatadir)/errors - -BUILT_SOURCES = org-gnome-groupwise-features.eplug $(error_DATA) - -EXTRA_DIST = \ - $(ui_DATA) \ - 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 - -CLEANFILES = $(BUILT_SOURCES) - --include $(top_srcdir)/git.mk diff --git a/plugins/groupwise-features/addressbook-groupwise.c b/plugins/groupwise-features/addressbook-groupwise.c deleted file mode 100644 index 8dda4dca40..0000000000 --- a/plugins/groupwise-features/addressbook-groupwise.c +++ /dev/null @@ -1,69 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see - * - * - * Authors: - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#include -#include -#include -#include -#include -#include -#include - -void commit_groupwise_addressbook (EPlugin *epl, EConfigTarget *target); -GtkWidget *e_book_groupwise_dummy (EPlugin *epl, EConfigHookItemFactoryData *data); - -void -commit_groupwise_addressbook (EPlugin *epl, EConfigTarget *target) -{ - EABConfigTargetSource *t = (EABConfigTargetSource *) target; - ESource *source = t->source; - gchar *uri_text; - ESourceGroup *source_group; - gchar *relative_uri; - GSList *l; - - uri_text = e_source_get_uri (source); - if (strncmp (uri_text, "groupwise", 9)) { - g_free (uri_text); - - return; - } - e_source_set_property (source, "auth-domain", "Groupwise"); - relative_uri = g_strconcat (";", e_source_peek_name (source), NULL); - e_source_set_relative_uri (source, relative_uri); - g_free (relative_uri); - - source_group = e_source_peek_group (source); - l = e_source_group_peek_sources (source_group); - if (l && l->data ) { - e_source_set_property(source, "auth", e_source_get_property(l->data, "auth")); - e_source_set_property(source, "user", e_source_get_property(l->data, "user")); - e_source_set_property(source, "use_ssl", e_source_get_property(l->data, "use_ssl")); - e_source_set_property(source, "port", e_source_get_property(l->data, "port")); - } -} - -GtkWidget * -e_book_groupwise_dummy (EPlugin *epl, EConfigHookItemFactoryData *data) -{ - - return NULL; -} diff --git a/plugins/groupwise-features/camel-gw-listener.c b/plugins/groupwise-features/camel-gw-listener.c deleted file mode 100644 index ed73953098..0000000000 --- a/plugins/groupwise-features/camel-gw-listener.c +++ /dev/null @@ -1,1043 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see - * - * - * Authors: - * Sivaiah Nallagatla - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "camel-gw-listener.h" -#include -#include -#include -#include -#include -#include "e-util/e-alert-dialog.h" -#include -#include -#include - -/*stores some info about all currently existing groupwise accounts - list of GwAccountInfo structures */ - -static GList *groupwise_accounts = NULL; - -struct _CamelGwListenerPrivate { - GConfClient *gconf_client; - /* we get notification about mail account changes form this object */ - EAccountList *account_list; -}; - -struct _GwAccountInfo { - gchar *uid; - gchar *name; - gchar *source_url; - gboolean auto_check; - guint auto_check_time; -}; - -typedef struct _GwAccountInfo GwAccountInfo; - -#define GROUPWISE_URI_PREFIX "groupwise://" -#define GROUPWISE_PREFIX_LENGTH 12 - -#define PARENT_TYPE G_TYPE_OBJECT - -static GObjectClass *parent_class = NULL; - -static void dispose (GObject *object); -static void finalize (GObject *object); - -static void -camel_gw_listener_class_init (CamelGwListenerClass *class) -{ - GObjectClass *object_class; - - parent_class = g_type_class_ref (PARENT_TYPE); - object_class = G_OBJECT_CLASS (class); - - /* virtual method override */ - object_class->dispose = dispose; - object_class->finalize = finalize; -} - -static void -camel_gw_listener_init (CamelGwListener *config_listener, CamelGwListenerClass *class) -{ - config_listener->priv = g_new0 (CamelGwListenerPrivate, 1); -} - -static void -dispose (GObject *object) -{ - CamelGwListener *config_listener = CAMEL_GW_LISTENER (object); - - g_object_unref (config_listener->priv->gconf_client); - g_object_unref (config_listener->priv->account_list); - - G_OBJECT_CLASS (parent_class)->dispose (object); -} - -static void -finalize (GObject *object) -{ - CamelGwListener *config_listener = CAMEL_GW_LISTENER (object); - GList *list; - GwAccountInfo *info; - - if (config_listener->priv) { - g_free (config_listener->priv); - } - - for (list = g_list_first (groupwise_accounts); list; list = g_list_next (list)) { - - info = (GwAccountInfo *) (list->data); - - if (info) { - - g_free (info->uid); - g_free (info->name); - g_free (info->source_url); - g_free (info); - } - } - - g_list_free (groupwise_accounts); - - G_OBJECT_CLASS (parent_class)->finalize (object); -} - -/*determines whehter the passed in account is groupwise or not by looking at source url */ - -static gboolean -is_groupwise_account (EAccount *account) -{ - if (account->source->url != NULL) { - return (strncmp (account->source->url, GROUPWISE_URI_PREFIX, GROUPWISE_PREFIX_LENGTH ) == 0); - } else { - return FALSE; - } -} - -/* looks up for an existing groupwise account info in the groupwise_accounts list based on uid */ - -static GwAccountInfo* -lookup_account_info (const gchar *key) -{ - GList *list; - GwAccountInfo *info; - gint found = 0; - - if (!key) - return NULL; - - info = NULL; - - for (list = g_list_first (groupwise_accounts); list; list = g_list_next (list)) { - info = (GwAccountInfo *) (list->data); - found = (strcmp (info->uid, key) == 0); - if (found) - break; - } - if (found) - return info; - return NULL; -} - -#define CALENDAR_SOURCES "/apps/evolution/calendar/sources" -#define TASKS_SOURCES "/apps/evolution/tasks/sources" -#define NOTES_SOURCES "/apps/evolution/memos/sources" -#define SELECTED_CALENDARS "/apps/evolution/calendar/display/selected_calendars" -#define SELECTED_TASKS "/apps/evolution/calendar/tasks/selected_tasks" -#define SELECTED_NOTES "/apps/evolution/calendar/memos/selected_memos" - -static void -add_esource (const gchar *conf_key, GwAccountInfo *info, const gchar *source_name, CamelURL *url, const gchar * parent_id_name, gboolean can_create) -{ - ESourceList *source_list; - ESourceGroup *group; - ESource *source; - GConfClient* client; - GSList *ids, *temp; - const gchar *source_selection_key; - gchar *relative_uri; - const gchar *soap_port; - const gchar * use_ssl; - const gchar *poa_address; - const gchar *offline_sync; - const gchar *group_name; - - poa_address = url->host; - if (!poa_address || strlen (poa_address) ==0) - return; - - group_name = info->name; - - soap_port = camel_url_get_param (url, "soap_port"); - - if (!soap_port || strlen (soap_port) == 0) - soap_port = "7191"; - - use_ssl = camel_url_get_param (url, "use_ssl"); - - offline_sync = camel_url_get_param (url, "offline_sync"); - - client = gconf_client_get_default (); - source_list = e_source_list_new_for_gconf (client, conf_key); - group = e_source_group_new (group_name, GROUPWISE_URI_PREFIX); - - if (!e_source_list_add_group (source_list, group, -1)) - return; - - if (!can_create) - e_source_group_set_property (group, "create_source", "no"); - - relative_uri = g_strdup_printf ("%s@%s/", url->user, poa_address); - source = e_source_new (source_name, relative_uri); - e_source_set_property (source, "auth", "1"); - e_source_set_property (source, "username", url->user); - e_source_set_property (source, "port", soap_port); - e_source_set_property (source, "auth-domain", "Groupwise"); - e_source_set_property (source, "use_ssl", use_ssl); - - if (info->auto_check) { - gchar *str = g_strdup_printf ("%d", info->auto_check_time); - - e_source_set_property (source, "refresh", str); - g_free (str); - } else - e_source_set_property (source, "refresh", NULL); - - e_source_set_property (source, "offline_sync", offline_sync ? "1" : "0" ); - e_source_set_property (source, "delete", "no"); - if (parent_id_name) { - e_source_set_property (source, "parent_id_name", parent_id_name); - e_source_set_color_spec (source, camel_url_get_param (url, "color")); - } else - e_source_set_color_spec (source, "#EEBC60"); - e_source_group_add_source (group, source, -1); - e_source_list_sync (source_list, NULL); - - if (!strcmp (conf_key, CALENDAR_SOURCES)) - source_selection_key = SELECTED_CALENDARS; - else if (!strcmp (conf_key, TASKS_SOURCES)) - source_selection_key = SELECTED_TASKS; - else if (!strcmp (conf_key, NOTES_SOURCES)) - source_selection_key = SELECTED_NOTES; - else - source_selection_key = NULL; - - if (source_selection_key) { - ids = gconf_client_get_list (client, source_selection_key , GCONF_VALUE_STRING, NULL); - ids = g_slist_append (ids, g_strdup (e_source_peek_uid (source))); - gconf_client_set_list (client, source_selection_key, GCONF_VALUE_STRING, ids, NULL); - temp = ids; - - for (; temp != NULL; temp = g_slist_next (temp)) - g_free (temp->data); - - g_slist_free (ids); - } - - g_object_unref (source); - g_object_unref (group); - g_object_unref (source_list); - g_object_unref (client); - g_free (relative_uri); -} - -static void -remove_esource (const gchar *conf_key, const gchar *group_name, gchar * source_name, const gchar * relative_uri) -{ - ESourceList *list; - GSList *groups; - gboolean found_group; - GConfClient* client; - GSList *ids; - GSList *node_tobe_deleted; - const gchar *source_selection_key; - - client = gconf_client_get_default (); - list = e_source_list_new_for_gconf (client, conf_key); - groups = e_source_list_peek_groups (list); - - found_group = FALSE; - - for (; groups != NULL && !found_group; groups = g_slist_next (groups)) { - ESourceGroup *group = E_SOURCE_GROUP (groups->data); - - if (strcmp (e_source_group_peek_name (group), group_name) == 0 && - strcmp (e_source_group_peek_base_uri (group), GROUPWISE_URI_PREFIX ) == 0) { - GSList *sources = e_source_group_peek_sources (group); - - for (; sources != NULL; sources = g_slist_next (sources)) { - ESource *source = E_SOURCE (sources->data); - const gchar *source_relative_uri; - - source_relative_uri = e_source_peek_relative_uri (source); - if (source_relative_uri == NULL) - continue; - if (strcmp (source_relative_uri, relative_uri) == 0) { - - if (!strcmp (conf_key, CALENDAR_SOURCES)) - source_selection_key = SELECTED_CALENDARS; - else if (!strcmp (conf_key, TASKS_SOURCES)) - source_selection_key = SELECTED_TASKS; - else if (!strcmp (conf_key, NOTES_SOURCES)) - source_selection_key = SELECTED_NOTES; - else source_selection_key = NULL; - if (source_selection_key) { - ids = gconf_client_get_list (client, source_selection_key , - GCONF_VALUE_STRING, NULL); - node_tobe_deleted = g_slist_find_custom (ids, e_source_peek_uid (source), (GCompareFunc) strcmp); - if (node_tobe_deleted) { - g_free (node_tobe_deleted->data); - ids = g_slist_delete_link (ids, node_tobe_deleted); - } - gconf_client_set_list (client, source_selection_key, - GCONF_VALUE_STRING, ids, NULL); - - } - e_source_list_remove_group (list, group); - e_source_list_sync (list, NULL); - found_group = TRUE; - break; - - } - } - - if (found_group) - break; - - } - - } - - g_object_unref (list); - g_object_unref (client); - -} - -/* looks up for e-source with having same info as old_account_info and changes its values passed in new values */ - -static void -modify_esource (const gchar * conf_key, GwAccountInfo *old_account_info, EAccount *a, CamelURL *new_url) -{ - ESourceList *list; - GSList *groups; - gchar *old_relative_uri; - CamelURL *url; - gboolean found_group; - GConfClient* client; - const gchar *poa_address; - const gchar *new_poa_address; - const gchar * new_group_name = a->name; - - url = camel_url_new (old_account_info->source_url, NULL); - poa_address = url->host; - if (!poa_address || strlen (poa_address) ==0) - return; - new_poa_address = new_url->host; - - old_relative_uri = g_strdup_printf ("%s@%s/", url->user, poa_address); - client = gconf_client_get_default (); - list = e_source_list_new_for_gconf (client, conf_key); - groups = e_source_list_peek_groups (list); - - found_group = FALSE; - - for (; groups != NULL && !found_group; groups = g_slist_next (groups)) { - ESourceGroup *group = E_SOURCE_GROUP (groups->data); - - if (strcmp (e_source_group_peek_name (group), old_account_info->name) == 0 && - strcmp (e_source_group_peek_base_uri (group), GROUPWISE_URI_PREFIX) == 0) { - GSList *sources = e_source_group_peek_sources (group); - - for (; sources != NULL; sources = g_slist_next (sources)) { - ESource *source = E_SOURCE (sources->data); - const gchar *source_relative_uri; - - source_relative_uri = e_source_peek_relative_uri (source); - if (source_relative_uri == NULL) - continue; - if (strcmp (source_relative_uri, old_relative_uri) == 0) { - gchar *new_relative_uri; - - new_relative_uri = g_strdup_printf ("%s@%s/", new_url->user, new_poa_address); - e_source_group_set_name (group, new_group_name); - e_source_set_relative_uri (source, new_relative_uri); - e_source_set_property (source, "username", new_url->user); - e_source_set_property (source, "port", camel_url_get_param (new_url,"soap_port")); - e_source_set_property (source, "use_ssl", camel_url_get_param (url, "use_ssl")); - e_source_set_property (source, "offline_sync", camel_url_get_param (url, "offline_sync") ? "1" : "0"); - - if (a->source->auto_check) { - gchar *str = g_strdup_printf ("%d", a->source->auto_check_time); - - e_source_set_property (source, "refresh", str); - g_free (str); - } else - e_source_set_property (source, "refresh", NULL); - - e_source_list_sync (list, NULL); - found_group = TRUE; - g_free (new_relative_uri); - break; - } - } - - if (found_group) - break; - } - } - - g_object_unref (list); - g_object_unref (client); - camel_url_free (url); - g_free (old_relative_uri); - -} -/* add sources for calendar and tasks if the account added is groupwise account - adds the new account info to groupwise_accounts list */ - -static void -add_calendar_tasks_sources (GwAccountInfo *info) -{ - CamelURL *url; - - url = camel_url_new (info->source_url, NULL); - add_esource ("/apps/evolution/calendar/sources", info, _("Calendar"), url, NULL, FALSE); - add_esource ("/apps/evolution/tasks/sources", info, _("Tasks"), url, NULL, FALSE); - add_esource ("/apps/evolution/memos/sources", info, _("Notes"), url, NULL, TRUE); - - camel_url_free (url); - -} - -/* removes calendar and tasks sources if the account removed is groupwise account - removes the the account info from groupwise_account list */ - -static void -remove_calendar_tasks_sources (GwAccountInfo *info) -{ - CamelURL *url; - gchar *relative_uri; - const gchar *poa_address; - - url = camel_url_new (info->source_url, NULL); - - poa_address = url->host; - if (!poa_address || strlen (poa_address) ==0) - return; - - relative_uri = g_strdup_printf ("%s@%s/", url->user, poa_address); - remove_esource ("/apps/evolution/calendar/sources", info->name, _("Calendar"), relative_uri); - remove_esource ("/apps/evolution/tasks/sources", info->name, _("Checklist"), relative_uri); - remove_esource ("/apps/evolution/memos/sources", info->name, _("Notes"), relative_uri); - - camel_url_free (url); - g_free (relative_uri); - -} - -static GList* -get_addressbook_names_from_server (gchar *source_url) -{ - gchar *key; - EGwConnection *cnc; - gchar *password; - GList *book_list = NULL; - gint status, count = 0; - const gchar *soap_port; - CamelURL *url; - gboolean remember; - gchar *failed_auth = NULL; - gchar *prompt; - gchar *password_prompt; - gchar *uri; - const gchar *use_ssl; - const gchar *poa_address; - guint32 flags = E_PASSWORDS_REMEMBER_FOREVER|E_PASSWORDS_SECRET; - - url = camel_url_new (source_url, NULL); - if (url == NULL) { - return NULL; - } - poa_address = url->host; - if (!poa_address || strlen (poa_address) ==0) - return NULL; - - soap_port = camel_url_get_param (url, "soap_port"); - if (!soap_port || strlen (soap_port) == 0) - soap_port = "7191"; - use_ssl = camel_url_get_param (url, "use_ssl"); - - key = g_strdup_printf ("groupwise://%s@%s/", url->user, poa_address); - - if (use_ssl && g_str_equal (use_ssl, "always")) - uri = g_strdup_printf ("https://%s:%s/soap", poa_address, soap_port); - else - uri = g_strdup_printf ("http://%s:%s/soap", poa_address, soap_port); - - cnc = NULL; - - do { - count++; - /*we have to uncache the password before prompting again*/ - if (failed_auth) { - e_passwords_forget_password ("Groupwise", key); - password = NULL; - } - - password = e_passwords_get_password ("Groupwise", key); - if (!password) { - /* Translators: First %s is the server name, second %s is user name */ - password_prompt = g_strdup_printf (_("Enter password for %s (user %s)"), - poa_address, url->user); - prompt = g_strconcat (failed_auth ? failed_auth : "", password_prompt, NULL); - g_free (password_prompt); - password = e_passwords_ask_password (prompt, "Groupwise", key, prompt, - flags, &remember, - NULL); - g_free (prompt); - - if (!password) - break; - } - - cnc = e_gw_connection_new (uri, url->user, password); - g_free (password); - if (!E_IS_GW_CONNECTION (cnc)) { - if (count == 3) - break; - } - - failed_auth = _("Failed to authenticate.\n"); - flags |= E_PASSWORDS_REPROMPT; - } while (cnc == NULL); - - g_free (key); - - if (E_IS_GW_CONNECTION (cnc)) { - book_list = NULL; - status = e_gw_connection_get_address_book_list (cnc, &book_list); - if (status == E_GW_CONNECTION_STATUS_OK) - return book_list; - } - - /*FIXME: This error message should be relocated to addressbook and should reflect - * that it actually failed to get the addressbooks*/ - e_alert_run_dialog_for_args (e_shell_get_active_window (NULL), - "mail:gw-accountsetup-error", poa_address, - NULL); - return NULL; -} - -static void -add_proxy_sources (GwAccountInfo *info, const gchar *parent_name) -{ - CamelURL *url; - gchar *color; - - url = camel_url_new (info->source_url, NULL); - - color = g_strdup_printf ("#%06X", g_random_int_range (0x100000, 0xffffaa)); - /* The above range is chosen so that the colors are neither too light nor too dark - and appealing in all the themes */ - - camel_url_set_param (url, "color", color); - - add_esource ("/apps/evolution/calendar/sources", info, _("Calendar"), url, parent_name, FALSE); - add_esource ("/apps/evolution/tasks/sources", info, _("Tasks"), url, parent_name, FALSE); - add_esource ("/apps/evolution/memos/sources", info, _("Notes"), url, parent_name, TRUE); - - g_free (color); - camel_url_free (url); -} - -static gboolean -add_addressbook_sources (EAccount *account) -{ - CamelURL *url; - ESourceList *list; - ESourceGroup *group; - ESource *source; - gchar *base_uri; - const gchar *soap_port; - GList *books_list, *temp_list; - GConfClient* client; - const gchar * use_ssl; - const gchar *poa_address; - gboolean is_frequent_contacts = FALSE, is_writable = FALSE; - - url = camel_url_new (account->source->url, NULL); - if (url == NULL) { - return FALSE; - } - - poa_address = url->host; - if (!poa_address || strlen (poa_address) ==0) - return FALSE; - - soap_port = camel_url_get_param (url, "soap_port"); - if (!soap_port || strlen (soap_port) == 0) - soap_port = "7191"; - use_ssl = camel_url_get_param (url, "use_ssl"); - base_uri = g_strdup_printf ("groupwise://%s@%s", url->user, poa_address); - client = gconf_client_get_default (); - list = e_source_list_new_for_gconf (client, "/apps/evolution/addressbook/sources" ); - group = e_source_group_new (account->name, base_uri); - books_list = get_addressbook_names_from_server (account->source->url); - temp_list = books_list; - if (!temp_list) - return FALSE; - for (; temp_list != NULL; temp_list = g_list_next (temp_list)) { - const gchar *book_name = e_gw_container_get_name (E_GW_CONTAINER (temp_list->data)); - /* is_writable is set to TRUE if the book has isPersonal property, - * by e_gw_connection_get_address_book_list() - */ - is_writable = e_gw_container_get_is_writable (E_GW_CONTAINER (temp_list->data)); - if (is_writable && - !g_ascii_strncasecmp (book_name, "Novell GroupWise Address Book", strlen (book_name))) { - /* This is a hack to not to show multiple groupwise system address books - * if they are the personal address books with the name of system address book - * See http://bugzilla.gnome.org/show_bug.cgi?id=320119 - * and http://bugzilla.gnome.org/show_bug.cgi?id=309511 - */ - continue; - } - - if (!is_frequent_contacts) - is_frequent_contacts = e_gw_container_get_is_frequent_contacts (E_GW_CONTAINER (temp_list->data)); - source = e_source_new (book_name, g_strconcat (";",book_name, NULL)); - e_source_set_property (source, "auth", "plain/password"); - e_source_set_property (source, "auth-domain", "Groupwise"); - e_source_set_property (source, "port", soap_port); - e_source_set_property(source, "user", url->user); - /* mark system address book for offline usage */ - /* FIXME: add isPersonal flag to container and use that isFrequentContact - * properties, instead of using writable to distinguish between the - * system address book and other address books. - */ - if (!is_writable) - e_source_set_property (source, "offline_sync", "1"); - else - e_source_set_property (source, "offline_sync", - camel_url_get_param (url, "offline_sync") ? "1" : "0"); - if (!is_writable) - e_source_set_property (source, "completion", "true"); - if (is_frequent_contacts) - e_source_set_property (source, "completion", "true"); - e_source_set_property (source, "use_ssl", use_ssl); - e_source_group_add_source (group, source, -1); - g_object_unref (source); - } - e_source_list_add_group (list, group, -1); - e_source_list_sync (list, NULL); - g_object_unref (group); - g_object_unref (list); - g_object_unref (client); - g_free (base_uri); - - if (!is_frequent_contacts) { - /* display warning message */ - e_alert_run_dialog_for_args (e_shell_get_active_window (NULL), - "addressbook:gw-book-list-init", NULL); - } - return TRUE; -} - -static void -modify_addressbook_sources ( EAccount *account, GwAccountInfo *existing_account_info ) -{ - CamelURL *url; - ESourceList *list; - ESourceGroup *group; - GSList *groups; - gboolean found_group; - gboolean delete_group; - gchar *old_base_uri; - gchar *new_base_uri; - const gchar *soap_port; - const gchar *use_ssl; - GSList *sources; - ESource *source; - GConfClient *client; - const gchar *poa_address; - - url = camel_url_new (existing_account_info->source_url, NULL); - if (url == NULL) { - return; - } - - poa_address = url->host; - if (!poa_address || strlen (poa_address) ==0) - return; - - old_base_uri = g_strdup_printf ("groupwise://%s@%s", url->user, poa_address); - camel_url_free (url); - - url = camel_url_new (account->source->url, NULL); - if (url == NULL) - return; - poa_address = url->host; - if (!poa_address || strlen (poa_address) ==0) - return; - new_base_uri = g_strdup_printf ("groupwise://%s@%s", url->user, poa_address); - soap_port = camel_url_get_param (url, "soap_port"); - if (!soap_port || strlen (soap_port) == 0) - soap_port = "7191"; - use_ssl = camel_url_get_param (url, "use_ssl"); - - client = gconf_client_get_default (); - list = e_source_list_new_for_gconf (client, "/apps/evolution/addressbook/sources" ); - groups = e_source_list_peek_groups (list); - delete_group = FALSE; - if (strcmp (old_base_uri, new_base_uri) != 0) - delete_group = TRUE; - group = NULL; - found_group = FALSE; - for (; groups != NULL && !found_group; groups = g_slist_next (groups)) { - - group = E_SOURCE_GROUP (groups->data); - if ( strcmp ( e_source_group_peek_base_uri (group), old_base_uri) == 0 && strcmp (e_source_group_peek_name (group), existing_account_info->name) == 0) { - found_group = TRUE; - if (!delete_group) { - e_source_group_set_name (group, account->name); - sources = e_source_group_peek_sources (group); - for (; sources != NULL; sources = g_slist_next (sources)) { - source = E_SOURCE (sources->data); - e_source_set_property (source, "port", soap_port); - e_source_set_property (source, "use_ssl", use_ssl); - } - - e_source_list_sync (list, NULL); - } - - } - } - if (found_group && delete_group) { - e_source_list_remove_group (list, group); - e_source_list_sync (list, NULL); - g_object_unref (list); - list = NULL; - add_addressbook_sources (account); - } - g_free (old_base_uri); - if (list) - g_object_unref (list); - camel_url_free (url); - g_object_unref (client); - -} - -static void -remove_addressbook_sources (GwAccountInfo *existing_account_info) -{ - ESourceList *list; - ESourceGroup *group; - GSList *groups; - CamelURL *url; - gchar *base_uri; - GConfClient *client; - const gchar *poa_address; - - url = camel_url_new (existing_account_info->source_url, NULL); - if (url == NULL) { - return; - } - - poa_address = url->host; - if (!poa_address || strlen (poa_address) ==0) - return; - - base_uri = g_strdup_printf ("groupwise://%s@%s", url->user, poa_address); - client = gconf_client_get_default (); - list = e_source_list_new_for_gconf (client, "/apps/evolution/addressbook/sources" ); - groups = e_source_list_peek_groups (list); - - for (; groups != NULL; groups = g_slist_next (groups)) { - - group = E_SOURCE_GROUP (groups->data); - if ( strcmp ( e_source_group_peek_base_uri (group), base_uri) == 0 && strcmp (e_source_group_peek_name (group), existing_account_info->name) == 0) { - - e_source_list_remove_group (list, group); - e_source_list_sync (list, NULL); - break; - } - } - g_object_unref (list); - g_object_unref (client); - g_free (base_uri); - camel_url_free (url); - -} - -static void -account_added (EAccountList *account_listener, EAccount *account) -{ - - GwAccountInfo *info; - EAccount *parent; - gboolean status; - CamelURL *parent_url; - - if (!is_groupwise_account (account)) - return; - - info = g_new0 (GwAccountInfo, 1); - info->uid = g_strdup (account->uid); - info->name = g_strdup (account->name); - info->source_url = g_strdup (account->source->url); - info->auto_check = account->source->auto_check; - info->auto_check_time = account->source->auto_check_time; - if (account->parent_uid) { - parent = (EAccount *)e_account_list_find (account_listener, E_ACCOUNT_FIND_UID, account->parent_uid); - - if (!parent) - return; - - parent_url = camel_url_new (e_account_get_string (parent, E_ACCOUNT_SOURCE_URL), NULL); - add_proxy_sources (info, parent_url->user); - } else { - status = add_addressbook_sources (account); - - if (status) - add_calendar_tasks_sources (info); - } - groupwise_accounts = g_list_append (groupwise_accounts, info); -} - -static void -account_removed (EAccountList *account_listener, EAccount *account) -{ - GwAccountInfo *info; - - if (!is_groupwise_account (account)) - return; - - info = lookup_account_info (account->uid); - if (info == NULL) - return; - - remove_calendar_tasks_sources (info); - remove_addressbook_sources (info); - groupwise_accounts = g_list_remove (groupwise_accounts, info); - g_free (info->uid); - g_free (info->name); - g_free (info->source_url); - g_free (info); -} - -static void -account_changed (EAccountList *account_listener, EAccount *account) -{ - gboolean is_gw_account; - CamelURL *old_url, *new_url; - const gchar *old_soap_port, *new_soap_port; - GwAccountInfo *existing_account_info; - const gchar *old_use_ssl, *new_use_ssl; - const gchar *old_poa_address, *new_poa_address; - - is_gw_account = is_groupwise_account (account); - - existing_account_info = lookup_account_info (account->uid); - - if (existing_account_info == NULL && is_gw_account) { - - if (!account->enabled) - return; - - /* some account of other type is changed to Groupwise */ - account_added (account_listener, account); - - } else if ( existing_account_info != NULL && !is_gw_account) { - - /*Groupwise account is changed to some other type */ - remove_calendar_tasks_sources (existing_account_info); - remove_addressbook_sources (existing_account_info); - groupwise_accounts = g_list_remove (groupwise_accounts, existing_account_info); - g_free (existing_account_info->uid); - g_free (existing_account_info->name); - g_free (existing_account_info->source_url); - g_free (existing_account_info); - - } else if (existing_account_info != NULL && is_gw_account) { - - if (!account->enabled) { - account_removed (account_listener, account); - return; - } - - /* some info of groupwise account is changed . update the sources with new info if required */ - old_url = camel_url_new (existing_account_info->source_url, NULL); - old_poa_address = old_url->host; - old_soap_port = camel_url_get_param (old_url, "soap_port"); - old_use_ssl = camel_url_get_param (old_url, "use_ssl"); - new_url = camel_url_new (account->source->url, NULL); - new_poa_address = new_url->host; - - if (!new_poa_address || strlen (new_poa_address) ==0) - return; - - new_soap_port = camel_url_get_param (new_url, "soap_port"); - - if (!new_soap_port || strlen (new_soap_port) == 0) - new_soap_port = "7191"; - - new_use_ssl = camel_url_get_param (new_url, "use_ssl"); - - if ((old_poa_address && strcmp (old_poa_address, new_poa_address)) - || (old_soap_port && strcmp (old_soap_port, new_soap_port)) - || strcmp (old_url->user, new_url->user) - || (!old_use_ssl) - || strcmp (old_use_ssl, new_use_ssl)) { - - account_removed (account_listener, account); - account_added (account_listener, account); - } else if (strcmp (existing_account_info->name, account->name)) { - - modify_esource ("/apps/evolution/calendar/sources", existing_account_info, account, new_url); - modify_esource ("/apps/evolution/tasks/sources", existing_account_info, account, new_url); - modify_esource ("/apps/evolution/memos/sources", existing_account_info, account, new_url); - modify_addressbook_sources (account, existing_account_info); - - } - - g_free (existing_account_info->name); - g_free (existing_account_info->source_url); - existing_account_info->name = g_strdup (account->name); - existing_account_info->source_url = g_strdup (account->source->url); - camel_url_free (old_url); - camel_url_free (new_url); - } -} - -static void -prune_proxies (void) { - - EAccountList *account_list; - ESourceList *sources; - ESourceGroup *group; - GSList *groups, *e_sources, *l, *p; - ESource *source; - GError *err = NULL; - const gchar *parent_id_name = NULL; - gint i; - ECalSourceType types[] = { E_CAL_SOURCE_TYPE_EVENT, - E_CAL_SOURCE_TYPE_TODO, - E_CAL_SOURCE_TYPE_JOURNAL - }; - - account_list = e_get_account_list (); - e_account_list_prune_proxies (account_list); - - for (i=0; i<3; i++) { - if (e_cal_get_sources (&sources, types[i], &err)) { - /* peek groupwise id and prune for proxies. */ - groups = e_source_list_peek_groups (sources); - for (l = groups; l != NULL;) { - group = (ESourceGroup *) l->data; - l = l->next; - if (!strcmp (e_source_group_peek_base_uri (group), "groupwise://")) { - e_sources = e_source_group_peek_sources (group); - for (p = e_sources; p != NULL; p = p->next) { - source = (ESource *)p->data; - parent_id_name = e_source_get_property (source, "parent_id_name"); - if (parent_id_name) { - e_source_group_remove_source (group, source); - e_source_list_remove_group (sources, group); - break; - } - } - } - } - e_source_list_sync (sources, NULL); - } - } - -} -static void -camel_gw_listener_construct (CamelGwListener *config_listener) -{ - EIterator *iter; - EAccount *account; - GwAccountInfo *info; - - prune_proxies (); - - config_listener->priv->account_list = e_account_list_new (config_listener->priv->gconf_client); - - for (iter = e_list_get_iterator (E_LIST ( config_listener->priv->account_list) ); e_iterator_is_valid (iter); e_iterator_next (iter)) { - - account = E_ACCOUNT (e_iterator_get (iter)); - - if ( is_groupwise_account (account) && account->enabled) { - - info = g_new0 (GwAccountInfo, 1); - info->uid = g_strdup (account->uid); - info->name = g_strdup (account->name); - info->source_url = g_strdup (account->source->url); - groupwise_accounts = g_list_append (groupwise_accounts, info); - - } - - } - - g_signal_connect (config_listener->priv->account_list, "account_added", G_CALLBACK (account_added), NULL); - g_signal_connect (config_listener->priv->account_list, "account_changed", G_CALLBACK (account_changed), NULL); - g_signal_connect (config_listener->priv->account_list, "account_removed", G_CALLBACK (account_removed), NULL); -} - -GType -camel_gw_listener_get_type (void) -{ - static GType camel_gw_listener_type = 0; - - if (!camel_gw_listener_type) { - static GTypeInfo info = { - sizeof (CamelGwListenerClass), - (GBaseInitFunc) NULL, - (GBaseFinalizeFunc) NULL, - (GClassInitFunc) camel_gw_listener_class_init, - NULL, NULL, - sizeof (CamelGwListener), - 0, - (GInstanceInitFunc) camel_gw_listener_init - }; - camel_gw_listener_type = g_type_register_static (PARENT_TYPE, "CamelGwListener", &info, 0); - } - - return camel_gw_listener_type; -} - -CamelGwListener* -camel_gw_listener_new (void) -{ - CamelGwListener *config_listener; - - config_listener = g_object_new (CAMEL_TYPE_GW_LISTENER, NULL); - config_listener->priv->gconf_client = gconf_client_get_default (); - - camel_gw_listener_construct (config_listener); - - return config_listener; -} diff --git a/plugins/groupwise-features/camel-gw-listener.h b/plugins/groupwise-features/camel-gw-listener.h deleted file mode 100644 index cc545def61..0000000000 --- a/plugins/groupwise-features/camel-gw-listener.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see - * - * - * Authors: - * Sivaiah Nallagatla - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifndef CAMEL_GW_LISTENER_H -#define CAMEL_GW_LISTENER_H - -#include -#include -#include - -G_BEGIN_DECLS - -#define CAMEL_TYPE_GW_LISTENER (camel_gw_listener_get_type ()) -#define CAMEL_GW_LISTENER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CAMEL_TYPE_GW_LISTENER, CamelGwListener)) -#define CAMEL_GW_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CAMEL_TYPE_GW_LISTENER, CamelGWListenerClass)) -#define CAMEL_IS_GWLISTENER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CAMEL_TYPE_GW_LISTENER)) -#define CAMEL_IS_GW_LISTENER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), CAMEL_TYPE_GW_LISTENER)) - -typedef struct _CamelGwListener CamelGwListener; -typedef struct _CamelGwListenerClass CamelGwListenerClass; -typedef struct _CamelGwListenerPrivate CamelGwListenerPrivate; - -struct _CamelGwListener { - GObject parent; - - CamelGwListenerPrivate *priv; -}; - -struct _CamelGwListenerClass { - GObjectClass parent_class; -}; - -GType camel_gw_listener_get_type (void); -CamelGwListener *camel_gw_listener_new (void); - -G_END_DECLS - -#endif diff --git a/plugins/groupwise-features/groupwise-account-setup.c b/plugins/groupwise-features/groupwise-account-setup.c deleted file mode 100644 index f232bab055..0000000000 --- a/plugins/groupwise-features/groupwise-account-setup.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see - * - * - * Authors: - * Sivaiah Nallagatla - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#include "camel-gw-listener.h" -#include -#include "mail/em-config.h" -#include -#include "shell/es-event.h" -#include -#include - -#define GROUPWISE_BASE_URI "groupwise://" - -static CamelGwListener *config_listener = NULL; - -gint e_plugin_lib_enable (EPlugin *ep, gint enable); -GtkWidget* org_gnome_gw_account_setup (struct _EPlugin *epl, struct _EConfigHookItemFactoryData *data); -void ensure_mandatory_esource_properties (EPlugin *ep, ESEventTargetUpgrade *target); - -static gboolean -is_groupwise_account (EAccount *account) -{ - if (account->source->url != NULL) { - return g_str_has_prefix (account->source->url, GROUPWISE_BASE_URI); - } else { - return FALSE; - } -} - -static void -set_esource_props (const gchar *path, EAccount *a, GConfClient *client, const gchar *name) -{ - ESourceList *list; - GSList *groups; - - list = e_source_list_new_for_gconf (client, path); - groups = e_source_list_peek_groups (list); - - for (; groups != NULL; groups = g_slist_next (groups)) { - ESourceGroup *group = E_SOURCE_GROUP (groups->data); - - if (strcmp (e_source_group_peek_name (group), name) == 0 && - strcmp (e_source_group_peek_base_uri (group), GROUPWISE_BASE_URI) == 0) { - GSList *sources = e_source_group_peek_sources (group); - - for (; sources != NULL; sources = g_slist_next (sources)) { - ESource *source = E_SOURCE (sources->data); - - if (a->source->auto_check) { - gchar *str = g_strdup_printf ("%d",a->source->auto_check_time); - - e_source_set_property (source, "refresh", str); - g_free (str); - } else - e_source_set_property (source, "refresh", NULL); - break; - } - } - } - e_source_list_sync (list, NULL); - - g_object_unref (list); -} - -void -ensure_mandatory_esource_properties (EPlugin *ep, ESEventTargetUpgrade *target) -{ - GConfClient* client; - EAccountList *al; - EIterator *it; - - al = e_get_account_list (); - client = gconf_client_get_default (); - - for (it = e_list_get_iterator ((EList *)al); - e_iterator_is_valid (it); - e_iterator_next (it)) { - EAccount *a; - - a = (EAccount *) e_iterator_get (it); - if (!a->enabled || !is_groupwise_account (a)) - continue; - set_esource_props ("/apps/evolution/calendar/sources", a, client, a->name); - set_esource_props ("/apps/evolution/tasks/sources", a, client, a->name); - set_esource_props ("/apps/evolution/memos/sources", a, client, a->name); - } - g_object_unref (client); -} - -static void -free_groupwise_listener ( void ) -{ - g_object_unref (config_listener); -} - -gint -e_plugin_lib_enable (EPlugin *ep, gint enable) -{ - if (!config_listener) { - config_listener = camel_gw_listener_new (); - g_atexit ( free_groupwise_listener ); - } - - return 0; -} - -GtkWidget * org_gnome_groupwise_account_setup (struct _EPlugin *epl, struct _EConfigHookItemFactoryData *data); - -GtkWidget * -org_gnome_groupwise_account_setup (struct _EPlugin *epl, struct _EConfigHookItemFactoryData *data) -{ - if (data->old) - return data->old; - /* FIXME, with new soap camel provider we don't need extra settings in receiving options page, Remove them - from camel-groupwise-provider.c once soap provider is ready and add any groupwise sepcific settings like "add contacts automatically to Frequent contacts folder" here*/ - - return NULL; -} diff --git a/plugins/groupwise-features/gw-ui.c b/plugins/groupwise-features/gw-ui.c deleted file mode 100644 index 08b9382838..0000000000 --- a/plugins/groupwise-features/gw-ui.c +++ /dev/null @@ -1,459 +0,0 @@ -/* - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#include -#include - -#include - -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - -#include "gw-ui.h" - -gboolean gw_ui_mail_folder_popup (GtkUIManager *ui_manager, EShellView *shell_view); -gboolean gw_ui_mail_message_popup (GtkUIManager *ui_manager, EShellView *shell_view); -gboolean gw_ui_calendar_event_popup (GtkUIManager *ui_manager, EShellView *shell_view); - -static gboolean -is_in_gw_account (EShellView *shell_view, gboolean *is_on_store, gchar **folder_full_name) -{ - EShellSidebar *shell_sidebar; - EMFolderTree *folder_tree = NULL; - GtkTreeSelection *selection; - GtkTreeModel *model = NULL; - GtkTreeIter iter; - gboolean is_store = FALSE, res; - gchar *uri = NULL; - gchar *full_name = NULL; - - if (folder_full_name) - *folder_full_name = NULL; - - shell_sidebar = e_shell_view_get_shell_sidebar (shell_view); - g_object_get (shell_sidebar, "folder-tree", &folder_tree, NULL); - g_return_val_if_fail (folder_tree != NULL, FALSE); - - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (folder_tree)); - g_return_val_if_fail (selection != NULL, FALSE); - - if (!gtk_tree_selection_get_selected (selection, &model, &iter)) - return FALSE; - - gtk_tree_model_get (model, &iter, - COL_STRING_FULL_NAME, &full_name, - COL_STRING_URI, &uri, - COL_BOOL_IS_STORE, &is_store, - -1); - - res = uri && g_ascii_strncasecmp (uri, "groupwise://", 12) == 0; - - if (is_on_store) - *is_on_store = is_store; - - if (!is_store) { - if (folder_full_name) - *folder_full_name = full_name; - else - g_free (full_name); - - } else { - g_free (full_name); - } - - g_free (uri); - - return res; -} - -static void -visible_actions (GtkActionGroup *action_group, gboolean visible, const GtkActionEntry *entries, guint n_entries) -{ - gint i; - - g_return_if_fail (action_group != NULL); - g_return_if_fail (entries != NULL); - - for (i = 0; i < n_entries; i++) { - GtkAction *action = gtk_action_group_get_action (action_group, entries[i].name); - - g_return_if_fail (action != NULL); - - gtk_action_set_visible (action, visible); - } -} - -static GtkActionEntry mfp_entries[] = { - { "gw-new-shared-folder", - "folder-new", - N_("New _Shared Folder..."), - NULL, - NULL, - G_CALLBACK (gw_new_shared_folder_cb) }, - - { "gw-proxy-login", - NULL, - N_("_Proxy Login..."), - NULL, - NULL, - G_CALLBACK (gw_proxy_login_cb) } -}; - -static void -update_mfp_entries_cb (EShellView *shell_view, gpointer user_data) -{ - GtkActionGroup *action_group; - EShellWindow *shell_window; - gboolean is_on_store = FALSE, visible; - - g_return_if_fail (E_IS_SHELL_VIEW (shell_view)); - - shell_window = e_shell_view_get_shell_window (shell_view); - action_group = e_shell_window_get_action_group (shell_window, "mail"); - - visible = is_in_gw_account (shell_view, &is_on_store, NULL); - visible_actions (action_group, visible, mfp_entries, G_N_ELEMENTS (mfp_entries)); - - if (visible && !is_on_store) { - GtkAction *action = gtk_action_group_get_action (action_group, "gw-proxy-login"); - - g_return_if_fail (action != NULL); - - gtk_action_set_visible (action, FALSE); - } -} - -gboolean -gw_ui_mail_folder_popup (GtkUIManager *ui_manager, EShellView *shell_view) -{ - EShellWindow *shell_window; - GtkActionGroup *action_group; - - shell_window = e_shell_view_get_shell_window (shell_view); - action_group = e_shell_window_get_action_group (shell_window, "mail"); - - gtk_action_group_add_actions ( - action_group, mfp_entries, - G_N_ELEMENTS (mfp_entries), shell_view); - - g_signal_connect (shell_view, "update-actions", G_CALLBACK (update_mfp_entries_cb), NULL); - - return TRUE; -} - -static GtkActionEntry mmp_entries[] = { - { "gw-junk-mail-settings", - NULL, - N_("Junk Mail Settings..."), - NULL, - NULL, - G_CALLBACK (gw_junk_mail_settings_cb) }, - - { "gw-track-message-status", - NULL, - N_("Track Message Status..."), - NULL, - NULL, - G_CALLBACK (gw_track_message_status_cb) }, - { "gw-retract-mail", - NULL, - N_("Retract Mail"), - NULL, - NULL, - G_CALLBACK (gw_retract_mail_cb) } -}; - -static void -update_mmp_entries_cb (EShellView *shell_view, gpointer user_data) -{ - EShellWindow *shell_window; - GtkActionGroup *action_group; - gboolean visible; - gchar *full_name = NULL, *uri = NULL; - guint n_selected = 0; - - g_return_if_fail (E_IS_SHELL_VIEW (shell_view)); - - shell_window = e_shell_view_get_shell_window (shell_view); - action_group = e_shell_window_get_action_group (shell_window, "mail"); - - visible = is_in_gw_account (shell_view, NULL, &full_name); - if (visible) { - EShellContent *shell_content; - EMailReader *reader; - GPtrArray *uids; - - shell_content = e_shell_view_get_shell_content (shell_view); - - reader = E_MAIL_READER (shell_content); - uids = e_mail_reader_get_selected_uids (reader); - - if (uids) - n_selected = uids->len; - - em_utils_uids_free (uids); - - visible = n_selected > 0; - } - - visible_actions (action_group, visible, mmp_entries, G_N_ELEMENTS (mmp_entries)); - - if (visible) { - GtkAction *action; - gboolean is_sent_items_folder = full_name && g_ascii_strncasecmp (full_name, "Sent Items", 10) == 0; - - action = gtk_action_group_get_action (action_group, "gw-track-message-status"); - g_return_if_fail (action != NULL); - gtk_action_set_visible (action, is_sent_items_folder && n_selected == 1); - - action = gtk_action_group_get_action (action_group, "gw-retract-mail"); - g_return_if_fail (action != NULL); - gtk_action_set_visible (action, is_sent_items_folder && n_selected == 1); - } - - g_free (full_name); - g_free (uri); -} - -gboolean -gw_ui_mail_message_popup (GtkUIManager *ui_manager, EShellView *shell_view) -{ - EShellWindow *shell_window; - GtkActionGroup *action_group; - - shell_window = e_shell_view_get_shell_window (shell_view); - action_group = e_shell_window_get_action_group (shell_window, "mail"); - - gtk_action_group_add_actions ( - action_group, mmp_entries, - G_N_ELEMENTS (mmp_entries), shell_view); - - g_signal_connect (shell_view, "update-actions", G_CALLBACK (update_mmp_entries_cb), NULL); - - return TRUE; -} - -static icalproperty * -get_attendee_prop (icalcomponent *icalcomp, const gchar *address) -{ - icalproperty *prop; - - if (!(address && *address)) - return NULL; - - for (prop = icalcomponent_get_first_property (icalcomp, ICAL_ATTENDEE_PROPERTY); - prop; - prop = icalcomponent_get_next_property (icalcomp, ICAL_ATTENDEE_PROPERTY)) { - const gchar *attendee = icalproperty_get_attendee (prop); - - if (g_str_equal (itip_strip_mailto (attendee), address)) { - return prop; - } - } - - return NULL; -} - -static gboolean -needs_to_accept (icalcomponent *icalcomp, const gchar *user_email) -{ - icalproperty *prop; - icalparameter *param; - icalparameter_partstat status = ICAL_PARTSTAT_NONE; - - prop = get_attendee_prop (icalcomp, user_email); - - /* It might be a mailing list */ - if (!prop) - return TRUE; - param = icalproperty_get_first_parameter (prop, ICAL_PARTSTAT_PARAMETER); - if (param) - status = icalparameter_get_partstat (param); - - if (status == ICAL_PARTSTAT_ACCEPTED || status == ICAL_PARTSTAT_TENTATIVE) - return FALSE; - - return TRUE; -} - -static gboolean -is_meeting_owner (ECalComponent *comp, ECal *client) -{ - ECalComponentOrganizer org; - gchar *email = NULL; - const gchar *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 = itip_address_is_user (strip); - - g_free (email); - return ret_val; -} - -static GtkActionEntry cal_entries[] = { - { "gw-meeting-accept", - GTK_STOCK_APPLY, - N_("Accept"), - NULL, - NULL, - G_CALLBACK (gw_meeting_accept_cb) }, - - { "gw-meeting-accept-tentative", - GTK_STOCK_DIALOG_QUESTION, - N_("Accept Tentatively"), - NULL, - NULL, - G_CALLBACK (gw_meeting_accept_tentative_cb) }, - - { "gw-meeting-decline", - GTK_STOCK_CANCEL, - N_("Decline"), - NULL, - NULL, - G_CALLBACK (gw_meeting_decline_cb) }, - - { "gw-resend-meeting", - GTK_STOCK_EDIT, - N_("Rese_nd Meeting..."), - NULL, - NULL, - G_CALLBACK (gw_resend_meeting_cb) } -}; - -static void -update_cal_entries_cb (EShellView *shell_view, gpointer user_data) -{ - EShellWindow *shell_window; - GtkActionGroup *action_group; - gboolean visible = FALSE, is_unaccepted = FALSE, is_mtg_owner = FALSE; - EShellContent *shell_content; - GnomeCalendar *gcal = NULL; - GnomeCalendarViewType view_type; - ECalendarView *view; - - g_return_if_fail (E_IS_SHELL_VIEW (shell_view)); - - shell_window = e_shell_view_get_shell_window (shell_view); - shell_content = e_shell_view_get_shell_content (shell_view); - - g_object_get (shell_content, "calendar", &gcal, NULL); - - view_type = gnome_calendar_get_view (gcal); - view = gnome_calendar_get_calendar_view (gcal, view_type); - - if (view) { - GList *selected; - - selected = e_calendar_view_get_selected_events (view); - if (selected && selected->data) { - ECalendarViewEvent *event = (ECalendarViewEvent *) selected->data; - const gchar *uri; - - uri = is_comp_data_valid (event) ? e_cal_get_uri (event->comp_data->client) : NULL; - - if (uri && g_ascii_strncasecmp (uri, "groupwise://", 12) == 0) { - visible = e_cal_util_component_has_attendee (event->comp_data->icalcomp); - if (visible) { - ECalComponent *comp; - - comp = e_cal_component_new (); - e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp)); - - if (e_cal_get_static_capability (event->comp_data->client, CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING)) { - gchar *user_email; - - user_email = itip_get_comp_attendee (comp, event->comp_data->client); - - is_unaccepted = needs_to_accept (event->comp_data->icalcomp, user_email); - - g_free (user_email); - } - - is_mtg_owner = is_meeting_owner (comp, event->comp_data->client); - - g_object_unref (comp); - } - } - } - - g_list_free (selected); - } - - action_group = e_shell_window_get_action_group (shell_window, "calendar"); - visible_actions (action_group, visible, cal_entries, G_N_ELEMENTS (cal_entries)); - - if (visible && !is_unaccepted) { - GtkAction *action; - - action = gtk_action_group_get_action (action_group, "gw-meeting-accept"); - g_return_if_fail (action != NULL); - gtk_action_set_visible (action, FALSE); - - action = gtk_action_group_get_action (action_group, "gw-meeting-accept-tentative"); - g_return_if_fail (action != NULL); - gtk_action_set_visible (action, FALSE); - } - - if (visible && !is_mtg_owner) { - GtkAction *action; - - action = gtk_action_group_get_action (action_group, "gw-resend-meeting"); - g_return_if_fail (action != NULL); - gtk_action_set_visible (action, FALSE); - } -} - -gboolean -gw_ui_calendar_event_popup (GtkUIManager *ui_manager, EShellView *shell_view) -{ - EShellWindow *shell_window; - GtkActionGroup *action_group; - - shell_window = e_shell_view_get_shell_window (shell_view); - action_group = e_shell_window_get_action_group (shell_window, "calendar"); - - gtk_action_group_add_actions ( - action_group, cal_entries, - G_N_ELEMENTS (cal_entries), shell_view); - - g_signal_connect (shell_view, "update-actions", G_CALLBACK (update_cal_entries_cb), NULL); - - return TRUE; -} diff --git a/plugins/groupwise-features/gw-ui.h b/plugins/groupwise-features/gw-ui.h deleted file mode 100644 index d8ed509e99..0000000000 --- a/plugins/groupwise-features/gw-ui.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifndef GW_UI_HEADER -#define GW_UI_HEADER - -#include -#include - -void gw_new_shared_folder_cb (GtkAction *action, EShellView *shell_view); -void gw_proxy_login_cb (GtkAction *action, EShellView *shell_view); - -void gw_junk_mail_settings_cb (GtkAction *action, EShellView *shell_view); -void gw_track_message_status_cb (GtkAction *action, EShellView *shell_view); -void gw_retract_mail_cb (GtkAction *action, EShellView *shell_view); - -void gw_meeting_accept_cb (GtkAction *action, EShellView *shell_view); -void gw_meeting_accept_tentative_cb (GtkAction *action, EShellView *shell_view); -void gw_meeting_decline_cb (GtkAction *action, EShellView *shell_view); -void gw_resend_meeting_cb (GtkAction *action, EShellView *shell_view); - -#endif diff --git a/plugins/groupwise-features/install-shared.c b/plugins/groupwise-features/install-shared.c deleted file mode 100644 index 6d290d0993..0000000000 --- a/plugins/groupwise-features/install-shared.c +++ /dev/null @@ -1,274 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see - * - * - * Authors: - * Vivek Jain - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -struct AcceptData { - CamelMimeMessage *msg; - EMFolderTreeModel *model; -}; - -void org_gnome_popup_wizard (EPlugin *ep, EMEventTargetMessage *target); - -static void -install_folder_response (EMFolderSelector *emfs, gint response, gpointer *data) -{ - struct AcceptData *accept_data = (struct AcceptData *)data; - EMFolderTreeModel *model; - const gchar *uri, *path; - gint parts = 0; - gchar **names; - gchar *folder_name; - gchar *parent_name; - gchar *container_id; - const gchar *item_id; - CamelService *service = NULL; - CamelFolder *folder; - EAccount *account; - CamelProvider *provider; - EGwConnection *cnc; - - if (response == GTK_RESPONSE_CANCEL) { - gtk_widget_destroy (GTK_WIDGET (emfs)); - } else { - CamelSession *session; - CamelURL *url; - EShell *shell; - - shell = e_shell_get_default (); - session = e_shell_settings_get_pointer (e_shell_get_shell_settings (shell), "mail-session"); - - model = accept_data->model; - item_id = camel_mime_message_get_message_id (accept_data->msg); - uri = em_folder_selector_get_selected_uri (emfs); - path = em_folder_selector_get_selected_path (emfs); - names = g_strsplit (path, "/", -1); - if (names == NULL) { - folder_name = (gchar *)path; - parent_name = NULL; - } else { - while (names[parts]) - parts++; - folder_name = names[parts -1]; - if (parts >= 2) - parent_name = names[parts -2]; - else - parent_name = NULL; - } - - url = camel_url_new (uri, NULL); - if (url != NULL) { - service = camel_session_get_service_by_url ( - session, url, CAMEL_PROVIDER_STORE); - camel_url_free (url); - } - - if (!CAMEL_IS_STORE (service)) { - g_strfreev (names); - return; - } - - cnc = get_cnc (CAMEL_STORE (service)); - if (E_IS_GW_CONNECTION (cnc)) { - container_id = get_container_id (cnc, parent_name); - - if (e_gw_connection_accept_shared_folder (cnc, folder_name, container_id, (gchar *)item_id, NULL) == E_GW_CONNECTION_STATUS_OK) { - const gchar *uid; - - /* FIXME Not passing a GCancellable or GError here. */ - folder = camel_store_get_folder_sync ( - CAMEL_STORE (service), - "Mailbox", 0, NULL, NULL); - /*changes = camel_folder_change_info_new (); - camel_folder_change_info_remove_uid (changes, (gchar *) item_id); - camel_folder_summary_remove_uid (folder->summary, item_id);*/ - /* camel_folder_delete_message (folder, item_id); */ - camel_folder_set_message_flags ( - folder, item_id, - CAMEL_MESSAGE_DELETED, - CAMEL_MESSAGE_DELETED); - camel_folder_summary_touch (folder->summary); - /* camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed", changes); */ - uid = camel_service_get_uid (service); - account = e_get_account_by_uid (uid); - uri = account->source->url; - em_folder_tree_model_remove_store ( - model, CAMEL_STORE (service)); - provider = camel_provider_get (uri, NULL); - if (provider == NULL) { - g_strfreev (names); - return; - } - - /* make sure the new store belongs in the tree */ - if (!(provider->flags & CAMEL_PROVIDER_IS_STORAGE)) { - g_strfreev (names); - return; - } - - em_folder_tree_model_add_store ( - model, CAMEL_STORE (service), - account->name); - } - } - - g_strfreev (names); - gtk_widget_destroy ((GtkWidget *)emfs); - } - -} - -static void -accept_free (gpointer data) -{ - struct AcceptData *accept_data = data; - - g_object_unref (accept_data->msg); - g_free (accept_data); -} - -static void -apply_clicked (GtkAssistant *assistant, CamelMimeMessage *msg) -{ - EShell *shell; - EShellBackend *shell_backend; - EMailSession *session; - EMFolderTree *folder_tree; - GtkWidget *dialog; - struct AcceptData *accept_data; - gchar *uri; - gpointer parent; - - shell = e_shell_get_default (); - shell_backend = e_shell_get_backend_by_name (shell, "mail"); - session = e_mail_backend_get_session (E_MAIL_BACKEND (shell_backend)); - - parent = gtk_widget_get_toplevel (GTK_WIDGET (assistant)); - parent = gtk_widget_is_toplevel (parent) ? parent : NULL; - - accept_data = g_new0 (struct AcceptData, 1); - folder_tree = (EMFolderTree *) em_folder_tree_new (session); - - dialog = em_folder_selector_create_new (parent, folder_tree, 0, _("Create folder"), _("Specify where to create the folder:")); - uri = em_folder_tree_get_selected_uri (folder_tree); - em_folder_selector_set_selected ((EMFolderSelector *) dialog, uri); - g_free (uri); - accept_data->msg = msg; - g_object_ref (msg); - accept_data->model = EM_FOLDER_TREE_MODEL (gtk_tree_view_get_model (GTK_TREE_VIEW (folder_tree))); - g_object_set_data_full((GObject *)dialog, "accept-data", accept_data, accept_free); - g_signal_connect (dialog, "response", G_CALLBACK (install_folder_response), accept_data); - g_object_set_data_full((GObject *)dialog, "assistant", assistant, (GDestroyNotify)gtk_widget_destroy); - gtk_window_set_title (GTK_WINDOW (dialog), "Install Shared Folder"); - gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); - gtk_widget_show (dialog); -} - -void -org_gnome_popup_wizard (EPlugin *ep, EMEventTargetMessage *target) -{ - CamelInternetAddress *from_addr = NULL; - const gchar *name; - const gchar *email; - CamelMimeMessage *msg = (CamelMimeMessage *) target->message; - CamelStream *stream; - CamelDataWrapper *dw; - GByteArray *byte_array; - gchar *start_message; - - if (!msg) - return; - - if (((gchar *)camel_medium_get_header (CAMEL_MEDIUM(msg),"X-notification")) == NULL - || (from_addr = camel_mime_message_get_from ((CamelMimeMessage *)target->message)) == NULL - || !camel_internet_address_get (from_addr, 0, &name, &email) - || (dw = camel_medium_get_content (CAMEL_MEDIUM (msg))) == NULL) { - return; - } else { - if (CAMEL_IS_MULTIPART (dw)) { - dw = camel_medium_get_content ((CamelMedium *)camel_multipart_get_part ((CamelMultipart *)dw, 0)); - if (dw == NULL) - return; - } - - byte_array = g_byte_array_new (); - stream = camel_stream_mem_new_with_byte_array (byte_array); - camel_data_wrapper_write_to_stream_sync (dw, stream, NULL, NULL); - camel_stream_write (stream, "", 1, NULL, NULL); - - from_addr = camel_mime_message_get_from ((CamelMimeMessage *)target->message); - if (from_addr && camel_internet_address_get (from_addr, 0, &name, &email)) { - GtkWidget *page; - GtkAssistant *assistant = GTK_ASSISTANT (gtk_assistant_new ()); - - start_message = g_strdup_printf (_("The user '%s' has shared a folder with you\n\n" - "Message from '%s'\n\n\n" - "%s\n\n\n" - "Click 'Apply' to install the shared folder\n\n"), - name, name, byte_array->data); - - page = gtk_label_new (start_message); - gtk_label_set_line_wrap (GTK_LABEL (page), TRUE); - gtk_misc_set_alignment (GTK_MISC (page), 0.0, 0.0); - gtk_misc_set_padding (GTK_MISC (page), 10, 10); - - gtk_assistant_append_page (assistant, page); - gtk_assistant_set_page_title (assistant, page, _("Install the shared folder")); - gtk_assistant_set_page_type (assistant, page, GTK_ASSISTANT_PAGE_CONFIRM); - gtk_assistant_set_page_complete (assistant, page, TRUE); - - gtk_window_set_title (GTK_WINDOW (assistant), _("Shared Folder Installation")); - gtk_window_set_position (GTK_WINDOW (assistant) , GTK_WIN_POS_CENTER_ALWAYS); - - g_object_ref (msg); - g_object_set_data_full((GObject *)page, "msg", msg, g_object_unref); - - g_signal_connect (assistant, "apply", G_CALLBACK (apply_clicked), msg); - - gtk_widget_show_all (GTK_WIDGET (assistant)); - - g_free (start_message); - } else - g_warning ("Could not get the sender name"); - - g_object_unref (stream); - } -} - diff --git a/plugins/groupwise-features/junk-mail-settings.c b/plugins/groupwise-features/junk-mail-settings.c deleted file mode 100644 index a633f0bcc3..0000000000 --- a/plugins/groupwise-features/junk-mail-settings.c +++ /dev/null @@ -1,119 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see - * - * - * Authors: - * Vivek Jain - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -#include -#include - -#include - -#include "gw-ui.h" -#include "share-folder.h" -#include "junk-settings.h" - -static void -abort_changes (JunkSettings *js) -{ - g_object_run_dispose ((GObject *)js); -} - -static void -junk_dialog_response (GtkWidget *dialog, gint response, JunkSettings *js) -{ - if (response == GTK_RESPONSE_ACCEPT) { - commit_changes (js); - abort_changes (js); - } - else - abort_changes (js); - - gtk_widget_destroy (dialog); - -} - -void -gw_junk_mail_settings_cb (GtkAction *action, EShellView *shell_view) -{ - GtkWidget *dialog ,*w, *notebook, *box; - GtkWidget *content_area; - JunkSettings *junk_tab; - gint page_count =0; - EGwConnection *cnc; - gchar *msg; - EShellContent *shell_content; - EMailReader *reader; - CamelFolder *folder; - - shell_content = e_shell_view_get_shell_content (shell_view); - - reader = E_MAIL_READER (shell_content); - folder = e_mail_reader_get_folder (reader); - g_return_if_fail (folder != NULL); - - cnc = get_cnc (camel_folder_get_parent_store (folder)); - - dialog = gtk_dialog_new_with_buttons (_("Junk Settings"), - NULL, - GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_STOCK_CANCEL, - GTK_RESPONSE_REJECT, - GTK_STOCK_OK, - GTK_RESPONSE_ACCEPT, - NULL); - content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); - gtk_window_set_default_size ((GtkWindow *) dialog, 292, 260); - gtk_widget_ensure_style (dialog); - gtk_container_set_border_width (GTK_CONTAINER (content_area), 12); - box = gtk_vbox_new (FALSE, 6); - w = gtk_label_new (""); - msg = g_strdup_printf("%s", _("Junk Mail Settings")); - gtk_label_set_markup (GTK_LABEL (w), msg); - gtk_box_pack_start ((GtkBox *) box, w, FALSE, FALSE, 6); - g_free (msg); - - junk_tab = junk_settings_new (cnc); - w = (GtkWidget *)junk_tab->vbox; - gtk_box_pack_start ((GtkBox *) box, w, FALSE, FALSE, 6); - - /* We might have to add more options for settings i.e. more pages */ - while (page_count > 0 ) { - notebook = gtk_notebook_new (); - gtk_notebook_append_page ((GtkNotebook *)notebook, box, NULL); - gtk_box_pack_start ( - GTK_BOX (content_area), notebook, TRUE, TRUE, 0); - } - - if (page_count == 0) - gtk_box_pack_start ( - GTK_BOX (content_area), box, TRUE, TRUE, 0); - - g_signal_connect (dialog, "response", G_CALLBACK (junk_dialog_response), junk_tab); - gtk_widget_show_all (dialog); -} diff --git a/plugins/groupwise-features/junk-settings.c b/plugins/groupwise-features/junk-settings.c deleted file mode 100644 index 6b0233d2bc..0000000000 --- a/plugins/groupwise-features/junk-settings.c +++ /dev/null @@ -1,428 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see - * - * - * Authors: - * Vivek Jain - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifdef HAVE_CONFIG_H -# include -#endif -#include "junk-settings.h" -#include -#include -#include -#include -#include -#define ROOTNODE "vboxSettings" -#define d(x) - -struct _JunkEntry { - EGwJunkEntry *entry; - gint flag; -}; - -typedef struct _JunkEntry JunkEntry; - -static void junk_settings_class_init (JunkSettingsClass *class); -static void junk_settings_init (JunkSettings *js); -static void junk_settings_dispose (GObject *obj); -static void junk_settings_finalise (GObject *obj); -static void free_all (JunkSettings *js); -static void get_junk_list (JunkSettings *js); -static void disable_clicked (GtkRadioButton *button, JunkSettings *js); -static void enable_clicked (GtkRadioButton *button, JunkSettings *js); - -static GtkVBoxClass *parent_class = NULL; - -GType -junk_settings_get_type (void) -{ - static GType type = 0; - - if (!type) { - static const GTypeInfo info = { - sizeof (JunkSettingsClass), - NULL, NULL, - (GClassInitFunc) junk_settings_class_init, - NULL, NULL, - sizeof (JunkSettings), - 0, - (GInstanceInitFunc) junk_settings_init - }; - - type = g_type_register_static (gtk_vbox_get_type (), "JunkSettings", &info, 0); - } - - return type; -} - -static void -junk_settings_class_init (JunkSettingsClass *klass) -{ - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - parent_class = g_type_class_ref (gtk_vbox_get_type ()); - object_class->dispose = junk_settings_dispose; - object_class->finalize = junk_settings_finalise; -} - -static void -junk_settings_finalise (GObject *obj) -{ - JunkSettings *js = (JunkSettings *) obj; - g_object_unref (js->builder); - free_all (js); - - G_OBJECT_CLASS (parent_class)->finalize (obj); -} - -static void -junk_settings_dispose (GObject *object) -{ - JunkSettings *js = (JunkSettings *) object; - free_all (js); - - /* Chain up to parent's dispose() method. */ - G_OBJECT_CLASS (parent_class)->dispose (object); -} - -static void -junk_settings_init (JunkSettings *js) -{ - js->users = 0; - js->flag_for_ok = 0; - js->enabled = FALSE; - js->junk_list = NULL; - js->entry_list = NULL; -} - -static void -free_entry_node (EGwJunkEntry *entry) -{ - if (entry) { - g_free (entry->match); - entry->match = NULL; - } - - return; -} - -static void -free_node (JunkEntry *nentry) -{ - EGwJunkEntry *junk_entry = nentry->entry; - - if (junk_entry) { - g_free (junk_entry->match); - junk_entry->match = NULL; - } - - return; -} - -static JunkEntry * -find_node (GList *list, gchar *match) -{ - JunkEntry *one_entry = NULL; - EGwJunkEntry *ent = NULL; - GList *tmp; - gint i; - - if (list) { - tmp = g_list_first (list); - for (i=0; tmp; i++) - { - one_entry = tmp->data; - ent = one_entry->entry; - if (!g_ascii_strcasecmp (ent->match, match)) { - return one_entry; - /*if found, it returns that user*/ - } - tmp= g_list_next (tmp); - } - } - - return NULL; -} - -static void -free_all (JunkSettings *js) -{ - if (js->junk_list) { - g_list_foreach (js->junk_list,(GFunc) free_node, NULL); - g_list_free (js->junk_list); - js->junk_list = NULL; - } -} - -static void -get_junk_list (JunkSettings *js) -{ - GList *list = NULL; - gchar *entry; - gchar *msg; - gint use_junk, use_block, use_pab, persistence; - - if (E_IS_GW_CONNECTION (js->cnc)) { - if (e_gw_connection_get_junk_settings (js->cnc, &use_junk, &use_block, &use_pab, &persistence) == E_GW_CONNECTION_STATUS_OK) { - if (use_junk) { - js->enabled = TRUE; - gtk_toggle_button_set_active ((GtkToggleButton *) js->enable, TRUE); - enable_clicked (js->enable , js); - gtk_widget_set_sensitive (GTK_WIDGET (js->table), TRUE); - } else { - gtk_toggle_button_set_active ((GtkToggleButton *) js->disable, TRUE); - disable_clicked (js->disable , js); - } - } - /* get list of containers */ - if (e_gw_connection_get_junk_entries (js->cnc, &(list)) == E_GW_CONNECTION_STATUS_OK) { - js->users = g_list_length (list); - if (js->users) { -/* I populate the list and set flags to 0 for the existing users*/ - while (list) { - JunkEntry *junk_entry = g_new0 (JunkEntry , 1); - junk_entry->entry = list->data; - junk_entry->flag = 0; - entry = g_strdup ((junk_entry->entry)->match); - msg = g_strdup_printf ("%s", entry); - gtk_list_store_append (GTK_LIST_STORE (js->model), &(js->iter)); - gtk_list_store_set (GTK_LIST_STORE (js->model), &(js->iter), 0, msg, -1); - js->junk_list = g_list_append (js->junk_list, junk_entry); - - g_free (msg); - g_free (entry); - msg = NULL; - entry = NULL; - list = list->next; - } - } - } - else - g_warning("Could not get the JUNK List"); - } -} - -void -commit_changes (JunkSettings *js) -{ - GList *new_list = NULL; - GList *remove_list = NULL; - GList *node = NULL; - JunkEntry *junk_entry = NULL; - EGwJunkEntry *entry; - gint use_junk, use_pab, use_block, persistence; - - for (node = js->junk_list; node; node = node->next) - { - junk_entry = node->data; - if (junk_entry->flag & 0x1) - new_list = g_list_append (new_list, junk_entry->entry); - else if (junk_entry->flag & 0x4) { - remove_list = g_list_append (remove_list, junk_entry->entry); - } - } - - if (E_IS_GW_CONNECTION (js->cnc)) { - if (js->flag_for_ok == 2 && js->enabled){ /* just turn off the bits*/ - use_junk = use_pab = use_block = persistence = 0; - if (e_gw_connection_modify_junk_settings (js->cnc, use_junk, use_pab, use_block, persistence) == E_GW_CONNECTION_STATUS_OK) { - ; - } - - } - if (js->flag_for_ok == 0 && !js->enabled) { - use_block = use_pab =0; - use_junk = 1; - persistence = 14; /* We are setting the default persistence*/ - if (e_gw_connection_modify_junk_settings (js->cnc, use_junk, use_pab, use_block, persistence) == E_GW_CONNECTION_STATUS_OK) { - ; - } - } - - while (new_list) { - entry = new_list->data; - if (e_gw_connection_create_junk_entry (js->cnc, entry->match, "email", "junk") == E_GW_CONNECTION_STATUS_OK) { - ; - } - new_list = new_list->next; - } - while (remove_list) { - entry = remove_list->data; - if (e_gw_connection_remove_junk_entry (js->cnc, entry->id) == E_GW_CONNECTION_STATUS_OK) { - ; - } - remove_list = remove_list->next; - } - - } - if (new_list) { - g_list_foreach (new_list, (GFunc) free_entry_node, NULL); - g_list_free (new_list); - } - new_list = NULL; - if (remove_list) { - g_list_foreach (remove_list,(GFunc) free_entry_node, NULL); - g_list_free (remove_list); - } - remove_list = NULL; -} - -static void -enable_clicked (GtkRadioButton *button, JunkSettings *js) -{ - js->flag_for_ok = 0; - gtk_widget_set_sensitive (GTK_WIDGET (js->table) ,TRUE); -} - -static void -disable_clicked (GtkRadioButton *button, JunkSettings *js) -{ - js->flag_for_ok = 2; - gtk_widget_set_sensitive (GTK_WIDGET (js->table), FALSE); -} - -static void -add_clicked (GtkButton *button, JunkSettings *js) -{ - const gchar *email = NULL; - const gchar *self_email = NULL; - JunkEntry *new_entry = NULL; - EGwJunkEntry *junk_entry = NULL; - gchar *msg = NULL; - - self_email = g_strdup (e_gw_connection_get_user_email (js->cnc)); - email = gtk_entry_get_text (js->entry); - /* You can't mark junk sender yourself*/ - if (g_strrstr (email, "@") == NULL || (!g_ascii_strcasecmp (email , self_email)) || !g_ascii_strcasecmp (email, "" )) - return; - else { - /*check whether already exists*/ - if (js->junk_list && email) { - new_entry = find_node (js->junk_list, (gchar *)email); - if (new_entry) - return; - - } - junk_entry = g_new0 (EGwJunkEntry, 1); - new_entry = g_new0 (JunkEntry, 1); - junk_entry->match = g_strdup (email); -/*XXX:populate more fields*/ - new_entry->entry = junk_entry; - new_entry->flag = 1; - msg = g_strdup (email); - gtk_list_store_append (GTK_LIST_STORE (js->model), &(js->iter)); - gtk_list_store_set (GTK_LIST_STORE (js->model), &(js->iter), 0, msg, -1); - g_free (msg); - js->junk_list = g_list_append (js->junk_list, new_entry); - js->flag_for_ok = 0; - } - gtk_entry_set_text (GTK_ENTRY(js->entry), ""); -} - -static void -remove_clicked (GtkButton *button, JunkSettings *js) -{ - JunkEntry *entry = NULL; - gchar *email; - - gtk_tree_model_get ((GtkTreeModel *) js->model, &(js->iter), 0, &email, -1); - entry = find_node (js->junk_list, email); - if (entry->flag & 0x1) { - js->junk_list = g_list_remove (js->junk_list, entry); - free_node (entry); - } else { - entry->flag = 0; - entry->flag |= 0x4; - } - g_free (email); - gtk_list_store_remove (GTK_LIST_STORE (js->model), &(js->iter)); -} - -static void -user_selected (GtkTreeSelection *selection, JunkSettings *js) -{ - GtkTreeModel *model; - - gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE); - if (gtk_tree_selection_get_selected (selection, &model, &(js->iter))) { - gtk_widget_set_sensitive (GTK_WIDGET (js->remove), TRUE); - - } -} - -static void -junk_settings_construct (JunkSettings *js) -{ - js->builder = gtk_builder_new (); - e_load_ui_builder_definition (js->builder, "junk-settings.ui"); - - js->vbox = GTK_VBOX (e_builder_get_widget(js->builder, "vboxSettings")); - js->table = GTK_VBOX (e_builder_get_widget (js->builder, "vbox194")); - gtk_widget_set_sensitive (GTK_WIDGET (js->table), FALSE); - - js->enable = GTK_RADIO_BUTTON (e_builder_get_widget (js->builder, "radEnable")); - g_signal_connect ((gpointer) js->enable, "clicked", G_CALLBACK (enable_clicked), js); - - js->disable = GTK_RADIO_BUTTON (e_builder_get_widget (js->builder, "radDisable")); - g_signal_connect ((gpointer) js->disable, "clicked", G_CALLBACK (disable_clicked), js); - - js->add_button = GTK_BUTTON (e_builder_get_widget(js->builder, "Add")); - g_signal_connect((GtkWidget *) js->add_button, "clicked", G_CALLBACK (add_clicked), js); - - js->remove = GTK_BUTTON(e_builder_get_widget(js->builder, "Remove")); - g_signal_connect ((GtkWidget *) js->remove, "clicked", G_CALLBACK (remove_clicked), js); - gtk_widget_set_sensitive (GTK_WIDGET (js->remove), FALSE); - - js->entry = GTK_ENTRY (e_builder_get_widget (js->builder, "entry4")); - /*TODO:connect entry and label*/ - gtk_widget_show ((GtkWidget *) js->entry); - - js->scrolled_window = GTK_WIDGET (e_builder_get_widget (js->builder,"scrolledwindow4")); - - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (js->scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - - js->model = gtk_list_store_new (4, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN); - js->entry_list = (GtkTreeView *)gtk_tree_view_new (); - /*gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (js->scrolled_window), (GtkWidget *)js->entry_list);*/ - gtk_container_add (GTK_CONTAINER (js->scrolled_window), (GtkWidget *)js->entry_list); - gtk_tree_view_set_model (GTK_TREE_VIEW (js->entry_list), GTK_TREE_MODEL (js->model)); - gtk_widget_show (GTK_WIDGET (js->entry_list)); - - js->cell = gtk_cell_renderer_text_new (); - js->column = gtk_tree_view_column_new_with_attributes (_("Email"), js->cell, "text", 0, NULL); - gtk_tree_view_append_column (GTK_TREE_VIEW (js->entry_list), - GTK_TREE_VIEW_COLUMN (js->column)); - - g_signal_connect(gtk_tree_view_get_selection(GTK_TREE_VIEW (js->entry_list)), "changed", G_CALLBACK (user_selected), js); -} - -JunkSettings * -junk_settings_new (EGwConnection *ccnc) -{ - JunkSettings *new; - new = (JunkSettings *) g_object_new (junk_settings_get_type (), NULL); - junk_settings_construct (new); - new->cnc = ccnc; - if (new->cnc) - get_junk_list (new); - - return (JunkSettings *) new; -} - diff --git a/plugins/groupwise-features/junk-settings.h b/plugins/groupwise-features/junk-settings.h deleted file mode 100644 index 2e67b8cc8c..0000000000 --- a/plugins/groupwise-features/junk-settings.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see - * - * - * Authors: - * Vivek Jain - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifndef __JUNK_SETTINGS_H__ -#define __JUNK_SETTINGS_H__ - -#include -#include - -#define _JUNK_SETTINGS_TYPE (junk_settings_get_type ()) -#define JUNK_SETTINGS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), JUNK_SETTINGS, JunkSettings)) -#define JUNK_SETTINGS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), JUNK_SETTINGS_TYPE, JunkSettings)) -#define IS_JUNK_SETTINGS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), JUNK_SETTINGS_TYPE)) -#define IS_JUNK_SETTINGS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), JUNK_SETTINGS_TYPE)) - -G_BEGIN_DECLS - -typedef struct _JunkSettings JunkSettings; -typedef struct _JunkSettingsClass JunkSettingsClass; - -struct _JunkSettings { - GtkVBox parent_object; - - GtkBuilder *builder; - - /* General tab */ - - /* Default Behavior */ - GtkTreeView *entry_list; - GtkButton *add_button; - GtkButton *remove; - GtkEntry *entry; - GtkRadioButton *enable; - GtkRadioButton *disable; - GtkWidget *scrolled_window; - GtkListStore *model; - GtkCellRenderer *cell; - GtkTreeViewColumn *column; - GtkVBox *vbox; - GtkVBox *table; - GtkWidget *window; - - GList *junk_list; - gint users; - gint flag_for_ok; - gboolean enabled; - EGwConnection *cnc; - GtkTreeIter iter; -}; - -struct _JunkSettingsClass { - GtkVBoxClass parent_class; - -}; - -GType junk_settings_get_type (void); -JunkSettings * junk_settings_new (EGwConnection *ccnc); -void commit_changes (JunkSettings *js); - -G_END_DECLS - -#endif /* __JUNK_SETTINGS_H__ */ diff --git a/plugins/groupwise-features/junk-settings.ui b/plugins/groupwise-features/junk-settings.ui deleted file mode 100644 index b998c90920..0000000000 --- a/plugins/groupwise-features/junk-settings.ui +++ /dev/null @@ -1,458 +0,0 @@ - - - - - Junk Mail Settings - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_NORMAL - GDK_GRAVITY_NORTH_WEST - True - - - True - True - True - True - GTK_POS_TOP - False - False - - - 12 - True - False - 12 - - - 0 - True - False - 6 - - - 0 - True - False - 12 - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - True - False - 6 - - - True - True - _Disable - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - True - True - _Enable - True - GTK_RELIEF_NORMAL - True - False - False - True - radDisable - - - 0 - False - False - - - - - True - False - 0 - - - True - False - 6 - - - 234 - 209 - True - False - 0 - - - True - False - 0 - - - True - Email: - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - True - True - True - True - 0 - - True - False - - - 2 - True - True - - - - - 0 - True - True - - - - - True - Junk List: - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - - - - 6 - False - False - - - - - 282 - 150 - True - True - GTK_POLICY_ALWAYS - GTK_POLICY_ALWAYS - GTK_SHADOW_NONE - GTK_CORNER_TOP_LEFT - - - - - - 6 - True - True - - - - - 0 - True - True - - - - - True - False - 6 - - - True - True - GTK_RELIEF_NORMAL - True - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - True - False - 2 - - - True - gtk-add - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - 29 - True - _Add - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - 0 - False - False - - - - - True - True - GTK_RELIEF_NORMAL - True - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - True - False - 2 - - - True - gtk-remove - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - True - _Remove - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - 0 - False - False - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - - - 0 - False - False - - - - - 0 - False - False - - - - - 0 - False - False - - - - - 0 - False - False - - - - - False - True - - - - - True - _Junk List - True - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - - - - diff --git a/plugins/groupwise-features/mail-retract.c b/plugins/groupwise-features/mail-retract.c deleted file mode 100644 index 1213311e36..0000000000 --- a/plugins/groupwise-features/mail-retract.c +++ /dev/null @@ -1,119 +0,0 @@ -/* - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see - * - * - * Authors: - * Sankar P - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include - -#include - -#include -#include -#include - -#include "gw-ui.h" -#include "share-folder.h" - -static gboolean -get_selected_info (EShellView *shell_view, CamelFolder **folder, gchar **selected_uid) -{ - EShellContent *shell_content; - EMailReader *reader; - GPtrArray *uids; - - shell_content = e_shell_view_get_shell_content (shell_view); - - reader = E_MAIL_READER (shell_content); - uids = e_mail_reader_get_selected_uids (reader); - - if (uids && uids->len == 1) { - *folder = e_mail_reader_get_folder (reader); - *selected_uid = g_strdup (g_ptr_array_index (uids, 0)); - } - - em_utils_uids_free (uids); - - return *selected_uid != NULL; -} - -void -gw_retract_mail_cb (GtkAction *action, EShellView *shell_view) -{ - EGwConnection *cnc; - CamelFolder *folder; - CamelStore *parent_store; - gchar *id = NULL; - GtkWidget *confirm_dialog, *confirm_warning; - GtkWidget *content_area; - gint n; - - g_return_if_fail (get_selected_info (shell_view, &folder, &id)); - g_return_if_fail (folder != NULL); - - parent_store = camel_folder_get_parent_store (folder); - - cnc = get_cnc (parent_store); - - if (cnc && E_IS_GW_CONNECTION (cnc)) { - confirm_dialog = gtk_dialog_new_with_buttons ( - _("Message Retract"), - GTK_WINDOW (e_shell_view_get_shell_window (shell_view)), - GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_STOCK_YES, GTK_RESPONSE_YES, - GTK_STOCK_NO, GTK_RESPONSE_NO, NULL); - - content_area = gtk_dialog_get_content_area ( - GTK_DIALOG (confirm_dialog)); - - confirm_warning = gtk_label_new (_("Retracting a message may remove it from the recipient's mailbox. Are you sure you want to do this?")); - gtk_label_set_line_wrap (GTK_LABEL (confirm_warning), TRUE); - gtk_label_set_selectable (GTK_LABEL (confirm_warning), TRUE); - - gtk_container_add (GTK_CONTAINER (content_area), confirm_warning); - gtk_widget_set_size_request (confirm_dialog, 400, 100); - gtk_widget_show_all (confirm_dialog); - - n =gtk_dialog_run (GTK_DIALOG (confirm_dialog)); - - gtk_widget_destroy (confirm_warning); - gtk_widget_destroy (confirm_dialog); - - if (n == GTK_RESPONSE_YES) { - - if (e_gw_connection_retract_request (cnc, id, NULL, FALSE, FALSE) != E_GW_CONNECTION_STATUS_OK ) - e_alert_run_dialog_for_args (GTK_WINDOW (e_shell_view_get_shell_window (shell_view)), - "org.gnome.evolution.message.retract:retract-failure", - NULL); - else { - GtkWidget *dialog; - dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, _("Message retracted successfully")); - gtk_dialog_run (GTK_DIALOG (dialog)); - gtk_widget_destroy (dialog); - } - } - } - - g_free (id); -} diff --git a/plugins/groupwise-features/mail-send-options.c b/plugins/groupwise-features/mail-send-options.c deleted file mode 100644 index 7c31b6e585..0000000000 --- a/plugins/groupwise-features/mail-send-options.c +++ /dev/null @@ -1,246 +0,0 @@ -/* - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see - * - * - * Authors: - * Parthasarathi Susarla - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#include -#include -#include -#include -#include - -#include -#include - -#include "mail-send-options.h" - -#include "mail/em-utils.h" -#include "mail/em-event.h" - -#include "composer/e-msg-composer.h" -#include "composer/e-composer-from-header.h" -#include "libedataserver/e-account.h" - -#include "misc/e-send-options.h" - -static ESendOptionsDialog * dialog = NULL; - -gboolean gw_ui_composer_actions (GtkUIManager *manager, EMsgComposer *composer); -void org_gnome_composer_message_reply (EPlugin *ep, EMEventTargetMessage *t); - -static time_t -add_day_to_time (time_t time, gint days) -{ - struct tm *tm; - - tm = localtime (&time); - tm->tm_mday += days; - tm->tm_isdst = -1; - - return mktime (tm); -} - -static void -feed_input_data (ESendOptionsDialog * dialog, gint state, gpointer data) -{ - EMsgComposer *comp; - gchar value[100]; - gchar *temp = NULL; - - comp = (EMsgComposer *) data; - /* we are bothered only for ok response: other cases are handled generally*/ - if (state == GTK_RESPONSE_OK) { - if (dialog->data->gopts->reply_enabled) { - if (dialog->data->gopts->reply_convenient) - e_msg_composer_add_header (comp, X_REPLY_CONVENIENT ,"1" ); - else { - time_t t; - t = add_day_to_time (time (NULL), dialog->data->gopts->reply_within); - strftime (value, 17, "%Y%m%dT%H%M%SZ", gmtime (&t)); - e_msg_composer_add_header (comp, X_REPLY_WITHIN , value); - } - } - - if (dialog->data->gopts->expiration_enabled) { - if (dialog->data->gopts->expire_after != 0) { - time_t t; - t = add_day_to_time (time (NULL), dialog->data->gopts->expire_after); - strftime (value, 17, "%Y%m%dT%H%M%SZ", gmtime (&t)); - e_msg_composer_add_header (comp, X_EXPIRE_AFTER, value); - } - } - if (dialog->data->gopts->delay_enabled) { - strftime (value, 17, "%Y%m%dT%H%M%SZ", gmtime (&dialog->data->gopts->delay_until)); - e_msg_composer_add_header (comp, X_DELAY_UNTIL, value); - } - - /*Status Tracking Options*/ - if (dialog->data->sopts->tracking_enabled) { - temp = g_strdup_printf ("%d",dialog->data->sopts->track_when); - e_msg_composer_add_header (comp, X_TRACK_WHEN, temp); - g_free (temp); - } - - if (dialog->data->sopts->autodelete) { - e_msg_composer_add_header (comp, X_AUTODELETE, "1"); - } - if (dialog->data->sopts->opened) { - temp = g_strdup_printf ("%d",dialog->data->sopts->opened); - e_msg_composer_add_header (comp, X_RETURN_NOTIFY_OPEN, temp); - g_free (temp); - } - if (dialog->data->sopts->declined) { - temp = g_strdup_printf ("%d",dialog->data->sopts->declined); - e_msg_composer_add_header (comp, X_RETURN_NOTIFY_DELETE, temp); - g_free (temp); - } - - if (dialog->data->gopts->priority) { - temp = g_strdup_printf ("%d",dialog->data->gopts->priority); - e_msg_composer_add_header (comp, X_SEND_OPT_PRIORITY, temp); - g_free (temp); - } - - if (dialog->data->gopts->security) { - temp = g_strdup_printf ("%d",dialog->data->gopts->security); - e_msg_composer_add_header (comp, X_SEND_OPT_SECURITY, temp); - g_free (temp); - } - } -} - -static void -send_options_commit (EMsgComposer *comp, gpointer user_data) -{ - if (!user_data && !E_IS_SENDOPTIONS_DIALOG (user_data)) - return; - - if (dialog) { - g_object_unref (dialog); - dialog = NULL; - } -} - -static gboolean -account_is_groupwise (EAccount *account) -{ - const gchar *url; - - if (!account) - return FALSE; - - url = e_account_get_string (account, E_ACCOUNT_TRANSPORT_URL); - return url && g_str_has_prefix (url, "groupwise://"); -} - -static void -from_changed_cb (EComposerFromHeader *header, EMsgComposer *composer) -{ - GtkActionGroup *group; - GtkAction *action; - EAccount *account; - - g_return_if_fail (header != NULL); - g_return_if_fail (composer != NULL); - - group = gtkhtml_editor_get_action_group (GTKHTML_EDITOR (composer), "composer"); - g_return_if_fail (group != NULL); - - action = gtk_action_group_get_action (group, "gw-send-options"); - g_return_if_fail (action != NULL); - - account = e_composer_from_header_get_active (header); - gtk_action_set_visible (action, account_is_groupwise (account)); -} - -static void -action_send_options_cb (GtkAction *action, EMsgComposer *composer) -{ - g_return_if_fail (action != NULL); - g_return_if_fail (composer != NULL); - - /* display the send options dialog */ - if (!dialog) { - dialog = e_send_options_dialog_new (); - } - - e_send_options_dialog_run (dialog, GTK_WIDGET (composer), E_ITEM_MAIL); - - g_signal_connect (dialog, "sod_response", - G_CALLBACK (feed_input_data), composer); - - g_signal_connect (GTK_WIDGET (composer), "destroy", - G_CALLBACK (send_options_commit), dialog); -} - -gboolean -gw_ui_composer_actions (GtkUIManager *manager, EMsgComposer *composer) -{ - static GtkActionEntry entries[] = { - { "gw-send-options", - NULL, - N_("_Send Options"), - NULL, - N_("Insert Send options"), - G_CALLBACK (action_send_options_cb) } - }; - - GtkhtmlEditor *editor; - EComposerHeaderTable *headers; - EComposerHeader *header; - - editor = GTKHTML_EDITOR (composer); - - /* Add actions to the "composer" action group. */ - gtk_action_group_add_actions ( - gtkhtml_editor_get_action_group (editor, "composer"), - entries, G_N_ELEMENTS (entries), composer); - - headers = e_msg_composer_get_header_table (composer); - header = e_composer_header_table_get_header (headers, E_COMPOSER_HEADER_FROM); - - from_changed_cb (E_COMPOSER_FROM_HEADER (header), composer); - g_signal_connect ( - header, "changed", - G_CALLBACK (from_changed_cb), composer); - - return TRUE; -} - -void -org_gnome_composer_message_reply (EPlugin *ep, EMEventTargetMessage *t) -{ - EMsgComposer *comp = (struct _EMsgComposer *)t->composer; - EComposerHeaderTable *table; - EAccount *account = NULL; - gchar *temp = NULL; - - table = e_msg_composer_get_header_table (comp); - account = e_composer_header_table_get_account (table); - if (!account) - return; - - temp = strstr (account->transport->url, "groupwise"); - if (!temp) { - return; - } - e_msg_composer_add_header (comp, "X-GW-ORIG-ITEM-ID", t->uid); -} diff --git a/plugins/groupwise-features/mail-send-options.h b/plugins/groupwise-features/mail-send-options.h deleted file mode 100644 index 71cacbff01..0000000000 --- a/plugins/groupwise-features/mail-send-options.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with the program; if not, see - * - * - * Authors: - * Parthasarathi Susarla - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) - * - */ - -#ifndef __GW_SEND_OPTIONS__ -#define __GW_SEND_OPTIONS__ - -/*Headers for send options*/ -#define X_SEND_OPTIONS "X-gw-send-options" -/*General Options*/ -#define X_SEND_OPT_PRIORITY "X-gw-send-opt-priority" -#define X_SEND_OPT_SECURITY "X-gw-send-opt-security" -#define X_REPLY_CONVENIENT "X-reply-convenient" -#define X_REPLY_WITHIN "X-reply-within" -#define X_EXPIRE_AFTER "X-expire-after" -#define X_DELAY_UNTIL "X-delay-until" - -/*Status Tracking Options*/ -#define X_TRACK_WHEN "X-track-when" -#define X_AUTODELETE "X-auto-delete" -#define X_RETURN_NOTIFY_OPEN "X-return-notify-open" -#define X_RETURN_NOTIFY_DELETE "X-return-notify-delete" - -#endif /*__GW_SEND_OPTIONS__*/ diff --git a/plugins/groupwise-features/notification.ui b/plugins/groupwise-features/notification.ui deleted file mode 100644 index a3fc64b568..0000000000 --- a/plugins/groupwise-features/notification.ui +++ /dev/null @@ -1,216 +0,0 @@ - - - - - 12 - True - False - 12 - - - True - The participants will receive the following notification. - - False - False - GTK_JUSTIFY_CENTER - False - False - 0.66 - 0.5 - 0 - 0 - - - 1 - False - False - - - - - 309 - True - False - 12 - - - True - False - 5 - - - True - Subject - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - 158 - True - True - True - True - 0 - - True - False - - - 6 - False - False - - - - - True - Message - False - False - GTK_JUSTIFY_CENTER - False - False - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - 0 - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - True - True - True - False - True - GTK_JUSTIFY_LEFT - GTK_WRAP_NONE - True - 0 - 0 - 0 - 0 - 0 - 0 - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - True - False - 0 - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.52 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - True - GTK_BUTTONBOX_END - 6 - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - - - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - - - - - - 0 - True - True - - - - - 0 - False - True - - - - diff --git a/plugins/groupwise-features/org-gnome-compose-send-options.xml b/plugins/groupwise-features/org-gnome-compose-send-options.xml deleted file mode 100644 index 25ff89803e..0000000000 --- a/plugins/groupwise-features/org-gnome-compose-send-options.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/plugins/groupwise-features/org-gnome-groupwise-features.eplug.xml b/plugins/groupwise-features/org-gnome-groupwise-features.eplug.xml deleted file mode 100644 index 08001f97d8..0000000000 --- a/plugins/groupwise-features/org-gnome-groupwise-features.eplug.xml +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - <_description>Fine-tune your GroupWise accounts. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/groupwise-features/org-gnome-mail-retract.error.xml b/plugins/groupwise-features/org-gnome-mail-retract.error.xml deleted file mode 100644 index 64e2ce2f1e..0000000000 --- a/plugins/groupwise-features/org-gnome-mail-retract.error.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - <_primary>Message retract failed - <_secondary>The server did not allow the selected message to be retracted. - - diff --git a/plugins/groupwise-features/org-gnome-process-meeting.error.xml b/plugins/groupwise-features/org-gnome-process-meeting.error.xml deleted file mode 100644 index 45fbc98103..0000000000 --- a/plugins/groupwise-features/org-gnome-process-meeting.error.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - - -<_primary>This is a recurring meeting - -<_secondary>Would you like to accept it? -