summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonny Lamb <jonnylamb@gnome.org>2013-08-20 16:21:57 +0200
committerJonny Lamb <jonnylamb@gnome.org>2013-08-20 16:25:52 +0200
commit117d10fa8321d74f9da4c4ca0902966753866ca1 (patch)
tree38f027cf24e663887ca94bbdea0ae9c33cf455d2
parent8da5fa02e056fb702e9dcc0fee38fa85ef008538 (diff)
call-window: ensure "Swap camera" is only visible when there are >1 camerasswap-camera
It was possible to get into a state where "Swap camera" was visible even when there was only one camera connected.
-rw-r--r--src/empathy-call-window.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 03c9efb61..8c84f7107 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -592,25 +592,29 @@ empathy_call_window_swap_camera_cb (GtkAction *action,
}
static void
-empathy_call_window_camera_added_cb (EmpathyCameraMonitor *monitor,
- EmpathyCamera *camera,
- EmpathyCallWindow *self)
+empathy_call_window_update_swap_camera (EmpathyCallWindow *self)
{
- const GList *cameras = empathy_camera_monitor_get_cameras (monitor);
+ const GList *cameras = empathy_camera_monitor_get_cameras (
+ self->priv->camera_monitor);
gtk_action_set_visible (self->priv->menu_swap_camera,
g_list_length ((GList *) cameras) >= 2);
}
static void
-empathy_call_window_camera_removed_cb (EmpathyCameraMonitor *monitor,
+empathy_call_window_camera_added_cb (EmpathyCameraMonitor *monitor,
EmpathyCamera *camera,
EmpathyCallWindow *self)
{
- const GList *cameras = empathy_camera_monitor_get_cameras (monitor);
+ empathy_call_window_update_swap_camera (self);
+}
- gtk_action_set_visible (self->priv->menu_swap_camera,
- g_list_length ((GList *) cameras) >= 2);
+static void
+empathy_call_window_camera_removed_cb (EmpathyCameraMonitor *monitor,
+ EmpathyCamera *camera,
+ EmpathyCallWindow *self)
+{
+ empathy_call_window_update_swap_camera (self);
}
static void
@@ -1681,6 +1685,7 @@ empathy_call_window_init (EmpathyCallWindow *self)
gtk_action_set_sensitive (priv->menu_fullscreen, FALSE);
priv->camera_monitor = empathy_camera_monitor_dup_singleton ();
+ empathy_call_window_update_swap_camera (self);
g_object_bind_property (priv->camera_monitor, "available",
priv->camera_button, "sensitive",