Philipp Hörist pushed to branch newcontrol at gajim / gajim
Commits:
70e2c864 by lovetox at 2022-08-03T23:09:40+02:00
refactor: Remove send-chatstate and send-marker actions
We have no widget who use these actions anymore
- - - - -
2 changed files:
- gajim/gtk/chat_stack.py
- gajim/gtk/const.py
Changes:
=====================================
gajim/gtk/chat_stack.py
=====================================
@@ -324,33 +324,15 @@ def _connect_actions(self) -> None:
'muc-request-voice',
]
- stateful_actions = [
- 'send-chatstate',
- 'send-marker',
- ]
-
for action in actions:
action = app.window.lookup_action(action)
assert action is not None
action.connect('activate', self._on_action)
- for action in stateful_actions:
- action = app.window.lookup_action(action)
- assert action is not None
- action.connect('change-state', self._on_stateful_action)
-
def _update_base_actions(self, contact: ChatContactT) -> None:
client = app.get_client(contact.account)
online = app.account_is_connected(contact.account)
- # TODO: handle gc participants
- chatstate = contact.settings.get('send_chatstate')
- chatstate = GLib.Variant('s', chatstate)
- app.window.get_action('send-chatstate').change_state(chatstate)
-
- state = GLib.Variant('b', contact.settings.get('send_marker'))
- app.window.get_action('send-marker').change_state(state)
-
has_text = self._message_action_box.msg_textview.has_text()
app.window.get_action('send-message').set_enabled(
online and has_text)
@@ -521,21 +503,6 @@ def _on_action(self,
elif action_name == 'muc-request-voice':
client.get_module('MUC').request_voice(contact.jid)
- def _on_stateful_action(self,
- action: Gio.SimpleAction,
- param: GLib.Variant) -> None:
-
- name = action.get_name()
- contact = self._get_current_contact()
-
- if name == 'send-chatstate':
- action.set_state(param)
- contact.settings.set('send_chatstate', param.get_string())
-
- elif name == 'send-marker':
- action.set_state(param)
- contact.settings.set('send_marker', param.get_boolean())
-
def _on_drag_data_received(self,
_widget: Gtk.Widget,
_context: Gdk.DragContext,
=====================================
gajim/gtk/const.py
=====================================
@@ -222,8 +222,6 @@ def __str__(self):
MAIN_WIN_STATEFUL_ACTIONS = [
# action name, variant type, default state, enabled
('set-encryption', 's', 'disabled', False),
- ('send-chatstate', 's', 'disabled', False),
- ('send-marker', 'b', False, False),
]
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/70e2c86488555d964861662659afd39e5578f5bb
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/70e2c86488555d964861662659afd39e5578f5bb
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
[email protected]
https://lists.gajim.org/cgi-bin/listinfo/commits