diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2009-11-25 00:26:15 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2009-11-28 00:33:43 +0800 |
commit | c2b043aa2094b697ce903186ea06038f24e1ef4b (patch) | |
tree | 2ef6a32414524fc7d6a8fd2382209b6a9718e2be | |
parent | 05d1a875137abbbefdb249aa02de0d582fe9f3e5 (diff) | |
download | gsoc2013-empathy-c2b043aa2094b697ce903186ea06038f24e1ef4b.tar gsoc2013-empathy-c2b043aa2094b697ce903186ea06038f24e1ef4b.tar.gz gsoc2013-empathy-c2b043aa2094b697ce903186ea06038f24e1ef4b.tar.bz2 gsoc2013-empathy-c2b043aa2094b697ce903186ea06038f24e1ef4b.tar.lz gsoc2013-empathy-c2b043aa2094b697ce903186ea06038f24e1ef4b.tar.xz gsoc2013-empathy-c2b043aa2094b697ce903186ea06038f24e1ef4b.tar.zst gsoc2013-empathy-c2b043aa2094b697ce903186ea06038f24e1ef4b.zip |
disable the others button when 'camera on' is enabled
-rw-r--r-- | src/empathy-call-window.c | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c index ef10866c6..8d4849d8b 100644 --- a/src/empathy-call-window.c +++ b/src/empathy-call-window.c @@ -814,22 +814,42 @@ tool_button_camera_preview_toggled_cb (GtkToggleToolButton *toggle, } static void -tool_button_camera_on_toggled_cb (GtkToggleToolButton *toggle, - EmpathyCallWindow *window) +enable_camera (EmpathyCallWindow *self) { - EmpathyCallWindowPriv *priv = GET_PRIV (window); - gboolean active; + EmpathyCallWindowPriv *priv = GET_PRIV (self); - if (priv->call_state != CONNECTED) - return; + priv->camera_state = CAMERA_STATE_ON; + empathy_call_window_set_send_video (self, TRUE); - active = (gtk_toggle_tool_button_get_active (toggle)); + block_camera_control_signals (self); + gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON ( + priv->tool_button_camera_off), FALSE); + gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON ( + priv->tool_button_camera_preview), FALSE); + unblock_camera_control_signals (self); +} - if (priv->sending_video == active) - return; +static void +tool_button_camera_on_toggled_cb (GtkToggleToolButton *toggle, + EmpathyCallWindow *self) +{ + EmpathyCallWindowPriv *priv = GET_PRIV (self); - empathy_call_window_set_send_video (window, active); - gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (priv->send_video), active); + if (!gtk_toggle_tool_button_get_active (toggle)) + { + if (priv->camera_state == CAMERA_STATE_ON) + { + /* We can't change the state by disabling the button */ + block_camera_control_signals (self); + gtk_toggle_tool_button_set_active (toggle, TRUE); + unblock_camera_control_signals (self); + } + + return; + } + + DEBUG ("enable camera"); + enable_camera (self); } static void |