Commit 4d95ad5a authored by Saul Ibarra's avatar Saul Ibarra

Switch automatically to the plugged audio device

parent 3a4a27e3
...@@ -551,6 +551,16 @@ class MainWindow(base_class, ui_class): ...@@ -551,6 +551,16 @@ class MainWindow(base_class, ui_class):
for action in self.alert_device_menu.actions(): for action in self.alert_device_menu.actions():
self.alert_devices_group.removeAction(action) self.alert_devices_group.removeAction(action)
self.alert_device_menu.removeAction(action) self.alert_device_menu.removeAction(action)
# TODO replace the following code with a device switch choosing window
old_devices = set(notification.data.old_devices)
new_devices = set(notification.data.new_devices)
added_devices = new_devices - old_devices
if added_devices:
new_device = added_devices.pop()
settings = SIPSimpleSettings()
settings.audio.input_device = new_device
settings.audio.output_device = new_device
settings.save()
self.load_audio_devices() self.load_audio_devices()
def _NH_CFGSettingsObjectDidChange(self, notification): def _NH_CFGSettingsObjectDidChange(self, notification):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment