aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libempathy-gtk/empathy-contact-dialogs.c25
-rw-r--r--libempathy-gtk/empathy-contact-dialogs.h1
-rw-r--r--src/empathy-event-manager.c3
3 files changed, 27 insertions, 2 deletions
diff --git a/libempathy-gtk/empathy-contact-dialogs.c b/libempathy-gtk/empathy-contact-dialogs.c
index 9189d41e6..a5ae51d03 100644
--- a/libempathy-gtk/empathy-contact-dialogs.c
+++ b/libempathy-gtk/empathy-contact-dialogs.c
@@ -91,11 +91,13 @@ subscription_dialog_response_cb (GtkDialog *dialog,
void
empathy_subscription_dialog_show (EmpathyContact *contact,
+ const gchar *message,
GtkWindow *parent)
{
GtkBuilder *gui;
GtkWidget *dialog;
GtkWidget *hbox_subscription;
+ GtkWidget *vbox;
GtkWidget *contact_widget;
GList *l;
gchar *filename;
@@ -119,16 +121,37 @@ empathy_subscription_dialog_show (EmpathyContact *contact,
g_free (filename);
g_object_unref (gui);
+ vbox = gtk_vbox_new (FALSE, 6);
+
+ gtk_box_pack_end (GTK_BOX (hbox_subscription), vbox,
+ TRUE, TRUE, 0);
+
/* Contact info widget */
contact_widget = empathy_contact_widget_new (contact,
EMPATHY_CONTACT_WIDGET_NO_SET_ALIAS |
EMPATHY_CONTACT_WIDGET_EDIT_ALIAS |
EMPATHY_CONTACT_WIDGET_EDIT_GROUPS);
- gtk_box_pack_end (GTK_BOX (hbox_subscription),
+ gtk_box_pack_start (GTK_BOX (vbox),
contact_widget,
TRUE, TRUE,
0);
+
+ if (!tp_str_empty (message)) {
+ GtkWidget *label;
+ gchar *tmp;
+
+ label = gtk_label_new ("");
+ tmp = g_strdup_printf ("<i>%s</i>", message);
+
+ gtk_label_set_markup (GTK_LABEL (label), tmp);
+ g_free (tmp);
+ gtk_widget_show (label);
+
+ gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+ }
+
gtk_widget_show (contact_widget);
+ gtk_widget_show (vbox);
g_object_set_data (G_OBJECT (dialog), "contact_widget", contact_widget);
subscription_dialogs = g_list_prepend (subscription_dialogs, dialog);
diff --git a/libempathy-gtk/empathy-contact-dialogs.h b/libempathy-gtk/empathy-contact-dialogs.h
index 21aa5ce73..8c3ffc6c1 100644
--- a/libempathy-gtk/empathy-contact-dialogs.h
+++ b/libempathy-gtk/empathy-contact-dialogs.h
@@ -29,6 +29,7 @@
G_BEGIN_DECLS
void empathy_subscription_dialog_show (EmpathyContact *contact,
+ const gchar *message,
GtkWindow *parent);
void empathy_contact_information_dialog_show (EmpathyContact *contact,
GtkWindow *parent);
diff --git a/src/empathy-event-manager.c b/src/empathy-event-manager.c
index 1145d1b65..91bd47445 100644
--- a/src/empathy-event-manager.c
+++ b/src/empathy-event-manager.c
@@ -976,7 +976,8 @@ out:
static void
event_pending_subscribe_func (EventPriv *event)
{
- empathy_subscription_dialog_show (event->public.contact, NULL);
+ empathy_subscription_dialog_show (event->public.contact, event->public.header,
+ NULL);
event_remove (event);
}