Commit 0db73f72 authored by mathieui's avatar mathieui

fix: make Tab.name always a property

parent 48a5b3e7
......@@ -128,8 +128,8 @@ class Tab:
def __init__(self, core: Core):
self.core = core
self.nb = 0
if not hasattr(self, 'name'):
self.name = self.__class__.__name__
if not hasattr(self, '_name'):
self._name = self.__class__.__name__
self.input = None
self.closed = False
self._state = 'normal'
......@@ -140,6 +140,12 @@ class Tab:
# and use them in on_input
self.commands = {} # and their own commands
@property
def name(self) -> str:
if hasattr(self, '_name'):
return self._name
return ''
@property
def size(self) -> SizeManager:
return self.core.size
......@@ -510,7 +516,7 @@ class ChatTab(Tab):
self._jid = jid
#: Is the tab currently requesting MAM data?
self.query_status = False
self._name: Optional[str] = jid.full
self._name = jid.full
self.text_win = windows.TextWin()
self.directed_presence = None
self._text_buffer = TextBuffer()
......
......@@ -29,7 +29,7 @@ class BookmarksTab(Tab):
def __init__(self, core, bookmarks: BookmarkList):
Tab.__init__(self, core)
self.name = "Bookmarks"
self._name = "Bookmarks"
self.bookmarks = bookmarks
self.new_bookmarks: List[Bookmark] = []
self.removed_bookmarks: List[Bookmark] = []
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment