From 5f58e2a9ac3747c157831ae4a62d9424587a6efd Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Fri, 27 Nov 2009 23:11:17 +0100 Subject: [PATCH] save audio / video input / output device in config --- data/glade/preferences_window.glade | 4 ++++ src/common/config.py | 4 ++++ src/config.py | 18 ++++++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/data/glade/preferences_window.glade b/data/glade/preferences_window.glade index e25ca6467..d3ea20d10 100644 --- a/data/glade/preferences_window.glade +++ b/data/glade/preferences_window.glade @@ -1957,6 +1957,7 @@ $T will be replaced by auto-not-available timeout True + 1 @@ -1967,6 +1968,7 @@ $T will be replaced by auto-not-available timeout True + 1 @@ -2059,6 +2061,7 @@ $T will be replaced by auto-not-available timeout True + 1 @@ -2069,6 +2072,7 @@ $T will be replaced by auto-not-available timeout True + 1 diff --git a/src/common/config.py b/src/common/config.py index 831b2b1eb..92bccad61 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -272,6 +272,10 @@ class Config: 'ask_offline_status_on_connection': [ opt_bool, False, _('Ask offline status message to all offline contacts when connection to an accoutn is established. WARNING: This causes a lot of requests to be sent!') ], 'shell_like_completion': [ opt_bool, False, _('If True, completion in groupchats will be like a shell auto-completion')], 'show_self_contact': [opt_str, 'when_other_resource', _('When is self contact row displayed. Can be "always", "when_other_resource" or "never"'), True], + 'audio_input_device': [opt_str, ''], + 'audio_output_device': [opt_str, ''], + 'video_input_device': [opt_str, ''], + 'video_output_device': [opt_str, ''], } __options_per_key = { diff --git a/src/config.py b/src/config.py index 65f14cac6..009e0accd 100644 --- a/src/config.py +++ b/src/config.py @@ -1026,6 +1026,24 @@ class PreferencesWindow: def on_msg_treemodel_row_deleted(self, model, path): self.save_status_messages(model) + def on_av_combobox_changed(self, combobox, opt_name): + model = combobox.get_model() + active = combobox.get_active() + device = model[active][1].decode('utf-8') + gajim.config.set(opt_name + '_device', device) + + def on_audio_input_combobox_changed(self, widget): + self.on_av_combobox_changed(widget, 'audio_input') + + def on_audio_output_combobox_changed(self, widget): + self.on_av_combobox_changed(widget, 'audio_output') + + def on_video_input_combobox_changed(self, widget): + self.on_av_combobox_changed(widget, 'video_input') + + def on_video_output_combobox_changed(self, widget): + self.on_av_combobox_changed(widget, 'video_output') + def on_applications_combobox_changed(self, widget): gajim.config.set('autodetect_browser_mailer', False) if widget.get_active() == 4: