]> git.0d.be Git - empathy.git/commitdiff
new-account-dialog: rely on the EmpathyAccountWidget::close signal
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 8 May 2012 11:50:03 +0000 (13:50 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 9 May 2012 07:34:18 +0000 (09:34 +0200)
User of the dialog should wait for the widget to be completely done before
destroying it.

Change the 'success' dialog response to GTK_RESPONSE_APPLY to stay coherent
with the response type received from EmpathyAccountWidget.

https://bugzilla.gnome.org/show_bug.cgi?id=675667

libempathy-gtk/empathy-new-account-dialog.c
src/empathy-accounts-dialog.c

index 180cc4198e5e0f4041b4fe85f1af7aa114d7f4ec..ed09be829662d4b496e12dcce7931ec9e8320b33 100644 (file)
@@ -42,18 +42,11 @@ struct _EmpathyNewAccountDialogPrivate
 };
 
 static void
-account_created_cb (EmpathyAccountWidget *widget,
-    TpAccount *account,
+close_cb (EmpathyAccountWidget *widget,
+    GtkResponseType response,
     EmpathyNewAccountDialog *self)
 {
-  gtk_dialog_response (GTK_DIALOG (self), GTK_RESPONSE_OK);
-}
-
-static void
-cancelled_cb (EmpathyAccountWidget *widget,
-    EmpathyNewAccountDialog *self)
-{
-  gtk_dialog_response (GTK_DIALOG (self), GTK_RESPONSE_CANCEL);
+  gtk_dialog_response (GTK_DIALOG (self), response);
 }
 
 static void
@@ -87,9 +80,7 @@ protocol_changed_cb (GtkComboBox *chooser,
   if (self->priv->current_account_widget != NULL)
     {
       g_signal_handlers_disconnect_by_func (self->priv->current_account_widget,
-          account_created_cb, self);
-      g_signal_handlers_disconnect_by_func (self->priv->current_account_widget,
-          cancelled_cb, self);
+          close_cb, self);
 
       gtk_widget_destroy (GTK_WIDGET (self->priv->current_account_widget));
     }
@@ -98,10 +89,8 @@ protocol_changed_cb (GtkComboBox *chooser,
 
   self->priv->settings = settings;
 
-  g_signal_connect (self->priv->current_account_widget, "account-created",
-      G_CALLBACK (account_created_cb), self);
-  g_signal_connect (self->priv->current_account_widget, "cancelled",
-      G_CALLBACK (cancelled_cb), self);
+  g_signal_connect (self->priv->current_account_widget, "close",
+      G_CALLBACK (close_cb), self);
 
   /* Restore "account" and "password" parameters in the new widget */
   if (account != NULL)
index 9c5715bc0308c97303c8f9a8bdd19792042c8722..a9b65b25d603b385843840c3214ca77c6f0cb17c 100644 (file)
@@ -996,7 +996,7 @@ accounts_dialog_button_add_clicked_cb (GtkWidget *button,
 
   response = gtk_dialog_run (GTK_DIALOG (dialog));
 
-  if (response == GTK_RESPONSE_OK)
+  if (response == GTK_RESPONSE_APPLY)
     {
       EmpathyAccountSettings *settings;
       TpAccount *account;