aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-new-message-dialog.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-02-09 05:09:59 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-02-09 05:09:59 +0800
commit675deab25d7076195e356c84e55de5207b8c3c6f (patch)
tree896c57db3e3277c69c687fdef823e82fefd55ab9 /libempathy-gtk/empathy-new-message-dialog.c
parentc8e6bc3f8314a881264fa9f2b160eee39cf4d8fe (diff)
downloadgsoc2013-empathy-675deab25d7076195e356c84e55de5207b8c3c6f.tar
gsoc2013-empathy-675deab25d7076195e356c84e55de5207b8c3c6f.tar.gz
gsoc2013-empathy-675deab25d7076195e356c84e55de5207b8c3c6f.tar.bz2
gsoc2013-empathy-675deab25d7076195e356c84e55de5207b8c3c6f.tar.lz
gsoc2013-empathy-675deab25d7076195e356c84e55de5207b8c3c6f.tar.xz
gsoc2013-empathy-675deab25d7076195e356c84e55de5207b8c3c6f.tar.zst
gsoc2013-empathy-675deab25d7076195e356c84e55de5207b8c3c6f.zip
Change new message dialog to new conversation and make possible to do voip call.
svn path=/trunk/; revision=608
Diffstat (limited to 'libempathy-gtk/empathy-new-message-dialog.c')
-rw-r--r--libempathy-gtk/empathy-new-message-dialog.c66
1 files changed, 27 insertions, 39 deletions
diff --git a/libempathy-gtk/empathy-new-message-dialog.c b/libempathy-gtk/empathy-new-message-dialog.c
index 80e3b611c..0213b0676 100644
--- a/libempathy-gtk/empathy-new-message-dialog.c
+++ b/libempathy-gtk/empathy-new-message-dialog.c
@@ -47,8 +47,8 @@ typedef struct {
GtkWidget *table_contact;
GtkWidget *account_chooser;
GtkWidget *entry_id;
- GtkWidget *button_validate;
- GtkWidget *button_voip;
+ GtkWidget *button_chat;
+ GtkWidget *button_call;
} EmpathyNewMessageDialog;
static void
@@ -69,27 +69,11 @@ new_message_dialog_response_cb (GtkWidget *widget,
return;
}
- if (response == GTK_RESPONSE_OK) {
- empathy_chat_with_contact_id (account, id);
+ if (response == 1) {
+ empathy_call_with_contact_id (account, id);
}
- else if (response == 3) {
- EmpathyContactFactory *factory;
- EmpathyContact *contact = NULL;
-
- factory = empathy_contact_factory_new ();
- contact = empathy_contact_factory_get_from_id (factory,
- account,
- id);
- if (contact) {
- empathy_call_contact (contact);
- } else {
- empathy_debug (DEBUG_DOMAIN,
- "Contact ID %s does not exists",
- id);
- }
-
- g_object_unref (contact);
- g_object_unref (factory);
+ else if (response == 2) {
+ empathy_chat_with_contact_id (account, id);
}
g_object_unref (account);
@@ -106,8 +90,8 @@ new_message_change_state_button_cb (GtkEditable *editable,
id = gtk_entry_get_text (GTK_ENTRY (editable));
sensitive = !G_STR_EMPTY (id);
- gtk_widget_set_sensitive(dialog->button_validate, sensitive);
- gtk_widget_set_sensitive(dialog->button_voip, sensitive);
+ gtk_widget_set_sensitive (dialog->button_chat, sensitive);
+ gtk_widget_set_sensitive (dialog->button_call, sensitive);
}
static void
@@ -131,21 +115,21 @@ empathy_new_message_dialog_show (GtkWindow *parent)
dialog = g_new0 (EmpathyNewMessageDialog, 1);
glade = empathy_glade_get_file ("empathy-new-message-dialog.glade",
- "new_message_dialog",
- NULL,
- "new_message_dialog", &dialog->dialog,
- "table_contact", &dialog->table_contact,
- "entry_id", &dialog->entry_id,
- "button_validate", &dialog->button_validate,
- "button_voip",&dialog->button_voip,
- NULL);
+ "new_message_dialog",
+ NULL,
+ "new_message_dialog", &dialog->dialog,
+ "table_contact", &dialog->table_contact,
+ "entry_id", &dialog->entry_id,
+ "button_chat", &dialog->button_chat,
+ "button_call",&dialog->button_call,
+ NULL);
empathy_glade_connect (glade,
- 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,
- NULL);
+ 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,
+ NULL);
g_object_add_weak_pointer (G_OBJECT (dialog->dialog), (gpointer) &dialog);
@@ -166,8 +150,12 @@ empathy_new_message_dialog_show (GtkWindow *parent)
GTK_WINDOW (parent));
}
- gtk_widget_set_sensitive(dialog->button_validate, FALSE);
- gtk_widget_set_sensitive(dialog->button_voip, FALSE);
+ gtk_widget_set_sensitive (dialog->button_chat, FALSE);
+ gtk_widget_set_sensitive (dialog->button_call, FALSE);
+
+#ifndef HAVE_VOIP
+ gtk_widget_hide (dialog->button_call);
+#endif
gtk_widget_show (dialog->dialog);