aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-contact-dialogs.c9
-rw-r--r--libempathy-gtk/empathy-contact-dialogs.h7
-rw-r--r--libempathy-gtk/empathy-contact-menu.c17
3 files changed, 28 insertions, 5 deletions
diff --git a/libempathy-gtk/empathy-contact-dialogs.c b/libempathy-gtk/empathy-contact-dialogs.c
index 0155f610e..5636714b0 100644
--- a/libempathy-gtk/empathy-contact-dialogs.c
+++ b/libempathy-gtk/empathy-contact-dialogs.c
@@ -370,6 +370,13 @@ new_contact_response_cb (GtkDialog *dialog,
void
empathy_new_contact_dialog_show (GtkWindow *parent)
{
+ empathy_new_contact_dialog_show_with_contact (parent, NULL);
+}
+
+void
+empathy_new_contact_dialog_show_with_contact (GtkWindow *parent,
+ EmpathyContact *contact)
+{
GtkWidget *dialog;
GtkWidget *button;
GtkWidget *contact_widget;
@@ -402,7 +409,7 @@ empathy_new_contact_dialog_show (GtkWindow *parent)
gtk_widget_show (button);
/* Contact info widget */
- contact_widget = empathy_contact_widget_new (NULL,
+ contact_widget = empathy_contact_widget_new (contact,
EMPATHY_CONTACT_WIDGET_EDIT_ALIAS |
EMPATHY_CONTACT_WIDGET_EDIT_ACCOUNT |
EMPATHY_CONTACT_WIDGET_EDIT_ID |
diff --git a/libempathy-gtk/empathy-contact-dialogs.h b/libempathy-gtk/empathy-contact-dialogs.h
index c714c6b96..5e881ab73 100644
--- a/libempathy-gtk/empathy-contact-dialogs.h
+++ b/libempathy-gtk/empathy-contact-dialogs.h
@@ -35,7 +35,12 @@ void empathy_contact_information_dialog_show (EmpathyContact *contact,
void empathy_contact_edit_dialog_show (EmpathyContact *contact,
GtkWindow *parent);
void empathy_contact_personal_dialog_show (GtkWindow *parent);
-void empathy_new_contact_dialog_show (GtkWindow *parent);
+ GtkWindow *parent,
+ gboolean edit,
+ gboolean is_user);
+void empathy_new_contact_dialog_show (GtkWindow *parent);
+void empathy_new_contact_dialog_show_with_contact (GtkWindow *parent,
+ EmpathyContact *contact);
G_END_DECLS
diff --git a/libempathy-gtk/empathy-contact-menu.c b/libempathy-gtk/empathy-contact-menu.c
index 9969f3def..44b00165e 100644
--- a/libempathy-gtk/empathy-contact-menu.c
+++ b/libempathy-gtk/empathy-contact-menu.c
@@ -126,10 +126,12 @@ empathy_contact_menu_new (EmpathyContact *contact,
}
static void
-empathy_contact_chat_menu_item_activated (GtkMenuItem *item,
+empathy_contact_add_menu_item_activated (GtkMenuItem *item,
EmpathyContact *contact)
{
- empathy_dispatcher_chat_with_contact (contact, NULL, NULL);
+ /* FIXME - attempt to get parent */
+ /* FIXME - the contact dialog doesn't set the source account right */
+ empathy_new_contact_dialog_show_with_contact (NULL, contact);
}
GtkWidget *
@@ -163,11 +165,20 @@ empathy_contact_add_menu_item_new (EmpathyContact *contact)
GTK_ICON_SIZE_MENU);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
- /* FIXME - callback */
+ g_signal_connect (item, "activate",
+ G_CALLBACK (empathy_contact_add_menu_item_activated),
+ contact);
return item;
}
+static void
+empathy_contact_chat_menu_item_activated (GtkMenuItem *item,
+ EmpathyContact *contact)
+{
+ empathy_dispatcher_chat_with_contact (contact, NULL, NULL);
+}
+
GtkWidget *
empathy_contact_chat_menu_item_new (EmpathyContact *contact)
{