Daniel Brötzmann pushed to branch mainwindow at gajim / gajim
Commits: d4f2d9f4 by wurstsalat at 2021-10-31T23:03:05+01:00 Control: Reset active control when unselecting chat - - - - - 1edcd9dc by wurstsalat at 2021-10-31T23:15:01+01:00 CallRow: Update row correctly - - - - - 3 changed files: - gajim/gtk/chat_page.py - gajim/gtk/chat_stack.py - gajim/gtk/conversation/rows/call.py Changes: ===================================== gajim/gtk/chat_page.py ===================================== @@ -132,6 +132,7 @@ def _on_chat_selected(self, _chat_list_stack, workspace_id, account, jid): def _on_chat_unselected(self, _chat_list_stack): self._chat_stack.clear() + self._chat_stack.reset_active_control() self._search_view.set_context(None, None) def _on_search_history(self, _action, _param): ===================================== gajim/gtk/chat_stack.py ===================================== @@ -105,6 +105,10 @@ def show_chat(self, account, jid): self._active_control = control GLib.idle_add(control.focus) + def reset_active_control(self): + self._active_control.reset_view() + self._active_control = None + def clear(self): self.set_visible_child_name('empty') ===================================== gajim/gtk/conversation/rows/call.py ===================================== @@ -48,8 +48,8 @@ def __init__(self, account, contact, event=None, db_message=None): if is_from_db: sid = db_message.additional_data.get_value('gajim', 'sid') - self._session = self._client.get_module('Jingle').get_jingle_session( - self._contact.jid, sid) + module = self._client.get_module('Jingle') + self._session = module.get_jingle_session(self._contact.jid, sid) avatar_placeholder = Gtk.Box() avatar_placeholder.set_size_request(AvatarSize.ROSTER, -1) @@ -76,7 +76,7 @@ def __init__(self, account, contact, event=None, db_message=None): self.show_all() def update(self): - if self._event is None: + if self._event is None and self._session is None: return self._call_box.destroy() @@ -87,8 +87,7 @@ def update(self): label = SimpleLabel() label.get_style_context().add_class('dim-label') - text = _('%s called you') % self._contact.name - label.set_text(text) + label.set_text(_('Call')) self.grid.attach(label, 2, 0, 1, 1) self.show_all() self._event = None @@ -112,6 +111,7 @@ def _on_reject(self, button): self.get_parent().reject_call(session) else: self.get_parent().reject_call(self._session) + self._session = None def _prepare_incoming_call(self): self._call_box = Gtk.Box( View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/af52f23fa1198aabbaf1221f322ddb313e0d39d7...1edcd9dcadfd8fb940c91e432cec2f22f0755c6d -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/compare/af52f23fa1198aabbaf1221f322ddb313e0d39d7...1edcd9dcadfd8fb940c91e432cec2f22f0755c6d 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