aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-11-25 19:22:46 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-11-28 00:33:44 +0800
commit8d1e30bfa8cacadaf2411c03396bd01ad41332c3 (patch)
tree8b1159f32187077c0a9b7ee165d8b5b79a596173 /src
parent0961715329c70614a83e874c3c8a5b64cea5691b (diff)
downloadgsoc2013-empathy-8d1e30bfa8cacadaf2411c03396bd01ad41332c3.tar
gsoc2013-empathy-8d1e30bfa8cacadaf2411c03396bd01ad41332c3.tar.gz
gsoc2013-empathy-8d1e30bfa8cacadaf2411c03396bd01ad41332c3.tar.bz2
gsoc2013-empathy-8d1e30bfa8cacadaf2411c03396bd01ad41332c3.tar.lz
gsoc2013-empathy-8d1e30bfa8cacadaf2411c03396bd01ad41332c3.tar.xz
gsoc2013-empathy-8d1e30bfa8cacadaf2411c03396bd01ad41332c3.tar.zst
gsoc2013-empathy-8d1e30bfa8cacadaf2411c03396bd01ad41332c3.zip
hook the camera radio buttons
Diffstat (limited to 'src')
-rw-r--r--src/empathy-call-window.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 1ecfd956c..b94f6796e 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -96,7 +96,7 @@ typedef enum {
} CallState;
typedef enum {
- CAMERA_STATE_OFF,
+ CAMERA_STATE_OFF = 0,
CAMERA_STATE_PREVIEW,
CAMERA_STATE_ON,
} CameraState;
@@ -879,6 +879,34 @@ tool_button_camera_on_toggled_cb (GtkToggleToolButton *toggle,
}
static void
+action_camera_change_cb (GtkRadioAction *action,
+ GtkRadioAction *current,
+ EmpathyCallWindow *self)
+{
+ CameraState state;
+
+ state = gtk_radio_action_get_current_value (current);
+
+ switch (state)
+ {
+ case CAMERA_STATE_OFF:
+ disable_camera (self);
+ break;
+
+ case CAMERA_STATE_PREVIEW:
+ enable_preview (self);
+ break;
+
+ case CAMERA_STATE_ON:
+ enable_camera (self);
+ break;
+
+ default:
+ g_assert_not_reached ();
+ }
+}
+
+static void
empathy_call_window_init (EmpathyCallWindow *self)
{
EmpathyCallWindowPriv *priv = GET_PRIV (self);
@@ -921,6 +949,7 @@ empathy_call_window_init (EmpathyCallWindow *self)
"camera_off", "toggled", tool_button_camera_off_toggled_cb,
"camera_preview", "toggled", tool_button_camera_preview_toggled_cb,
"camera_on", "toggled", tool_button_camera_on_toggled_cb,
+ "action_camera_off", "changed", action_camera_change_cb,
NULL);
priv->lock = g_mutex_new ();
@@ -2563,6 +2592,8 @@ block_camera_control_signals (EmpathyCallWindow *self)
tool_button_camera_preview_toggled_cb, self);
g_signal_handlers_block_by_func (priv->tool_button_camera_on,
tool_button_camera_on_toggled_cb, self);
+ g_signal_handlers_block_by_func (priv->action_camera,
+ tool_button_camera_on_toggled_cb, self);
}
static void
@@ -2576,4 +2607,6 @@ unblock_camera_control_signals (EmpathyCallWindow *self)
tool_button_camera_preview_toggled_cb, self);
g_signal_handlers_unblock_by_func (priv->tool_button_camera_on,
tool_button_camera_on_toggled_cb, self);
+ g_signal_handlers_unblock_by_func (priv->action_camera,
+ tool_button_camera_on_toggled_cb, self);
}