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

Commits:

5 changed files:

Changes:

  • gajim/gtk/control_stack.py
    ... ... @@ -18,7 +18,6 @@
    18 18
     
    
    19 19
     import logging
    
    20 20
     
    
    21
    -from gi.repository import GLib
    
    22 21
     from gi.repository import Gtk
    
    23 22
     
    
    24 23
     from nbxmpp import JID
    

  • gajim/gtk/controls/base.py
    ... ... @@ -309,9 +309,6 @@ def is_groupchat(self) -> bool:
    309 309
         def _nec_ping(self, obj):
    
    310 310
             raise NotImplementedError
    
    311 311
     
    
    312
    -    def delegate_action(self, action: str) -> int:
    
    313
    -        pass
    
    314
    -
    
    315 312
         def mark_as_read(self, send_marker: bool = True) -> None:
    
    316 313
             self._jump_to_end_button.reset_unread_count()
    
    317 314
     
    

  • gajim/gtk/controls/chat.py
    ... ... @@ -88,9 +88,6 @@ def _connect_contact_signals(self) -> None:
    88 88
         def jid(self) -> JID:
    
    89 89
             return self.contact.jid
    
    90 90
     
    
    91
    -    def delegate_action(self, action: str) -> int:
    
    92
    -        return Gdk.EVENT_PROPAGATE
    
    93
    -
    
    94 91
         def _on_mam_message_received(self,
    
    95 92
                                      event: events.MamMessageReceived) -> None:
    
    96 93
             if event.properties.is_muc_pm:
    

  • gajim/gtk/controls/groupchat.py
    ... ... @@ -700,29 +700,6 @@ def _on_drag_data_received(self,
    700 700
                 # File drag and drop (handled in chat_control_base)
    
    701 701
                 self.drag_data_file_transfer(selection)
    
    702 702
     
    
    703
    -    def delegate_action(self, action: str) -> int:
    
    704
    -        res = super().delegate_action(action)
    
    705
    -        if res == Gdk.EVENT_STOP:
    
    706
    -            return res
    
    707
    -
    
    708
    -        if action == 'change-nickname':
    
    709
    -            app.window.activate_action('muc-change-nickname', None)
    
    710
    -            return Gdk.EVENT_STOP
    
    711
    -
    
    712
    -        # if action == 'escape':
    
    713
    -        #     if self._get_current_page() == 'groupchat':
    
    714
    -        #         return Gdk.EVENT_PROPAGATE
    
    715
    -
    
    716
    -        #     return Gdk.EVENT_STOP
    
    717
    -
    
    718
    -        if action == 'change-subject':
    
    719
    -            open_window('GroupchatDetails',
    
    720
    -                        contact=self.contact,
    
    721
    -                        page='manage')
    
    722
    -            return Gdk.EVENT_STOP
    
    723
    -
    
    724
    -        return Gdk.EVENT_PROPAGATE
    
    725
    -
    
    726 703
         def _on_groupchat_state_abort_clicked(self, _button: Gtk.Button) -> None:
    
    727 704
             app.window.activate_action(
    
    728 705
                 'remove-chat',
    

  • gajim/gtk/main.py
    ... ... @@ -393,10 +393,15 @@ def _on_action(self,
    393 393
     
    
    394 394
             control = self.get_active_control()
    
    395 395
             if control is not None:
    
    396
    +            if action_name == 'change-nickname':
    
    397
    +                app.window.activate_action('muc-change-nickname', None)
    
    398
    +                return None
    
    396 399
     
    
    397
    -            res = control.delegate_action(action_name)
    
    398
    -            if res != Gdk.EVENT_PROPAGATE:
    
    399
    -                return res
    
    400
    +            if action_name == 'change-subject':
    
    401
    +                open_window('GroupchatDetails',
    
    402
    +                            contact=control.contact,
    
    403
    +                            page='manage')
    
    404
    +                return None
    
    400 405
     
    
    401 406
                 if action_name == 'escape':
    
    402 407
                     if app.settings.get('escape_key_closes'):