aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTravis Reitter <treitter@gmail.com>2010-08-13 06:38:29 +0800
committerTravis Reitter <treitter@gmail.com>2010-08-16 23:59:01 +0800
commitb52cc53444e1373c7f4d179634fcf8566f0786f3 (patch)
tree9f8339ee11bfed96049ea8f46ad68ae145b32b69
parenteba39f0ca541d20531528eb92e86aa7d623bf3fd (diff)
downloadgsoc2013-empathy-b52cc53444e1373c7f4d179634fcf8566f0786f3.tar
gsoc2013-empathy-b52cc53444e1373c7f4d179634fcf8566f0786f3.tar.gz
gsoc2013-empathy-b52cc53444e1373c7f4d179634fcf8566f0786f3.tar.bz2
gsoc2013-empathy-b52cc53444e1373c7f4d179634fcf8566f0786f3.tar.lz
gsoc2013-empathy-b52cc53444e1373c7f4d179634fcf8566f0786f3.tar.xz
gsoc2013-empathy-b52cc53444e1373c7f4d179634fcf8566f0786f3.tar.zst
gsoc2013-empathy-b52cc53444e1373c7f4d179634fcf8566f0786f3.zip
Support calls in the Personas menu.
-rw-r--r--libempathy-gtk/empathy-individual-menu.c48
-rw-r--r--libempathy-gtk/empathy-individual-menu.h6
-rw-r--r--libempathy-gtk/empathy-individual-view.c4
3 files changed, 42 insertions, 16 deletions
diff --git a/libempathy-gtk/empathy-individual-menu.c b/libempathy-gtk/empathy-individual-menu.c
index 92af5d588..976c15cb4 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;
}
diff --git a/libempathy-gtk/empathy-individual-menu.h b/libempathy-gtk/empathy-individual-menu.h
index fc2a7fcd3..8c89ab708 100644
--- a/libempathy-gtk/empathy-individual-menu.h
+++ b/libempathy-gtk/empathy-individual-menu.h
@@ -45,9 +45,11 @@ GtkWidget * empathy_individual_add_menu_item_new (FolksIndividual *individual);
GtkWidget * empathy_individual_chat_menu_item_new (FolksIndividual *individual,
EmpathyContact *contact);
GtkWidget * empathy_individual_audio_call_menu_item_new (
- FolksIndividual *individual);
+ FolksIndividual *individual,
+ EmpathyContact *contact);
GtkWidget * empathy_individual_video_call_menu_item_new (
- FolksIndividual *individual);
+ FolksIndividual *individual,
+ EmpathyContact *contact);
GtkWidget * empathy_individual_log_menu_item_new (FolksIndividual *individual);
GtkWidget * empathy_individual_info_menu_item_new (FolksIndividual *individual);
GtkWidget * empathy_individual_edit_menu_item_new (FolksIndividual *individual);
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c
index 4e6db6c6d..ad777c94a 100644
--- a/libempathy-gtk/empathy-individual-view.c
+++ b/libempathy-gtk/empathy-individual-view.c
@@ -960,12 +960,12 @@ individual_view_call_activated_cb (EmpathyCellRendererActivatable *cell,
shell = GTK_MENU_SHELL (menu);
/* audio */
- 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 */
- 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);