diff options
Diffstat (limited to 'addressbook/gui/widgets')
-rw-r--r-- | addressbook/gui/widgets/Makefile.am | 8 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-util.c | 57 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-util.h | 6 | ||||
-rw-r--r-- | addressbook/gui/widgets/e-minicard.h | 2 |
4 files changed, 50 insertions, 23 deletions
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 <gnome.h> #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 <libgnomeui/gnome-canvas.h> -#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" |