summaryrefslogtreecommitdiff
path: root/libempathy-gtk/empathy-individual-menu.c
diff options
context:
space:
mode:
authorTravis Reitter <treitter@gmail.com>2010-08-12 15:38:29 -0700
committerTravis Reitter <treitter@gmail.com>2010-08-16 08:59:01 -0700
commitb52cc53444e1373c7f4d179634fcf8566f0786f3 (patch)
tree9f8339ee11bfed96049ea8f46ad68ae145b32b69 /libempathy-gtk/empathy-individual-menu.c
parenteba39f0ca541d20531528eb92e86aa7d623bf3fd (diff)
Support calls in the Personas menu.
Diffstat (limited to 'libempathy-gtk/empathy-individual-menu.c')
-rw-r--r--libempathy-gtk/empathy-individual-menu.c48
1 files changed, 36 insertions, 12 deletions
diff --git a/libempathy-gtk/empathy-individual-menu.c b/libempathy-gtk/empathy-individual-menu.c
index 92af5d58..976c15cb 100644
--- a/libempathy-gtk/empathy-individual-menu.c
+++ b/libempathy-gtk/empathy-individual-menu.c
@@ -206,12 +206,12 @@ empathy_individual_menu_new (FolksIndividual *individual,
if (features & EMPATHY_INDIVIDUAL_FEATURE_CALL)
{
/* Audio Call */
- item = empathy_individual_audio_call_menu_item_new (individual);
+ item = empathy_individual_audio_call_menu_item_new (individual, NULL);
gtk_menu_shell_append (shell, item);
gtk_widget_show (item);
/* Video Call */
- item = empathy_individual_video_call_menu_item_new (individual);
+ item = empathy_individual_video_call_menu_item_new (individual, NULL);
gtk_menu_shell_append (shell, item);
gtk_widget_show (item);
}
@@ -490,21 +490,33 @@ empathy_individual_audio_call_menu_item_activated (GtkMenuItem *item,
}
GtkWidget *
-empathy_individual_audio_call_menu_item_new (FolksIndividual *individual)
+empathy_individual_audio_call_menu_item_new (FolksIndividual *individual,
+ EmpathyContact *contact)
{
GtkWidget *item;
GtkWidget *image;
- g_return_val_if_fail (FOLKS_IS_INDIVIDUAL (individual), NULL);
+ g_return_val_if_fail (FOLKS_IS_INDIVIDUAL (individual) ||
+ EMPATHY_IS_CONTACT (contact),
+ NULL);
item = gtk_image_menu_item_new_with_mnemonic (C_("menu item", "_Audio Call"));
image = gtk_image_new_from_icon_name (EMPATHY_IMAGE_VOIP, GTK_ICON_SIZE_MENU);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
gtk_widget_show (image);
- menu_item_set_first_contact (item, individual,
- G_CALLBACK (empathy_individual_audio_call_menu_item_activated),
- empathy_contact_can_voip_audio);
+ if (contact != NULL)
+ {
+ menu_item_set_contact (item, contact,
+ G_CALLBACK (empathy_individual_audio_call_menu_item_activated),
+ empathy_contact_can_voip_audio);
+ }
+ else
+ {
+ menu_item_set_first_contact (item, individual,
+ G_CALLBACK (empathy_individual_audio_call_menu_item_activated),
+ empathy_contact_can_voip_audio);
+ }
return item;
}
@@ -520,12 +532,15 @@ empathy_individual_video_call_menu_item_activated (GtkMenuItem *item,
}
GtkWidget *
-empathy_individual_video_call_menu_item_new (FolksIndividual *individual)
+empathy_individual_video_call_menu_item_new (FolksIndividual *individual,
+ EmpathyContact *contact)
{
GtkWidget *item;
GtkWidget *image;
- g_return_val_if_fail (FOLKS_IS_INDIVIDUAL (individual), NULL);
+ g_return_val_if_fail (FOLKS_IS_INDIVIDUAL (individual) ||
+ EMPATHY_IS_CONTACT (contact),
+ NULL);
item = gtk_image_menu_item_new_with_mnemonic (C_("menu item", "_Video Call"));
image = gtk_image_new_from_icon_name (EMPATHY_IMAGE_VIDEO_CALL,
@@ -533,9 +548,18 @@ empathy_individual_video_call_menu_item_new (FolksIndividual *individual)
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
gtk_widget_show (image);
- menu_item_set_first_contact (item, individual,
- G_CALLBACK (empathy_individual_video_call_menu_item_activated),
- empathy_contact_can_voip_video);
+ if (contact != NULL)
+ {
+ menu_item_set_contact (item, contact,
+ G_CALLBACK (empathy_individual_video_call_menu_item_activated),
+ empathy_contact_can_voip_video);
+ }
+ else
+ {
+ menu_item_set_first_contact (item, individual,
+ G_CALLBACK (empathy_individual_video_call_menu_item_activated),
+ empathy_contact_can_voip_video);
+ }
return item;
}