aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-mic-menu.c
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2011-08-17 23:04:30 +0800
committerJonny Lamb <jonny.lamb@collabora.co.uk>2011-08-18 22:59:11 +0800
commita719df5e3df6a31d0e629516cffcdfca9436e5ae (patch)
tree73a0d31ae877997e6464e424778d2f388c5d887b /src/empathy-mic-menu.c
parent9a93b2732802719b6263b1d314252c7df9c62c1a (diff)
downloadgsoc2013-empathy-a719df5e3df6a31d0e629516cffcdfca9436e5ae.tar
gsoc2013-empathy-a719df5e3df6a31d0e629516cffcdfca9436e5ae.tar.gz
gsoc2013-empathy-a719df5e3df6a31d0e629516cffcdfca9436e5ae.tar.bz2
gsoc2013-empathy-a719df5e3df6a31d0e629516cffcdfca9436e5ae.tar.lz
gsoc2013-empathy-a719df5e3df6a31d0e629516cffcdfca9436e5ae.tar.xz
gsoc2013-empathy-a719df5e3df6a31d0e629516cffcdfca9436e5ae.tar.zst
gsoc2013-empathy-a719df5e3df6a31d0e629516cffcdfca9436e5ae.zip
mic-menu: don't show the menu if we can't switch microphones
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Diffstat (limited to 'src/empathy-mic-menu.c')
-rw-r--r--src/empathy-mic-menu.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/empathy-mic-menu.c b/src/empathy-mic-menu.c
index 7f5cd2380..f3d46b17e 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);
}