Commit 1cc05b15 authored by Yann Leboulanger's avatar Yann Leboulanger

improve jingle audio GUI

parent 3adbc74e
This diff is collapsed.
...@@ -1449,6 +1449,15 @@ def __init__(self, parent_win, contact, acct, session, resource = None): ...@@ -1449,6 +1449,15 @@ def __init__(self, parent_win, contact, acct, session, resource = None):
id_ = widget.connect('released', self.on_num_button_released) id_ = widget.connect('released', self.on_num_button_released)
self.handlers[id_] = widget self.handlers[id_] = widget
self.dtmf_window = self.xml.get_object('dtmf_window')
id_ = self.dtmf_window.connect('focus-out-event',
self.on_dtmf_window_focus_out_event)
self.handlers[id_] = self.dtmf_window
widget = self.xml.get_object('dtmf_button')
id_ = widget.connect('clicked', self.on_dtmf_button_clicked)
self.handlers[id_] = widget
widget = self.xml.get_object('mic_hscale') widget = self.xml.get_object('mic_hscale')
id_ = widget.connect('value_changed', self.on_mic_hscale_value_changed) id_ = widget.connect('value_changed', self.on_mic_hscale_value_changed)
self.handlers[id_] = widget self.handlers[id_] = widget
...@@ -1595,7 +1604,7 @@ def _update_jingle(self, jingle_type): ...@@ -1595,7 +1604,7 @@ def _update_jingle(self, jingle_type):
def update_audio(self): def update_audio(self):
self._update_jingle('audio') self._update_jingle('audio')
vbox = self.xml.get_object('audio_vbox') hbox = self.xml.get_object('audio_buttons_hbox')
if self.audio_state == self.JINGLE_STATE_CONNECTED: if self.audio_state == self.JINGLE_STATE_CONNECTED:
# Set volume from config # Set volume from config
input_vol = gajim.config.get('audio_input_volume') input_vol = gajim.config.get('audio_input_volume')
...@@ -1605,11 +1614,11 @@ def update_audio(self): ...@@ -1605,11 +1614,11 @@ def update_audio(self):
self.xml.get_object('mic_hscale').set_value(input_vol) self.xml.get_object('mic_hscale').set_value(input_vol)
self.xml.get_object('sound_hscale').set_value(output_vol) self.xml.get_object('sound_hscale').set_value(output_vol)
# Show vbox # Show vbox
vbox.set_no_show_all(False) hbox.set_no_show_all(False)
vbox.show_all() hbox.show_all()
elif not self.audio_sid: elif not self.audio_sid:
vbox.set_no_show_all(True) hbox.set_no_show_all(True)
vbox.hide() hbox.hide()
def update_video(self): def update_video(self):
self._update_jingle('video') self._update_jingle('video')
...@@ -1683,19 +1692,21 @@ def on_num_button_pressed(self, widget, num): ...@@ -1683,19 +1692,21 @@ def on_num_button_pressed(self, widget, num):
def on_num_button_released(self, released): def on_num_button_released(self, released):
self._get_audio_content()._stop_dtmf() self._get_audio_content()._stop_dtmf()
def on_mic_hscale_value_changed(self, widget): def on_dtmf_button_clicked(self, widget):
value = widget.get_value() self.dtmf_window.show_all()
def on_dtmf_window_focus_out_event(self, widget, event):
self.dtmf_window.hide()
def on_mic_hscale_value_changed(self, widget, value):
self._get_audio_content().set_mic_volume(value / 100) self._get_audio_content().set_mic_volume(value / 100)
# Save volume to config # Save volume to config
# FIXME: Putting it here is maybe not the right thing to do?
gajim.config.set('audio_input_volume', value) gajim.config.set('audio_input_volume', value)
def on_sound_hscale_value_changed(self, widget): def on_sound_hscale_value_changed(self, widget, value):
value = widget.get_value()
self._get_audio_content().set_out_volume(value / 100) self._get_audio_content().set_out_volume(value / 100)
# Save volume to config # Save volume to config
# FIXME: Putting it here is maybe not the right thing to do?
gajim.config.set('audio_output_volume', value) gajim.config.set('audio_output_volume', value)
def on_avatar_eventbox_enter_notify_event(self, widget, event): def on_avatar_eventbox_enter_notify_event(self, widget, event):
......
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