diff options
author | Danielle Madeley <danielle.madeley@collabora.co.uk> | 2011-02-11 10:46:07 +0800 |
---|---|---|
committer | Chandni Verma <chandniverma2112@gmail.com> | 2011-03-08 12:04:56 +0800 |
commit | 95283d6bffb0b907ec1741c6c685e7fe67d701a0 (patch) | |
tree | 63e0fce0dee7c150a9b0218189ce4030814893a4 /libempathy-gtk | |
parent | 9cf8d924a615ead7f3e74644d0b9d39532645649 (diff) | |
download | gsoc2013-empathy-95283d6bffb0b907ec1741c6c685e7fe67d701a0.tar gsoc2013-empathy-95283d6bffb0b907ec1741c6c685e7fe67d701a0.tar.gz gsoc2013-empathy-95283d6bffb0b907ec1741c6c685e7fe67d701a0.tar.bz2 gsoc2013-empathy-95283d6bffb0b907ec1741c6c685e7fe67d701a0.tar.lz gsoc2013-empathy-95283d6bffb0b907ec1741c6c685e7fe67d701a0.tar.xz gsoc2013-empathy-95283d6bffb0b907ec1741c6c685e7fe67d701a0.tar.zst gsoc2013-empathy-95283d6bffb0b907ec1741c6c685e7fe67d701a0.zip |
Add UI to blocking confirmation dialog for future "report as abusive" function
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-contact-dialogs.c | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/libempathy-gtk/empathy-contact-dialogs.c b/libempathy-gtk/empathy-contact-dialogs.c index 11b608bef..8408ed6ca 100644 --- a/libempathy-gtk/empathy-contact-dialogs.c +++ b/libempathy-gtk/empathy-contact-dialogs.c @@ -502,9 +502,16 @@ empathy_block_contact_dialog_show (GtkWindow *parent, EmpathyContact *contact, gboolean *abusive) { + EmpathyContactManager *manager; + EmpathyContactListFlags flags; GtkWidget *dialog; + GtkWidget *abusive_check = NULL; int res; + manager = empathy_contact_manager_dup_singleton (); + flags = empathy_contact_manager_get_flags_for_connection (manager, + empathy_contact_get_connection (contact)); + dialog = gtk_message_dialog_new (parent, GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, @@ -520,13 +527,33 @@ empathy_block_contact_dialog_show (GtkWindow *parent, _("_Block"), GTK_RESPONSE_REJECT, NULL); - /* FIXME: support reporting abusive contacts */ + /* ask the user if they want to also report the contact as abusive */ + if (flags & EMPATHY_CONTACT_LIST_CAN_REPORT_ABUSIVE) { + GtkWidget *vbox; + + vbox = gtk_message_dialog_get_message_area ( + GTK_MESSAGE_DIALOG (dialog)); + abusive_check = gtk_check_button_new_with_mnemonic ( + _("_Report this contact as abusive")); + + gtk_box_pack_start (GTK_BOX (vbox), abusive_check, + FALSE, TRUE, 0); + gtk_widget_show (abusive_check); + } res = gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); - if (abusive != NULL) - *abusive = FALSE; + if (abusive != NULL) { + if (abusive_check != NULL) { + *abusive = gtk_toggle_button_get_active ( + GTK_TOGGLE_BUTTON (abusive_check)); + } else { + *abusive = FALSE; + } + } + + g_object_unref (manager); return res == GTK_RESPONSE_REJECT; } |