aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/widgets/e-minicard-view.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-11-14 11:56:01 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-11-14 11:56:01 +0800
commit8c0bd86d5fdd6d87c3170e2a01423e7c7018a981 (patch)
tree22da2df051cb6f1bc988d15aca08ebb0a5baf7e4 /addressbook/gui/widgets/e-minicard-view.c
parent6760cc72334346b8654fcd9fe1440890db55ac1b (diff)
downloadgsoc2013-evolution-8c0bd86d5fdd6d87c3170e2a01423e7c7018a981.tar.gz
gsoc2013-evolution-8c0bd86d5fdd6d87c3170e2a01423e7c7018a981.tar.zst
gsoc2013-evolution-8c0bd86d5fdd6d87c3170e2a01423e7c7018a981.zip
Rearranged some of the addressbook code to try and eliminate some circular
dependencies in our libraries. The circular dependency between the composer and the mail module is still causing me headaches. And it doesn't help that the addressbook and calendar also want to link to the composer. svn path=/branches/kill-bonobo/; revision=36782
Diffstat (limited to 'addressbook/gui/widgets/e-minicard-view.c')
-rw-r--r--addressbook/gui/widgets/e-minicard-view.c43
1 files changed, 36 insertions, 7 deletions
diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c
index 37ffc8844d..cca2a54a3c 100644
--- a/addressbook/gui/widgets/e-minicard-view.c
+++ b/addressbook/gui/widgets/e-minicard-view.c
@@ -56,6 +56,8 @@ enum {
enum {
+ CREATE_CONTACT,
+ CREATE_CONTACT_LIST,
RIGHT_CLICK,
LAST_SIGNAL
};
@@ -383,13 +385,8 @@ e_minicard_view_event (GnomeCanvasItem *item, GdkEvent *event)
g_object_get(view->adapter, "editable", &editable, NULL);
- if (editable) {
- EBook *book;
- g_object_get(view, "book", &book, NULL);
-
- if (book && E_IS_BOOK (book))
- eab_show_contact_editor (book, e_contact_new(), TRUE, editable);
- }
+ if (editable)
+ e_minicard_view_create_contact (view);
return TRUE;
}
case GDK_BUTTON_PRESS:
@@ -547,6 +544,22 @@ e_minicard_view_class_init (EMinicardViewClass *klass)
FALSE,
G_PARAM_READWRITE));
+ signals [CREATE_CONTACT] =
+ g_signal_new ("create-contact",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
+ 0, NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
+ signals [CREATE_CONTACT_LIST] =
+ g_signal_new ("create-contact-list",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
+ 0, NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
+
signals [RIGHT_CLICK] =
g_signal_new ("right_click",
G_OBJECT_CLASS_TYPE (object_class),
@@ -655,3 +668,19 @@ e_minicard_view_get_card_list (EMinicardView *view)
mal.list = g_list_reverse (mal.list);
return mal.list;
}
+
+void
+e_minicard_view_create_contact (EMinicardView *view)
+{
+ g_return_if_fail (E_IS_MINICARD_VIEW (view));
+
+ g_signal_emit (view, signals[CREATE_CONTACT], 0);
+}
+
+void
+e_minicard_view_create_contact_list (EMinicardView *view)
+{
+ g_return_if_fail (E_IS_MINICARD_VIEW (view));
+
+ g_signal_emit (view, signals[CREATE_CONTACT_LIST], 0);
+}