aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-03-22 01:52:10 +0800
committerEmilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>2011-03-22 05:04:13 +0800
commit4d795d822f9590c2916bfa64b4cbc3d536e3ad4a (patch)
tree2dc38065a31b54e82da388f3acf5f42ae120fccc /libempathy-gtk
parent9c4deab9ee56bd39de5f4828d774a4d1be59a7bb (diff)
downloadgsoc2013-empathy-4d795d822f9590c2916bfa64b4cbc3d536e3ad4a.tar
gsoc2013-empathy-4d795d822f9590c2916bfa64b4cbc3d536e3ad4a.tar.gz
gsoc2013-empathy-4d795d822f9590c2916bfa64b4cbc3d536e3ad4a.tar.bz2
gsoc2013-empathy-4d795d822f9590c2916bfa64b4cbc3d536e3ad4a.tar.lz
gsoc2013-empathy-4d795d822f9590c2916bfa64b4cbc3d536e3ad4a.tar.xz
gsoc2013-empathy-4d795d822f9590c2916bfa64b4cbc3d536e3ad4a.tar.zst
gsoc2013-empathy-4d795d822f9590c2916bfa64b4cbc3d536e3ad4a.zip
Also show an avatar when blocking from a conversation
https://bugzilla.gnome.org/show_bug.cgi?id=645069
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-contact-dialogs.c11
-rw-r--r--libempathy-gtk/empathy-contact-dialogs.h1
-rw-r--r--libempathy-gtk/empathy-contact-menu.c5
3 files changed, 14 insertions, 3 deletions
diff --git a/libempathy-gtk/empathy-contact-dialogs.c b/libempathy-gtk/empathy-contact-dialogs.c
index d16062eff..29552cccc 100644
--- a/libempathy-gtk/empathy-contact-dialogs.c
+++ b/libempathy-gtk/empathy-contact-dialogs.c
@@ -88,8 +88,8 @@ subscription_dialog_response_cb (GtkDialog *dialog,
gboolean abusive;
/* confirm the blocking */
- if (empathy_block_contact_dialog_show (GTK_WINDOW (dialog),
- contact, &abusive)) {
+ if (empathy_block_contact_dialog_show (GTK_WINDOW (dialog), contact,
+ NULL, &abusive)) {
empathy_contact_list_remove (
EMPATHY_CONTACT_LIST (manager),
contact, "");
@@ -514,6 +514,7 @@ empathy_new_contact_dialog_show_with_contact (GtkWindow *parent,
gboolean
empathy_block_contact_dialog_show (GtkWindow *parent,
EmpathyContact *contact,
+ GdkPixbuf *avatar,
gboolean *abusive)
{
EmpathyContactManager *manager;
@@ -542,6 +543,12 @@ empathy_block_contact_dialog_show (GtkWindow *parent,
_("_Block"), GTK_RESPONSE_REJECT,
NULL);
+ if (avatar != NULL) {
+ GtkWidget *image = gtk_image_new_from_pixbuf (avatar);
+ gtk_message_dialog_set_image (GTK_MESSAGE_DIALOG (dialog), image);
+ gtk_widget_show (image);
+ }
+
/* ask the user if they want to also report the contact as abusive */
if (flags & EMPATHY_CONTACT_LIST_CAN_REPORT_ABUSIVE) {
GtkWidget *vbox;
diff --git a/libempathy-gtk/empathy-contact-dialogs.h b/libempathy-gtk/empathy-contact-dialogs.h
index 7dc1db10f..5dbb77650 100644
--- a/libempathy-gtk/empathy-contact-dialogs.h
+++ b/libempathy-gtk/empathy-contact-dialogs.h
@@ -41,6 +41,7 @@ void empathy_new_contact_dialog_show_with_contact (GtkWindow *parent,
EmpathyContact *contact);
gboolean empathy_block_contact_dialog_show (GtkWindow *parent,
EmpathyContact *contact,
+ GdkPixbuf *avatar,
gboolean *abusive);
G_END_DECLS
diff --git a/libempathy-gtk/empathy-contact-menu.c b/libempathy-gtk/empathy-contact-menu.c
index 441b69212..15f47b206 100644
--- a/libempathy-gtk/empathy-contact-menu.c
+++ b/libempathy-gtk/empathy-contact-menu.c
@@ -244,6 +244,7 @@ empathy_contact_block_menu_item_toggled (GtkCheckMenuItem *item,
if (blocked) {
/* confirm the user really wishes to block the contact */
GtkWidget *parent;
+ GdkPixbuf *avatar;
/* gtk_menu_get_attach_widget () doesn't behave properly here
* for some reason */
@@ -251,8 +252,10 @@ empathy_contact_block_menu_item_toggled (GtkCheckMenuItem *item,
G_OBJECT (gtk_widget_get_parent (GTK_WIDGET (item))),
"window");
+ avatar = empathy_pixbuf_avatar_from_contact_scaled (contact, 48, 48);
+
if (!empathy_block_contact_dialog_show (GTK_WINDOW (parent),
- contact, &abusive))
+ contact, avatar, &abusive))
return;
}