#include <stdlib.h>
#include <gtk/gtk.h>
-#include <glade/glade.h>
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
#include <libmissioncontrol/mc-account.h>
#include <libmissioncontrol/mission-control.h>
+#include <libempathy/empathy-call-factory.h>
#include <libempathy/empathy-contact-factory.h>
#include <libempathy/empathy-contact-manager.h>
#include <libempathy/empathy-dispatcher.h>
account = empathy_account_chooser_get_account (EMPATHY_ACCOUNT_CHOOSER (dialog->account_chooser));
id = gtk_entry_get_text (GTK_ENTRY (dialog->entry_id));
- if (!account || G_STR_EMPTY (id)) {
+ if (!account || EMP_STR_EMPTY (id)) {
if (account) {
g_object_unref (account);
}
}
if (response == 1) {
- empathy_dispatcher_call_with_contact_id (account, id);
- }
- else if (response == 2) {
- empathy_dispatcher_chat_with_contact_id (account, id);
+ EmpathyContactFactory *factory;
+ EmpathyContact *contact;
+ EmpathyCallFactory *call_factory;
+
+ factory = empathy_contact_factory_dup_singleton ();
+ contact = empathy_contact_factory_get_from_id (factory, account, id);
+
+ call_factory = empathy_call_factory_get();
+ empathy_call_factory_new_call (call_factory, contact);
+
+ g_object_unref (contact);
+ g_object_unref (factory);
+ } else if (response == 2) {
+ empathy_dispatcher_chat_with_contact_id (account, id, NULL, NULL);
}
g_object_unref (account);
gboolean sensitive;
id = gtk_entry_get_text (GTK_ENTRY (editable));
- sensitive = !G_STR_EMPTY (id);
+ sensitive = !EMP_STR_EMPTY (id);
gtk_widget_set_sensitive (dialog->button_chat, sensitive);
gtk_widget_set_sensitive (dialog->button_call, sensitive);
empathy_new_message_dialog_show (GtkWindow *parent)
{
static EmpathyNewMessageDialog *dialog = NULL;
- GladeXML *glade;
+ GtkBuilder *gui;
gchar *filename;
GtkEntryCompletion *completion;
GtkListStore *model;
dialog = g_new0 (EmpathyNewMessageDialog, 1);
/* create a contact manager */
- dialog->contact_manager = empathy_contact_manager_new ();
+ dialog->contact_manager = empathy_contact_manager_dup_singleton ();
- filename = empathy_file_lookup ("empathy-new-message-dialog.glade",
+ filename = empathy_file_lookup ("empathy-new-message-dialog.ui",
"libempathy-gtk");
- glade = empathy_glade_get_file (filename,
- "new_message_dialog",
- NULL,
+ gui = empathy_builder_get_file (filename,
"new_message_dialog", &dialog->dialog,
"table_contact", &dialog->table_contact,
"entry_id", &dialog->entry_id,
g_object_unref(completion);
g_object_unref(model);
- empathy_glade_connect (glade, dialog,
+ empathy_builder_connect (gui, dialog,
"new_message_dialog", "destroy", new_message_dialog_destroy_cb,
"new_message_dialog", "response", new_message_dialog_response_cb,
"entry_id", "changed", new_message_change_state_button_cb,
g_object_add_weak_pointer (G_OBJECT (dialog->dialog), (gpointer) &dialog);
- g_object_unref (glade);
+ g_object_unref (gui);
/* Create account chooser */
dialog->account_chooser = empathy_account_chooser_new ();
return dialog->dialog;
}
-