Philipp Hörist pushed to branch master at gajim / gajim

Commits:

2 changed files:

Changes:

  • gajim/gtk/chat_page.py
    ... ... @@ -12,6 +12,8 @@
    12 12
     # You should have received a copy of the GNU General Public License
    
    13 13
     # along with Gajim. If not, see <http://www.gnu.org/licenses/>.
    
    14 14
     
    
    15
    +from __future__ import annotations
    
    16
    +
    
    15 17
     from typing import Any
    
    16 18
     from typing import Literal
    
    17 19
     
    
    ... ... @@ -33,7 +35,10 @@
    33 35
     from .chat_list_stack import ChatListStack
    
    34 36
     from .chat_stack import ChatStack
    
    35 37
     from .search_view import SearchView
    
    36
    -from .types import ControlT
    
    38
    +
    
    39
    +from typing import TYPE_CHECKING
    
    40
    +if TYPE_CHECKING:
    
    41
    +    from .control import ChatControl
    
    37 42
     
    
    38 43
     
    
    39 44
     log = logging.getLogger('gajim.gui.chat_page')
    
    ... ... @@ -293,7 +298,7 @@ def remove_chats_for_account(self, account: str) -> None:
    293 298
                 if self._chat_control.contact.account == account:
    
    294 299
                     self._chat_control.clear()
    
    295 300
     
    
    296
    -    def get_control(self) -> ControlT:
    
    301
    +    def get_control(self) -> ChatControl:
    
    297 302
             return self._chat_control
    
    298 303
     
    
    299 304
         def hide_search(self) -> bool:
    

  • gajim/gtk/main.py
    ... ... @@ -63,6 +63,10 @@
    63 63
     from .structs import AddChatActionParams
    
    64 64
     from .structs import actionmethod
    
    65 65
     
    
    66
    +from typing import TYPE_CHECKING
    
    67
    +if TYPE_CHECKING:
    
    68
    +    from .control import ChatControl
    
    69
    +
    
    66 70
     log = logging.getLogger('gajim.gui.main')
    
    67 71
     
    
    68 72
     
    
    ... ... @@ -749,7 +753,7 @@ def add_app_message(self,
    749 753
                             message: Optional[str] = None) -> None:
    
    750 754
             self._app_page.add_app_message(category, message)
    
    751 755
     
    
    752
    -    def get_control(self) -> Any:
    
    756
    +    def get_control(self) -> ChatControl:
    
    753 757
             return self._chat_page.get_control()
    
    754 758
     
    
    755 759
         def chat_exists(self, account: str, jid: JID) -> bool: