diff libervia/frontends/quick_frontend/quick_contact_list.py @ 4170:b47f21f2b8fa

quick_frontend, tui: fix name conflict with `show_resources`
author Goffi <goffi@goffi.org>
date Fri, 01 Dec 2023 18:23:04 +0100
parents 26b7ed2817da
children 0d7bb4df2343
line wrap: on
line diff
--- 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