aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChandni Verma <chandniverma2112@gmail.com>2011-05-09 07:22:16 +0800
committerChandni Verma <chandniverma2112@gmail.com>2011-05-11 17:39:33 +0800
commit34a7a0b348e1cdd3cfc184f135a8371d79741272 (patch)
tree6c01137ef4e4906b157a1a6cd675233e7147b5b5
parent0c9a992db9d0f8426264b097f0aa0cfaca860509 (diff)
downloadgsoc2013-empathy-34a7a0b348e1cdd3cfc184f135a8371d79741272.tar
gsoc2013-empathy-34a7a0b348e1cdd3cfc184f135a8371d79741272.tar.gz
gsoc2013-empathy-34a7a0b348e1cdd3cfc184f135a8371d79741272.tar.bz2
gsoc2013-empathy-34a7a0b348e1cdd3cfc184f135a8371d79741272.tar.lz
gsoc2013-empathy-34a7a0b348e1cdd3cfc184f135a8371d79741272.tar.xz
gsoc2013-empathy-34a7a0b348e1cdd3cfc184f135a8371d79741272.tar.zst
gsoc2013-empathy-34a7a0b348e1cdd3cfc184f135a8371d79741272.zip
Password infobar amendments
Destroy password infobar on parting password protected chatrooms and insensitivate input-text-view when displaying a new infobar
-rw-r--r--libempathy-gtk/empathy-chat.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index 0b61d53f5..b2d091518 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -3288,6 +3288,18 @@ password_entry_changed_cb (GtkEditable *entry,
}
static void
+chat_invalidated_cb (TpProxy *proxy,
+ guint domain,
+ gint code,
+ gchar *message,
+ gpointer password_infobar)
+{
+ /* Destroy the password infobar whenever a channel is invalidated
+ * so we don't have multiple infobars when the MUC is rejoined */
+ gtk_widget_destroy (GTK_WIDGET (password_infobar));
+}
+
+static void
display_password_info_bar (EmpathyChat *self)
{
EmpathyChatPriv *priv = GET_PRIV (self);
@@ -3369,12 +3381,19 @@ display_password_info_bar (EmpathyChat *self)
TRUE, TRUE, 3);
gtk_widget_show_all (hbox);
+ tp_g_signal_connect_object (empathy_tp_chat_get_channel (priv->tp_chat),
+ "invalidated", G_CALLBACK (chat_invalidated_cb),
+ info_bar, 0);
+
data->response_id = g_signal_connect (info_bar, "response",
G_CALLBACK (password_infobar_response_cb), data);
gtk_widget_show_all (info_bar);
/* ... but hide the spinner */
gtk_widget_hide (spinner);
+
+ /* prevent the user from typing anything */
+ gtk_widget_set_sensitive (self->input_text_view, FALSE);
}
static void