[empathy] make disable_camera, enable_preview and enable_camera no-op if we are already in the desired state
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [empathy] make disable_camera, enable_preview and enable_camera no-op if we are already in the desired state
- Date: Fri, 27 Nov 2009 16:41:18 +0000 (UTC)
commit 0961715329c70614a83e874c3c8a5b64cea5691b
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Wed Nov 25 11:20:10 2009 +0000
make disable_camera, enable_preview and enable_camera no-op if we are already in the desired state
src/empathy-call-window.c | 27 +++++++++++++++------------
1 files changed, 15 insertions(+), 12 deletions(-)
---
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index 8f657f6..1ecfd95 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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]