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


Commits:
2560d7ee by wurstsalat at 2021-03-06T10:41:08+01:00
Roster: Rename menu handlers

- - - - -


1 changed file:

- gajim/gtk/roster.py


Changes:

=====================================
gajim/gtk/roster.py
=====================================
@@ -98,10 +98,10 @@ def __init__(self, account):
 
     def _add_actions(self):
         actions = [
-            ('contact-info', self._contact_info),
-            ('execute-command', self._execute_command),
-            ('block-contact', self._block_contact),
-            ('remove-contact', self._remove_contact),
+            ('contact-info', self._on_contact_info),
+            ('execute-command', self._on_execute_command),
+            ('block-contact', self._on_block_contact),
+            ('remove-contact', self._on_remove_contact),
         ]
         for action in actions:
             action_name, func = action
@@ -114,7 +114,7 @@ def _add_actions(self):
             f'show-offline-{self._account}',
             None,
             GLib.Variant.new_boolean(app.settings.get('showoffline')))
-        action.connect('change-state', self._show_offline)
+        action.connect('change-state', self._on_show_offline)
         app.window.add_action(action)
 
     def update_actions(self):
@@ -151,21 +151,21 @@ def _on_account_state(self, _event):
     def _on_theme_update(self, _event):
         self.redraw()
 
-    def _show_offline(self, action, param):
+    def _on_show_offline(self, action, param):
         action.set_state(param)
         app.settings.set('showoffline', param.get_boolean())
         self._draw_contacts()
 
-    def _contact_info(self, _action, param):
+    def _on_contact_info(self, _action, param):
         app.window.contact_info(self._account, param.get_string())
 
-    def _execute_command(self, _action, param):
+    def _on_execute_command(self, _action, param):
         app.window.execute_command(self._account, param.get_string())
 
-    def _block_contact(self, _action, param):
+    def _on_block_contact(self, _action, param):
         app.window.block_contact(self._account, param.get_string())
 
-    def _remove_contact(self, _action, param):
+    def _on_remove_contact(self, _action, param):
         app.window.remove_contact(self._account, param.get_string())
 
     def _on_roster_row_activated(self, _treeview, path, _column):
@@ -289,7 +289,7 @@ def _on_avatar_update(self, contact, _signal_name):
         self._draw_contact(contact)
 
     @event_filter(['account'])
-    def _on_roster_received(self, event):
+    def _on_roster_received(self, _event):
         self._reset()
 
     @event_filter(['account'])
@@ -404,6 +404,7 @@ def _draw_contacts(self):
     def _draw_contact(self, contact):
         for ref in self._contact_refs[contact.jid]:
             self._draw_contact_row(ref, contact)
+        self._roster.expand_all()
 
     def _draw_contact_row(self, ref, contact):
         iter_ = self._get_iter_from_ref(ref)
@@ -490,8 +491,7 @@ def clear(self):
         self._group_refs = {}
         self._store.clear()
 
-    def _on_presence_received(self, event):
-        # TODO: self.draw_contacts() if contact changes status
+    def _on_presence_received(self, _event):
         pass
 
     def process_event(self, event):



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/2560d7eefbe4b869ad15c7c43977d651ce8214ff

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/commit/2560d7eefbe4b869ad15c7c43977d651ce8214ff
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list
Commits@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to