]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-new-call-dialog.c
Merge commit 'staz/dnd'
[empathy.git] / libempathy-gtk / empathy-new-call-dialog.c
index 67bfb589d8204d7cb7dc32137109618240bf79c7..1a171af5a10d93b15fb4132ce393afe9a46ee9e2 100644 (file)
@@ -90,13 +90,20 @@ got_contact_cb (EmpathyTpContactFactory *factory,
 }
 
 static void
-empathy_new_call_dialog_got_response (EmpathyContactSelectorDialog *dialog,
-    TpConnection *connection,
-    const gchar *contact_id)
+empathy_new_call_dialog_response (GtkDialog *dialog, int response_id)
 {
   EmpathyNewCallDialogPriv *priv = GET_PRIV (dialog);
   EmpathyTpContactFactory *factory;
   gboolean video;
+  TpConnection *connection;
+  const gchar *contact_id;
+
+  if (response_id != GTK_RESPONSE_ACCEPT) goto out;
+
+  contact_id = empathy_contact_selector_dialog_get_selected (
+      EMPATHY_CONTACT_SELECTOR_DIALOG (dialog), &connection);
+
+  if (EMP_STR_EMPTY (contact_id) || connection == NULL) goto out;
 
   /* check if video is enabled now because the dialog will be destroyed once
    * we return from this function. */
@@ -107,6 +114,9 @@ empathy_new_call_dialog_got_response (EmpathyContactSelectorDialog *dialog,
       got_contact_cb, GUINT_TO_POINTER (video), NULL, NULL);
 
   g_object_unref (factory);
+
+out:
+  gtk_widget_destroy (GTK_WIDGET (dialog));
 }
 
 static gboolean
@@ -177,8 +187,8 @@ empathy_new_call_dialog_init (EmpathyNewCallDialog *dialog)
   /* add video toggle */
   priv->check_video = gtk_check_button_new_with_mnemonic (_("Send _Video"));
 
-  gtk_table_attach_defaults (GTK_TABLE (parent->table_contact),
-      priv->check_video, 1, 2, 2, 3);
+  gtk_box_pack_end (GTK_BOX (parent->vbox), priv->check_video,
+      FALSE, TRUE, 0);
 
   gtk_widget_show (priv->check_video);
 
@@ -204,15 +214,17 @@ empathy_new_call_dialog_class_init (
   EmpathyNewCallDialogClass *class)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (class);
-  EmpathyContactSelectorDialogClass *dialog_class = \
+  GtkDialogClass *dialog_class = GTK_DIALOG_CLASS (class);
+  EmpathyContactSelectorDialogClass *selector_dialog_class = \
     EMPATHY_CONTACT_SELECTOR_DIALOG_CLASS (class);
 
   g_type_class_add_private (class, sizeof (EmpathyNewCallDialogPriv));
 
   object_class->constructor = empathy_new_call_dialog_constructor;
 
-  dialog_class->got_response = empathy_new_call_dialog_got_response;
-  dialog_class->account_filter = empathy_new_call_dialog_account_filter;
+  dialog_class->response = empathy_new_call_dialog_response;
+
+  selector_dialog_class->account_filter = empathy_new_call_dialog_account_filter;
 }
 
 /**