aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-contact-menu.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-04-25 17:33:29 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-04-25 17:33:29 +0800
commit50efb94e69a9cccebb7475f1977e7eb1f749f362 (patch)
tree60f490e3c7896e5ecb5b2cda835030ebfc1630ef /libempathy-gtk/empathy-contact-menu.c
parent9d5d80ba33f31e935c7335be6fa89ecd183b85bc (diff)
downloadgsoc2013-empathy-50efb94e69a9cccebb7475f1977e7eb1f749f362.tar
gsoc2013-empathy-50efb94e69a9cccebb7475f1977e7eb1f749f362.tar.gz
gsoc2013-empathy-50efb94e69a9cccebb7475f1977e7eb1f749f362.tar.bz2
gsoc2013-empathy-50efb94e69a9cccebb7475f1977e7eb1f749f362.tar.lz
gsoc2013-empathy-50efb94e69a9cccebb7475f1977e7eb1f749f362.tar.xz
gsoc2013-empathy-50efb94e69a9cccebb7475f1977e7eb1f749f362.tar.zst
gsoc2013-empathy-50efb94e69a9cccebb7475f1977e7eb1f749f362.zip
Create contact menu in empathy-contact-menu.h
svn path=/trunk/; revision=1046
Diffstat (limited to 'libempathy-gtk/empathy-contact-menu.c')
-rw-r--r--libempathy-gtk/empathy-contact-menu.c63
1 files changed, 63 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-contact-menu.c b/libempathy-gtk/empathy-contact-menu.c
index 4509dd171..b06bcd3e4 100644
--- a/libempathy-gtk/empathy-contact-menu.c
+++ b/libempathy-gtk/empathy-contact-menu.c
@@ -37,6 +37,69 @@
#define DEBUG_DOMAIN "ContactMenu"
GtkWidget *
+empathy_contact_menu_new (EmpathyContact *contact,
+ EmpathyContactFeatureFlags features)
+{
+ GtkWidget *menu;
+ GtkMenuShell *shell;
+ GtkWidget *item;
+
+ g_return_val_if_fail (EMPATHY_IS_CONTACT (contact), NULL);
+
+ if (features == EMPATHY_CONTACT_FEATURE_NONE) {
+ return NULL;
+ }
+
+ menu = gtk_menu_new ();
+ shell = GTK_MENU_SHELL (menu);
+
+ /* Chat */
+ if (features & EMPATHY_CONTACT_FEATURE_CHAT) {
+ item = empathy_contact_chat_menu_item_new (contact);
+ gtk_menu_shell_append (shell, item);
+ gtk_widget_show (item);
+ }
+
+ /* Call */
+ if (features & EMPATHY_CONTACT_FEATURE_CALL) {
+ item = empathy_contact_call_menu_item_new (contact);
+ gtk_menu_shell_append (shell, item);
+ gtk_widget_show (item);
+ }
+
+ /* Log */
+ if (features & EMPATHY_CONTACT_FEATURE_LOG) {
+ item = empathy_contact_log_menu_item_new (contact);
+ gtk_menu_shell_append (shell, item);
+ gtk_widget_show (item);
+ }
+
+ /* Separator */
+ if (features & (EMPATHY_CONTACT_FEATURE_EDIT |
+ EMPATHY_CONTACT_FEATURE_INFO)) {
+ item = gtk_separator_menu_item_new ();
+ gtk_menu_shell_append (shell, item);
+ gtk_widget_show (item);
+ }
+
+ /* Edit */
+ if (features & EMPATHY_CONTACT_FEATURE_EDIT) {
+ item = empathy_contact_edit_menu_item_new (contact);
+ gtk_menu_shell_append (shell, item);
+ gtk_widget_show (item);
+ }
+
+ /* Info */
+ if (features & EMPATHY_CONTACT_FEATURE_INFO) {
+ item = empathy_contact_info_menu_item_new (contact);
+ gtk_menu_shell_append (shell, item);
+ gtk_widget_show (item);
+ }
+
+ return menu;
+}
+
+GtkWidget *
empathy_contact_chat_menu_item_new (EmpathyContact *contact)
{
GtkWidget *item;