aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-10-28 00:57:08 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-11-09 16:05:38 +0800
commite390a8a182a198b0e7a8f60a760773019f6d4e08 (patch)
treefe1970f5b9570791527bbb9e409c0e6b9e99938d /libempathy-gtk
parent877ea6bc7673b4a3a31be2528a3f6e4bcad4262e (diff)
downloadgsoc2013-empathy-e390a8a182a198b0e7a8f60a760773019f6d4e08.tar
gsoc2013-empathy-e390a8a182a198b0e7a8f60a760773019f6d4e08.tar.gz
gsoc2013-empathy-e390a8a182a198b0e7a8f60a760773019f6d4e08.tar.bz2
gsoc2013-empathy-e390a8a182a198b0e7a8f60a760773019f6d4e08.tar.lz
gsoc2013-empathy-e390a8a182a198b0e7a8f60a760773019f6d4e08.tar.xz
gsoc2013-empathy-e390a8a182a198b0e7a8f60a760773019f6d4e08.tar.zst
gsoc2013-empathy-e390a8a182a198b0e7a8f60a760773019f6d4e08.zip
empathy_subscription_dialog_show: display user's message if any (#630707)
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-contact-dialogs.c25
-rw-r--r--libempathy-gtk/empathy-contact-dialogs.h1
2 files changed, 25 insertions, 1 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);