comparison cagou/plugins/plugin_wid_widget_selector.py @ 491:203755bbe0fe

massive refactoring from camelCase -> snake_case. See backend commit log for more details
author Goffi <goffi@goffi.org>
date Sat, 08 Apr 2023 13:44:32 +0200
parents 3c9ba4a694ef
children
comparison
equal deleted inserted replaced
490:962d17c4078c 491:203755bbe0fe
43 item = properties.ObjectProperty() 43 item = properties.ObjectProperty()
44 44
45 def on_release(self, *args): 45 def on_release(self, *args):
46 log.debug("widget selection: {}".format(self.plugin_info["name"])) 46 log.debug("widget selection: {}".format(self.plugin_info["name"]))
47 factory = self.plugin_info["factory"] 47 factory = self.plugin_info["factory"]
48 G.host.switchWidget( 48 G.host.switch_widget(
49 self, factory(self.plugin_info, None, profiles=iter(G.host.profiles))) 49 self, factory(self.plugin_info, None, profiles=iter(G.host.profiles)))
50 50
51 51
52 class WidgetSelector(cagou_widget.CagouWidget): 52 class WidgetSelector(cagou_widget.CagouWidget):
53 container = properties.ObjectProperty() 53 container = properties.ObjectProperty()
54 54
55 def __init__(self): 55 def __init__(self):
56 super(WidgetSelector, self).__init__() 56 super(WidgetSelector, self).__init__()
57 self.items = [] 57 self.items = []
58 for plugin_info in G.host.getPluggedWidgets(except_cls=self.__class__): 58 for plugin_info in G.host.get_plugged_widgets(except_cls=self.__class__):
59 item = WidgetSelItem(plugin_info=plugin_info) 59 item = WidgetSelItem(plugin_info=plugin_info)
60 self.items.append(item.item) 60 self.items.append(item.item)
61 item.item.bind(minimum_width=self.adjust_width) 61 item.item.bind(minimum_width=self.adjust_width)
62 self.container.add_widget(item) 62 self.container.add_widget(item)
63 self.container.add_widget(Widget()) 63 self.container.add_widget(Widget())