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

Commits:

1 changed file:

Changes:

  • gajim/gtk/controls/groupchat.py
    ... ... @@ -40,7 +40,8 @@
    40 40
     from gi.repository import GLib
    
    41 41
     from gi.repository import Gio
    
    42 42
     
    
    43
    -from gajim import gui_menu_builder
    
    43
    +from gajim.gui_menu_builder import get_encryption_menu
    
    44
    +from gajim.gui_menu_builder import get_groupchat_menu
    
    44 45
     
    
    45 46
     from gajim.common import app
    
    46 47
     from gajim.common import ged
    
    ... ... @@ -142,8 +143,8 @@ def __init__(self, account, jid):
    142 143
             # Encryption
    
    143 144
             self.set_lock_image()
    
    144 145
     
    
    145
    -        self.xml.encryption_menu.set_menu_model(
    
    146
    -            gui_menu_builder.get_encryption_menu(self.control_id, self._type))
    
    146
    +        self.xml.encryption_menu.set_menu_model(get_encryption_menu(
    
    147
    +            self.control_id, self._type))
    
    147 148
             self.set_encryption_menu_icon()
    
    148 149
     
    
    149 150
             # Banner
    
    ... ... @@ -175,9 +176,9 @@ def __init__(self, account, jid):
    175 176
             self.xml.invite_grid.attach(self._invite_box, 0, 0, 1, 1)
    
    176 177
             self._invite_box.connect('listbox-changed', self._on_invite_ready)
    
    177 178
     
    
    178
    -        self.control_menu = gui_menu_builder.get_groupchat_menu(self.control_id,
    
    179
    -                                                                self.account,
    
    180
    -                                                                self.room_jid)
    
    179
    +        self.control_menu = get_groupchat_menu(self.control_id,
    
    180
    +                                               self.account,
    
    181
    +                                               self.room_jid)
    
    181 182
     
    
    182 183
             self.xml.settings_menu.set_menu_model(self.control_menu)
    
    183 184
     
    
    ... ... @@ -322,7 +323,8 @@ def update_actions(self, *args):
    322 323
                                                             subject_change)
    
    323 324
     
    
    324 325
             # Change Nick
    
    325
    -        self._get_action('change-nickname-').set_enabled(joined)
    
    326
    +        self._get_action('change-nickname-').set_enabled(
    
    327
    +            joined and not self.is_irc())
    
    326 328
     
    
    327 329
             # Execute command
    
    328 330
             self._get_action('execute-command-').set_enabled(joined)
    
    ... ... @@ -391,6 +393,11 @@ def remove_actions(self):
    391 393
             for action in actions:
    
    392 394
                 app.window.remove_action(f'{action}{self.control_id}')
    
    393 395
     
    
    396
    +    def is_irc(self) -> bool:
    
    397
    +        if self.disco_info is None:
    
    398
    +            return False
    
    399
    +        return self.disco_info.is_irc
    
    400
    +
    
    394 401
         def _is_subject_change_allowed(self):
    
    395 402
             contact = self.contact.get_self()
    
    396 403
             if contact is None: