[empathy] password-dialog: destroy the dialog if the handler is invalidated



commit 86aa1501e7a76b92ba402dddc4ce85d403c609bf
Author: Jonny Lamb <jonnylamb gnome org>
Date:   Wed Dec 15 13:57:02 2010 +0000

    password-dialog: destroy the dialog if the handler is invalidated
    
    Signed-off-by: Jonny Lamb <jonnylamb gnome org>

 libempathy-gtk/empathy-password-dialog.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/libempathy-gtk/empathy-password-dialog.c b/libempathy-gtk/empathy-password-dialog.c
index 5608bb0..442396d 100644
--- a/libempathy-gtk/empathy-password-dialog.c
+++ b/libempathy-gtk/empathy-password-dialog.c
@@ -203,6 +203,13 @@ password_dialog_window_state_changed (GtkWidget *widget,
 }
 
 static void
+password_dialog_handler_invalidated_cb (EmpathyServerSASLHandler *handler,
+    EmpathyPasswordDialog *dialog)
+{
+  gtk_widget_destroy (GTK_WIDGET (dialog));
+}
+
+static void
 empathy_password_dialog_constructed (GObject *object)
 {
   EmpathyPasswordDialog *dialog;
@@ -221,6 +228,10 @@ empathy_password_dialog_constructed (GObject *object)
 
   account = empathy_server_sasl_handler_get_account (priv->handler);
 
+  tp_g_signal_connect_object (priv->handler, "invalidated",
+      G_CALLBACK (password_dialog_handler_invalidated_cb),
+      object, 0);
+
   /* dialog */
   gtk_dialog_add_buttons (GTK_DIALOG (dialog),
       GTK_STOCK_OK, GTK_RESPONSE_OK,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]