Philipp Hörist pushed to branch mainwindow at gajim / gajim
Commits: 7e470b2e by lovetox at 2021-02-07T20:53:11+01:00 Connect Menu actions
- - - - -
1 changed file:
- gajim/gtk/main.py
Changes:
===================================== gajim/gtk/main.py ===================================== @@ -68,7 +68,6 @@ def __init__(self): self._ui.paned.set_position(app.settings.get('chat_handle_position')) self._ui.paned.connect('button-release-event', self._on_button_release)
- # pylint: disable=line-too-long self.register_events([ ('presence-received', ged.GUI1, self._on_event), ('nickname-received', ged.GUI1, self._on_event), @@ -110,6 +109,8 @@ def __init__(self): ('muc-disco-update', ged.GUI1, self._on_event), ('muc-configuration-finished', ged.GUI1, self._on_event), ('muc-configuration-failed', ged.GUI1, self._on_event), + ('our-show', ged.GUI1, self._on_our_show), + ('signed-in', ged.GUI1, self._on_signed_in), ])
self.show_all() @@ -118,6 +119,17 @@ def __init__(self): self._add_accounts() self._add_actions()
+ @staticmethod + def _on_our_show(event): + if event.show == 'offline': + app.app.set_account_actions_state(event.account) + app.app.update_app_actions_state() + + @staticmethod + def _on_signed_in(event): + app.app.set_account_actions_state(event.account, True) + app.app.update_app_actions_state() + @staticmethod def _on_button_release(paned, event): if event.window != paned.get_handle_window():
View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/7e470b2ec441c326598be5c0c818fc414...