aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-individual-menu.c
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2010-08-06 00:28:16 +0800
committerPhilip Withnall <philip.withnall@collabora.co.uk>2010-08-12 00:34:55 +0800
commitdd8b8fb6b503194aecec14b4f5f9186c253a46c6 (patch)
treeca5c9318330aca8be009685301aa87ab82852d41 /libempathy-gtk/empathy-individual-menu.c
parent9d23b85fc16e7bc4b83af2850fdd2e96909b09d9 (diff)
downloadgsoc2013-empathy-dd8b8fb6b503194aecec14b4f5f9186c253a46c6.tar
gsoc2013-empathy-dd8b8fb6b503194aecec14b4f5f9186c253a46c6.tar.gz
gsoc2013-empathy-dd8b8fb6b503194aecec14b4f5f9186c253a46c6.tar.bz2
gsoc2013-empathy-dd8b8fb6b503194aecec14b4f5f9186c253a46c6.tar.lz
gsoc2013-empathy-dd8b8fb6b503194aecec14b4f5f9186c253a46c6.tar.xz
gsoc2013-empathy-dd8b8fb6b503194aecec14b4f5f9186c253a46c6.tar.zst
gsoc2013-empathy-dd8b8fb6b503194aecec14b4f5f9186c253a46c6.zip
Add EmpathyLinkingDialog
A dialogue which uses EmpathyIndividualLinker to allow linking of Individuals, accessible by a "Link" entry in the contacts' context menu.
Diffstat (limited to 'libempathy-gtk/empathy-individual-menu.c')
-rw-r--r--libempathy-gtk/empathy-individual-menu.c39
1 files changed, 38 insertions, 1 deletions
diff --git a/libempathy-gtk/empathy-individual-menu.c b/libempathy-gtk/empathy-individual-menu.c
index 092208b61..8f8c5e459 100644
--- a/libempathy-gtk/empathy-individual-menu.c
+++ b/libempathy-gtk/empathy-individual-menu.c
@@ -43,6 +43,7 @@
#include "empathy-individual-dialogs.h"
#include "empathy-ui-utils.h"
#include "empathy-share-my-desktop.h"
+#include "empathy-linking-dialog.h"
GtkWidget *
empathy_individual_menu_new (FolksIndividual *individual,
@@ -120,7 +121,8 @@ empathy_individual_menu_new (FolksIndividual *individual,
/* Separator */
if (features & (EMPATHY_INDIVIDUAL_FEATURE_EDIT |
EMPATHY_INDIVIDUAL_FEATURE_INFO |
- EMPATHY_INDIVIDUAL_FEATURE_FAVOURITE))
+ EMPATHY_INDIVIDUAL_FEATURE_FAVOURITE |
+ EMPATHY_INDIVIDUAL_FEATURE_LINK))
{
item = gtk_separator_menu_item_new ();
gtk_menu_shell_append (shell, item);
@@ -135,6 +137,14 @@ empathy_individual_menu_new (FolksIndividual *individual,
gtk_widget_show (item);
}
+ /* Link */
+ if (features & EMPATHY_INDIVIDUAL_FEATURE_LINK)
+ {
+ item = empathy_individual_link_menu_item_new (individual);
+ gtk_menu_shell_append (shell, item);
+ gtk_widget_show (item);
+ }
+
/* Info */
if (features & EMPATHY_INDIVIDUAL_FEATURE_INFO)
{
@@ -610,6 +620,33 @@ empathy_individual_edit_menu_item_new (FolksIndividual *individual)
return item;
}
+static void
+individual_link_menu_item_activate_cb (FolksIndividual *individual)
+{
+ empathy_linking_dialog_show (individual, NULL);
+}
+
+GtkWidget *
+empathy_individual_link_menu_item_new (FolksIndividual *individual)
+{
+ GtkWidget *item;
+ /*GtkWidget *image;*/
+
+ g_return_val_if_fail (FOLKS_IS_INDIVIDUAL (individual), NULL);
+
+ item = gtk_image_menu_item_new_with_mnemonic (
+ C_("Link individual (contextual menu)", "_Link"));
+ /* TODO */
+ /*image = gtk_image_new_from_icon_name (GTK_STOCK_EDIT, GTK_ICON_SIZE_MENU);
+ gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
+ gtk_widget_show (image);*/
+
+ g_signal_connect_swapped (item, "activate",
+ G_CALLBACK (individual_link_menu_item_activate_cb), individual);
+
+ return item;
+}
+
typedef struct
{
FolksIndividual *individual;