Philipp Hörist pushed to branch newcontrol at gajim / gajim

Commits:

1 changed file:

Changes:

  • gajim/gtk/message_actions_box.py
    ... ... @@ -145,20 +145,16 @@ def _connect_actions(self) -> None:
    145 145
             ]
    
    146 146
     
    
    147 147
             for action in actions:
    
    148
    -            action = app.window.lookup_action(action)
    
    149
    -            assert action is not None
    
    148
    +            action = app.window.get_action(action)
    
    150 149
                 action.connect('activate', self._on_action)
    
    151 150
     
    
    152
    -        action = app.window.lookup_action('set-encryption')
    
    153
    -        assert action is not None
    
    151
    +        action = app.window.get_action('set-encryption')
    
    154 152
             action.connect('change-state', self._change_encryption)
    
    155 153
     
    
    156
    -        action = app.window.lookup_action('send-file-jingle')
    
    157
    -        assert action is not None
    
    154
    +        action = app.window.get_action('send-file-jingle')
    
    158 155
             action.connect('notify::enabled', self._on_send_file_enabled_changed)
    
    159 156
     
    
    160
    -        action = app.window.lookup_action('send-file-httpupload')
    
    161
    -        assert action is not None
    
    157
    +        action = app.window.get_action('send-file-httpupload')
    
    162 158
             action.connect('notify::enabled', self._on_send_file_enabled_changed)
    
    163 159
     
    
    164 160
         def _on_action(self,
    
    ... ... @@ -293,8 +289,7 @@ def _set_chatstate(self, state: bool) -> None:
    293 289
                     self._contact, Chatstate.INACTIVE)
    
    294 290
     
    
    295 291
         def _set_encryption_state(self, state: str) -> None:
    
    296
    -        action = app.window.lookup_action('set-encryption')
    
    297
    -        assert action is not None
    
    292
    +        action = app.window.get_action('set-encryption')
    
    298 293
             action.set_state(GLib.Variant('s', state))
    
    299 294
     
    
    300 295
             if state in ('OMEMO', 'OpenPGP', 'PGP'):
    
    ... ... @@ -514,8 +509,7 @@ def _update_send_file_button_tooltip(self):
    514 509
     
    
    515 510
         def _on_buffer_changed(self, textbuffer: Gtk.TextBuffer) -> None:
    
    516 511
             has_text = self.msg_textview.has_text
    
    517
    -        send_message_action = app.window.lookup_action('send-message')
    
    518
    -        assert send_message_action is not None
    
    512
    +        send_message_action = app.window.get_action('send-message')
    
    519 513
             send_message_action.set_enabled(has_text)
    
    520 514
     
    
    521 515
             encryption_enabled, encryption_name = self._get_encryption_state()