aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/contact-editor
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-05-08 12:58:41 +0800
committerChris Lahey <clahey@src.gnome.org>2001-05-08 12:58:41 +0800
commit3c0c62e2958b5dccca490908145c534022a85563 (patch)
tree421d5332f2518c99cfd6ac6dd4aa325f1a0a1a84 /addressbook/gui/contact-editor
parent5d4895eb431adfbf2c7895d4257fa20a28f474f9 (diff)
downloadgsoc2013-evolution-3c0c62e2958b5dccca490908145c534022a85563.tar
gsoc2013-evolution-3c0c62e2958b5dccca490908145c534022a85563.tar.gz
gsoc2013-evolution-3c0c62e2958b5dccca490908145c534022a85563.tar.bz2
gsoc2013-evolution-3c0c62e2958b5dccca490908145c534022a85563.tar.lz
gsoc2013-evolution-3c0c62e2958b5dccca490908145c534022a85563.tar.xz
gsoc2013-evolution-3c0c62e2958b5dccca490908145c534022a85563.tar.zst
gsoc2013-evolution-3c0c62e2958b5dccca490908145c534022a85563.zip
Removed e-card-pairs.h since we're not using it.
2001-05-08 Christopher James Lahey <clahey@ximian.com> * backend/ebook/Makefile.am (libebookinclude_HEADERS): Removed e-card-pairs.h since we're not using it. * backend/ebook/e-book-view.c (e_book_view_check_listener_queue): Added break; to default: case here. * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h: Added changed variable so as to avoid sync_card when possible. (e_card_simple_destroy): Free all the data here properly. (e_card_simple_get_arg): Slight simplification here. (fill_in_info, e_card_simple_arbitrary_foreach, e_card_simple_get_arbitrary): Call e_card_free_empty_lists here to save a bit of memory. * backend/ebook/e-card.c, backend/ebook/e-card.h: Fixed up includes a bit. (e_card_list_get_vcard, e_card_list_send): Added these functions for acting on a group of cards. (parse_org): Cleaned up this function a bit. (e_card_free_empty_lists): Added this function to delete unnecessary ELists and save a bit of memory. (e_v_object_get_child_value): Made this return NULL if not found instead of g_strdup(""). * contact-editor/e-contact-save-as.c, contact-editor/e-contact-save-as.h (e_contact_list_save_as): Added this function to save multiple contacts. * gui/widgets/Makefile.am: Commented out reflow test. (libeminicard_a_SOURCES): Added e-minicard-view-model.c and e-minicard-view-model.h. * gui/widgets/e-minicard-view-model.c, gui/widgets/e-minicard-view-model.h: Model for use in EMinicardView. * gui/widgets/e-minicard-view.c, gui/widgets/e-minicard-view.h: Reworked this to use the new EReflow stuff. * gui/widgets/e-minicard.c (e_minicard_event): Doesn't handle right click menus now. Emits a signal on the parent canvas item instead. * printing/e-contact-print-envelope.c, printing/e-contact-print-envelope.h (e_contact_print_envelope_list_dialog_new): Added this function to print multiple envelopes (only prints first for now.) * printing/e-contact-print.c, printing/e-contact-print.h (e_contact_print_card_list_dialog_new): Added this function to print multiple cards. Only prints the first for now. svn path=/trunk/; revision=9711
Diffstat (limited to 'addressbook/gui/contact-editor')
-rw-r--r--addressbook/gui/contact-editor/e-contact-save-as.c44
-rw-r--r--addressbook/gui/contact-editor/e-contact-save-as.h2
2 files changed, 34 insertions, 12 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-save-as.c b/addressbook/gui/contact-editor/e-contact-save-as.c
index 5381fb8b2d..8ed7bad549 100644
--- a/addressbook/gui/contact-editor/e-contact-save-as.c
+++ b/addressbook/gui/contact-editor/e-contact-save-as.c
@@ -29,17 +29,17 @@
typedef struct {
GtkFileSelection *filesel;
- ECard *card;
+ char *vcard;
} SaveAsInfo;
static void
save_it(GtkWidget *widget, SaveAsInfo *info)
{
- char *vcard = e_card_get_vcard(info->card);
- const char *filename = gtk_file_selection_get_filename(info->filesel);
- e_write_file(filename, vcard, O_WRONLY | O_CREAT | O_EXCL | O_TRUNC);
- g_free(vcard);
- gtk_object_unref(GTK_OBJECT(info->card));
+ const char *filename = gtk_file_selection_get_filename (info->filesel);
+
+ e_write_file (filename, info->vcard, O_WRONLY | O_CREAT | O_EXCL | O_TRUNC);
+
+ g_free (info->vcard);
gtk_widget_destroy(GTK_WIDGET(info->filesel));
g_free(info);
}
@@ -47,16 +47,16 @@ save_it(GtkWidget *widget, SaveAsInfo *info)
static void
close_it(GtkWidget *widget, SaveAsInfo *info)
{
- gtk_object_unref(GTK_OBJECT(info->card));
- gtk_widget_destroy(GTK_WIDGET(info->filesel));
- g_free(info);
+ g_free (info->vcard);
+ gtk_widget_destroy (GTK_WIDGET (info->filesel));
+ g_free (info);
}
static void
delete_it(GtkWidget *widget, SaveAsInfo *info)
{
- gtk_object_unref(GTK_OBJECT(info->card));
- g_free(info);
+ g_free (info->vcard);
+ g_free (info);
}
void
@@ -68,7 +68,27 @@ e_contact_save_as(char *title, ECard *card)
filesel = GTK_FILE_SELECTION(gtk_file_selection_new(title));
info->filesel = filesel;
- info->card = e_card_duplicate(card);
+ info->vcard = e_card_get_vcard(card);
+
+ gtk_signal_connect(GTK_OBJECT(filesel->ok_button), "clicked",
+ save_it, info);
+ gtk_signal_connect(GTK_OBJECT(filesel->cancel_button), "clicked",
+ close_it, info);
+ gtk_signal_connect(GTK_OBJECT(filesel), "delete_event",
+ delete_it, info);
+ gtk_widget_show(GTK_WIDGET(filesel));
+}
+
+void
+e_contact_list_save_as(char *title, GList *list)
+{
+ GtkFileSelection *filesel;
+ SaveAsInfo *info = g_new(SaveAsInfo, 1);
+
+ filesel = GTK_FILE_SELECTION(gtk_file_selection_new(title));
+
+ info->filesel = filesel;
+ info->vcard = e_card_list_get_vcard (list);
gtk_signal_connect(GTK_OBJECT(filesel->ok_button), "clicked",
save_it, info);
diff --git a/addressbook/gui/contact-editor/e-contact-save-as.h b/addressbook/gui/contact-editor/e-contact-save-as.h
index d304d4d558..a746720c53 100644
--- a/addressbook/gui/contact-editor/e-contact-save-as.h
+++ b/addressbook/gui/contact-editor/e-contact-save-as.h
@@ -32,6 +32,8 @@ extern "C" {
void
e_contact_save_as(gchar *title, ECard *card);
+void
+e_contact_list_save_as(gchar *title, GList *list);
#ifdef __cplusplus
}