From 8cb68557aebb62334f68beeea60cf3bbf5930f9e Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Mon, 25 Jun 2001 01:09:43 +0000 Subject: correct path to libecontacteditor.a. (minicard_widget_test_LDADD): same. 2001-06-24 Chris Toshok * gui/widgets/Makefile.am (minicard_test_LDADD): correct path to libecontacteditor.a. (minicard_widget_test_LDADD): same. (INCLUDES): same, for the includes. * gui/widgets/e-minicard.h: correct e-contact-editor.h path. * gui/widgets/e-addressbook-util.h: correct path to e-contact-editor.h, and add e-contact-list-editor.h. Add prototype for e_addressbook_show_contact_list_editor. * gui/widgets/e-addressbook-util.c: remove #include "e-contact-editor.h" (our header includes it.) (added_cb): rename card_added_cb to this, and make it so it can be reused in both the list and card cases. remove the g_print too. (modified_cb): same for modified case. (deleted_cb): same for deleted case. (editor_closed_cb): change first arg to GtkObject* so we can reuse this for both list and card. (e_addressbook_show_contact_editor): use added_cb, modified_cb, deleted_cb, and pass FALSE as user_data. (e_addressbook_show_contact_list_editor): new function, same as above but creating a contact-list-editor, and pass TRUE as user_data. * gui/component/e-address-popup.c: correct path to contact-editor. * gui/component/e-address-widget.c: same. * gui/component/select-names/e-select-names-popup.c: same. * gui/component/select-names/e-select-names-text-model.c: same. * gui/component/addressbook.c (new_contact_list_cb): new function. (update_command_state): update ContactNewList command. (verbs): remove ViewAll from the toolbar from the verb list. Add ContactNewList. (pixmaps): same for pixmaps. * gui/component/Makefile.am (evolution_addressbook_LDADD): new path for contact-editor. (INCLUDES): same. * gui/contact-list-editor/e-contact-list-model.h: * gui/contact-list-editor/e-contact-list-model.c: * gui/contact-list-editor/e-contact-list-editor.h: * gui/contact-list-editor/e-contact-list-editor.c: * gui/contact-list-editor/Makefile.am: Initial contact-list editor commit. * gui/Makefile.am (SUBDIRS): add contact-editor. * Makefile.am: (SUBDIRS): remove contact-editor. svn path=/trunk/; revision=10463 --- addressbook/gui/widgets/Makefile.am | 8 ++-- addressbook/gui/widgets/e-addressbook-util.c | 57 +++++++++++++++++++--------- addressbook/gui/widgets/e-addressbook-util.h | 6 ++- addressbook/gui/widgets/e-minicard.h | 2 +- 4 files changed, 50 insertions(+), 23 deletions(-) (limited to 'addressbook/gui/widgets') diff --git a/addressbook/gui/widgets/Makefile.am b/addressbook/gui/widgets/Makefile.am index a375965a66..9619363732 100644 --- a/addressbook/gui/widgets/Makefile.am +++ b/addressbook/gui/widgets/Makefile.am @@ -4,7 +4,7 @@ INCLUDES = \ -DEVOLUTION_DATADIR=\""$(datadir)"\" \ -I$(top_srcdir) \ -I$(top_srcdir)/addressbook/backend/ebook \ - -I$(top_srcdir)/addressbook/contact-editor \ + -I$(top_srcdir)/addressbook/gui/contact-editor \ -I$(top_srcdir)/addressbook/gui/merging \ -I$(top_srcdir)/widgets/misc \ $(BONOBO_GNOME_CFLAGS) \ @@ -66,7 +66,8 @@ minicard_test_LDADD = \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/libversit/libversit.la \ $(top_builddir)/e-util/ename/libename.la \ - $(top_builddir)/addressbook/contact-editor/libecontacteditor.a \ + $(top_builddir)/addressbook/gui/contact-editor/libecontacteditor.a \ + $(top_builddir)/addressbook/gui/contact-list-editor/libecontactlisteditor.a \ $(top_builddir)/addressbook/printing/libecontactprint.a \ $(top_builddir)/addressbook/gui/merging/libecardmerging.a \ $(top_builddir)/widgets/misc/libemiscwidgets.a \ @@ -118,7 +119,8 @@ minicard_widget_test_LDADD = \ $(top_builddir)/e-util/libeutil.la \ $(top_builddir)/libversit/libversit.la \ $(top_builddir)/e-util/ename/libename.la \ - $(top_builddir)/addressbook/contact-editor/libecontacteditor.a \ + $(top_builddir)/addressbook/gui/contact-editor/libecontacteditor.a \ + $(top_builddir)/addressbook/gui/contact-list-editor/libecontactlisteditor.a \ $(top_builddir)/addressbook/printing/libecontactprint.a \ $(top_builddir)/widgets/misc/libemiscwidgets.a \ $(top_builddir)/e-util/libeutil.la \ diff --git a/addressbook/gui/widgets/e-addressbook-util.c b/addressbook/gui/widgets/e-addressbook-util.c index 7ec044adf8..9aaa554547 100644 --- a/addressbook/gui/widgets/e-addressbook-util.c +++ b/addressbook/gui/widgets/e-addressbook-util.c @@ -25,7 +25,6 @@ #include #include "e-addressbook-util.h" -#include "e-contact-editor.h" #include "e-card-merging.h" void @@ -53,39 +52,38 @@ e_addressbook_error_dialog (const gchar *msg, EBookStatus status) static void -card_added_cb (EBook* book, EBookStatus status, const char *id, - gpointer user_data) +added_cb (EBook* book, EBookStatus status, const char *id, + gboolean is_list) { - g_print ("%s: %s(): a card was added\n", __FILE__, __FUNCTION__); if (status != E_BOOK_STATUS_SUCCESS) { - e_addressbook_error_dialog (_("Error adding card"), status); + e_addressbook_error_dialog (is_list ? _("Error adding list") : _("Error adding card"), status); } } static void -card_modified_cb (EBook* book, EBookStatus status, - gpointer user_data) +modified_cb (EBook* book, EBookStatus status, + gboolean is_list) { - g_print ("%s: %s(): a card was modified\n", __FILE__, __FUNCTION__); if (status != E_BOOK_STATUS_SUCCESS) { - e_addressbook_error_dialog (_("Error modifying card"), status); + e_addressbook_error_dialog (is_list ? _("Error modifying list") : _("Error modifying card"), + status); } } static void -card_deleted_cb (EBook* book, EBookStatus status, - gpointer user_data) +deleted_cb (EBook* book, EBookStatus status, + gboolean is_list) { - g_print ("%s: %s(): a card was removed\n", __FILE__, __FUNCTION__); if (status != E_BOOK_STATUS_SUCCESS) { - e_addressbook_error_dialog (_("Error removing card"), status); + e_addressbook_error_dialog (is_list ? _("Error removing list") : _("Error removing card"), + status); } } static void -editor_closed_cb (EContactEditor *ce, gpointer data) +editor_closed_cb (GtkObject *editor, gpointer data) { - gtk_object_unref (GTK_OBJECT (ce)); + gtk_object_unref (editor); } EContactEditor * @@ -98,13 +96,36 @@ e_addressbook_show_contact_editor (EBook *book, ECard *card, ce = e_contact_editor_new (book, card, is_new_card, editable); gtk_signal_connect (GTK_OBJECT (ce), "card_added", - GTK_SIGNAL_FUNC (card_added_cb), NULL); + GTK_SIGNAL_FUNC (added_cb), GINT_TO_POINTER (FALSE)); gtk_signal_connect (GTK_OBJECT (ce), "card_modified", - GTK_SIGNAL_FUNC (card_modified_cb), NULL); + GTK_SIGNAL_FUNC (modified_cb), GINT_TO_POINTER (FALSE)); gtk_signal_connect (GTK_OBJECT (ce), "card_deleted", - GTK_SIGNAL_FUNC (card_deleted_cb), NULL); + GTK_SIGNAL_FUNC (deleted_cb), GINT_TO_POINTER (FALSE)); gtk_signal_connect (GTK_OBJECT (ce), "editor_closed", GTK_SIGNAL_FUNC (editor_closed_cb), NULL); return ce; } + +EContactListEditor * +e_addressbook_show_contact_list_editor (EBook *book, ECard *card, + gboolean is_new_card, + gboolean editable) +{ + EContactListEditor *ce; + + ce = e_contact_list_editor_new (book, card, is_new_card, editable); + + gtk_signal_connect (GTK_OBJECT (ce), "list_added", + GTK_SIGNAL_FUNC (added_cb), GINT_TO_POINTER (TRUE)); + gtk_signal_connect (GTK_OBJECT (ce), "list_modified", + GTK_SIGNAL_FUNC (modified_cb), GINT_TO_POINTER (TRUE)); + gtk_signal_connect (GTK_OBJECT (ce), "list_deleted", + GTK_SIGNAL_FUNC (deleted_cb), GINT_TO_POINTER (TRUE)); + gtk_signal_connect (GTK_OBJECT (ce), "editor_closed", + GTK_SIGNAL_FUNC (editor_closed_cb), GINT_TO_POINTER (TRUE)); + + e_contact_list_editor_show (ce); + + return ce; +} diff --git a/addressbook/gui/widgets/e-addressbook-util.h b/addressbook/gui/widgets/e-addressbook-util.h index 3e222f7154..1f3ffe074d 100644 --- a/addressbook/gui/widgets/e-addressbook-util.h +++ b/addressbook/gui/widgets/e-addressbook-util.h @@ -22,7 +22,8 @@ #define __E_ADDRESSBOOK_UTIL_H__ #include "addressbook/backend/ebook/e-book.h" -#include "addressbook/contact-editor/e-contact-editor.h" +#include "addressbook/gui/contact-editor/e-contact-editor.h" +#include "addressbook/gui/contact-list-editor/e-contact-list-editor.h" #ifdef __cplusplus extern "C" { @@ -34,6 +35,9 @@ void e_addressbook_error_dialog (const gchar *msg, EContactEditor* e_addressbook_show_contact_editor (EBook *book, ECard *card, gboolean is_new_card, gboolean editable); +EContactListEditor * e_addressbook_show_contact_list_editor (EBook *book, ECard *card, + gboolean is_new_card, + gboolean editable); #ifdef __cplusplus } diff --git a/addressbook/gui/widgets/e-minicard.h b/addressbook/gui/widgets/e-minicard.h index 88c34b97d3..ae54ad63ec 100644 --- a/addressbook/gui/widgets/e-minicard.h +++ b/addressbook/gui/widgets/e-minicard.h @@ -22,7 +22,7 @@ #define __E_MINICARD_H__ #include -#include "addressbook/contact-editor/e-contact-editor.h" +#include "addressbook/gui/contact-editor/e-contact-editor.h" #include "addressbook/backend/ebook/e-card.h" #include "addressbook/backend/ebook/e-card-simple.h" -- cgit v1.2.3