aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-06-29 20:21:32 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-07-06 17:31:00 +0800
commit001cd2ec66845de212ecb58c71a8f38e68834bfe (patch)
treee701715620961430a3f2e7339cb242b849a9f431
parentb020c790f9d30e23c34bc5a7fec1a4de4c2aa528 (diff)
downloadgsoc2013-empathy-001cd2ec66845de212ecb58c71a8f38e68834bfe.tar
gsoc2013-empathy-001cd2ec66845de212ecb58c71a8f38e68834bfe.tar.gz
gsoc2013-empathy-001cd2ec66845de212ecb58c71a8f38e68834bfe.tar.bz2
gsoc2013-empathy-001cd2ec66845de212ecb58c71a8f38e68834bfe.tar.lz
gsoc2013-empathy-001cd2ec66845de212ecb58c71a8f38e68834bfe.tar.xz
gsoc2013-empathy-001cd2ec66845de212ecb58c71a8f38e68834bfe.tar.zst
gsoc2013-empathy-001cd2ec66845de212ecb58c71a8f38e68834bfe.zip
remove empathy_subscription_dialog_show()
https://bugzilla.gnome.org/show_bug.cgi?id=679136
-rw-r--r--libempathy-gtk/empathy-contact-dialogs.c135
-rw-r--r--libempathy-gtk/empathy-contact-dialogs.h3
2 files changed, 0 insertions, 138 deletions
diff --git a/libempathy-gtk/empathy-contact-dialogs.c b/libempathy-gtk/empathy-contact-dialogs.c
index 027ba370c..1e9f13175 100644
--- a/libempathy-gtk/empathy-contact-dialogs.c
+++ b/libempathy-gtk/empathy-contact-dialogs.c
@@ -36,7 +36,6 @@
#include "empathy-contact-widget.h"
#include "empathy-ui-utils.h"
-static GList *subscription_dialogs = NULL;
static GList *information_dialogs = NULL;
static GtkWidget *new_contact_dialog = NULL;
@@ -54,140 +53,6 @@ contact_dialogs_find (GtkDialog *dialog,
}
/*
- * Subscription dialog
- */
-
-static void
-subscription_dialog_response_cb (GtkDialog *dialog,
- gint response,
- GtkWidget *contact_widget)
-{
- EmpathyContact *contact;
-
- contact = empathy_contact_widget_get_contact (contact_widget);
-
- if (response == GTK_RESPONSE_YES) {
- empathy_contact_add_to_contact_list (contact, "");
-
- empathy_contact_set_alias (contact,
- empathy_contact_widget_get_alias (contact_widget));
- }
- else if (response == GTK_RESPONSE_NO) {
- empathy_contact_remove_from_contact_list (contact);
- }
- else if (response == GTK_RESPONSE_REJECT) {
- gboolean abusive;
-
- /* confirm the blocking */
- if (empathy_block_contact_dialog_show (GTK_WINDOW (dialog), contact,
- NULL, &abusive)) {
- TpContact *tp_contact;
-
- empathy_contact_remove_from_contact_list (contact);
-
- tp_contact = empathy_contact_get_tp_contact (contact);
-
- tp_contact_block_async (tp_contact, abusive, NULL, NULL);
- } else {
- /* if they don't confirm, return back to the
- * first dialog */
- return;
- }
- }
-
- subscription_dialogs = g_list_remove (subscription_dialogs, dialog);
- gtk_widget_destroy (GTK_WIDGET (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;
- GtkWidget *block_user_button;
- GList *l;
- gchar *filename;
- TpConnection *conn;
-
- g_return_if_fail (EMPATHY_IS_CONTACT (contact));
-
- l = g_list_find_custom (subscription_dialogs,
- contact,
- (GCompareFunc) contact_dialogs_find);
- if (l) {
- gtk_window_present (GTK_WINDOW (l->data));
- return;
- }
-
- filename = empathy_file_lookup ("empathy-contact-dialogs.ui",
- "libempathy-gtk");
- gui = empathy_builder_get_file (filename,
- "subscription_request_dialog", &dialog,
- "hbox_subscription", &hbox_subscription,
- "block-user-button", &block_user_button,
- NULL);
- g_free (filename);
- g_object_unref (gui);
-
- vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 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 |
- EMPATHY_CONTACT_WIDGET_SHOW_DETAILS);
- 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);
-
- g_signal_connect (dialog, "response",
- G_CALLBACK (subscription_dialog_response_cb),
- contact_widget);
-
- conn = empathy_contact_get_connection (contact);
-
- if (tp_proxy_has_interface_by_id (conn,
- TP_IFACE_QUARK_CONNECTION_INTERFACE_CONTACT_BLOCKING))
- gtk_widget_show (block_user_button);
-
- if (parent) {
- gtk_window_set_transient_for (GTK_WINDOW (dialog), parent);
- }
-
- gtk_widget_show (dialog);
-}
-
-/*
* Information dialog
*/
diff --git a/libempathy-gtk/empathy-contact-dialogs.h b/libempathy-gtk/empathy-contact-dialogs.h
index 8eb787702..82d21639b 100644
--- a/libempathy-gtk/empathy-contact-dialogs.h
+++ b/libempathy-gtk/empathy-contact-dialogs.h
@@ -28,9 +28,6 @@
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);
void empathy_new_contact_dialog_show (GtkWindow *parent);