diff options
author | Chris Toshok <toshok@ximian.com> | 2001-06-25 09:09:43 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2001-06-25 09:09:43 +0800 |
commit | 8cb68557aebb62334f68beeea60cf3bbf5930f9e (patch) | |
tree | bc27d2cd32645cddfd8631f6d6cc602ab29eea4e /addressbook/gui/widgets/e-addressbook-util.c | |
parent | dcf2e1a4acef258ff7473425cbd8d119294e41c0 (diff) | |
download | gsoc2013-evolution-8cb68557aebb62334f68beeea60cf3bbf5930f9e.tar.gz gsoc2013-evolution-8cb68557aebb62334f68beeea60cf3bbf5930f9e.tar.zst gsoc2013-evolution-8cb68557aebb62334f68beeea60cf3bbf5930f9e.zip |
correct path to libecontacteditor.a. (minicard_widget_test_LDADD): same.
2001-06-24 Chris Toshok <toshok@ximian.com>
* 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
Diffstat (limited to 'addressbook/gui/widgets/e-addressbook-util.c')
-rw-r--r-- | addressbook/gui/widgets/e-addressbook-util.c | 57 |
1 files changed, 39 insertions, 18 deletions
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; +} |