# HG changeset patch # User Goffi # Date 1701451384 -3600 # Node ID b47f21f2b8fa596d768084b78426e5ada1cc4b3d # Parent e92c32014024bcf85b4df7bda4e152f0ca6f84bf quick_frontend, tui: fix name conflict with `show_resources` diff -r e92c32014024 -r b47f21f2b8fa libervia/frontends/quick_frontend/quick_contact_list.py --- a/libervia/frontends/quick_frontend/quick_contact_list.py Fri Dec 01 18:22:26 2023 +0100 +++ b/libervia/frontends/quick_frontend/quick_contact_list.py Fri Dec 01 18:23:04 2023 +0100 @@ -84,7 +84,7 @@ # options self.show_disconnected = False self._show_empty_groups = True - self.show_resources = False + self._show_resources = False self.show_status = False # do we show entities with notifications? # if True, entities will be show even if they normally would not @@ -765,11 +765,16 @@ self._show_empty_groups = show self.update(type_=C.UPDATE_STRUCTURE, profile=self.profile) - def show_resources(self, show): + @property + def show_resources(self) -> bool: + return self._show_resources + + @show_resources.setter + def show_resources(self, show: bool) -> None: assert isinstance(show, bool) - if self.show_resources == show: + if self._show_resources == show: return - self.show_resources = show + self._show_resources = show self.update(type_=C.UPDATE_STRUCTURE, profile=self.profile) def plug(self): @@ -1068,7 +1073,7 @@ # True or False mean override these values for all profiles self.show_disconnected = None # TODO self._show_empty_groups = None # TODO - self.show_resources = None # TODO + self._show_resources = None # TODO self.show_status = None # TODO def post_init(self): @@ -1084,6 +1089,14 @@ return handler.items @property + def show_resources(self) -> bool|None: + return self._show_resources + + @show_resources.setter + def show_resources(self, show: bool|None) -> None: + self._show_resources = show + + @property def items_sorted(self): return handler.items_sorted diff -r e92c32014024 -r b47f21f2b8fa libervia/tui/contact_list.py --- a/libervia/tui/contact_list.py Fri Dec 01 18:22:26 2023 +0100 +++ b/libervia/tui/contact_list.py Fri Dec 01 18:23:04 2023 +0100 @@ -92,7 +92,7 @@ profile_key=self.profile, ) elif key == a_key["RESOURCES_HIDE"]: # user wants to (un)hide contacts resources - self.contact_list.show_resources(not self.contact_list.show_resources) + self.contact_list.show_resources = not self.contact_list.show_resources self.update() return super(ContactList, self).keypress(size, key)