aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2010-02-25 01:20:17 +0800
committerMilan Crha <mcrha@redhat.com>2010-02-25 01:20:17 +0800
commite3d64cd4276e2696791f23f8fe705d09e6a83e14 (patch)
tree64e81c5e27f8a22c282ecd5e44afa6cf12b216cb /addressbook
parent50fb261954dabc9b9421466aa7b8929216f24028 (diff)
downloadgsoc2013-evolution-e3d64cd4276e2696791f23f8fe705d09e6a83e14.tar
gsoc2013-evolution-e3d64cd4276e2696791f23f8fe705d09e6a83e14.tar.gz
gsoc2013-evolution-e3d64cd4276e2696791f23f8fe705d09e6a83e14.tar.bz2
gsoc2013-evolution-e3d64cd4276e2696791f23f8fe705d09e6a83e14.tar.lz
gsoc2013-evolution-e3d64cd4276e2696791f23f8fe705d09e6a83e14.tar.xz
gsoc2013-evolution-e3d64cd4276e2696791f23f8fe705d09e6a83e14.tar.zst
gsoc2013-evolution-e3d64cd4276e2696791f23f8fe705d09e6a83e14.zip
Bug #610658 - Contact is lost after moving to the same address book
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/gui/widgets/eab-gui-util.c17
-rw-r--r--addressbook/gui/widgets/eab-gui-util.h2
2 files changed, 12 insertions, 7 deletions
diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c
index cc78818f6f..0a159da304 100644
--- a/addressbook/gui/widgets/eab-gui-util.c
+++ b/addressbook/gui/widgets/eab-gui-util.c
@@ -219,15 +219,18 @@ make_safe_filename (gchar *name)
}
static void
-source_selection_changed_cb (GtkWidget *selector, GtkWidget *ok_button)
+source_selection_changed_cb (ESourceSelector *selector, GtkWidget *ok_button)
{
- gtk_widget_set_sensitive (ok_button,
- e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (selector)) ?
- TRUE : FALSE);
+ ESource *except_source = NULL, *selected;
+
+ except_source = g_object_get_data (G_OBJECT (ok_button), "except-source");
+ selected = e_source_selector_peek_primary_selection (selector);
+
+ gtk_widget_set_sensitive (ok_button, selected && selected != except_source);
}
ESource *
-eab_select_source (const gchar *title, const gchar *message, const gchar *select_uid, GtkWindow *parent)
+eab_select_source (ESource *except_source, const gchar *title, const gchar *message, const gchar *select_uid, GtkWindow *parent)
{
ESource *source;
ESourceList *source_list;
@@ -254,6 +257,8 @@ eab_select_source (const gchar *title, const gchar *message, const gchar *select
selector = e_source_selector_new (source_list);
e_source_selector_show_selection (E_SOURCE_SELECTOR (selector), FALSE);
+ if (except_source)
+ g_object_set_data (G_OBJECT (ok_button), "except-source", e_source_list_peek_source_by_uid (source_list, e_source_peek_uid (except_source)));
g_signal_connect (selector, "primary_selection_changed",
G_CALLBACK (source_selection_changed_cb), ok_button);
@@ -439,7 +444,7 @@ eab_transfer_contacts (EBook *source, GList *contacts /* adopted */, gboolean de
desc = _("Copy contacts to");
}
- destination_source = eab_select_source (desc, NULL,
+ destination_source = eab_select_source (e_book_get_source (source), desc, NULL,
last_uid, parent_window);
if (!destination_source)
diff --git a/addressbook/gui/widgets/eab-gui-util.h b/addressbook/gui/widgets/eab-gui-util.h
index e37d89d762..ffa43ef94f 100644
--- a/addressbook/gui/widgets/eab-gui-util.h
+++ b/addressbook/gui/widgets/eab-gui-util.h
@@ -45,7 +45,7 @@ void eab_transfer_contacts (EBook *source,
gchar * eab_suggest_filename (GList *contact_list);
-ESource *eab_select_source (const gchar *title, const gchar *message,
+ESource *eab_select_source (ESource *except_source, const gchar *title, const gchar *message,
const gchar *select_uid, GtkWindow *parent);
/* To parse quoted printable address & return email & name fields */