Philipp Hörist pushed to branch master at gajim / gajim
Commits: 1bc90e22 by Daniel Brötzmann at 2020-03-19T21:07:35+01:00 Preferences: Add infobar for missing A/V dependencies
- - - - -
2 changed files:
- gajim/data/gui/preferences_window.ui - gajim/gtk/preferences.py
Changes:
===================================== gajim/data/gui/preferences_window.ui ===================================== @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.22.1 --> +<!-- Generated with glade 3.22.2 --> <interface> <requires lib="gtk+" version="3.20"/> <object class="GtkAdjustment" id="adjustment_status_auto_away"> @@ -2092,305 +2092,393 @@ $T will be replaced by auto-not-available timeout.</property> </packing> </child> <child> - <object class="GtkBox" id="audio_video_tab"> + <object class="GtkBox"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="border_width">18</property> <property name="orientation">vertical</property> - <property name="spacing">6</property> <child> - <object class="GtkGrid"> + <object class="GtkInfoBar" id="av_dependencies_infobar"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="halign">start</property> - <property name="row_spacing">6</property> - <property name="column_spacing">12</property> - <child> - <object class="GtkLabel"> - <property name="width_request">-1</property> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">end</property> - <property name="label" translatable="yes">A_udio output device</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">audio_output_combobox</property> - <style> - <class name="dim-label"/> - </style> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">2</property> - </packing> - </child> - <child> - <object class="GtkComboBox" id="audio_output_combobox"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <signal name="changed" handler="on_audio_output_combobox_changed" swapped="no"/> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">2</property> - </packing> - </child> - <child> - <object class="GtkComboBox" id="audio_input_combobox"> - <property name="width_request">200</property> - <property name="visible">True</property> - <property name="can_focus">False</property> - <signal name="changed" handler="on_audio_input_combobox_changed" swapped="no"/> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">1</property> - </packing> - </child> - <child> - <object class="GtkLabel"> - <property name="width_request">-1</property> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">end</property> - <property name="label" translatable="yes">_Audio input device</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">audio_input_combobox</property> - <style> - <class name="dim-label"/> - </style> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> - </packing> - </child> - <child> - <object class="GtkLabel"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">start</property> - <property name="label" translatable="yes">Audio</property> - <property name="use_markup">True</property> - <style> - <class name="bold"/> - <class name="margin-top6"/> - </style> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> - </packing> - </child> - <child> - <object class="GtkLabel"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">start</property> - <property name="label" translatable="yes">Video</property> - <property name="use_markup">True</property> - <style> - <class name="bold"/> - <class name="margin-top6"/> - </style> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">3</property> - </packing> - </child> - <child> - <object class="GtkLabel"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">end</property> - <property name="label" translatable="yes">_Video input device</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">video_input_combobox</property> - <style> - <class name="dim-label"/> - </style> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">4</property> - </packing> - </child> - <child> - <object class="GtkComboBox" id="video_input_combobox"> - <property name="visible">True</property> + <property name="message_type">warning</property> + <child internal-child="action_area"> + <object class="GtkButtonBox"> <property name="can_focus">False</property> - <signal name="changed" handler="on_video_input_combobox_changed" swapped="no"/> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">4</property> - </packing> - </child> - <child> - <object class="GtkLabel"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">end</property> - <property name="label" translatable="yes">Video output</property> - <property name="mnemonic_widget">selected_video_output</property> - <style> - <class name="dim-label"/> - </style> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">5</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="selected_video_output"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">start</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">5</property> - </packing> - </child> - <child> - <object class="GtkLabel"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">end</property> - <property name="margin_top">12</property> - <property name="label" translatable="yes">Video _framerate</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">video_framerate_combobox</property> - <style> - <class name="dim-label"/> - </style> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">6</property> - </packing> - </child> - <child> - <object class="GtkComboBox" id="video_framerate_combobox"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="margin_top">12</property> - <signal name="changed" handler="on_video_framerate_combobox_changed" swapped="no"/> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">6</property> - </packing> - </child> - <child> - <object class="GtkLabel"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">end</property> - <property name="label" translatable="yes">Video si_ze</property> - <property name="use_underline">True</property> - <property name="mnemonic_widget">video_size_combobox</property> - <style> - <class name="dim-label"/> - </style> + <property name="spacing">6</property> + <property name="layout_style">end</property> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <object class="GtkButton" id="features_button"> + <property name="label" translatable="yes">Show _Features</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_underline">True</property> + <signal name="clicked" handler="_on_features_button_clicked" swapped="no"/> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> </object> <packing> - <property name="left_attach">0</property> - <property name="top_attach">7</property> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> </packing> </child> - <child> - <object class="GtkComboBox" id="video_size_combobox"> - <property name="visible">True</property> + <child internal-child="content_area"> + <object class="GtkBox"> <property name="can_focus">False</property> - <signal name="changed" handler="on_video_size_combobox_changed" swapped="no"/> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">7</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="video_see_self_checkbutton"> - <property name="label" translatable="yes">Vi_ew own video source</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="halign">start</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="on_video_see_self_checkbutton_toggled" swapped="no"/> + <property name="spacing">16</property> + <child> + <object class="GtkLabel" id="av_dependencies_label"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="ellipsize">end</property> + <property name="single_line_mode">True</property> + <property name="max_width_chars">50</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> </object> <packing> - <property name="left_attach">1</property> - <property name="top_attach">8</property> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">0</property> </packing> </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkBox" id="audio_video_tab"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="border_width">18</property> + <property name="orientation">vertical</property> + <property name="spacing">6</property> <child> - <object class="GtkLabel"> + <object class="GtkGrid"> <property name="visible">True</property> <property name="can_focus">False</property> <property name="halign">start</property> - <property name="label" translatable="yes">Connection</property> - <property name="use_markup">True</property> - <style> - <class name="bold"/> - <class name="margin-top6"/> - </style> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">9</property> - </packing> - </child> - <child> - <object class="GtkCheckButton" id="stun_checkbutton"> - <property name="label" translatable="yes">STU_N server</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">False</property> - <property name="halign">end</property> - <property name="use_underline">True</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="on_stun_checkbutton_toggled" swapped="no"/> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">10</property> - </packing> - </child> - <child> - <object class="GtkEntry" id="stun_server_entry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="tooltip_text" translatable="yes">STUN server hostname. If no hostname was given, Gajim will try + <property name="row_spacing">6</property> + <property name="column_spacing">12</property> + <child> + <object class="GtkLabel"> + <property name="width_request">-1</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">end</property> + <property name="label" translatable="yes">A_udio output device</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">audio_output_combobox</property> + <style> + <class name="dim-label"/> + </style> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="audio_output_combobox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <signal name="changed" handler="on_audio_output_combobox_changed" swapped="no"/> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">2</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="audio_input_combobox"> + <property name="width_request">200</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <signal name="changed" handler="on_audio_input_combobox_changed" swapped="no"/> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="GtkLabel"> + <property name="width_request">-1</property> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">end</property> + <property name="label" translatable="yes">_Audio input device</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">audio_input_combobox</property> + <style> + <class name="dim-label"/> + </style> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">1</property> + </packing> + </child> + <child> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="label" translatable="yes">Audio</property> + <property name="use_markup">True</property> + <style> + <class name="bold"/> + <class name="margin-top6"/> + </style> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">0</property> + </packing> + </child> + <child> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="label" translatable="yes">Video</property> + <property name="use_markup">True</property> + <style> + <class name="bold"/> + <class name="margin-top6"/> + </style> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">3</property> + </packing> + </child> + <child> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">end</property> + <property name="label" translatable="yes">_Video input device</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">video_input_combobox</property> + <style> + <class name="dim-label"/> + </style> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">4</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="video_input_combobox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <signal name="changed" handler="on_video_input_combobox_changed" swapped="no"/> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">4</property> + </packing> + </child> + <child> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">end</property> + <property name="label" translatable="yes">Video output</property> + <property name="mnemonic_widget">selected_video_output</property> + <style> + <class name="dim-label"/> + </style> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">5</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="selected_video_output"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">5</property> + </packing> + </child> + <child> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">end</property> + <property name="margin_top">12</property> + <property name="label" translatable="yes">Video _framerate</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">video_framerate_combobox</property> + <style> + <class name="dim-label"/> + </style> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">6</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="video_framerate_combobox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_top">12</property> + <signal name="changed" handler="on_video_framerate_combobox_changed" swapped="no"/> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">6</property> + </packing> + </child> + <child> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">end</property> + <property name="label" translatable="yes">Video si_ze</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">video_size_combobox</property> + <style> + <class name="dim-label"/> + </style> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">7</property> + </packing> + </child> + <child> + <object class="GtkComboBox" id="video_size_combobox"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <signal name="changed" handler="on_video_size_combobox_changed" swapped="no"/> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">7</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="video_see_self_checkbutton"> + <property name="label" translatable="yes">Vi_ew own video source</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="halign">start</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="on_video_see_self_checkbutton_toggled" swapped="no"/> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">8</property> + </packing> + </child> + <child> + <object class="GtkLabel"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">start</property> + <property name="label" translatable="yes">Connection</property> + <property name="use_markup">True</property> + <style> + <class name="bold"/> + <class name="margin-top6"/> + </style> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">9</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="stun_checkbutton"> + <property name="label" translatable="yes">STU_N server</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="halign">end</property> + <property name="use_underline">True</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="on_stun_checkbutton_toggled" swapped="no"/> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">10</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="stun_server_entry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="tooltip_text" translatable="yes">STUN server hostname. If no hostname was given, Gajim will try to discover one from the server. (Example: stun.iptel.org)</property> - <property name="invisible_char">●</property> - <signal name="changed" handler="stun_server_entry_changed" swapped="no"/> + <property name="invisible_char">●</property> + <signal name="changed" handler="stun_server_entry_changed" swapped="no"/> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">10</property> + </packing> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> </object> <packing> - <property name="left_attach">1</property> - <property name="top_attach">10</property> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> </packing> </child> - <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> - <child> - <placeholder/> - </child> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">0</property> + <property name="position">1</property> </packing> </child> </object>
===================================== gajim/gtk/preferences.py ===================================== @@ -13,6 +13,7 @@ # along with Gajim. If not, see http://www.gnu.org/licenses/.
import logging +import os
from gi.repository import GLib from gi.repository import Gtk @@ -358,7 +359,17 @@ class Preferences(Gtk.ApplicationWindow): if config == value: combobox.set_active(index)
+ if os.name == 'nt': + self._ui.av_dependencies_label.set_text( + _('Feature not available under Windows')) + else: + self._ui.av_dependencies_label.set_text( + _('Missing dependencies for Audio/Video')) + if app.is_installed('AV'): + self._ui.av_dependencies_infobar.set_no_show_all(True) + self._ui.av_dependencies_infobar.hide() + create_av_combobox('audio_input', AudioInputManager().get_devices()) create_av_combobox('audio_output', AudioOutputManager().get_devices()) create_av_combobox('video_input', VideoInputManager().get_devices()) @@ -961,6 +972,9 @@ class Preferences(Gtk.ApplicationWindow): self.on_checkbutton_toggled(widget, 'use_transports_iconsets')
### Audio/Video tab ### + def _on_features_button_clicked(self, _button): + open_window('Features') + def on_av_combobox_changed(self, combobox, config_name): model = combobox.get_model() active = combobox.get_active()
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/1bc90e224d63a0d8926fb4753a9a5e073...