aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-04-25 17:33:16 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-04-25 17:33:16 +0800
commit9d5d80ba33f31e935c7335be6fa89ecd183b85bc (patch)
tree1cc7c8b8dc09c263bf5089caeaefdea5260b1ef9 /libempathy-gtk
parente7c508690e38330c4d1568e2ff0e1ae1bbf0c8e9 (diff)
downloadgsoc2013-empathy-9d5d80ba33f31e935c7335be6fa89ecd183b85bc.tar
gsoc2013-empathy-9d5d80ba33f31e935c7335be6fa89ecd183b85bc.tar.gz
gsoc2013-empathy-9d5d80ba33f31e935c7335be6fa89ecd183b85bc.tar.bz2
gsoc2013-empathy-9d5d80ba33f31e935c7335be6fa89ecd183b85bc.tar.lz
gsoc2013-empathy-9d5d80ba33f31e935c7335be6fa89ecd183b85bc.tar.xz
gsoc2013-empathy-9d5d80ba33f31e935c7335be6fa89ecd183b85bc.tar.zst
gsoc2013-empathy-9d5d80ba33f31e935c7335be6fa89ecd183b85bc.zip
Setup contact submenu in chat window.
svn path=/trunk/; revision=1045
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-chat.c48
-rw-r--r--libempathy-gtk/empathy-chat.h1
2 files changed, 49 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c
index 53a794b96..55282d164 100644
--- a/libempathy-gtk/empathy-chat.c
+++ b/libempathy-gtk/empathy-chat.c
@@ -48,6 +48,7 @@
#include "empathy-spell-dialog.h"
#include "empathy-contact-list-store.h"
#include "empathy-contact-list-view.h"
+#include "empathy-contact-menu.h"
#include "empathy-ui-utils.h"
#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_CHAT, EmpathyChatPriv))
@@ -1699,6 +1700,53 @@ empathy_chat_get_members_count (EmpathyChat *chat)
return 0;
}
+GtkWidget *
+empathy_chat_get_contact_menu (EmpathyChat *chat)
+{
+ EmpathyChatPriv *priv = GET_PRIV (chat);
+ GtkWidget *menu = NULL;
+
+ g_return_val_if_fail (EMPATHY_IS_CHAT (chat), NULL);
+
+ if (priv->remote_contact) {
+ GtkMenuShell *shell;
+ GtkWidget *item;
+
+ menu = gtk_menu_new ();
+ shell = GTK_MENU_SHELL (menu);
+
+ item = empathy_contact_call_menu_item_new (priv->remote_contact);
+ gtk_menu_shell_append (shell, item);
+ gtk_widget_show (item);
+
+ item = empathy_contact_log_menu_item_new (priv->remote_contact);
+ gtk_menu_shell_append (shell, item);
+ gtk_widget_show (item);
+
+ /* Separator */
+ item = gtk_separator_menu_item_new ();
+ gtk_menu_shell_append (shell, item);
+ gtk_widget_show (item);
+
+ item = empathy_contact_info_menu_item_new (priv->remote_contact);
+ gtk_menu_shell_append (shell, item);
+ gtk_widget_show (item);
+ }
+ else if (priv->contact_list_view) {
+ EmpathyContactListView *view;
+ EmpathyContact *contact;
+
+ view = EMPATHY_CONTACT_LIST_VIEW (priv->contact_list_view);
+ contact = empathy_contact_list_view_get_selected (view);
+ if (contact) {
+ menu = empathy_contact_list_view_get_contact_menu (view, contact);
+ g_object_unref (contact);
+ }
+ }
+
+ return menu;
+}
+
void
empathy_chat_clear (EmpathyChat *chat)
{
diff --git a/libempathy-gtk/empathy-chat.h b/libempathy-gtk/empathy-chat.h
index 2b5e64247..ea98211a1 100644
--- a/libempathy-gtk/empathy-chat.h
+++ b/libempathy-gtk/empathy-chat.h
@@ -72,6 +72,7 @@ const gchar * empathy_chat_get_name (EmpathyChat *chat);
const gchar * empathy_chat_get_subject (EmpathyChat *chat);
EmpathyContact * empathy_chat_get_remote_contact (EmpathyChat *chat);
guint empathy_chat_get_members_count (EmpathyChat *chat);
+GtkWidget * empathy_chat_get_contact_menu (EmpathyChat *chat);
void empathy_chat_clear (EmpathyChat *chat);
void empathy_chat_scroll_down (EmpathyChat *chat);
void empathy_chat_cut (EmpathyChat *chat);