diff options
author | lovetox <philipp@hoerist.com> | 2022-08-16 21:53:26 +0300 |
---|---|---|
committer | lovetox <philipp@hoerist.com> | 2022-08-16 21:53:26 +0300 |
commit | 015b8548e8cf18ff51b57ad6c2d8cee3d3d20bfb (patch) | |
tree | add5e456d46a8c3de8197bc6ac9405984f78dc8e | |
parent | f7fecc737cb14a9f3a8dd61ba3a5255aad07f85b (diff) |
cq: Fix some annotations to prevent import cycles
-rw-r--r-- | gajim/gtk/chat_action_processor.py | 9 | ||||
-rw-r--r-- | gajim/gtk/groupchat_nick_completion.py | 6 |
2 files changed, 5 insertions, 10 deletions
diff --git a/gajim/gtk/chat_action_processor.py b/gajim/gtk/chat_action_processor.py index 9ad1c78d5..a4af8e269 100644 --- a/gajim/gtk/chat_action_processor.py +++ b/gajim/gtk/chat_action_processor.py @@ -16,7 +16,6 @@ from __future__ import annotations from typing import cast from typing import Optional -from typing import TYPE_CHECKING from gi.repository import Gdk from gi.repository import Gio @@ -31,14 +30,12 @@ from gajim.common.modules.contacts import GroupchatContact from .emoji_data_gtk import get_emoji_data from .groupchat_nick_completion import GroupChatNickCompletion -if TYPE_CHECKING: - from .message_input import MessageInputTextView MAX_ENTRIES = 5 class ChatActionProcessor(Gtk.Popover): - def __init__(self, message_input: MessageInputTextView) -> None: + def __init__(self, message_input: Gtk.TextView) -> None: Gtk.Popover.__init__(self) self._menu = Gio.Menu() self.bind_model(self._menu) @@ -75,7 +72,7 @@ class ChatActionProcessor(Gtk.Popover): app.check_finalize(self) def _on_key_press(self, - textview: MessageInputTextView, + textview: Gtk.TextView, event: Gdk.EventKey ) -> bool: if isinstance(self._contact, GroupchatContact): @@ -125,7 +122,7 @@ class ChatActionProcessor(Gtk.Popover): assert self._contact is not None return app.commands.get_commands(self._contact.type_string) - def _on_changed(self, _textview: MessageInputTextView) -> None: + def _on_changed(self, _text_buffer: Gtk.TextBuffer) -> None: insert = self._buf.get_insert() self._current_iter = self._buf.get_iter_at_mark(insert) current_offset = self._current_iter.get_offset() diff --git a/gajim/gtk/groupchat_nick_completion.py b/gajim/gtk/groupchat_nick_completion.py index 0755a736a..fceb49bc4 100644 --- a/gajim/gtk/groupchat_nick_completion.py +++ b/gajim/gtk/groupchat_nick_completion.py @@ -15,12 +15,12 @@ from __future__ import annotations from typing import Optional -from typing import TYPE_CHECKING import logging from nbxmpp.structs import PresenceProperties +from gi.repository import Gtk from gi.repository import Gdk from gajim.common import app @@ -31,8 +31,6 @@ from gajim.common.ged import EventHelper from gajim.common.helpers import jid_is_blocked from gajim.common.helpers import message_needs_highlight -if TYPE_CHECKING: - from .message_input import MessageInputTextView log = logging.getLogger('gajim.gui.groupchat_nick_completion') @@ -186,7 +184,7 @@ class GroupChatNickCompletion(EventHelper): return matches + other_nicks def process_key_press(self, - textview: MessageInputTextView, + textview: Gtk.TextView, event: Gdk.EventKey ) -> bool: if (event.get_state() & Gdk.ModifierType.SHIFT_MASK or |