[empathy] mic-menu: don't show the menu if we can't switch microphones



commit a719df5e3df6a31d0e629516cffcdfca9436e5ae
Author: Jonny Lamb <jonny lamb collabora co uk>
Date:   Wed Aug 17 16:04:30 2011 +0100

    mic-menu: don't show the menu if we can't switch microphones
    
    Signed-off-by: Jonny Lamb <jonny lamb collabora co uk>

 src/empathy-mic-menu.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/empathy-mic-menu.c b/src/empathy-mic-menu.c
index 7f5cd23..f3d46b1 100644
--- a/src/empathy-mic-menu.c
+++ b/src/empathy-mic-menu.c
@@ -372,6 +372,14 @@ empathy_mic_menu_constructed (GObject *obj)
   gtk_action_group_add_action (priv->action_group, priv->anchor_action);
   g_object_unref (priv->anchor_action);
 
+  priv->microphones = g_queue_new ();
+
+  /* Don't bother with any of this if we don't support changing
+   * microphone, so don't listen for microphone changes or enumerate
+   * the available microphones. */
+  if (!empathy_audio_src_supports_changing_mic (audio))
+    return;
+
   tp_g_signal_connect_object (audio, "notify::microphone",
       G_CALLBACK (empathy_mic_menu_notify_microphone_cb), self, 0);
   tp_g_signal_connect_object (priv->mic_monitor, "microphone-added",
@@ -379,8 +387,6 @@ empathy_mic_menu_constructed (GObject *obj)
   tp_g_signal_connect_object (priv->mic_monitor, "microphone-removed",
       G_CALLBACK (empathy_mic_menu_microphone_removed_cb), self, 0);
 
-  priv->microphones = g_queue_new ();
-
   empathy_mic_monitor_list_microphones_async (priv->mic_monitor,
       empathy_mic_menu_list_microphones_cb, self);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]