- Revise patch for GNOME bug #417999 to fix GNOME bug #447591 (Automatic

Contacts combo boxes don't work).
This commit is contained in:
Matthew Barnes 2007-08-21 02:45:51 +00:00
parent d72a1441ed
commit 32042447a8
2 changed files with 183 additions and 30 deletions

View File

@ -1,5 +1,5 @@
--- evolution-2.11.90/widgets/misc/e-pilot-settings.c.e-source-combo-box 2007-07-05 02:11:06.000000000 -0400
+++ evolution-2.11.90/widgets/misc/e-pilot-settings.c 2007-08-15 13:42:01.000000000 -0400
+++ evolution-2.11.90/widgets/misc/e-pilot-settings.c 2007-08-20 21:59:26.000000000 -0400
@@ -27,7 +27,7 @@
#include <gtk/gtk.h>
@ -41,7 +41,7 @@
gboolean
--- evolution-2.11.90/plugins/itip-formatter/itip-formatter.c.e-source-combo-box 2007-08-09 02:46:59.000000000 -0400
+++ evolution-2.11.90/plugins/itip-formatter/itip-formatter.c 2007-08-15 13:42:01.000000000 -0400
+++ evolution-2.11.90/plugins/itip-formatter/itip-formatter.c 2007-08-20 21:59:26.000000000 -0400
@@ -40,7 +40,7 @@
#include <camel/camel-store.h>
#include <libecal/e-cal.h>
@ -52,7 +52,7 @@
#include <gtkhtml/gtkhtml-embedded.h>
#include <mail/em-format-hook.h>
--- evolution-2.11.90/plugins/itip-formatter/itip-view.c.e-source-combo-box 2007-07-28 15:37:56.000000000 -0400
+++ evolution-2.11.90/plugins/itip-formatter/itip-view.c 2007-08-15 13:42:01.000000000 -0400
+++ evolution-2.11.90/plugins/itip-formatter/itip-view.c 2007-08-20 21:59:26.000000000 -0400
@@ -35,7 +35,7 @@
#include <camel/camel-mime-message.h>
#include <libedataserver/e-time-utils.h>
@ -178,7 +178,7 @@
void
--- evolution-2.11.90/plugins/bbdb/gaimbuddies.c.e-source-combo-box 2007-08-09 02:46:58.000000000 -0400
+++ evolution-2.11.90/plugins/bbdb/gaimbuddies.c 2007-08-15 13:42:01.000000000 -0400
+++ evolution-2.11.90/plugins/bbdb/gaimbuddies.c 2007-08-20 21:59:26.000000000 -0400
@@ -44,7 +44,7 @@
#include <string.h>
@ -189,7 +189,7 @@
#include <sys/time.h>
#include <sys/stat.h>
--- evolution-2.11.90/plugins/bbdb/bbdb.c.e-source-combo-box 2007-08-09 02:46:58.000000000 -0400
+++ evolution-2.11.90/plugins/bbdb/bbdb.c 2007-08-15 13:42:01.000000000 -0400
+++ evolution-2.11.90/plugins/bbdb/bbdb.c 2007-08-20 21:59:26.000000000 -0400
@@ -40,7 +40,7 @@
#include <string.h>
@ -199,17 +199,93 @@
#include <e-util/e-config.h>
#include <mail/em-config.h>
@@ -345,7 +345,8 @@ enable_toggled_cb (GtkWidget *widget, gp
@@ -71,10 +71,49 @@ static gboolean bbdb_timeout (gpointer d
static void bbdb_do_it (EBook *book, const char *name, const char *email);
static void add_email_to_contact (EContact *contact, const char *email);
static void enable_toggled_cb (GtkWidget *widget, gpointer data);
-static void source_changed_cb (GtkWidget *widget, ESource *source, gpointer data);
+static void source_changed_cb (ESourceComboBox *source_combo_box, struct bbdb_stuff *stuff);
static GtkWidget *create_addressbook_option_menu (struct bbdb_stuff *stuff, int type);
static void cleanup_cb (GObject *o, gpointer data);
+static ESource *
+find_esource_by_uri (ESourceList *source_list, const gchar *target_uri)
+{
+ GSList *groups;
+
+ /* XXX This would be unnecessary if the plugin had stored
+ * the addressbook's UID instead of the URI in GConf.
+ * Too late to change it now, I suppose. */
+
+ if (source_list == NULL || target_uri == NULL)
+ return NULL;
+
+ groups = e_source_list_peek_groups (source_list);
+
+ while (groups != NULL) {
+ GSList *sources;
+
+ sources = e_source_group_peek_sources (groups->data);
+
+ while (sources != NULL) {
+ gchar *uri;
+ gboolean match;
+
+ uri = e_source_get_uri (sources->data);
+ match = (strcmp (uri, target_uri) == 0);
+ g_free (uri);
+
+ if (match)
+ return sources->data;
+
+ sources = g_slist_next (sources);
+ }
+
+ groups = g_slist_next (groups);
+ }
+
+ return NULL;
+}
+
int
e_plugin_lib_enable (EPluginLib *ep, int enable)
{
@@ -266,8 +305,6 @@ bbdb_open_addressbook (int type)
char *uri;
EBook *book = NULL;
- gboolean enable;
-
gboolean status;
GError *error = NULL;
@@ -345,8 +382,23 @@ enable_toggled_cb (GtkWidget *widget, gp
gtk_widget_set_sensitive (stuff->option_menu, active);
if (active && !gconf_client_get_string (stuff->target->gconf, GCONF_KEY_WHICH_ADDRESSBOOK, NULL)) {
- selected_source = e_source_option_menu_peek_selected (E_SOURCE_OPTION_MENU (stuff->option_menu));
- gconf_client_set_string (stuff->target->gconf, GCONF_KEY_WHICH_ADDRESSBOOK, e_source_get_uri (selected_source), NULL);
+ const gchar *uri = NULL;
+ GError *error = NULL;
+
+ selected_source = e_source_combo_box_get_active (
+ E_SOURCE_COMBO_BOX (stuff->option_menu));
gconf_client_set_string (stuff->target->gconf, GCONF_KEY_WHICH_ADDRESSBOOK, e_source_get_uri (selected_source), NULL);
+ if (selected_source != NULL)
+ uri = e_source_get_uri (selected_source);
+
+ gconf_client_set_string (
+ stuff->target->gconf,
+ GCONF_KEY_WHICH_ADDRESSBOOK,
+ uri, &error);
+
+ if (error != NULL) {
+ g_warning ("%s", error->message);
+ g_error_free (error);
+ }
}
}
@@ -364,7 +365,8 @@ enable_gaim_toggled_cb (GtkWidget *widge
@@ -364,7 +416,8 @@ enable_gaim_toggled_cb (GtkWidget *widge
gtk_widget_set_sensitive (stuff->gaim_option_menu, active);
if (active && !gconf_client_get_string (stuff->target->gconf, GCONF_KEY_WHICH_ADDRESSBOOK_GAIM, NULL)) {
@ -219,15 +295,67 @@
gconf_client_set_string (stuff->target->gconf, GCONF_KEY_WHICH_ADDRESSBOOK_GAIM, e_source_get_uri (selected_source), NULL);
}
}
@@ -393,31 +395,32 @@ gaim_source_changed_cb (GtkWidget *widge
@@ -376,48 +429,77 @@ synchronize_button_clicked_cb (GtkWidget
}
static void
-source_changed_cb (GtkWidget *widget, ESource *source, gpointer data)
+source_changed_cb (ESourceComboBox *source_combo_box,
+ struct bbdb_stuff *stuff)
{
- struct bbdb_stuff *stuff = (struct bbdb_stuff *) data;
-
- gconf_client_set_string (stuff->target->gconf, GCONF_KEY_WHICH_ADDRESSBOOK, e_source_get_uri (source), NULL);
+ ESource *source;
+ GError *error = NULL;
+
+ source = e_source_combo_box_get_active (source_combo_box);
+ g_return_if_fail (source != NULL);
+
+ gconf_client_set_string (
+ stuff->target->gconf,
+ GCONF_KEY_WHICH_ADDRESSBOOK,
+ e_source_get_uri (source), &error);
+
+ if (error != NULL) {
+ g_warning ("%s", error->message);
+ g_error_free (error);
+ }
}
static void
-gaim_source_changed_cb (GtkWidget *widget, ESource *source, gpointer data)
+gaim_source_changed_cb (ESourceComboBox *source_combo_box,
+ struct bbdb_stuff *stuff)
{
- struct bbdb_stuff *stuff = (struct bbdb_stuff *) data;
- gconf_client_set_string (stuff->target->gconf, GCONF_KEY_WHICH_ADDRESSBOOK_GAIM, e_source_get_uri (source), NULL);
+ ESource *source;
+ GError *error = NULL;
+
+ source = e_source_combo_box_get_active (source_combo_box);
+ g_return_if_fail (source != NULL);
+
+ gconf_client_set_string (
+ stuff->target->gconf,
+ GCONF_KEY_WHICH_ADDRESSBOOK_GAIM,
+ e_source_get_uri (source), &error);
+
+ if (error != NULL) {
+ g_warning ("%s", error->message);
+ g_error_free (error);
+ }
}
static GtkWidget *
create_addressbook_option_menu (struct bbdb_stuff *stuff, int type)
{
- GtkWidget *menu;
+ GtkWidget *combo_box;
ESourceList *source_list;
char *selected_source_uri;
- ESource *selected_source;
- char *selected_source_uri;
ESource *selected_source;
+ char *selected_source_uri;
GConfClient *gconf = stuff->target->gconf;
@ -239,15 +367,18 @@
selected_source_uri = gconf_client_get_string (gconf, GCONF_KEY_WHICH_ADDRESSBOOK_GAIM, NULL);
else
selected_source_uri = gconf_client_get_string (gconf, GCONF_KEY_WHICH_ADDRESSBOOK, NULL);
if (selected_source_uri != NULL) {
- if (selected_source_uri != NULL) {
- selected_source = e_source_new_with_absolute_uri ("", selected_source_uri);
- e_source_option_menu_select (E_SOURCE_OPTION_MENU (menu), selected_source);
- g_free (selected_source_uri);
- }
+ selected_source = find_esource_by_uri (
+ source_list, selected_source_uri);
+ g_free (selected_source_uri);
+
+ if (selected_source != NULL)
+ e_source_combo_box_set_active (
+ E_SOURCE_COMBO_BOX (combo_box),
+ e_source_new_with_absolute_uri (
+ "", selected_source_uri));
g_free (selected_source_uri);
}
+ E_SOURCE_COMBO_BOX (combo_box), selected_source);
- gtk_widget_show (menu);
+ gtk_widget_show (combo_box);
@ -259,8 +390,26 @@
}
GtkWidget *
@@ -483,7 +565,7 @@ bbdb_page_factory (EPlugin *ep, EConfigH
/* Source selection option menu */
option = create_addressbook_option_menu (stuff, AUTOMATIC_CONTACTS_ADDRESSBOOK);
- g_signal_connect (option, "source_selected", G_CALLBACK (source_changed_cb), stuff);
+ g_signal_connect (option, "changed", G_CALLBACK (source_changed_cb), stuff);
gtk_widget_set_sensitive (option, gconf_client_get_bool (target->gconf, GCONF_KEY_ENABLE, NULL));
gtk_box_pack_start (GTK_BOX (inner_vbox), option, FALSE, FALSE, 0);
stuff->option_menu = option;
@@ -519,7 +601,7 @@ bbdb_page_factory (EPlugin *ep, EConfigH
/* Gaim Source Selection Option Menu */
gaim_option = create_addressbook_option_menu (stuff, GAIM_ADDRESSBOOK);
- g_signal_connect (gaim_option, "source_selected", G_CALLBACK (gaim_source_changed_cb), stuff);
+ g_signal_connect (gaim_option, "changed", G_CALLBACK (gaim_source_changed_cb), stuff);
gtk_widget_set_sensitive (gaim_option, gconf_client_get_bool (target->gconf, GCONF_KEY_ENABLE_GAIM, NULL));
gtk_box_pack_start (GTK_BOX (inner_vbox), gaim_option, FALSE, FALSE, 0);
stuff->gaim_option_menu = gaim_option;
--- evolution-2.11.90/addressbook/gui/contact-list-editor/contact-list-editor.glade.e-source-combo-box 2007-07-05 02:06:54.000000000 -0400
+++ evolution-2.11.90/addressbook/gui/contact-list-editor/contact-list-editor.glade 2007-08-15 13:42:01.000000000 -0400
+++ evolution-2.11.90/addressbook/gui/contact-list-editor/contact-list-editor.glade 2007-08-20 21:59:26.000000000 -0400
@@ -158,9 +158,9 @@
</child>
@ -274,7 +423,7 @@
<property name="int2">0</property>
<property name="last_modification_time">Tue, 01 Jun 2004 18:22:38 GMT</property>
--- evolution-2.11.90/addressbook/gui/contact-list-editor/e-contact-list-editor.c.e-source-combo-box 2007-07-05 02:06:54.000000000 -0400
+++ evolution-2.11.90/addressbook/gui/contact-list-editor/e-contact-list-editor.c 2007-08-15 13:42:01.000000000 -0400
+++ evolution-2.11.90/addressbook/gui/contact-list-editor/e-contact-list-editor.c 2007-08-20 21:59:26.000000000 -0400
@@ -33,7 +33,7 @@
#include <gtk/gtktogglebutton.h>
#include <gtk/gtkdialog.h>
@ -391,7 +540,7 @@
gtk_widget_set_sensitive (glade_xml_get_widget (editor->gui, "source-label"), editor->is_new_list);
}
--- evolution-2.11.90/addressbook/gui/contact-editor/contact-editor.glade.e-source-combo-box 2007-07-08 22:46:43.000000000 -0400
+++ evolution-2.11.90/addressbook/gui/contact-editor/contact-editor.glade 2007-08-15 13:42:01.000000000 -0400
+++ evolution-2.11.90/addressbook/gui/contact-editor/contact-editor.glade 2007-08-20 21:59:26.000000000 -0400
@@ -356,9 +356,9 @@
</child>
@ -405,7 +554,7 @@
<property name="int2">0</property>
<property name="last_modification_time">Tue, 13 Apr 2004 20:47:50 GMT</property>
--- evolution-2.11.90/addressbook/gui/contact-editor/e-contact-editor.c.e-source-combo-box 2007-08-09 02:46:47.000000000 -0400
+++ evolution-2.11.90/addressbook/gui/contact-editor/e-contact-editor.c 2007-08-15 13:42:01.000000000 -0400
+++ evolution-2.11.90/addressbook/gui/contact-editor/e-contact-editor.c 2007-08-20 21:59:26.000000000 -0400
@@ -46,7 +46,7 @@
#include <text/e-entry.h>
@ -519,7 +668,7 @@
+ return combo_box;
}
--- evolution-2.11.90/addressbook/gui/contact-editor/e-contact-quick-add.c.e-source-combo-box 2007-07-28 15:38:05.000000000 -0400
+++ evolution-2.11.90/addressbook/gui/contact-editor/e-contact-quick-add.c 2007-08-15 13:42:01.000000000 -0400
+++ evolution-2.11.90/addressbook/gui/contact-editor/e-contact-quick-add.c 2007-08-20 21:59:26.000000000 -0400
@@ -37,7 +37,7 @@
#include <libgnomeui/gnome-app.h>
#include <libebook/e-book.h>
@ -569,7 +718,7 @@
g_object_unref (source_list);
--- evolution-2.11.90/calendar/gui/dialogs/memo-page.glade.e-source-combo-box 2007-08-13 06:41:54.000000000 -0400
+++ evolution-2.11.90/calendar/gui/dialogs/memo-page.glade 2007-08-15 13:42:01.000000000 -0400
+++ evolution-2.11.90/calendar/gui/dialogs/memo-page.glade 2007-08-20 21:59:26.000000000 -0400
@@ -194,7 +194,7 @@
<child>
<widget class="Custom" id="source">
@ -580,7 +729,7 @@
<property name="int2">0</property>
<property name="last_modification_time">Tue, 13 Jan 2004 22:00:00 GMT</property>
--- evolution-2.11.90/calendar/gui/dialogs/event-page.glade.e-source-combo-box 2007-08-13 06:41:54.000000000 -0400
+++ evolution-2.11.90/calendar/gui/dialogs/event-page.glade 2007-08-15 13:42:01.000000000 -0400
+++ evolution-2.11.90/calendar/gui/dialogs/event-page.glade 2007-08-20 21:59:26.000000000 -0400
@@ -827,7 +827,7 @@
<child>
<widget class="Custom" id="source">
@ -591,7 +740,7 @@
<property name="int2">0</property>
<property name="last_modification_time">Wed, 17 Dec 2003 18:20:26 GMT</property>
--- evolution-2.11.90/calendar/gui/dialogs/task-page.glade.e-source-combo-box 2007-08-13 06:41:54.000000000 -0400
+++ evolution-2.11.90/calendar/gui/dialogs/task-page.glade 2007-08-15 13:42:01.000000000 -0400
+++ evolution-2.11.90/calendar/gui/dialogs/task-page.glade 2007-08-20 21:59:26.000000000 -0400
@@ -671,7 +671,7 @@
<widget class="Custom" id="source">
<property name="height_request">24</property>
@ -602,7 +751,7 @@
<property name="int2">0</property>
<property name="last_modification_time">Thu, 18 Dec 2003 01:58:48 GMT</property>
--- evolution-2.11.90/calendar/gui/dialogs/memo-page.c.e-source-combo-box 2007-08-13 06:41:54.000000000 -0400
+++ evolution-2.11.90/calendar/gui/dialogs/memo-page.c 2007-08-15 13:42:01.000000000 -0400
+++ evolution-2.11.90/calendar/gui/dialogs/memo-page.c 2007-08-20 21:59:26.000000000 -0400
@@ -35,7 +35,7 @@
#include <gtk/gtkmessagedialog.h>
#include <glib/gi18n.h>
@ -703,7 +852,7 @@
+ return combo_box;
}
--- evolution-2.11.90/calendar/gui/dialogs/event-page.c.e-source-combo-box 2007-08-13 06:41:54.000000000 -0400
+++ evolution-2.11.90/calendar/gui/dialogs/event-page.c 2007-08-15 13:42:59.000000000 -0400
+++ evolution-2.11.90/calendar/gui/dialogs/event-page.c 2007-08-20 21:59:26.000000000 -0400
@@ -33,7 +33,7 @@
#include <gdk/gdkkeysyms.h>
#include <glib/gi18n.h>
@ -816,7 +965,7 @@
GtkWidget *make_status_icons (void);
--- evolution-2.11.90/calendar/gui/dialogs/task-page.c.e-source-combo-box 2007-08-13 06:41:54.000000000 -0400
+++ evolution-2.11.90/calendar/gui/dialogs/task-page.c 2007-08-15 13:42:01.000000000 -0400
+++ evolution-2.11.90/calendar/gui/dialogs/task-page.c 2007-08-20 21:59:26.000000000 -0400
@@ -35,7 +35,7 @@
#include <gtk/gtkmessagedialog.h>
#include <glib/gi18n.h>
@ -936,7 +1085,7 @@
+ return combo_box;
}
--- evolution-2.11.90/calendar/gui/e-itip-control.c.e-source-combo-box 2007-07-05 02:11:20.000000000 -0400
+++ evolution-2.11.90/calendar/gui/e-itip-control.c 2007-08-15 13:42:01.000000000 -0400
+++ evolution-2.11.90/calendar/gui/e-itip-control.c 2007-08-20 21:59:26.000000000 -0400
@@ -44,7 +44,7 @@
#include <gtkhtml/gtkhtml-embedded.h>
#include <gtkhtml/gtkhtml-stream.h>

View File

@ -45,7 +45,7 @@
Name: evolution
Version: 2.11.90
Release: 2%{?dist}
Release: 3%{?dist}
License: GPLv2 and GFDL+
Group: Applications/Productivity
Summary: GNOME's next-generation groupware suite
@ -715,6 +715,10 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/evolution/%{evo_major}/libmenus.so
%changelog
* Mon Aug 20 2007 Matthew Barnes <mbarnes@redhat.com> - 2.11.90-3.fc8
- Revise patch for GNOME bug #417999 to fix GNOME bug #447591
(Automatic Contacts combo boxes don't work).
* Sat Aug 18 2007 Matthew Barnes <mbarnes@redhat.com> - 2.11.90-2.fc8
- Add patch for RH bug #253348 (crash on startup).