diff options
author | Jonny Lamb <jonnylamb@gnome.org> | 2013-08-20 22:21:57 +0800 |
---|---|---|
committer | Jonny Lamb <jonnylamb@gnome.org> | 2013-08-20 22:35:17 +0800 |
commit | 77e07fc2d134a663ff2af3dcb500f3f6c386ee5e (patch) | |
tree | b0e064b52b5b2487206450623744f61ddaa8a248 /src | |
parent | 1fca8aff9bd2bbd3b54022983a6533f2dfd74e89 (diff) | |
download | gsoc2013-empathy-77e07fc2d134a663ff2af3dcb500f3f6c386ee5e.tar.gz gsoc2013-empathy-77e07fc2d134a663ff2af3dcb500f3f6c386ee5e.tar.zst gsoc2013-empathy-77e07fc2d134a663ff2af3dcb500f3f6c386ee5e.zip |
call-window: ensure "Swap camera" is only visible when there are >1 cameras
It was possible to get into a state where "Swap camera" was visible
even when there was only one camera connected.
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-call-window.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c index 39c70c17b..7fe365f30 100644 --- a/src/empathy-call-window.c +++ b/src/empathy-call-window.c @@ -596,25 +596,29 @@ empathy_call_window_swap_camera_cb (GtkAction *action, } static void -empathy_call_window_camera_added_cb (TpawCameraMonitor *monitor, - TpawCamera *camera, - EmpathyCallWindow *self) +empathy_call_window_update_swap_camera (EmpathyCallWindow *self) { - const GList *cameras = tpaw_camera_monitor_get_cameras (monitor); + const GList *cameras = tpaw_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 (TpawCameraMonitor *monitor, +empathy_call_window_camera_added_cb (TpawCameraMonitor *monitor, TpawCamera *camera, EmpathyCallWindow *self) { - const GList *cameras = tpaw_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 (TpawCameraMonitor *monitor, + TpawCamera *camera, + EmpathyCallWindow *self) +{ + empathy_call_window_update_swap_camera (self); } static void @@ -1685,6 +1689,7 @@ empathy_call_window_init (EmpathyCallWindow *self) gtk_action_set_sensitive (priv->menu_fullscreen, FALSE); priv->camera_monitor = tpaw_camera_monitor_dup_singleton (); + empathy_call_window_update_swap_camera (self); g_object_bind_property (priv->camera_monitor, "available", priv->camera_button, "sensitive", |