aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/widgets/e-minicard.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-02-15 06:34:36 +0800
committerChris Lahey <clahey@src.gnome.org>2001-02-15 06:34:36 +0800
commit6743dacd6c2de056f80300f3e378bed07cfdf4e4 (patch)
tree2868e21d6f7aed4f116f3425f70b90b28165b3d6 /addressbook/gui/widgets/e-minicard.c
parent4029db7b4c554fb76d22d5aa8a8a841c4887d592 (diff)
downloadgsoc2013-evolution-6743dacd6c2de056f80300f3e378bed07cfdf4e4.tar.gz
gsoc2013-evolution-6743dacd6c2de056f80300f3e378bed07cfdf4e4.tar.zst
gsoc2013-evolution-6743dacd6c2de056f80300f3e378bed07cfdf4e4.zip
Undefine E_STRING_PROP and E_LIST_PROP here.
2001-02-14 Christopher James Lahey <clahey@ximian.com> * backend/pas/pas-backend-ldap.c: Undefine E_STRING_PROP and E_LIST_PROP here. * contact-editor/e-contact-editor.c, contact-editor/e-contact-editor.h (e_contact_editor_raise): Added this function. * gui/widgets/e-minicard.c, gui/widgets/e-minicard.h (e_minicard_event): Added an editor field to the EMinicard object. Made it so that if you double click on the same card twice, it doesn't open a new window, but instead raises the old. 2001-02-08 Iain Holmes <iain@ximian.com> * gui/component/addressbook-storage.c (addressbook_source_free): Free the ldap.binddn. * gui/widgets/e-addressbook-view.c (e_addressbook_view_setup_menus): Free the dir strings. 2001-02-08 Christopher James Lahey <clahey@ximian.com> * contact-editor/e-contact-editor.c (categories_clicked): Set the header on the category dialog we pop up. svn path=/trunk/; revision=8234
Diffstat (limited to 'addressbook/gui/widgets/e-minicard.c')
-rw-r--r--addressbook/gui/widgets/e-minicard.c46
1 files changed, 26 insertions, 20 deletions
diff --git a/addressbook/gui/widgets/e-minicard.c b/addressbook/gui/widgets/e-minicard.c
index b77b1bbfd2..be0fe6eba8 100644
--- a/addressbook/gui/widgets/e-minicard.c
+++ b/addressbook/gui/widgets/e-minicard.c
@@ -146,6 +146,8 @@ e_minicard_init (EMinicard *minicard)
minicard->card = NULL;
minicard->simple = e_card_simple_new(NULL);
+ minicard->editor = NULL;
+
minicard->changed = FALSE;
e_canvas_item_set_reflow_callback(GNOME_CANVAS_ITEM(minicard), e_minicard_reflow);
@@ -491,7 +493,9 @@ delete_card_cb (EContactEditor *ce, ECard *card, gpointer data)
static void
editor_closed_cb (EContactEditor *ce, gpointer data)
{
+ EMinicard *minicard = data;
gtk_object_unref (GTK_OBJECT (ce));
+ minicard->editor = NULL;
}
static gboolean
@@ -586,27 +590,29 @@ e_minicard_event (GnomeCanvasItem *item, GdkEvent *event)
case GDK_2BUTTON_PRESS:
if (event->button.button == 1 && E_IS_MINICARD_VIEW(item->parent)) {
- EContactEditor *ce;
- EBook *book = NULL;
- if (E_IS_MINICARD_VIEW(item->parent)) {
-
- gtk_object_get(GTK_OBJECT(item->parent),
- "book", &book,
- NULL);
- }
- ce = e_contact_editor_new (e_minicard->card, FALSE);
-
- if (book != NULL) {
- gtk_signal_connect (GTK_OBJECT (ce), "add_card",
- GTK_SIGNAL_FUNC (add_card_cb), book);
- gtk_signal_connect (GTK_OBJECT (ce), "commit_card",
- GTK_SIGNAL_FUNC (commit_card_cb), book);
- gtk_signal_connect (GTK_OBJECT (ce), "delete_card",
- GTK_SIGNAL_FUNC (delete_card_cb), book);
- }
+ if (e_minicard->editor) {
+ e_contact_editor_raise(e_minicard->editor);
+ } else {
+ EBook *book = NULL;
+ if (E_IS_MINICARD_VIEW(item->parent)) {
+ gtk_object_get(GTK_OBJECT(item->parent),
+ "book", &book,
+ NULL);
+ }
+ e_minicard->editor = e_contact_editor_new (e_minicard->card, FALSE);
+
+ if (book != NULL) {
+ gtk_signal_connect (GTK_OBJECT (e_minicard->editor), "add_card",
+ GTK_SIGNAL_FUNC (add_card_cb), book);
+ gtk_signal_connect (GTK_OBJECT (e_minicard->editor), "commit_card",
+ GTK_SIGNAL_FUNC (commit_card_cb), book);
+ gtk_signal_connect (GTK_OBJECT (e_minicard->editor), "delete_card",
+ GTK_SIGNAL_FUNC (delete_card_cb), book);
+ }
- gtk_signal_connect (GTK_OBJECT (ce), "editor_closed",
- GTK_SIGNAL_FUNC (editor_closed_cb), NULL);
+ gtk_signal_connect (GTK_OBJECT (e_minicard->editor), "editor_closed",
+ GTK_SIGNAL_FUNC (editor_closed_cb), e_minicard);
+ }
return TRUE;
}
break;