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

Commits:

2 changed files:

Changes:

  • gajim/data/gui/systray_context_menu.ui
    1 1
     <?xml version="1.0" encoding="UTF-8"?>
    
    2
    -<!-- Generated with glade 3.18.3 -->
    
    2
    +<!-- Generated with glade 3.22.1 -->
    
    3 3
     <interface>
    
    4 4
       <requires lib="gtk+" version="3.12"/>
    
    5 5
       <object class="GtkAccelGroup" id="accelgroup1"/>
    
    ... ... @@ -14,11 +14,12 @@
    14 14
           </object>
    
    15 15
         </child>
    
    16 16
         <child>
    
    17
    -      <object class="GtkMenuItem" id="chat_with_menuitem">
    
    17
    +      <object class="GtkMenuItem" id="start_chat_menuitem">
    
    18 18
             <property name="visible">True</property>
    
    19 19
             <property name="can_focus">False</property>
    
    20 20
             <property name="label" translatable="yes">_Start Chat...</property>
    
    21 21
             <property name="use_underline">True</property>
    
    22
    +        <signal name="activate" handler="on_new_chat" swapped="no"/>
    
    22 23
           </object>
    
    23 24
         </child>
    
    24 25
         <child>
    

  • gajim/gtk/statusicon.py
    ... ... @@ -46,7 +46,6 @@ class StatusIcon:
    46 46
         def __init__(self):
    
    47 47
             self.single_message_handler_id = None
    
    48 48
             self.show_roster_handler_id = None
    
    49
    -        self.new_chat_handler_id = None
    
    50 49
             # click somewhere else does not popdown menu. workaround this.
    
    51 50
             self.added_hide_menuitem = False
    
    52 51
             self.status = 'offline'
    
    ... ... @@ -170,7 +169,7 @@ class StatusIcon:
    170 169
         def on_single_message_menuitem_activate(self, widget, account):
    
    171 170
             SingleMessageWindow(account, action='send')
    
    172 171
     
    
    173
    -    def on_new_chat(self, widget, account):
    
    172
    +    def on_new_chat(self, _widget):
    
    174 173
             app.app.activate_action('start-chat', GLib.Variant('s', ''))
    
    175 174
     
    
    176 175
         def make_menu(self, event_button, event_time):
    
    ... ... @@ -180,7 +179,7 @@ class StatusIcon:
    180 179
             for m in self.popup_menus:
    
    181 180
                 m.destroy()
    
    182 181
     
    
    183
    -        chat_with_menuitem = self._ui.chat_with_menuitem
    
    182
    +        start_chat_menuitem = self._ui.start_chat_menuitem
    
    184 183
             single_message_menuitem = self._ui.single_message_menuitem
    
    185 184
             status_menuitem = self._ui.status_menu
    
    186 185
             join_gc_menuitem = self._ui.join_gc_menuitem
    
    ... ... @@ -191,9 +190,6 @@ class StatusIcon:
    191 190
                 single_message_menuitem.handler_disconnect(
    
    192 191
                         self.single_message_handler_id)
    
    193 192
                 self.single_message_handler_id = None
    
    194
    -        if self.new_chat_handler_id:
    
    195
    -            chat_with_menuitem.disconnect(self.new_chat_handler_id)
    
    196
    -            self.new_chat_handler_id = None
    
    197 193
     
    
    198 194
             sub_menu = Gtk.Menu()
    
    199 195
             self.popup_menus.append(sub_menu)
    
    ... ... @@ -229,34 +225,11 @@ class StatusIcon:
    229 225
     
    
    230 226
             iskey = connected_accounts > 0 and not (connected_accounts == 1 and
    
    231 227
                 app.zeroconf_is_connected())
    
    232
    -        chat_with_menuitem.set_sensitive(iskey)
    
    228
    +        start_chat_menuitem.set_sensitive(iskey)
    
    233 229
             single_message_menuitem.set_sensitive(iskey)
    
    234 230
             join_gc_menuitem.set_sensitive(iskey)
    
    235 231
     
    
    236 232
             accounts_list = sorted(app.contacts.get_accounts())
    
    237
    -        # items that get shown whether an account is zeroconf or not
    
    238
    -        if connected_accounts > 1: # 2 or more connections? make submenus
    
    239
    -            account_menu_for_chat_with = Gtk.Menu()
    
    240
    -            chat_with_menuitem.set_submenu(account_menu_for_chat_with)
    
    241
    -            self.popup_menus.append(account_menu_for_chat_with)
    
    242
    -
    
    243
    -            for account in accounts_list:
    
    244
    -                account_label = app.get_account_label(account)
    
    245
    -                if app.account_is_connected(account):
    
    246
    -                    # for chat_with
    
    247
    -                    item = Gtk.MenuItem.new_with_label(
    
    248
    -                        _('using account %s') % account_label)
    
    249
    -                    account_menu_for_chat_with.append(item)
    
    250
    -                    item.connect('activate', self.on_new_chat, account)
    
    251
    -
    
    252
    -        elif connected_accounts == 1: # one account
    
    253
    -            # one account connected, no need to show 'as jid'
    
    254
    -            for account in app.connections:
    
    255
    -                if app.connections[account].connected > 1:
    
    256
    -                    # for start chat
    
    257
    -                    self.new_chat_handler_id = chat_with_menuitem.connect(
    
    258
    -                            'activate', self.on_new_chat, account)
    
    259
    -                    break # No other connected account
    
    260 233
     
    
    261 234
             # menu items that don't apply to zeroconf connections
    
    262 235
             if connected_accounts == 1 or (connected_accounts == 2 and \