Daniel Brötzmann pushed to branch master at gajim / gajim
Commits:
-
5ecf5a35
by wurstsalat at 2022-04-26T18:59:37+02:00
-
feff2cfd
by wurstsalat at 2022-04-26T19:00:06+02:00
4 changed files:
- gajim/data/gui/preferences.ui
- gajim/gtk/builder.pyi
- gajim/gtk/controls/chat.py
- gajim/gtk/preferences.py
Changes:
| ... | ... | @@ -719,7 +719,7 @@ |
| 719 | 719 | <property name="can-focus">False</property>
|
| 720 | 720 | <property name="orientation">vertical</property>
|
| 721 | 721 | <child>
|
| 722 | - <object class="GtkInfoBar" id="audio_video_info_bar">
|
|
| 722 | + <object class="GtkInfoBar" id="av_info_bar">
|
|
| 723 | 723 | <property name="visible">True</property>
|
| 724 | 724 | <property name="can-focus">False</property>
|
| 725 | 725 | <property name="message-type">warning</property>
|
| ... | ... | @@ -764,7 +764,7 @@ |
| 764 | 764 | <placeholder/>
|
| 765 | 765 | </child>
|
| 766 | 766 | <child>
|
| 767 | - <object class="GtkLabel">
|
|
| 767 | + <object class="GtkLabel" id="av_info_bar_label">
|
|
| 768 | 768 | <property name="visible">True</property>
|
| 769 | 769 | <property name="can-focus">False</property>
|
| 770 | 770 | <property name="label" translatable="yes">Missing dependencies for Audio/Video</property>
|
| ... | ... | @@ -697,8 +697,9 @@ class PreferencesBuilder(Builder): |
| 697 | 697 | automatic_status: Gtk.Grid
|
| 698 | 698 | themes: Gtk.Grid
|
| 699 | 699 | emoji: Gtk.Grid
|
| 700 | - audio_video_info_bar: Gtk.InfoBar
|
|
| 700 | + av_info_bar: Gtk.InfoBar
|
|
| 701 | 701 | button1: Gtk.Button
|
| 702 | + av_info_bar_label: Gtk.Label
|
|
| 702 | 703 | server: Gtk.Grid
|
| 703 | 704 | audio: Gtk.Grid
|
| 704 | 705 | video: Gtk.Grid
|
| ... | ... | @@ -31,6 +31,7 @@ |
| 31 | 31 | |
| 32 | 32 | import time
|
| 33 | 33 | import logging
|
| 34 | +import sys
|
|
| 34 | 35 | |
| 35 | 36 | from gi.repository import Gtk
|
| 36 | 37 | from gi.repository import Gio
|
| ... | ... | @@ -212,7 +213,8 @@ def update_actions(self) -> None: |
| 212 | 213 | audio_available = self._call_widget.get_jingle_available('audio')
|
| 213 | 214 | video_available = self._call_widget.get_jingle_available('video')
|
| 214 | 215 | self._get_action('start-call-').set_enabled(
|
| 215 | - online and (audio_available or video_available))
|
|
| 216 | + online and (audio_available or video_available)
|
|
| 217 | + and sys.platform != 'win32')
|
|
| 216 | 218 | |
| 217 | 219 | # Send message
|
| 218 | 220 | has_text = self.msg_textview.has_text()
|
| ... | ... | @@ -104,7 +104,11 @@ def __init__(self) -> None: |
| 104 | 104 | self._add_prefs(prefs)
|
| 105 | 105 | self._add_video_preview()
|
| 106 | 106 | |
| 107 | - self._ui.audio_video_info_bar.set_revealed(not app.is_installed('AV'))
|
|
| 107 | + self._ui.av_info_bar.set_revealed(
|
|
| 108 | + not app.is_installed('AV') or sys.platform == 'win32')
|
|
| 109 | + if sys.platform == 'win32':
|
|
| 110 | + self._ui.av_info_bar_label.set_text(
|
|
| 111 | + _('Video calls are not available on Windows'))
|
|
| 108 | 112 | |
| 109 | 113 | self.connect('key-press-event', self._on_key_press)
|
| 110 | 114 | self.connect('destroy', self._on_destroy)
|
| ... | ... | @@ -120,16 +124,11 @@ def get_ui(self): |
| 120 | 124 | def _add_prefs(self, prefs: list[tuple[str, Type[PreferenceBox]]]):
|
| 121 | 125 | for ui_name, klass in prefs:
|
| 122 | 126 | pref_box = getattr(self._ui, ui_name)
|
| 123 | - if ui_name == 'video' and sys.platform == 'win32':
|
|
| 124 | - continue
|
|
| 125 | - |
|
| 126 | 127 | pref = klass(self)
|
| 127 | 128 | pref_box.add(pref)
|
| 128 | 129 | self._prefs[ui_name] = pref
|
| 129 | 130 | |
| 130 | 131 | def _add_video_preview(self) -> None:
|
| 131 | - if sys.platform == 'win32':
|
|
| 132 | - return
|
|
| 133 | 132 | self._video_preview = VideoPreview()
|
| 134 | 133 | self._ui.video.add(self._video_preview.widget)
|
| 135 | 134 |