comparison cagou/plugins/plugin_wid_settings.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
50 # the Widget() avoid CagouWidget header to be down at the beginning 50 # the Widget() avoid CagouWidget header to be down at the beginning
51 # then up when the UI is loaded 51 # then up when the UI is loaded
52 self.loading_widget = Widget() 52 self.loading_widget = Widget()
53 self.add_widget(self.loading_widget) 53 self.add_widget(self.loading_widget)
54 extra = {} 54 extra = {}
55 G.local_platform.updateParamsExtra(extra) 55 G.local_platform.update_params_extra(extra)
56 G.host.bridge.getParamsUI( 56 G.host.bridge.param_ui_get(
57 -1, C.APP_NAME, data_format.serialise(extra), self.profile, 57 -1, C.APP_NAME, data_format.serialise(extra), self.profile,
58 callback=self.getParamsUICb, 58 callback=self.get_params_ui_cb,
59 errback=self.getParamsUIEb) 59 errback=self.get_params_ui_eb)
60 60
61 def changeWidget(self, widget): 61 def change_widget(self, widget):
62 self.clear_widgets([self.loading_widget]) 62 self.clear_widgets([self.loading_widget])
63 del self.loading_widget 63 del self.loading_widget
64 self.add_widget(widget) 64 self.add_widget(widget)
65 65
66 def getParamsUICb(self, xmlui): 66 def get_params_ui_cb(self, xmlui):
67 G.host.actionManager({"xmlui": xmlui}, ui_show_cb=self.changeWidget, profile=self.profile) 67 G.host.action_manager({"xmlui": xmlui}, ui_show_cb=self.change_widget, profile=self.profile)
68 68
69 def getParamsUIEb(self, failure): 69 def get_params_ui_eb(self, failure):
70 self.changeWidget(Label( 70 self.change_widget(Label(
71 text=_("Can't load parameters!"), 71 text=_("Can't load parameters!"),
72 bold=True, 72 bold=True,
73 color=(1,0,0,1))) 73 color=(1,0,0,1)))
74 G.host.showDialog("Can't load params UI", str(failure), "error") 74 G.host.show_dialog("Can't load params UI", str(failure), "error")