aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-11-25 19:20:10 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2009-11-28 00:33:44 +0800
commit0961715329c70614a83e874c3c8a5b64cea5691b (patch)
tree41f9ac9fac52e6a8aa34404b552902add56b2b75
parent90c8334a4a0c8e84fdd430c44fffb54fa8623b7c (diff)
downloadgsoc2013-empathy-0961715329c70614a83e874c3c8a5b64cea5691b.tar
gsoc2013-empathy-0961715329c70614a83e874c3c8a5b64cea5691b.tar.gz
gsoc2013-empathy-0961715329c70614a83e874c3c8a5b64cea5691b.tar.bz2
gsoc2013-empathy-0961715329c70614a83e874c3c8a5b64cea5691b.tar.lz
gsoc2013-empathy-0961715329c70614a83e874c3c8a5b64cea5691b.tar.xz
gsoc2013-empathy-0961715329c70614a83e874c3c8a5b64cea5691b.tar.zst
gsoc2013-empathy-0961715329c70614a83e874c3c8a5b64cea5691b.zip
make disable_camera, enable_preview and enable_camera no-op if we are already in the desired state
-rw-r--r--src/empathy-call-window.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 8f657f626..1ecfd956c 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -737,6 +737,11 @@ disable_camera (EmpathyCallWindow *self)
{
EmpathyCallWindowPriv *priv = GET_PRIV (self);
+ if (priv->camera_state == CAMERA_STATE_OFF)
+ return;
+
+ DEBUG ("disable camera");
+
display_video_preview (self, FALSE);
empathy_call_window_set_send_video (self, FALSE);
@@ -772,10 +777,6 @@ tool_button_camera_off_toggled_cb (GtkToggleToolButton *toggle,
return;
}
- if (priv->camera_state == CAMERA_STATE_OFF)
- return;
-
- DEBUG ("disable camera");
disable_camera (self);
}
@@ -784,6 +785,11 @@ enable_preview (EmpathyCallWindow *self)
{
EmpathyCallWindowPriv *priv = GET_PRIV (self);
+ if (priv->camera_state == CAMERA_STATE_PREVIEW)
+ return;
+
+ DEBUG ("enable preview");
+
if (priv->camera_state == CAMERA_STATE_ON)
/* preview is already displayed so we just have to stop sending */
empathy_call_window_set_send_video (self, FALSE);
@@ -822,10 +828,6 @@ tool_button_camera_preview_toggled_cb (GtkToggleToolButton *toggle,
return;
}
- if (priv->camera_state == CAMERA_STATE_PREVIEW)
- return;
-
- DEBUG ("enable preview");
enable_preview (self);
}
@@ -834,6 +836,11 @@ enable_camera (EmpathyCallWindow *self)
{
EmpathyCallWindowPriv *priv = GET_PRIV (self);
+ if (priv->camera_state == CAMERA_STATE_ON)
+ return;
+
+ DEBUG ("enable camera");
+
empathy_call_window_set_send_video (self, TRUE);
block_camera_control_signals (self);
@@ -868,10 +875,6 @@ tool_button_camera_on_toggled_cb (GtkToggleToolButton *toggle,
return;
}
- if (priv->camera_state == CAMERA_STATE_ON)
- return;
-
- DEBUG ("enable camera");
enable_camera (self);
}