[evolution] Bug #555324 - Ask for destination before "Save in Addressbook" inline vCard



commit 12ea46655183a26ab59627c5adc43369d9729e50
Author: Milan Crha <mcrha redhat com>
Date:   Thu Dec 2 15:04:09 2010 +0100

    Bug #555324 - Ask for destination before "Save in Addressbook" inline vCard

 plugins/vcard-inline/vcard-inline.c |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/plugins/vcard-inline/vcard-inline.c b/plugins/vcard-inline/vcard-inline.c
index 5891344..dfa1966 100644
--- a/plugins/vcard-inline/vcard-inline.c
+++ b/plugins/vcard-inline/vcard-inline.c
@@ -26,6 +26,7 @@
 #include <libebook/e-contact.h>
 #include <gtkhtml/gtkhtml-embedded.h>
 #include <libedataserverui/e-book-auth-util.h>
+#include <libedataserverui/e-source-selector-dialog.h>
 
 #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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]