aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-chat-window.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2007-09-09 05:36:53 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-09-09 05:36:53 +0800
commit3ab538f85f2ec8fe2ffdb31957c341596d615e07 (patch)
treedeafd7ec89798bb1b51b5e53106e52116bbc8999 /libempathy-gtk/empathy-chat-window.c
parentd3e46f8c3570d2486eeab6255899daaaf308b036 (diff)
downloadgsoc2013-empathy-3ab538f85f2ec8fe2ffdb31957c341596d615e07.tar
gsoc2013-empathy-3ab538f85f2ec8fe2ffdb31957c341596d615e07.tar.gz
gsoc2013-empathy-3ab538f85f2ec8fe2ffdb31957c341596d615e07.tar.bz2
gsoc2013-empathy-3ab538f85f2ec8fe2ffdb31957c341596d615e07.tar.lz
gsoc2013-empathy-3ab538f85f2ec8fe2ffdb31957c341596d615e07.tar.xz
gsoc2013-empathy-3ab538f85f2ec8fe2ffdb31957c341596d615e07.tar.zst
gsoc2013-empathy-3ab538f85f2ec8fe2ffdb31957c341596d615e07.zip
Adding UI to start a VoIP call. It does nothing yet. Most of the code is
2007-09-08 Xavier Claessens <xclaesse@gmail.com> * libempathy-gtk/empathy-images.h: * libempathy-gtk/empathy-chat.glade: * libempathy-gtk/empathy-contact-list-view.c: * libempathy-gtk/empathy-contact-list-store.c: * libempathy-gtk/empathy-contact-list-store.h: * libempathy-gtk/Makefile.am: * libempathy-gtk/empathy-chat-window.c: * libempathy/empathy-contact.c: * libempathy/empathy-contact.h: Adding UI to start a VoIP call. It does nothing yet. Most of the code is ported from Gossip patch (Raphael Slinckx, Xavier Claessens). svn path=/trunk/; revision=292
Diffstat (limited to 'libempathy-gtk/empathy-chat-window.c')
-rw-r--r--libempathy-gtk/empathy-chat-window.c41
1 files changed, 39 insertions, 2 deletions
diff --git a/libempathy-gtk/empathy-chat-window.c b/libempathy-gtk/empathy-chat-window.c
index 94107e99f..6a2d776f6 100644
--- a/libempathy-gtk/empathy-chat-window.c
+++ b/libempathy-gtk/empathy-chat-window.c
@@ -83,6 +83,8 @@ struct _EmpathyChatWindowPriv {
/* Menu items. */
GtkWidget *menu_conv_clear;
GtkWidget *menu_conv_insert_smiley;
+ GtkWidget *menu_conv_call;
+ GtkWidget *menu_conv_call_separator;
GtkWidget *menu_conv_log;
GtkWidget *menu_conv_separator;
GtkWidget *menu_conv_add_contact;
@@ -138,6 +140,8 @@ static void chat_window_info_activate_cb (GtkWidget *
EmpathyChatWindow *window);
static void chat_window_add_contact_activate_cb (GtkWidget *menuitem,
EmpathyChatWindow *window);
+static void chat_window_call_activate_cb (GtkWidget *menuitem,
+ EmpathyChatWindow *window);
static void chat_window_log_activate_cb (GtkWidget *menuitem,
EmpathyChatWindow *window);
static void chat_window_show_contacts_toggled_cb (GtkWidget *menuitem,
@@ -287,6 +291,8 @@ empathy_chat_window_init (EmpathyChatWindow *window)
"menu_conv", &menu_conv,
"menu_conv_clear", &priv->menu_conv_clear,
"menu_conv_insert_smiley", &priv->menu_conv_insert_smiley,
+ "menu_conv_call", &priv->menu_conv_call,
+ "menu_conv_call_separator", &priv->menu_conv_call_separator,
"menu_conv_log", &priv->menu_conv_log,
"menu_conv_separator", &priv->menu_conv_separator,
"menu_conv_add_contact", &priv->menu_conv_add_contact,
@@ -313,6 +319,7 @@ empathy_chat_window_init (EmpathyChatWindow *window)
"chat_window", "configure-event", chat_window_configure_event_cb,
"menu_conv", "activate", chat_window_conv_activate_cb,
"menu_conv_clear", "activate", chat_window_clear_activate_cb,
+ "menu_conv_call", "activate", chat_window_call_activate_cb,
"menu_conv_log", "activate", chat_window_log_activate_cb,
"menu_conv_add_contact", "activate", chat_window_add_contact_activate_cb,
"menu_conv_info", "activate", chat_window_info_activate_cb,
@@ -900,6 +907,24 @@ chat_window_add_contact_activate_cb (GtkWidget *menuitem,
}
static void
+chat_window_call_activate_cb (GtkWidget *menuitem,
+ EmpathyChatWindow *window)
+{
+ EmpathyChatWindowPriv *priv;
+
+ priv = GET_PRIV (window);
+
+ if (!empathy_chat_is_group_chat (priv->current_chat)) {
+ EmpathyPrivateChat *chat;
+ EmpathyContact *contact;
+
+ chat = EMPATHY_PRIVATE_CHAT (priv->current_chat);
+ contact = empathy_private_chat_get_contact (chat);
+ /* FIXME: Start VoIP */
+ }
+}
+
+static void
chat_window_log_activate_cb (GtkWidget *menuitem,
EmpathyChatWindow *window)
{
@@ -974,12 +999,13 @@ chat_window_configure_event_cb (GtkWidget *widget,
}
static void
-chat_window_conv_activate_cb (GtkWidget *menuitem,
+chat_window_conv_activate_cb (GtkWidget *menuitem,
EmpathyChatWindow *window)
{
EmpathyChatWindowPriv *priv;
- EmpathyLogManager *manager;
+ EmpathyLogManager *manager;
gboolean log_exists = FALSE;
+ gboolean can_voip = FALSE;
priv = GET_PRIV (window);
@@ -990,7 +1016,18 @@ chat_window_conv_activate_cb (GtkWidget *menuitem,
empathy_chat_is_group_chat (priv->current_chat));
g_object_unref (manager);
+ if (!empathy_chat_is_group_chat (priv->current_chat)) {
+ EmpathyPrivateChat *chat;
+ EmpathyContact *contact;
+
+ chat = EMPATHY_PRIVATE_CHAT (priv->current_chat);
+ contact = empathy_private_chat_get_contact (chat);
+ can_voip = empathy_contact_can_voip (contact);
+ }
+
gtk_widget_set_sensitive (priv->menu_conv_log, log_exists);
+ g_object_set (priv->menu_conv_call, "visible", can_voip, NULL);
+ g_object_set (priv->menu_conv_call_separator, "visible", can_voip, NULL);
}
static void