comparison 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
comparison
equal deleted inserted replaced
4169:e92c32014024 4170:b47f21f2b8fa
82 self._selected = set() 82 self._selected = set()
83 83
84 # options 84 # options
85 self.show_disconnected = False 85 self.show_disconnected = False
86 self._show_empty_groups = True 86 self._show_empty_groups = True
87 self.show_resources = False 87 self._show_resources = False
88 self.show_status = False 88 self.show_status = False
89 # do we show entities with notifications? 89 # do we show entities with notifications?
90 # if True, entities will be show even if they normally would not 90 # if True, entities will be show even if they normally would not
91 # (e.g. not in contact list) if they have notifications attached 91 # (e.g. not in contact list) if they have notifications attached
92 self.show_entities_with_notifs = True 92 self.show_entities_with_notifs = True
763 if self._show_empty_groups == show: 763 if self._show_empty_groups == show:
764 return 764 return
765 self._show_empty_groups = show 765 self._show_empty_groups = show
766 self.update(type_=C.UPDATE_STRUCTURE, profile=self.profile) 766 self.update(type_=C.UPDATE_STRUCTURE, profile=self.profile)
767 767
768 def show_resources(self, show): 768 @property
769 def show_resources(self) -> bool:
770 return self._show_resources
771
772 @show_resources.setter
773 def show_resources(self, show: bool) -> None:
769 assert isinstance(show, bool) 774 assert isinstance(show, bool)
770 if self.show_resources == show: 775 if self._show_resources == show:
771 return 776 return
772 self.show_resources = show 777 self._show_resources = show
773 self.update(type_=C.UPDATE_STRUCTURE, profile=self.profile) 778 self.update(type_=C.UPDATE_STRUCTURE, profile=self.profile)
774 779
775 def plug(self): 780 def plug(self):
776 handler.add_profile(self.profile) 781 handler.add_profile(self.profile)
777 782
1066 # options 1071 # options
1067 # for next values, None means use indivual value per profile 1072 # for next values, None means use indivual value per profile
1068 # True or False mean override these values for all profiles 1073 # True or False mean override these values for all profiles
1069 self.show_disconnected = None # TODO 1074 self.show_disconnected = None # TODO
1070 self._show_empty_groups = None # TODO 1075 self._show_empty_groups = None # TODO
1071 self.show_resources = None # TODO 1076 self._show_resources = None # TODO
1072 self.show_status = None # TODO 1077 self.show_status = None # TODO
1073 1078
1074 def post_init(self): 1079 def post_init(self):
1075 """Method to be called by frontend after widget is initialised""" 1080 """Method to be called by frontend after widget is initialised"""
1076 handler.register(self) 1081 handler.register(self)
1080 return handler.all_iter 1085 return handler.all_iter
1081 1086
1082 @property 1087 @property
1083 def items(self): 1088 def items(self):
1084 return handler.items 1089 return handler.items
1090
1091 @property
1092 def show_resources(self) -> bool|None:
1093 return self._show_resources
1094
1095 @show_resources.setter
1096 def show_resources(self, show: bool|None) -> None:
1097 self._show_resources = show
1085 1098
1086 @property 1099 @property
1087 def items_sorted(self): 1100 def items_sorted(self):
1088 return handler.items_sorted 1101 return handler.items_sorted
1089 1102