aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-individual-menu.c
diff options
context:
space:
mode:
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;