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

Commits:

3 changed files:

Changes:

  • gajim/gtk/groupchat_inviter.py
    ... ... @@ -294,12 +294,14 @@ def _remove_new_contact_row(self) -> None:
    294 294
                 return
    
    295 295
     
    
    296 296
             for row in self._new_contact_rows.values():
    
    297
    -            self._ui.contacts_listbox.remove(row)
    
    297
    +            if row is not None:
    
    298
    +                self._ui.contacts_listbox.remove(row)
    
    298 299
             self._new_contact_row_visible = False
    
    299 300
     
    
    300 301
         def _update_new_contact_rows(self, search_text: str) -> None:
    
    301 302
             for row in self._new_contact_rows.values():
    
    302
    -            row.update_jid(search_text)
    
    303
    +            if row is not None:
    
    304
    +                row.update_jid(search_text)
    
    303 305
     
    
    304 306
         def _select_new_match(self,
    
    305 307
                               _entry: Gtk.SearchEntry,
    
    ... ... @@ -367,7 +369,7 @@ def _sort_func(row1: ContactRow,
    367 369
             return locale.strcoll(name1.lower(), name2.lower())
    
    368 370
     
    
    369 371
         def _reset(self) -> None:
    
    370
    -        def _remove(row):
    
    372
    +        def _remove(row: Gtk.ListBoxRow) -> None:
    
    371 373
                 self.remove(row)
    
    372 374
                 row.destroy()
    
    373 375
             self._ui.contacts_listbox.foreach(_remove)
    

  • gajim/gtk/groupchat_settings.py
    ... ... @@ -24,7 +24,7 @@
    24 24
     
    
    25 25
     
    
    26 26
     class GroupChatSettings(SettingsBox):
    
    27
    -    def __init__(self, account, jid):
    
    27
    +    def __init__(self, account: str, jid: str) -> None:
    
    28 28
             SettingsBox.__init__(self, account, jid)
    
    29 29
     
    
    30 30
             self.get_style_context().add_class('settings-border')
    
    ... ... @@ -38,7 +38,7 @@ def __init__(self, account, jid):
    38 38
                 'all': _('All Chat States')
    
    39 39
             }
    
    40 40
     
    
    41
    -        settings = [
    
    41
    +        settings: list[Setting] = [
    
    42 42
                 Setting(SettingKind.SWITCH,
    
    43 43
                         _('Show Join/Leave'),
    
    44 44
                         SettingType.GROUP_CHAT,
    

  • gajim/gtk/groupchat_state.py
    ... ... @@ -57,8 +57,8 @@ def set_not_joined(self):
    57 57
         def set_fetching(self):
    
    58 58
             self._ui.groupchat_state.set_visible_child_name('fetching')
    
    59 59
     
    
    60
    -    def _on_join_clicked(self, _button):
    
    60
    +    def _on_join_clicked(self, _button: Gtk.Button) -> None:
    
    61 61
             self.emit('join-clicked')
    
    62 62
     
    
    63
    -    def _on_abort_clicked(self, _button):
    
    63
    +    def _on_abort_clicked(self, _button: Gtk.Button) -> None:
    
    64 64
             self.emit('abort-clicked')