Daniel Brötzmann pushed to branch master at gajim / gajim


Commits:
f43f63db by wurstsalat at 2022-01-15T19:07:18+01:00
Preferences: Typing

- - - - -
e546be1c by wurstsalat at 2022-01-15T19:07:37+01:00
ChatControl: Fix trailing whitespace

- - - - -


2 changed files:

- gajim/gtk/controls/chat.py
- gajim/gtk/preferences.py


Changes:

=====================================
gajim/gtk/controls/chat.py
=====================================
@@ -82,7 +82,7 @@ class ChatControl(BaseControl):
 
     # Set a command host to bound to. Every command given through a chat will 
be
     # processed with this command host.
-    COMMAND_HOST: ClassVar[Type[CommandHost]] = ChatCommands 
+    COMMAND_HOST: ClassVar[Type[CommandHost]] = ChatCommands
 
     def __init__(self, account: str, jid: JID) -> None:
         BaseControl.__init__(self,


=====================================
gajim/gtk/preferences.py
=====================================
@@ -16,6 +16,7 @@
 from typing import Any
 from typing import Optional
 from typing import cast
+from typing import Type
 
 import logging
 import sys
@@ -77,7 +78,7 @@ def __init__(self) -> None:
 
         self._check_emoji_theme()
 
-        prefs = [
+        prefs: list[tuple[str, Type[PreferenceBox]]] = [
             ('window_behaviour', WindowBehaviour),
             ('chats', Chats),
             ('group_chats', GroupChats),
@@ -111,7 +112,7 @@ def __init__(self) -> None:
     def get_ui(self):
         return self._ui
 
-    def _add_prefs(self, prefs):
+    def _add_prefs(self, prefs: list[tuple[str, Type[PreferenceBox]]]):
         for ui_name, klass in prefs:
             pref_box = getattr(self._ui, ui_name)
             if ui_name == 'video' and sys.platform == 'win32':
@@ -262,6 +263,8 @@ def _on_use_speller(value: bool, *args: Any) -> None:
         gspell_lang = Gspell.language_lookup(lang)
         if gspell_lang is None:
             gspell_lang = Gspell.language_get_default()
+        if gspell_lang is None:
+            return
         app.settings.set('speller_language', gspell_lang.get_code())
         for ctrl in app.window.get_controls():
             ctrl.set_speller()
@@ -855,7 +858,8 @@ def _on_video_input_changed(_value: str, *args: Any) -> 
None:
     def _toggle_live_preview(value: bool, *args: Any) -> None:
         pref_win = cast(Preferences, get_app_window('Preferences'))
         preview = pref_win.get_video_preview()
-        preview.toggle_preview(value)
+        if preview is not None:
+            preview.toggle_preview(value)
 
     @staticmethod
     def _create_av_combo_items(items_dict: dict[str, str]) -> dict[str, str]:



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/33dba187224b2e1e290b252cdc557934f458d6c0...e546be1c9fe4d81001d8c543a51901724322a385

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/33dba187224b2e1e290b252cdc557934f458d6c0...e546be1c9fe4d81001d8c543a51901724322a385
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to