diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2008-12-11 02:30:29 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2008-12-11 02:30:29 +0800 |
commit | d158af8cdfa6e4bf85c1e74769e8d61bc469494c (patch) | |
tree | ba55b970ae3a23e5ade4edbddc4eb8dcaf3033bd /plugins | |
parent | dc0d0ee010319425b19d8d8d493f0bc489d5fd07 (diff) | |
download | gsoc2013-evolution-d158af8cdfa6e4bf85c1e74769e8d61bc469494c.tar gsoc2013-evolution-d158af8cdfa6e4bf85c1e74769e8d61bc469494c.tar.gz gsoc2013-evolution-d158af8cdfa6e4bf85c1e74769e8d61bc469494c.tar.bz2 gsoc2013-evolution-d158af8cdfa6e4bf85c1e74769e8d61bc469494c.tar.lz gsoc2013-evolution-d158af8cdfa6e4bf85c1e74769e8d61bc469494c.tar.xz gsoc2013-evolution-d158af8cdfa6e4bf85c1e74769e8d61bc469494c.tar.zst gsoc2013-evolution-d158af8cdfa6e4bf85c1e74769e8d61bc469494c.zip |
Merge revisions 36811:36865 from trunk.
svn path=/branches/kill-bonobo/; revision=36867
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/caldav/ChangeLog | 26 | ||||
-rw-r--r-- | plugins/caldav/caldav-source.c | 171 | ||||
-rw-r--r-- | plugins/caldav/org-gnome-evolution-caldav.eplug.xml | 2 | ||||
-rw-r--r-- | plugins/calendar-weather/ChangeLog | 16 | ||||
-rw-r--r-- | plugins/calendar-weather/Makefile.am | 9 | ||||
-rw-r--r-- | plugins/calendar-weather/calendar-weather.c | 175 | ||||
-rw-r--r-- | plugins/exchange-operations/ChangeLog | 17 | ||||
-rw-r--r-- | plugins/exchange-operations/exchange-account-setup.c | 67 | ||||
-rw-r--r-- | plugins/exchange-operations/org-gnome-exchange-operations.error.xml | 5 | ||||
-rw-r--r-- | plugins/itip-formatter/ChangeLog | 8 | ||||
-rw-r--r-- | plugins/itip-formatter/itip-formatter.c | 22 | ||||
-rw-r--r-- | plugins/mailing-list-actions/ChangeLog | 6 | ||||
-rw-r--r-- | plugins/mailing-list-actions/org-gnome-mailing-list-actions.error.xml | 2 | ||||
-rw-r--r-- | plugins/sa-junk-plugin/ChangeLog | 9 | ||||
-rw-r--r-- | plugins/sa-junk-plugin/em-junk-filter.c | 2 |
15 files changed, 406 insertions, 131 deletions
diff --git a/plugins/caldav/ChangeLog b/plugins/caldav/ChangeLog index 5463c6124e..8236b8f2e2 100644 --- a/plugins/caldav/ChangeLog +++ b/plugins/caldav/ChangeLog @@ -1,3 +1,29 @@ +2008-12-08 Milan Crha <mcrha@redhat.com> + + ** Fix for bug #562990 + + * caldav-source.c: (user_changed), (oge_caldav): Use 'username' + property of the ESource to read/write user name, not the uri. + +2008-11-28 Milan Crha <mcrha@redhat.com> + + ** Part of fix for bug #503662 + + * caldav-source.c: (user_changed): + Set NULL properly to protect against using already freed memory. + +2008-11-28 Milan Crha <mcrha@redhat.com> + + ** Part of fix for bug #359745 + + * caldav-source.c: (ensure_caldav_source_group), + (e_plugin_lib_enable): Ensure source group for VTODO and VJOURNAL too. + * caldav-source.c: (set_refresh_time), (get_refresh_minutes), + (spin_changed), (option_changed), (oge_caldav): + Be able to change refresh time for the CalDAV sources. + * org-gnome-evolution-caldav.eplug.xml: + Show CalDAV options under all the other standard options. + 2008-09-02 Sankar P <psankar@novell.com> License Changes diff --git a/plugins/caldav/caldav-source.c b/plugins/caldav/caldav-source.c index 24bf2040f3..6fb7ea3841 100644 --- a/plugins/caldav/caldav-source.c +++ b/plugins/caldav/caldav-source.c @@ -52,21 +52,31 @@ GtkWidget * oge_caldav (EPlugin *epl, /* plugin intialization */ static void -ensure_caldav_source_group (void) +ensure_caldav_source_group (ECalSourceType source_type) { ESourceList *slist; - ESourceGroup *group; - + GSList *groups, *g; + ESourceGroup *group = NULL; - if (!e_cal_get_sources (&slist, E_CAL_SOURCE_TYPE_EVENT, NULL)) { + if (!e_cal_get_sources (&slist, source_type, NULL)) { g_warning ("Could not get calendar source list from GConf!"); return; } - group = e_source_list_peek_group_by_name (slist, _("CalDAV")); + groups = e_source_list_peek_groups (slist); + for (g = groups; g; g = g->next) { + group = E_SOURCE_GROUP (g->data); + + if (group && e_source_group_peek_base_uri (group) && strncmp ("caldav://", e_source_group_peek_base_uri (group), 9) == 0) + break; + + group = NULL; + } if (group == NULL) { + /* no such group has been found, create it */ gboolean res; + group = e_source_group_new (_("CalDAV"), "caldav://"); res = e_source_list_add_group (slist, group, -1); @@ -77,8 +87,12 @@ ensure_caldav_source_group (void) } g_object_unref (group); - g_object_unref (slist); + } else { + /* we found the group, change the name based on the actual language */ + e_source_group_set_name (group, _("CalDAV")); } + + g_object_unref (slist); } int @@ -87,7 +101,9 @@ e_plugin_lib_enable (EPluginLib *ep, int enable) if (enable) { d(g_print ("CalDAV Eplugin starting up ...\n")); - ensure_caldav_source_group (); + ensure_caldav_source_group (E_CAL_SOURCE_TYPE_EVENT); + ensure_caldav_source_group (E_CAL_SOURCE_TYPE_TODO); + ensure_caldav_source_group (E_CAL_SOURCE_TYPE_JOURNAL); } return 0; @@ -174,21 +190,100 @@ user_changed (GtkEntry *editable, ESource *source) euri = e_uri_new (uri); g_free (euri->user); + euri->user = NULL; - if (user != NULL) { - euri->user = g_strdup (user); + if (user != NULL && *user) { e_source_set_property (source, "auth", "1"); } else { e_source_set_property (source, "auth", NULL); } - e_source_set_property (source, "username", euri->user); + e_source_set_property (source, "username", user); ruri = print_uri_noproto (euri); e_source_set_relative_uri (source, ruri); g_free (ruri); e_uri_free (euri); } +static void +set_refresh_time (ESource *source, GtkWidget *spin, GtkWidget *option) +{ + int time; + int item_num = 0; + const char *refresh_str = e_source_get_property (source, "refresh"); + time = refresh_str ? atoi (refresh_str) : 30; + + if (time && !(time % 10080)) { + /* weeks */ + item_num = 3; + time /= 10080; + } else if (time && !(time % 1440)) { + /* days */ + item_num = 2; + time /= 1440; + } else if (time && !(time % 60)) { + /* hours */ + item_num = 1; + time /= 60; + } + gtk_option_menu_set_history (GTK_OPTION_MENU (option), item_num); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin), time); +} + +static char * +get_refresh_minutes (GtkWidget *spin, GtkWidget *option) +{ + int setting = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (spin)); + switch (gtk_option_menu_get_history (GTK_OPTION_MENU (option))) { + case 0: + /* minutes */ + break; + case 1: + /* hours */ + setting *= 60; + break; + case 2: + /* days */ + setting *= 1440; + break; + case 3: + /* weeks - is this *really* necessary? */ + setting *= 10080; + break; + default: + g_warning ("Time unit out of range"); + break; + } + + return g_strdup_printf ("%d", setting); +} + +static void +spin_changed (GtkSpinButton *spin, ESource *source) +{ + char *refresh_str; + GtkWidget *option; + + option = g_object_get_data (G_OBJECT (spin), "option"); + + refresh_str = get_refresh_minutes ((GtkWidget *) spin, option); + e_source_set_property (source, "refresh", refresh_str); + g_free (refresh_str); +} + +static void +option_changed (GtkOptionMenu *option, ESource *source) +{ + char *refresh_str; + GtkWidget *spin; + + spin = g_object_get_data (G_OBJECT (option), "spin"); + + refresh_str = get_refresh_minutes (spin, (GtkWidget *) option); + e_source_set_property (source, "refresh", refresh_str); + g_free (refresh_str); +} + GtkWidget * oge_caldav (EPlugin *epl, EConfigHookItemFactoryData *data) @@ -204,11 +299,13 @@ oge_caldav (EPlugin *epl, GtkWidget *widget; GtkWidget *luser; GtkWidget *user; + GtkWidget *label, *hbox, *spin, *option, *menu; + GtkWidget *times[4]; char *uri; char *username; const char *ssl_prop; gboolean ssl_enabled; - int row; + int row, i; source = t->source; group = e_source_peek_group (source); @@ -230,10 +327,12 @@ oge_caldav (EPlugin *epl, return NULL; } - username = euri->user; + g_free (euri->user); euri->user = NULL; uri = e_uri_to_string (euri, FALSE); + username = e_source_get_duped_property (source, "username"); + ssl_prop = e_source_get_property (source, "ssl"); if (ssl_prop && ssl_prop[0] == '1') { ssl_enabled = TRUE; @@ -268,12 +367,14 @@ oge_caldav (EPlugin *epl, G_CALLBACK (location_changed), source); + row++; + cssl = gtk_check_button_new_with_mnemonic (_("Use _SSL")); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(cssl), ssl_enabled); gtk_widget_show (cssl); gtk_table_attach (GTK_TABLE (parent), cssl, 1, 2, - row + 1, row + 2, + row , row + 1, GTK_FILL, 0, 0, 0); g_signal_connect (G_OBJECT (cssl), @@ -281,19 +382,21 @@ oge_caldav (EPlugin *epl, G_CALLBACK (ssl_changed), source); + row++; + luser = gtk_label_new_with_mnemonic (_("User_name:")); gtk_widget_show (luser); gtk_misc_set_alignment (GTK_MISC (luser), 0.0, 0.5); gtk_table_attach (GTK_TABLE (parent), luser, 0, 1, - row + 2, row + 3, + row, row + 1, GTK_FILL, 0, 0, 0); user = gtk_entry_new (); gtk_widget_show (user); gtk_entry_set_text (GTK_ENTRY (user), username ? username : ""); gtk_table_attach (GTK_TABLE (parent), user, - 1, 2, row + 2, row + 3, + 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, 0, 0, 0); gtk_label_set_mnemonic_widget (GTK_LABEL (luser), user); @@ -303,10 +406,48 @@ oge_caldav (EPlugin *epl, G_CALLBACK (user_changed), source); + row++; g_free (uri); g_free (username); + /* add refresh option */ + label = gtk_label_new_with_mnemonic (_("Re_fresh:")); + gtk_widget_show (label); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + gtk_table_attach (GTK_TABLE (parent), label, 0, 1, row, row+1, GTK_FILL, 0, 0, 0); + + hbox = gtk_hbox_new (FALSE, 6); + gtk_widget_show (hbox); + + spin = gtk_spin_button_new_with_range (0, 100, 1); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), spin); + gtk_widget_show (spin); + gtk_box_pack_start (GTK_BOX (hbox), spin, FALSE, TRUE, 0); + + option = gtk_option_menu_new (); + gtk_widget_show (option); + times[0] = gtk_menu_item_new_with_label (_("minutes")); + times[1] = gtk_menu_item_new_with_label (_("hours")); + times[2] = gtk_menu_item_new_with_label (_("days")); + times[3] = gtk_menu_item_new_with_label (_("weeks")); + menu = gtk_menu_new (); + gtk_widget_show (menu); + for (i = 0; i < 4; i++) { + gtk_widget_show (times[i]); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), times[i]); + } + gtk_option_menu_set_menu (GTK_OPTION_MENU (option), menu); + set_refresh_time (source, spin, option); + gtk_box_pack_start (GTK_BOX (hbox), option, FALSE, TRUE, 0); + + g_object_set_data (G_OBJECT (option), "spin", spin); + g_signal_connect (G_OBJECT (option), "changed", G_CALLBACK (option_changed), source); + g_object_set_data (G_OBJECT (spin), "option", option); + g_signal_connect (G_OBJECT (spin), "value-changed", G_CALLBACK (spin_changed), source); + + gtk_table_attach (GTK_TABLE (parent), hbox, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, 0, 0, 0); + return widget; } diff --git a/plugins/caldav/org-gnome-evolution-caldav.eplug.xml b/plugins/caldav/org-gnome-evolution-caldav.eplug.xml index dc728f1e7f..368570d49b 100644 --- a/plugins/caldav/org-gnome-evolution-caldav.eplug.xml +++ b/plugins/caldav/org-gnome-evolution-caldav.eplug.xml @@ -17,7 +17,7 @@ id="org.gnome.evolution.calendar.calendarProperties"> <item type="item_table" - path="00.general/00.source/15.caldav" + path="00.general/00.source/99.caldav" factory="oge_caldav"/> </group> diff --git a/plugins/calendar-weather/ChangeLog b/plugins/calendar-weather/ChangeLog index 13f1f22a89..a34f5df01b 100644 --- a/plugins/calendar-weather/ChangeLog +++ b/plugins/calendar-weather/ChangeLog @@ -1,3 +1,19 @@ +2008-12-10 Suman Manjunath <msuman@novell.com> + + * Makefile.am: Don't try to specify LIBGWEATHER_(CFLAGS|LIBS), they + will be provided by configure.in. + +2008-12-03 Milan Crha <mcrha@redhat.com> + + ** Part of fix for bug #352287 + + * Makefile.am: Compile and link with libgweather. + * calendar-weather.c: (e_plugin_lib_enable), (selection_changed), + (find_location_func), (find_location), (treeview_clicked), + (create_source_selector), (build_location_path), + (location_clicked), (e_calendar_weather_location): + Use libgweather for weather calendar. + 2008-07-31 Matthew Barnes <mbarnes@redhat.com> ** Fixes part of bug #545568 diff --git a/plugins/calendar-weather/Makefile.am b/plugins/calendar-weather/Makefile.am index 8f57db1dcc..2e2be150e3 100644 --- a/plugins/calendar-weather/Makefile.am +++ b/plugins/calendar-weather/Makefile.am @@ -7,7 +7,8 @@ INCLUDES = \ $(EVOLUTION_CALENDAR_CFLAGS) \ $(SOURCE_SEL_CFLAGS) \ -DWEATHER_DATADIR=\""$(weatherdatadir)"\" \ - -DWEATHER_EDS_DATADIR=\""$(eds_datadir)/weather"\" + -DWEATHER_EDS_DATADIR=\""$(eds_datadir)/weather"\" \ + $(LIBGWEATHER_CFLAGS) @EVO_PLUGIN_RULE@ @@ -24,12 +25,12 @@ plugin_DATA = org-gnome-calendar-weather.eplug plugin_LTLIBRARIES = liborg-gnome-calendar-weather.la liborg_gnome_calendar_weather_la_SOURCES = calendar-weather.c -liborg_gnome_calendar_weather_la_LDFLAGS = -module -avoid-version $(NO_UNDEFINED) -liborg_gnome_calendar_weather_la_LIBADD = \ +liborg_gnome_calendar_weather_la_LDFLAGS = -module -avoid-version $(NO_UNDEFINED) $(LIBGWEATHER_LIBS) +liborg_gnome_calendar_weather_la_LIBADD = \ $(top_builddir)/calendar/gui/libevolution-calendar.la \ $(EVOLUTION_CALENDAR_LIBS) -EXTRA_DIST = \ +EXTRA_DIST = \ org-gnome-calendar-weather.eplug.xml \ $(weatherdata_DATA) diff --git a/plugins/calendar-weather/calendar-weather.c b/plugins/calendar-weather/calendar-weather.c index 68cac54258..a6dce31326 100644 --- a/plugins/calendar-weather/calendar-weather.c +++ b/plugins/calendar-weather/calendar-weather.c @@ -21,6 +21,7 @@ #include <gtk/gtk.h> #include <e-util/e-config.h> +#include "e-util/e-icon-factory.h" #include <calendar/gui/e-cal-config.h> #include <calendar/gui/e-cal-event.h> #include <calendar/gui/calendar-component.h> @@ -32,6 +33,11 @@ #include <libxml/tree.h> #include <string.h> +#define GWEATHER_I_KNOW_THIS_IS_UNSTABLE +#include <libgweather/weather.h> +#include <libgweather/gweather-xml.h> +#undef GWEATHER_I_KNOW_THIS_IS_UNSTABLE + 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); @@ -39,8 +45,6 @@ gboolean e_calendar_weather_check (EPlugin *epl, EConfigHookPageCheckData *dat void e_calendar_weather_migrate (EPlugin *epl, ECalEventTargetComponent *data); int e_plugin_lib_enable (EPluginLib *epl, int enable); -static GtkTreeStore *store = NULL; - #define WEATHER_BASE_URI "weather://" int @@ -48,22 +52,44 @@ e_plugin_lib_enable (EPluginLib *epl, int enable) { GList *l; gboolean found = FALSE; + const char *tmp; + + static struct { + const char *description; + const char *icon_name; + } categories[] = { + { N_("Weather: Fog"), "weather-fog" }, + { N_("Weather: Cloudy"), "weather-few-clouds" }, + { N_("Weather: Cloudy Night"), "weather-few-clouds-night" }, + { N_("Weather: Overcast"), "weather-overcast" }, + { N_("Weather: Showers"), "weather-showers" }, + { N_("Weather: Snow"), "weather-snow" }, + { N_("Weather: Sunny"), "weather-clear" }, + { N_("Weather: Clear Night"), "weather-clear-night" }, + { N_("Weather: Thunderstorms"), "weather-storm" }, + { NULL, NULL } + }; + + tmp = _(categories [0].description); /* Add the categories icons if we don't have them. */ for (l = e_categories_get_list (); l; l = g_list_next (l)) { - if (!strcmp ((const char *)l->data, _("Weather: Cloudy"))) { + if (!strcmp ((const char *)l->data, tmp)) { found = TRUE; break; } } + if (!found) { - e_categories_add (_("Weather: Cloudy"), NULL, WEATHER_DATADIR "/category_weather_cloudy_16.png", FALSE); - e_categories_add (_("Weather: Fog"), NULL, WEATHER_DATADIR "/category_weather_fog_16.png", FALSE); - e_categories_add (_("Weather: Partly Cloudy"), NULL, WEATHER_DATADIR "/category_weather_partly_cloudy_16.png", FALSE); - e_categories_add (_("Weather: Rain"), NULL, WEATHER_DATADIR "/category_weather_rain_16.png", FALSE); - e_categories_add (_("Weather: Snow"), NULL, WEATHER_DATADIR "/category_weather_snow_16.png", FALSE); - e_categories_add (_("Weather: Sunny"), NULL, WEATHER_DATADIR "/category_weather_sun_16.png", FALSE); - e_categories_add (_("Weather: Thunderstorms"), NULL, WEATHER_DATADIR "/category_weather_tstorm_16.png", FALSE); + int i; + + for (i = 0; categories[i].description; i++) { + char *filename; + + filename = e_icon_factory_get_icon_filename (categories[i].icon_name, E_ICON_SIZE_MENU); + e_categories_add (_(categories[i].description), NULL, filename, FALSE); + g_free (filename); + } } return 0; @@ -110,87 +136,15 @@ e_calendar_weather_migrate (EPlugin *epl, ECalEventTargetComponent *data) } static void -parse_subtree (GtkTreeIter *parent, xmlNode *node) -{ - GtkTreeIter iter; - xmlNode *child; - - if (node->type == XML_ELEMENT_NODE) { - gtk_tree_store_append (store, &iter, parent); - if (strcmp ((const char *)node->name, "location") == 0) { - xmlAttr *attr; - - child = node->children; - g_assert (child->type == XML_TEXT_NODE); - gtk_tree_store_set (store, &iter, 0, child->content, -1); - - for (attr = node->properties; attr; attr = attr->next) { - if (strcmp ((const char *)attr->name, "code") == 0) - gtk_tree_store_set (store, &iter, 1, attr->children->content, -1); - else if (strcmp ((const char *)attr->name, "url") == 0) - gtk_tree_store_set (store, &iter, 2, attr->children->content, -1); - else if (strcmp ((const char *)attr->name, "type") == 0) - gtk_tree_store_set (store, &iter, 3, attr->children->content, -1); - } - } else { - xmlAttr *attr; - - for (child = node->children; child; child = child->next) - parse_subtree (&iter, child); - - for (attr = node->properties; attr; attr = attr->next) - if (strcmp ((const char *)attr->name, "name") == 0) - gtk_tree_store_set (store, &iter, 0, attr->children->content, -1); - } - } -} - -static void -load_locations (void) -{ - xmlDoc *doc; - xmlNode *root, *child; - - LIBXML_TEST_VERSION - - doc = xmlParseFile (WEATHER_EDS_DATADIR "/Locations.xml"); - if (doc == NULL) { - g_warning ("failed to read locations file"); - return; - } - - if (store == NULL) - store = gtk_tree_store_new (4, - G_TYPE_STRING, /* name */ - G_TYPE_STRING, /* code */ - G_TYPE_STRING, /* URL */ - G_TYPE_STRING); /* type */ - - root = xmlDocGetRootElement (doc); - for (child = root->children; child; child = child->next) - parse_subtree (NULL, child); - xmlFreeDoc (doc); -} - -static void selection_changed (GtkTreeSelection *selection, GtkDialog *dialog) { GtkTreeModel *model; GtkTreeIter iter; if (gtk_tree_selection_get_selected (selection, &model, &iter)) { - gchar *code = NULL; - gtk_tree_model_get (model, &iter, 1, &code, -1); - if (code != NULL) { - gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, TRUE); - } else { - GtkTreeView *view = gtk_tree_selection_get_tree_view (selection); - GtkTreePath *path; - path = gtk_tree_model_get_path (model, &iter); - gtk_tree_view_expand_row (view, path, FALSE); - gtk_tree_path_free (path); - gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, FALSE); - } + WeatherLocation *loc = NULL; + gtk_tree_model_get (model, &iter, GWEATHER_XML_COL_POINTER, &loc, -1); + gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, loc != NULL); } else { gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, FALSE); } @@ -198,6 +152,7 @@ selection_changed (GtkTreeSelection *selection, GtkDialog *dialog) static struct { + gboolean is_old; gchar **ids; GtkTreeIter *result; } find_data; @@ -205,13 +160,13 @@ static struct static gboolean find_location_func (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *node, gpointer data) { - gchar *type, *code, *name; - gtk_tree_model_get (model, node, 0, &name, 1, &code, 3, &type, -1); - if (name == NULL || code == NULL || type == NULL) + WeatherLocation *wl = NULL; + + gtk_tree_model_get (model, node, GWEATHER_XML_COL_POINTER, &wl, -1); + if (!wl || !wl->name || !wl->code) return FALSE; - if ((!strcmp (type, find_data.ids[0])) && - (!strcmp (code, find_data.ids[1])) && - (!strcmp (name, find_data.ids[2]))) { + if (((!strcmp (wl->code, find_data.ids[0])) || (find_data.is_old && !strcmp (wl->code + 1, find_data.ids[0]))) && + (!strcmp (wl->name, find_data.ids[1]))) { find_data.result = gtk_tree_iter_copy (node); return TRUE; } @@ -219,12 +174,18 @@ find_location_func (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *node, g } static GtkTreeIter * -find_location (gchar *relative_url) +find_location (GtkTreeModel *model, gchar *relative_url) { - /* type/code/name */ + /* old URL uses type/code/name, but new uses only code/name */ + if (strncmp (relative_url, "ccf/", 4) == 0) { + relative_url = relative_url + 4; + find_data.is_old = TRUE; + } else + find_data.is_old = FALSE; + find_data.ids = g_strsplit (relative_url, "/", -1); find_data.result = NULL; - gtk_tree_model_foreach (GTK_TREE_MODEL (store), (GtkTreeModelForeachFunc) find_location_func, NULL); + gtk_tree_model_foreach (model, (GtkTreeModelForeachFunc) find_location_func, NULL); g_strfreev (find_data.ids); return find_data.result; @@ -239,9 +200,9 @@ treeview_clicked (GtkTreeView *treeview, GdkEventButton *event, GtkDialog *dialo GtkTreeIter iter; if (gtk_tree_selection_get_selected (selection, &model, &iter)) { - gchar *code = NULL; - gtk_tree_model_get (model, &iter, 1, &code, -1); - if (code != NULL) { + WeatherLocation *wl = NULL; + gtk_tree_model_get (model, &iter, GWEATHER_XML_COL_POINTER, &wl, -1); + if (wl != NULL && wl->code != NULL && wl->name != NULL) { gtk_dialog_response (dialog, GTK_RESPONSE_OK); return TRUE; } @@ -250,6 +211,8 @@ treeview_clicked (GtkTreeView *treeview, GdkEventButton *event, GtkDialog *dialo return FALSE; } +static GtkTreeModel *store = NULL; + static GtkDialog * create_source_selector (ESource *source) { @@ -274,7 +237,7 @@ create_source_selector (ESource *source) scrolledwindow = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); gtk_widget_show (scrolledwindow); - treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store)); + treeview = gtk_tree_view_new_with_model (store); gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview), FALSE); gtk_widget_show (treeview); gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (scrolledwindow), treeview); @@ -286,7 +249,7 @@ create_source_selector (ESource *source) uri_text = e_source_get_uri (source); uri = e_uri_new (uri_text); if (uri->path && strlen (uri->path)) { - GtkTreeIter *iter = find_location (uri_text + 10); + GtkTreeIter *iter = find_location (store, uri_text + 10); GtkTreePath *path = gtk_tree_model_get_path (GTK_TREE_MODEL (store), iter); gtk_tree_view_expand_to_path (GTK_TREE_VIEW (treeview), path); gtk_tree_selection_select_path (selection, path); @@ -317,11 +280,11 @@ build_location_path (GtkTreeIter *iter) GtkTreeIter parent; gchar *path, *temp1, *temp2; - gtk_tree_model_get (GTK_TREE_MODEL (store), iter, 0, &temp1, -1); + gtk_tree_model_get (GTK_TREE_MODEL (store), iter, GWEATHER_XML_COL_LOC, &temp1, -1); path = g_strdup (temp1); while (gtk_tree_model_iter_parent (GTK_TREE_MODEL (store), &parent, iter)) { - gtk_tree_model_get (GTK_TREE_MODEL (store), &parent, 0, &temp1, -1); + gtk_tree_model_get (GTK_TREE_MODEL (store), &parent, GWEATHER_XML_COL_LOC, &temp1, -1); temp2 = g_strdup_printf ("%s : %s", temp1, path); g_free (path); path = temp2; @@ -347,17 +310,17 @@ location_clicked (GtkButton *button, ESource *source) GtkTreeModel *model; GtkTreeIter iter; GtkWidget *label; - gchar *type, *code, *name; + WeatherLocation *wl = NULL; gchar *path, *uri; gtk_tree_selection_get_selected (selection, &model, &iter); - gtk_tree_model_get (model, &iter, 0, &name, 1, &code, 3, &type, -1); + gtk_tree_model_get (model, &iter, GWEATHER_XML_COL_POINTER, &wl, -1); path = build_location_path (&iter); label = gtk_bin_get_child (GTK_BIN (button)); gtk_label_set_text (GTK_LABEL (label), path); - uri = g_strdup_printf ("%s/%s/%s", type, code, name); + uri = g_strdup_printf ("%s/%s", wl->code, wl->name); /* FIXME - url_encode (&uri); */ e_source_set_relative_uri (source, uri); g_free (uri); @@ -387,7 +350,7 @@ e_calendar_weather_location (EPlugin *epl, EConfigHookItemFactoryData *data) static GtkWidget *hidden; if (store == NULL) - load_locations (); + store = gweather_xml_load_locations (); if (!hidden) hidden = gtk_label_new (""); @@ -416,7 +379,7 @@ e_calendar_weather_location (EPlugin *epl, EConfigHookItemFactoryData *data) gtk_widget_show (button); if (uri->path && strlen (uri->path)) { - GtkTreeIter *iter = find_location (uri_text + 10); + GtkTreeIter *iter = find_location (store, uri_text + 10); gchar *location = build_location_path (iter); text = gtk_label_new (location); g_free (location); diff --git a/plugins/exchange-operations/ChangeLog b/plugins/exchange-operations/ChangeLog index 0d526d6245..34dc1f3aa0 100644 --- a/plugins/exchange-operations/ChangeLog +++ b/plugins/exchange-operations/ChangeLog @@ -1,3 +1,20 @@ +2008-12-08 Bharath Acharya <abharath@novell.com> + + ** Fix for bug #558498 + + * exchange-account-setup.c: (org_gnome_exchange_settings), + (destroy_oof_data), (org_gnome_exchange_commit): + * org-gnome-exchange-operations.error.xml:Check for the offline status + before setting up the Exchange settings. + +2008-12-02 Milan Crha <mcrha@redhat.com> + + ** Part of fix for bug #562228 + + * exchange-account-setup.c: (want_mailbox_toggled), + (org_gnome_exchange_owa_url): + Make it clearer the mailbox entry is optional. + 2008-10-22 Bharath Acharya <abharath@novell.com> ** Fix for bug #557246 diff --git a/plugins/exchange-operations/exchange-account-setup.c b/plugins/exchange-operations/exchange-account-setup.c index 275a214b90..5b3d0b9653 100644 --- a/plugins/exchange-operations/exchange-account-setup.c +++ b/plugins/exchange-operations/exchange-account-setup.c @@ -181,6 +181,7 @@ org_gnome_exchange_settings(EPlugin *epl, EConfigHookItemFactoryData *data) const char *source_url; char *message = NULL, *txt = NULL, *oof_message; gboolean oof_state = FALSE; + gint offline_status; GtkVBox *vbox_settings; @@ -234,6 +235,14 @@ org_gnome_exchange_settings(EPlugin *epl, EConfigHookItemFactoryData *data) account = exchange_operations_get_exchange_account (); + exchange_config_listener_get_offline_status (exchange_global_config_listener, + &offline_status); + if (offline_status == OFFLINE_MODE) { + e_error_run (NULL, ERROR_DOMAIN ":exchange-settings-offline", NULL); + + return NULL; + } + oof_data = g_new0 (OOFData, 1); oof_data->state = FALSE; @@ -613,6 +622,30 @@ mailbox_editor_entry_changed (GtkWidget *entry, EConfig *config) update_mailbox_param_in_url (target->account, E_ACCOUNT_TRANSPORT_URL, mailbox); } +static void +want_mailbox_toggled (GtkWidget *toggle, EConfig *config) +{ + GtkWidget *entry; + + g_return_if_fail (toggle != NULL); + g_return_if_fail (config != NULL); + + entry = g_object_get_data (G_OBJECT (toggle), "mailbox-entry"); + if (entry) { + gboolean is_active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (toggle)); + EMConfigTargetAccount *target; + const char *mailbox; + + gtk_widget_set_sensitive (entry, is_active); + + target = (EMConfigTargetAccount *)config->target; + mailbox = gtk_entry_get_text (GTK_ENTRY (entry)); + + update_mailbox_param_in_url (target->account, E_ACCOUNT_SOURCE_URL, is_active ? mailbox : NULL); + update_mailbox_param_in_url (target->account, E_ACCOUNT_TRANSPORT_URL, is_active ? mailbox : NULL); + } +} + static char * construct_owa_url (CamelURL *url) { @@ -645,8 +678,8 @@ org_gnome_exchange_owa_url(EPlugin *epl, EConfigHookItemFactoryData *data) { EMConfigTargetAccount *target_account; const char *source_url; - char *owa_url = NULL, *mailbox_name; - GtkWidget *owa_entry, *mailbox_entry; + char *owa_url = NULL, *mailbox_name, *username; + GtkWidget *owa_entry, *mailbox_entry, *want_mailbox_check; CamelURL *url; int row; GtkWidget *hbox, *label, *button; @@ -679,6 +712,7 @@ org_gnome_exchange_owa_url(EPlugin *epl, EConfigHookItemFactoryData *data) owa_url = g_strdup (camel_url_get_param(url, "owa_url")); mailbox_name = g_strdup (camel_url_get_param (url, "mailbox")); + username = g_strdup (url->user); /* if the host is null, then user+other info is dropped silently, force it to be kept */ if (url->host == NULL) { @@ -740,6 +774,19 @@ org_gnome_exchange_owa_url(EPlugin *epl, EConfigHookItemFactoryData *data) owa_editor_entry_changed (owa_entry, data->config); row++; + want_mailbox_check = gtk_check_button_new_with_mnemonic (_("S_pecify the mailbox name")); + gtk_widget_show (want_mailbox_check); + gtk_table_attach (GTK_TABLE (data->parent), want_mailbox_check, 1, 2, row, row+1, GTK_FILL, GTK_FILL, 0, 0); + if (!username || !*username || !mailbox_name || !*mailbox_name || + g_ascii_strcasecmp (username, mailbox_name) == 0 || + (strchr (username, '/') && g_ascii_strcasecmp (strchr (username, '/') + 1, mailbox_name) == 0)) { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (want_mailbox_check), FALSE); + } else { + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (want_mailbox_check), TRUE); + } + g_signal_connect (want_mailbox_check, "toggled", G_CALLBACK (want_mailbox_toggled), data->config); + + row++; label = gtk_label_new_with_mnemonic (_("_Mailbox:")); gtk_widget_show (label); @@ -750,14 +797,18 @@ org_gnome_exchange_owa_url(EPlugin *epl, EConfigHookItemFactoryData *data) gtk_label_set_mnemonic_widget (GTK_LABEL (label), mailbox_entry); + gtk_widget_set_sensitive (mailbox_entry, gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (want_mailbox_check))); + g_signal_connect (mailbox_entry, "changed", G_CALLBACK (mailbox_editor_entry_changed), data->config); g_object_set_data (G_OBJECT (button), "mailbox-entry", mailbox_entry); + g_object_set_data (G_OBJECT (want_mailbox_check), "mailbox-entry", mailbox_entry); gtk_table_attach (GTK_TABLE (data->parent), label, 0, 1, row, row+1, 0, 0, 0, 0); gtk_table_attach (GTK_TABLE (data->parent), mailbox_entry, 1, 2, row, row+1, GTK_FILL|GTK_EXPAND, GTK_FILL, 0, 0); g_free (owa_url); g_free (mailbox_name); + g_free (username); return hbox; } @@ -815,7 +866,8 @@ destroy_oof_data (void) { if (oof_data->message) g_free (oof_data->message); - g_free (oof_data); + if (oof_data) + g_free (oof_data); } void @@ -824,6 +876,7 @@ org_gnome_exchange_commit (EPlugin *epl, EConfigHookItemFactoryData *data) EMConfigTargetAccount *target_account; const char *source_url; CamelURL *url; + gint offline_status; target_account = (EMConfigTargetAccount *)data->config->target; source_url = e_account_get_string (target_account->account, E_ACCOUNT_SOURCE_URL); @@ -844,6 +897,14 @@ org_gnome_exchange_commit (EPlugin *epl, EConfigHookItemFactoryData *data) } camel_url_free (url); + + exchange_config_listener_get_offline_status (exchange_global_config_listener, + &offline_status); + + if (offline_status == OFFLINE_MODE) { + return; + } + /* Set oof data in exchange account */ set_oof_info (); destroy_oof_data (); diff --git a/plugins/exchange-operations/org-gnome-exchange-operations.error.xml b/plugins/exchange-operations/org-gnome-exchange-operations.error.xml index c162f365ec..37ed0aa318 100644 --- a/plugins/exchange-operations/org-gnome-exchange-operations.error.xml +++ b/plugins/exchange-operations/org-gnome-exchange-operations.error.xml @@ -48,6 +48,11 @@ <_secondary>Cannot display folders.</_secondary> </error> + <error id="exchange-settings-offline" type="info"> + <_primary>Exchange Account is offline.</_primary> + <_secondary>Cannot access the "Exchange settings" tab in offline mode.</_secondary> + </error> + <error id="account-offline-generic" type="info"> <_primary>Exchange Account is offline.</_primary> <_secondary>Cannot perform the operation.</_secondary> diff --git a/plugins/itip-formatter/ChangeLog b/plugins/itip-formatter/ChangeLog index 966cc611e7..c04825312f 100644 --- a/plugins/itip-formatter/ChangeLog +++ b/plugins/itip-formatter/ChangeLog @@ -1,3 +1,11 @@ +2008-11-28 Suman Manjunath <msuman@novell.com> + + ** Fix for bug #561467 + + * itip-formatter.c (update_x), (update_attendee_status): Copy + required X-* properties . This might be needed for special cases + in certain backends. + 2008-11-06 Patrick Ohly <patrick.ohly@gmx.de> ** Fix for bug #541121 diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index ae7190174b..61d2234bd8 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -1186,6 +1186,26 @@ remove_delegate (struct _itip_puri *pitip, const char *delegate, const char *del } +static void +update_x (ECalComponent *pitip_comp, ECalComponent *comp) +{ + icalcomponent *itip_icalcomp = e_cal_component_get_icalcomponent (pitip_comp); + icalcomponent *icalcomp = e_cal_component_get_icalcomponent (comp); + + icalproperty *prop = icalcomponent_get_first_property (itip_icalcomp, ICAL_X_PROPERTY); + while (prop) { + const char *name = icalproperty_get_x_name (prop); + if (!g_ascii_strcasecmp (name, "X-EVOLUTION-IS-REPLY")) { + icalproperty *new_prop = icalproperty_new_x (icalproperty_get_x (prop)); + icalproperty_set_x_name (new_prop, "X-EVOLUTION-IS-REPLY"); + icalcomponent_add_property (icalcomp, new_prop); + } + prop = icalcomponent_get_next_property (itip_icalcomp, ICAL_X_PROPERTY); + } + + e_cal_component_set_icalcomponent (comp, icalcomp); +} + static void update_attendee_status (struct _itip_puri *pitip) { @@ -1286,6 +1306,8 @@ update_attendee_status (struct _itip_puri *pitip) } } + update_x (pitip->comp, comp); + if (itip_view_get_update (ITIP_VIEW (pitip->view))) { e_cal_component_commit_sequence (comp); itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp, pitip->current_ecal, NULL, NULL, NULL); diff --git a/plugins/mailing-list-actions/ChangeLog b/plugins/mailing-list-actions/ChangeLog index 066bf2bda1..f53e9e3961 100644 --- a/plugins/mailing-list-actions/ChangeLog +++ b/plugins/mailing-list-actions/ChangeLog @@ -1,3 +1,9 @@ +2008-12-08 Jennifer Newman <jennifer.newman@tufts.edu> + + ** Fix for bug #549964 + + * org-gnome-mailing-list-actions.error.xml: Fix for an erroneous string + 2008-09-04 Sankar P <psankar@novell.com> License Changes diff --git a/plugins/mailing-list-actions/org-gnome-mailing-list-actions.error.xml b/plugins/mailing-list-actions/org-gnome-mailing-list-actions.error.xml index a48d5c17b6..d0b860741c 100644 --- a/plugins/mailing-list-actions/org-gnome-mailing-list-actions.error.xml +++ b/plugins/mailing-list-actions/org-gnome-mailing-list-actions.error.xml @@ -30,7 +30,7 @@ Header: {1}</_secondary> <error id="no-action" type="error"> <_primary>No e-mail action</_primary> - <_secondary xml:space="preserve">The action could not be performed. This means the header for this action did not contain any action we could process. + <_secondary xml:space="preserve">The action could not be performed. The header for this action did not contain any action that could be processed. Header: {0}</_secondary> </error> diff --git a/plugins/sa-junk-plugin/ChangeLog b/plugins/sa-junk-plugin/ChangeLog index badfbb83ff..46f51c7003 100644 --- a/plugins/sa-junk-plugin/ChangeLog +++ b/plugins/sa-junk-plugin/ChangeLog @@ -1,3 +1,12 @@ +2008-12-03 Matthew Barnes <mbarnes@redhat.com> + + ** Fixes bug #560420 (patch by hp@syntomax.com) + + * em-junk-filter.c (pipe_to_sa_full): + spamc and spamassassin use error codes >= 64 to denote execution + errors. Positive error codes < 64 means the message was identified + as spam. + 2008-09-29 Sankar P <psankar@novell.com> License Changes diff --git a/plugins/sa-junk-plugin/em-junk-filter.c b/plugins/sa-junk-plugin/em-junk-filter.c index 1a442b42aa..4cb554eb17 100644 --- a/plugins/sa-junk-plugin/em-junk-filter.c +++ b/plugins/sa-junk-plugin/em-junk-filter.c @@ -250,7 +250,7 @@ pipe_to_sa_full (CamelMimeMessage *msg, const char *in, char **argv, int rv_err, else res = rv_err; - if (res != 0) + if (res >= 64) g_set_error (error, EM_JUNK_ERROR, res, _("Pipe to SpamAssassin failed, error code: %d"), res); return res; |