X-Git-Url: https://git.0d.be/?p=empathy.git;a=blobdiff_plain;f=libempathy-gtk%2Fempathy-contact-dialogs.c;fp=libempathy-gtk%2Fempathy-contact-dialogs.c;h=5f885e8545a60e833a883392bc27bfd36adc206e;hp=1e9f1317594f781046ba7173b7bee976ff12df3d;hb=7615fb3d04356ebb2155a8e335db6eb995dac66d;hpb=001cd2ec66845de212ecb58c71a8f38e68834bfe diff --git a/libempathy-gtk/empathy-contact-dialogs.c b/libempathy-gtk/empathy-contact-dialogs.c index 1e9f1317..5f885e85 100644 --- a/libempathy-gtk/empathy-contact-dialogs.c +++ b/libempathy-gtk/empathy-contact-dialogs.c @@ -232,76 +232,3 @@ empathy_new_contact_dialog_show_with_contact (GtkWindow *parent, gtk_widget_show (dialog); } - -/** - * empathy_block_contact_dialog_show: - * @parent: the parent of this dialog (or %NULL) - * @contact: the contact for this dialog - * @abusive: a pointer to store the value of the abusive contact check box - * (or %NULL) - * - * Returns: %TRUE if the user wishes to block the contact - */ -gboolean -empathy_block_contact_dialog_show (GtkWindow *parent, - EmpathyContact *contact, - GdkPixbuf *avatar, - gboolean *abusive) -{ - GtkWidget *dialog; - GtkWidget *abusive_check = NULL; - int res; - TpConnection *conn; - - dialog = gtk_message_dialog_new (parent, - GTK_DIALOG_MODAL, - GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, - _("Block %s?"), - empathy_contact_get_alias (contact)); - - gtk_message_dialog_format_secondary_text ( - GTK_MESSAGE_DIALOG (dialog), - _("Are you sure you want to block '%s' from " - "contacting you again?"), - empathy_contact_get_alias (contact)); - gtk_dialog_add_buttons (GTK_DIALOG (dialog), - GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - _("_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); - } - - conn = empathy_contact_get_connection (contact); - - /* ask the user if they want to also report the contact as abusive */ - if (tp_connection_can_report_abusive (conn)) { - 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)); - if (abusive != NULL) { - if (abusive_check != NULL) { - *abusive = gtk_toggle_button_get_active ( - GTK_TOGGLE_BUTTON (abusive_check)); - } else { - *abusive = FALSE; - } - } - - gtk_widget_destroy (dialog); - - return res == GTK_RESPONSE_REJECT; -}